papersearch 0.5.5 → 0.5.7
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.en.md +11 -9
- package/README.md +11 -9
- package/assets/ask-with-skill.png +0 -0
- package/carsi/paper_search_carsi/assets/capsule.html +173 -21
- package/carsi/paper_search_carsi/assets/capsule_en.json +64 -1
- package/carsi/paper_search_carsi/browser/watchdog.py +6 -1
- package/carsi/paper_search_carsi/capsule_placement.py +8 -5
- package/carsi/paper_search_carsi/capsule_window.py +495 -0
- package/carsi/paper_search_carsi/cli.py +2 -2
- package/carsi/paper_search_carsi/engine/batch_capture.py +11 -3
- package/carsi/paper_search_carsi/engine/batch_login.py +3 -2
- package/carsi/paper_search_carsi/engine/batch_waits.py +28 -7
- package/carsi/paper_search_carsi/i18n.py +5 -0
- package/carsi/paper_search_carsi/progress_capsule.py +177 -426
- package/carsi/paper_search_carsi/progress_macos.py +53 -6
- package/carsi/paper_search_carsi/progress_reporter.py +132 -20
- package/carsi/paper_search_carsi/progress_view.py +95 -14
- package/carsi/paper_search_carsi/server.py +25 -3
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js +1 -1
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.d.ts +4 -3
- package/dist/capabilities/pdf-discovery/batch.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.js +217 -85
- package/dist/capabilities/pdf-discovery/batch.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batchPapers.d.ts +19 -0
- package/dist/capabilities/pdf-discovery/batchPapers.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/batchPapers.js +44 -0
- package/dist/capabilities/pdf-discovery/batchPapers.js.map +1 -0
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts +6 -1
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/batchSummary.js +33 -8
- package/dist/capabilities/pdf-discovery/batchSummary.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts +13 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js +77 -25
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts +4 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js +5 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiResultNormalizer.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiResultNormalizer.js +4 -3
- package/dist/capabilities/pdf-discovery/carsi/CarsiResultNormalizer.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/index.d.ts +1 -1
- package/dist/capabilities/pdf-discovery/carsi/index.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts +51 -2
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/handler.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/handler.js +2 -1
- package/dist/capabilities/pdf-discovery/handler.js.map +1 -1
- package/dist/capabilities/pdf-discovery/outputLayout.d.ts +27 -2
- package/dist/capabilities/pdf-discovery/outputLayout.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/outputLayout.js +133 -29
- package/dist/capabilities/pdf-discovery/outputLayout.js.map +1 -1
- package/dist/capabilities/pdf-discovery/types.d.ts +5 -0
- package/dist/capabilities/pdf-discovery/types.d.ts.map +1 -1
- package/dist/cli.js +1 -31
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.d.ts +4 -0
- package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.js +11 -3
- package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
- package/dist/management/carsi/autoUpdate.d.ts +2 -2
- package/dist/management/carsi/autoUpdate.d.ts.map +1 -1
- package/dist/management/carsi/autoUpdate.js +8 -2
- package/dist/management/carsi/autoUpdate.js.map +1 -1
- package/dist/management/carsi/cliProgress.d.ts +8 -0
- package/dist/management/carsi/cliProgress.d.ts.map +1 -0
- package/dist/management/carsi/cliProgress.js +38 -0
- package/dist/management/carsi/cliProgress.js.map +1 -0
- package/dist/management/carsi/installer.d.ts.map +1 -1
- package/dist/management/carsi/installer.js +3 -6
- package/dist/management/carsi/installer.js.map +1 -1
- package/package.json +1 -1
- package/skills/paper-search/SKILL.md +4 -5
- package/skills/paper-search/references/browser-download.md +6 -6
- package/skills/paper-search/references/carsi-setup.md +2 -3
- package/skills/paper-search/references/cli-contract.md +4 -4
- package/skills/paper-search/references/management-layer.md +2 -2
- package/skills/paper-search/references/setup.md +3 -3
- package/skills/paper-search/references/troubleshooting.md +2 -2
- package/carsi/paper_search_carsi/progress_bar.py +0 -684
|
@@ -155,22 +155,69 @@ def install_notification_handler(callback: Callable[[str, str], Any]) -> None:
|
|
|
155
155
|
_callback = callback
|
|
156
156
|
|
|
157
157
|
|
|
158
|
+
def _host() -> NotificationBridge:
|
|
159
|
+
"""The running native host, started on first use (called under _bridge_lock)."""
|
|
160
|
+
global _bridge
|
|
161
|
+
if _bridge is None:
|
|
162
|
+
if _callback is None:
|
|
163
|
+
raise RuntimeError("PaperSearch's notification click handler is unavailable")
|
|
164
|
+
_bridge = NotificationBridge(prepare_app(), _callback)
|
|
165
|
+
return _bridge
|
|
166
|
+
|
|
167
|
+
|
|
158
168
|
def notify(title: str, body: str, state: dict[str, Any]) -> None:
|
|
159
169
|
from .user_settings import notify_enabled
|
|
160
170
|
|
|
161
|
-
global _bridge
|
|
162
171
|
with _bridge_lock:
|
|
163
172
|
# A queued notification must also respect a switch turned off meanwhile.
|
|
164
173
|
if not notify_enabled():
|
|
165
174
|
return
|
|
166
|
-
|
|
167
|
-
if _callback is None:
|
|
168
|
-
raise RuntimeError("PaperSearch's notification click handler is unavailable")
|
|
169
|
-
_bridge = NotificationBridge(prepare_app(), _callback)
|
|
170
|
-
_bridge.send("notify", title=title, body=body, current=str(state.get("current") or ""),
|
|
175
|
+
_host().send("notify", title=title, body=body, current=str(state.get("current") or ""),
|
|
171
176
|
run_id=str(state.get("run_id") or ""))
|
|
172
177
|
|
|
173
178
|
|
|
179
|
+
# System Settings keeps each app's notification settings in com.apple.ncprefs ("apps", one
|
|
180
|
+
# entry per app that has shown notifications): bit 25 of "flags" is "Allow notifications",
|
|
181
|
+
# bits 3-5 the alert style (0 none, 1 banners, 2 alerts). Undocumented, read as System
|
|
182
|
+
# Settings writes it (macOS 15, 2026-11-10). The host cannot ask instead: for its notifications
|
|
183
|
+
# UNUserNotificationCenter answers "not determined" while PaperSearch is allowed.
|
|
184
|
+
ALLOWED_FLAG = 1 << 25
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def notifications_allowed() -> str:
|
|
188
|
+
""""ok", "off" (not allowed, or nothing shown on screen), or "unknown"."""
|
|
189
|
+
try:
|
|
190
|
+
exported = subprocess.run(["defaults", "export", "com.apple.ncprefs", "-"], capture_output=True,
|
|
191
|
+
timeout=5, check=True).stdout
|
|
192
|
+
apps = plistlib.loads(exported).get("apps", [])
|
|
193
|
+
except (OSError, subprocess.SubprocessError, plistlib.InvalidFileException, ValueError, AttributeError) as exc:
|
|
194
|
+
logger.warning("notification settings unreadable: %s", type(exc).__name__)
|
|
195
|
+
return "unknown"
|
|
196
|
+
entry = next((app for app in apps if isinstance(app, dict) and app.get("bundle-id") == BUNDLE_ID), None)
|
|
197
|
+
if entry is None:
|
|
198
|
+
return "ok" # never shown yet: the first notification lists PaperSearch in the settings
|
|
199
|
+
flags = entry.get("flags")
|
|
200
|
+
if not isinstance(flags, int):
|
|
201
|
+
return "unknown"
|
|
202
|
+
return "ok" if flags & ALLOWED_FLAG and (flags >> 3) & 7 else "off"
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def send_test(title: str, body: str) -> None:
|
|
206
|
+
"""A notification for the settings' test: no task behind it, so a click does nothing."""
|
|
207
|
+
with _bridge_lock:
|
|
208
|
+
_host().send("notify", title=title, body=body, current="", run_id="")
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def open_settings() -> None:
|
|
212
|
+
"""System Settings at PaperSearch's notifications (macOS 13+), else the Notifications pane."""
|
|
213
|
+
import platform
|
|
214
|
+
|
|
215
|
+
major = int((platform.mac_ver()[0] or "0").split(".")[0] or 0)
|
|
216
|
+
url = (f"x-apple.systempreferences:com.apple.Notifications-Settings.extension?id={BUNDLE_ID}" if major >= 13
|
|
217
|
+
else "x-apple.systempreferences:com.apple.preference.notifications")
|
|
218
|
+
subprocess.Popen(["open", url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
219
|
+
|
|
220
|
+
|
|
174
221
|
def clear_notifications() -> None:
|
|
175
222
|
with _bridge_lock:
|
|
176
223
|
if _bridge is not None:
|
|
@@ -54,8 +54,8 @@ def progress_path() -> Path:
|
|
|
54
54
|
return _progress_dir() / "current.json"
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
def _atomic_write(payload: dict[str, Any]) -> None:
|
|
58
|
-
path = progress_path()
|
|
57
|
+
def _atomic_write(payload: dict[str, Any], path: Path | None = None) -> None:
|
|
58
|
+
path = path or progress_path()
|
|
59
59
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
60
60
|
fd, tmp = tempfile.mkstemp(dir=str(path.parent), suffix=".tmp")
|
|
61
61
|
try:
|
|
@@ -265,8 +265,13 @@ def _batch_state(batch_id: str) -> dict[str, Any] | None:
|
|
|
265
265
|
|
|
266
266
|
|
|
267
267
|
def _adopt_batch(batch_id: str, total: int, counts: tuple[int | None, int | None, int | None],
|
|
268
|
-
**fields: Any) -> None:
|
|
269
|
-
"""Continue this batch's report in the current process, or start it.
|
|
268
|
+
*, beside_download: bool = False, **fields: Any) -> bool | None:
|
|
269
|
+
"""Continue this batch's report in the current process, or start it (True).
|
|
270
|
+
|
|
271
|
+
``beside_download``: an update from the caller's other lane. While a download
|
|
272
|
+
of this batch runs here, only the totals and ``lanes`` change (False); while
|
|
273
|
+
one runs in another process, nothing is written (None). Decided under the
|
|
274
|
+
lock a starting download takes too, so neither overwrites the other."""
|
|
270
275
|
global _STATE, _STARTED_MONO
|
|
271
276
|
try:
|
|
272
277
|
from .config import load_config
|
|
@@ -279,6 +284,20 @@ def _adopt_batch(batch_id: str, total: int, counts: tuple[int | None, int | None
|
|
|
279
284
|
pass
|
|
280
285
|
previous = _batch_state(batch_id)
|
|
281
286
|
with _LOCK:
|
|
287
|
+
if beside_download:
|
|
288
|
+
if (_STATE.get("batch_id") == batch_id and _STATE.get("status") == "running"
|
|
289
|
+
and not _STATE.get("awaiting_next")):
|
|
290
|
+
done, succeeded, failed = counts
|
|
291
|
+
_STATE.update(total=int(total), lanes=fields.get("lanes", ""),
|
|
292
|
+
**({"done": done} if done is not None else {}),
|
|
293
|
+
**({"success": succeeded} if succeeded is not None else {}),
|
|
294
|
+
**({"failed": failed} if failed is not None else {}))
|
|
295
|
+
_write_state()
|
|
296
|
+
return False
|
|
297
|
+
owner = previous.get("owner_pid") if previous else None
|
|
298
|
+
if (previous is not None and previous.get("status") == "running" and not previous.get("awaiting_next")
|
|
299
|
+
and isinstance(owner, int) and owner != os.getpid() and _pid_alive(owner)):
|
|
300
|
+
return None
|
|
282
301
|
_STARTED_MONO = time.monotonic()
|
|
283
302
|
if previous is None:
|
|
284
303
|
previous = {
|
|
@@ -307,11 +326,12 @@ def _adopt_batch(batch_id: str, total: int, counts: tuple[int | None, int | None
|
|
|
307
326
|
_STATE.pop("finished_at", None)
|
|
308
327
|
_STATE.pop("results", None)
|
|
309
328
|
_write_state()
|
|
329
|
+
return True
|
|
310
330
|
|
|
311
331
|
|
|
312
332
|
def sync_batch(batch_id: str, total: int, done: int, succeeded: int, failed: int, *,
|
|
313
333
|
current: str = "", finished: bool = False, results: Any = None,
|
|
314
|
-
phase: str = "", channel: str = "") -> bool:
|
|
334
|
+
phase: str = "", channel: str = "", lanes: str = "") -> bool:
|
|
315
335
|
"""Record batch totals for items finished without the backend, or the batch end.
|
|
316
336
|
|
|
317
337
|
``results`` (the batch end only) is the caller's summary of every item,
|
|
@@ -319,7 +339,10 @@ def sync_batch(batch_id: str, total: int, done: int, succeeded: int, failed: int
|
|
|
319
339
|
report and never opens a window for a batch the backend did not show.
|
|
320
340
|
``phase`` replaces the waiting line and ``channel`` names where the caller
|
|
321
341
|
fetches from (its open-access stretch, before any publisher); both are
|
|
322
|
-
short single lines and are dropped at the batch end.
|
|
342
|
+
short single lines and are dropped at the batch end. ``lanes`` is one line on
|
|
343
|
+
what each lane got in a batch whose open-access checks run beside its downloads;
|
|
344
|
+
it may come while a download of the batch runs, which then keeps its paper,
|
|
345
|
+
stage and prompts (``_adopt_batch``)."""
|
|
323
346
|
ctx = BatchContext.from_args(batch_id, max(1, min(done, total)), total, done, succeeded, failed)
|
|
324
347
|
if ctx is None or done > total:
|
|
325
348
|
return False
|
|
@@ -327,13 +350,17 @@ def sync_batch(batch_id: str, total: int, done: int, succeeded: int, failed: int
|
|
|
327
350
|
previous = _batch_state(ctx.batch_id)
|
|
328
351
|
if finished and previous is None and (done == 0 or summary is not None):
|
|
329
352
|
return False
|
|
330
|
-
phase, channel = _short_line(phase), _short_line(channel)
|
|
331
|
-
_adopt_batch(ctx.batch_id, total, (done, succeeded, failed),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
353
|
+
phase, channel, lanes = _short_line(phase), _short_line(channel), _short_line(lanes)
|
|
354
|
+
adopted = _adopt_batch(ctx.batch_id, total, (done, succeeded, failed),
|
|
355
|
+
beside_download=bool(lanes) and not finished,
|
|
356
|
+
**({"current": current} if current else {}),
|
|
357
|
+
**({"lanes": lanes} if lanes or finished else {}),
|
|
358
|
+
stage="saved_pending_verification" if finished else "starting",
|
|
359
|
+
channel="" if finished else channel,
|
|
360
|
+
phase=(f"批量下载结束:成功 {succeeded},失败 {failed}" if finished
|
|
361
|
+
else phase or f"已完成 {done}/{total} 篇,等待下一篇"))
|
|
362
|
+
if not adopted:
|
|
363
|
+
return adopted is False # beside a download: written here, or left to its process
|
|
337
364
|
with _LOCK:
|
|
338
365
|
if finished:
|
|
339
366
|
_STATE.update(status="done", awaiting_next=False,
|
|
@@ -367,6 +394,16 @@ _MAX_RESULT_FAILURES = 1000 # the caller's batch limit
|
|
|
367
394
|
_MAX_RESULT_TEXT = 300
|
|
368
395
|
|
|
369
396
|
|
|
397
|
+
def _display_text(value: Any) -> str:
|
|
398
|
+
"""A caller's text for the window: plain, one line, bounded.
|
|
399
|
+
|
|
400
|
+
Crossref's titles and journals can keep HTML entities ("Arthritis & Rheumatology")
|
|
401
|
+
and markup ("<i>Glossostemon bruguieri</i>"); the card shows plain text."""
|
|
402
|
+
if not isinstance(value, str):
|
|
403
|
+
return ""
|
|
404
|
+
return " ".join(re.sub(r"<[^<>]{1,40}>", "", html.unescape(value)).split())[:_MAX_RESULT_TEXT]
|
|
405
|
+
|
|
406
|
+
|
|
370
407
|
def _batch_results(raw: Any) -> dict[str, Any] | None:
|
|
371
408
|
"""The caller's end-of-batch summary, checked and bounded for the window.
|
|
372
409
|
|
|
@@ -375,6 +412,7 @@ def _batch_results(raw: Any) -> dict[str, Any] | None:
|
|
|
375
412
|
``started`` (epoch seconds the batch began); ``stopped``;
|
|
376
413
|
``main`` (main texts saved), ``supplements`` (attachment files saved),
|
|
377
414
|
``no_supplements`` (pages that listed none); ``sources`` ([label, count]);
|
|
415
|
+
``source_details`` ([label, text]: a label's sources, shown in brackets after its count);
|
|
378
416
|
``failures`` ([{cls, reason, title, journal, doi, note}]) with ``cls`` one
|
|
379
417
|
of FAILURE_CLASSES and a short ``reason`` text; ``supplement_failures``, the
|
|
380
418
|
same for papers whose main text was saved but not every supplementary file
|
|
@@ -386,13 +424,7 @@ def _batch_results(raw: Any) -> dict[str, Any] | None:
|
|
|
386
424
|
def count(value: Any) -> int:
|
|
387
425
|
return value if isinstance(value, int) and not isinstance(value, bool) and 0 <= value <= 1_000_000 else 0
|
|
388
426
|
|
|
389
|
-
|
|
390
|
-
# Crossref's titles and journals can keep HTML entities ("Arthritis & Rheumatology")
|
|
391
|
-
# and markup ("<i>Glossostemon bruguieri</i>"); the card shows plain text.
|
|
392
|
-
if not isinstance(value, str):
|
|
393
|
-
return ""
|
|
394
|
-
return " ".join(re.sub(r"<[^<>]{1,40}>", "", html.unescape(value)).split())[:_MAX_RESULT_TEXT]
|
|
395
|
-
|
|
427
|
+
text = _display_text
|
|
396
428
|
summary: dict[str, Any] = {
|
|
397
429
|
"content": raw.get("content") if raw.get("content") in _RESULT_CONTENTS else "main",
|
|
398
430
|
"main": count(raw.get("main")),
|
|
@@ -401,6 +433,9 @@ def _batch_results(raw: Any) -> dict[str, Any] | None:
|
|
|
401
433
|
"sources": [[text(s[0]), count(s[1])] for s in (raw.get("sources") or [])[:8]
|
|
402
434
|
if isinstance(s, list) and len(s) == 2 and text(s[0]) and count(s[1])]
|
|
403
435
|
if isinstance(raw.get("sources"), list) else [],
|
|
436
|
+
"source_details": {text(s[0]): text(s[1]) for s in (raw.get("source_details") or [])[:8]
|
|
437
|
+
if isinstance(s, list) and len(s) == 2 and text(s[0]) and text(s[1])}
|
|
438
|
+
if isinstance(raw.get("source_details"), list) else {},
|
|
404
439
|
"failures": [],
|
|
405
440
|
"supplement_failures": [],
|
|
406
441
|
"stopped": raw.get("stopped") is True,
|
|
@@ -423,6 +458,83 @@ def _batch_results(raw: Any) -> dict[str, Any] | None:
|
|
|
423
458
|
return summary
|
|
424
459
|
|
|
425
460
|
|
|
461
|
+
# A paper's states in the order it moves through them: open access not checked
|
|
462
|
+
# yet, waiting for (or in) the institutional download, then its result.
|
|
463
|
+
PAPER_STATES = {"open": 0, "school": 1, "ok": 2, "failed": 2}
|
|
464
|
+
_PAPERS_LOCK = threading.Lock()
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def papers_path() -> Path:
|
|
468
|
+
return _progress_dir() / "papers.json"
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def _paper(raw: Any) -> dict[str, Any] | None:
|
|
472
|
+
"""One paper as the caller sent it, checked and bounded (see ``sync_papers``)."""
|
|
473
|
+
if not isinstance(raw, dict) or raw.get("state") not in PAPER_STATES:
|
|
474
|
+
return None
|
|
475
|
+
index = raw.get("index")
|
|
476
|
+
if not isinstance(index, int) or isinstance(index, bool) or not 1 <= index <= _MAX_RESULT_FAILURES:
|
|
477
|
+
return None
|
|
478
|
+
paper = {"index": index, "state": raw["state"],
|
|
479
|
+
**{field: _display_text(raw.get(field)) for field in ("doi", "title", "journal")}}
|
|
480
|
+
if paper["state"] == "ok":
|
|
481
|
+
paper.update(via=_display_text(raw.get("via")), detail=_display_text(raw.get("detail")))
|
|
482
|
+
path = raw.get("path")
|
|
483
|
+
if isinstance(path, str) and 0 < len(path) <= 4096 and os.path.isabs(path):
|
|
484
|
+
paper["path"] = path
|
|
485
|
+
elif paper["state"] == "failed":
|
|
486
|
+
paper.update(cls=raw.get("cls") if raw.get("cls") in FAILURE_CLASSES else "unexplained",
|
|
487
|
+
reason=_display_text(raw.get("reason")))
|
|
488
|
+
return paper
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
def sync_papers(batch_id: str, folder: str, papers: Any) -> bool:
|
|
492
|
+
"""Each paper of a batch, for the lists behind the window's 成功, 失败 and 剩余.
|
|
493
|
+
|
|
494
|
+
The caller sends every paper once, then the ones that changed; they are merged
|
|
495
|
+
into ``papers.json`` by ``index`` (1..N), and a paper's state only moves forward
|
|
496
|
+
(``PAPER_STATES``). Another batch starts a new list. Wire shape of a paper:
|
|
497
|
+
``index``, ``doi``, ``title``, ``journal``, ``state``; a saved one adds ``via``
|
|
498
|
+
(开放下载 or 机构下载), ``detail`` (the open source when not open access: 出版社 API,
|
|
499
|
+
Sci-Hub, 预印本) and ``path`` (the PDF, absolute); a failed one ``cls`` (one of
|
|
500
|
+
FAILURE_CLASSES) and ``reason``. ``folder`` is the batch's download folder: the
|
|
501
|
+
window opens a PDF only from inside it. Kept apart from the progress file, which
|
|
502
|
+
the downloading process rewrites every moment."""
|
|
503
|
+
if not isinstance(batch_id, str) or not 0 < len(batch_id) <= 128 or not isinstance(papers, list):
|
|
504
|
+
return False
|
|
505
|
+
with _PAPERS_LOCK:
|
|
506
|
+
try:
|
|
507
|
+
listed = json.loads(papers_path().read_text(encoding="utf-8"))
|
|
508
|
+
except Exception:
|
|
509
|
+
listed = None
|
|
510
|
+
if not isinstance(listed, dict) or listed.get("batch_id") != batch_id or not isinstance(listed.get("papers"), dict):
|
|
511
|
+
listed = {"batch_id": batch_id, "folder": "", "papers": {}}
|
|
512
|
+
if isinstance(folder, str) and 0 < len(folder) <= 4096 and os.path.isabs(folder):
|
|
513
|
+
listed["folder"] = folder
|
|
514
|
+
known = listed["papers"]
|
|
515
|
+
for raw in papers[:_MAX_RESULT_FAILURES]:
|
|
516
|
+
paper = _paper(raw)
|
|
517
|
+
if paper is None:
|
|
518
|
+
continue
|
|
519
|
+
before = known.get(str(paper["index"]))
|
|
520
|
+
if before and PAPER_STATES.get(before.get("state"), 0) > PAPER_STATES[paper["state"]]:
|
|
521
|
+
continue # a late report never takes a paper back
|
|
522
|
+
known[str(paper["index"])] = paper
|
|
523
|
+
try:
|
|
524
|
+
_atomic_write(listed, papers_path())
|
|
525
|
+
except Exception:
|
|
526
|
+
return False # the lists are optional; the download goes on
|
|
527
|
+
return True
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
def read_papers() -> dict[str, Any] | None:
|
|
531
|
+
try:
|
|
532
|
+
listed = json.loads(papers_path().read_text(encoding="utf-8"))
|
|
533
|
+
except Exception:
|
|
534
|
+
return None
|
|
535
|
+
return listed if isinstance(listed, dict) and isinstance(listed.get("papers"), dict) else None
|
|
536
|
+
|
|
537
|
+
|
|
426
538
|
@contextmanager
|
|
427
539
|
def tracked_download(current: str, output_dir: Any = None, batch: BatchContext | None = None,
|
|
428
540
|
content: str = "main"):
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"""What the
|
|
1
|
+
"""What the progress capsule (``progress_capsule``) shows, worked out from the progress file.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
so tests cover every state without opening a window.
|
|
3
|
+
The texts, the steps, the needs-you prompts, when a finished window closes,
|
|
4
|
+
the window lock and the OS appearance. No GUI imports, so tests cover every
|
|
5
|
+
state without opening a window.
|
|
7
6
|
"""
|
|
8
7
|
|
|
9
8
|
from __future__ import annotations
|
|
@@ -95,13 +94,6 @@ class AutoClose:
|
|
|
95
94
|
return not hovering and now - self._since >= self.linger
|
|
96
95
|
|
|
97
96
|
|
|
98
|
-
def fmt_elapsed(seconds: float) -> str:
|
|
99
|
-
seconds = max(0, int(seconds))
|
|
100
|
-
h, rem = divmod(seconds, 3600)
|
|
101
|
-
m, s = divmod(rem, 60)
|
|
102
|
-
return f"{h}:{m:02d}:{s:02d}" if h else f"{m:02d}:{s:02d}"
|
|
103
|
-
|
|
104
|
-
|
|
105
97
|
def fmt_clock(seconds: float) -> str:
|
|
106
98
|
"""The capsule's times: 3:12, 2:41, 1:02:03."""
|
|
107
99
|
seconds = max(0, int(seconds))
|
|
@@ -212,13 +204,77 @@ def summary_view(results: Any) -> dict[str, Any] | None:
|
|
|
212
204
|
first.append(f"{none_listed} 篇未列出附录")
|
|
213
205
|
else:
|
|
214
206
|
first = [f"正文 {main} 篇"] + ([f"附录 {files} 个"] if content == "both" else [])
|
|
215
|
-
|
|
216
|
-
|
|
207
|
+
details = results.get("source_details") if isinstance(results.get("source_details"), dict) else {}
|
|
208
|
+
sources = [f"{s[0]} {_count(s[1])}" + (f"({details[s[0]]})" if details.get(s[0]) else "")
|
|
209
|
+
for s in results.get("sources") or [] if isinstance(s, list) and len(s) == 2 and _count(s[1])]
|
|
217
210
|
saved = [" · ".join(first)] + ([" · ".join(sources)] if sources and content != "supplements" else [])
|
|
218
211
|
return {"groups": groups, "supplement_groups": supplement_groups, "supplement_missing": len(shortfalls),
|
|
219
212
|
"saved": saved}
|
|
220
213
|
|
|
221
214
|
|
|
215
|
+
OPEN_DOWNLOAD = "开放下载"
|
|
216
|
+
# Behind 剩余: the paper being downloaded, then the waiting ones by lane.
|
|
217
|
+
LEFT_GROUPS = (("now", "正在下载"), ("school", "排队等机构下载"), ("open", "开放下载还没查"))
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def paper_lists(listed: Any, state: dict[str, Any] | None) -> dict[str, Any]:
|
|
221
|
+
"""The lists behind the card's 成功, 失败 and 剩余, from the batch's papers (``sync_papers``).
|
|
222
|
+
|
|
223
|
+
``ok``: by the way each came (开放下载, its sources in brackets; 机构下载), a paper
|
|
224
|
+
opening its PDF by ``index``; ``failed``: by reason as on the finished card, a paper
|
|
225
|
+
opening its article page; ``left``: the paper being downloaded, those waiting for the
|
|
226
|
+
institutional download and those open access has not checked yet. Each list has its
|
|
227
|
+
``count`` and groups, the first one open. Empty for another batch's papers."""
|
|
228
|
+
if not isinstance(listed, dict) or not state or listed.get("batch_id") != state.get("batch_id"):
|
|
229
|
+
return {}
|
|
230
|
+
papers = sorted((p for p in (listed.get("papers") or {}).values() if isinstance(p, dict)),
|
|
231
|
+
key=lambda p: _count(p.get("index")))
|
|
232
|
+
current = str(state.get("current") or "").lower() if state.get("status") == "running" else ""
|
|
233
|
+
|
|
234
|
+
def row(paper: dict[str, Any], *where: Any) -> dict[str, Any]:
|
|
235
|
+
doi = str(paper.get("doi") or "").strip()
|
|
236
|
+
return {"index": _count(paper.get("index")), "where": " · ".join(str(w) for w in where if w),
|
|
237
|
+
"title": str(paper.get("title") or doi or f"第 {_count(paper.get('index'))} 篇"),
|
|
238
|
+
"doi": doi if DOI.fullmatch(doi) else ""}
|
|
239
|
+
|
|
240
|
+
def group(label: str, rows: list[dict[str, Any]]) -> dict[str, Any]:
|
|
241
|
+
return {"label": label, "count": len(rows), "papers": rows[:MAX_LISTED_PAPERS],
|
|
242
|
+
"more": max(0, len(rows) - MAX_LISTED_PAPERS), "open": False}
|
|
243
|
+
|
|
244
|
+
def first_open(groups: list[dict[str, Any]]) -> dict[str, Any]:
|
|
245
|
+
for at, item in enumerate(groups):
|
|
246
|
+
item["open"] = at == 0
|
|
247
|
+
return {"count": sum(item["count"] for item in groups), "groups": groups}
|
|
248
|
+
|
|
249
|
+
by_way: dict[str, list[dict[str, Any]]] = {}
|
|
250
|
+
for paper in papers:
|
|
251
|
+
if paper.get("state") == "ok":
|
|
252
|
+
by_way.setdefault(str(paper.get("via") or OPEN_DOWNLOAD), []).append(paper)
|
|
253
|
+
saved = []
|
|
254
|
+
for way, items in sorted(by_way.items(), key=lambda kv: -len(kv[1])):
|
|
255
|
+
details: dict[str, int] = {}
|
|
256
|
+
for paper in items:
|
|
257
|
+
if paper.get("detail"):
|
|
258
|
+
details[paper["detail"]] = details.get(paper["detail"], 0) + 1
|
|
259
|
+
label = way + ("(" + "、".join(f"{name} {n}" for name, n in details.items()) + ")" if details else "")
|
|
260
|
+
saved.append(group(label, [row(p, p.get("journal"), (p.get("detail") or "开放获取") if way == OPEN_DOWNLOAD else "")
|
|
261
|
+
for p in items]))
|
|
262
|
+
|
|
263
|
+
failed = _reason_groups([{**p, "note": ""} for p in papers if p.get("state") == "failed"], 0)
|
|
264
|
+
for item in failed:
|
|
265
|
+
item.update(label=item["reason"])
|
|
266
|
+
|
|
267
|
+
waiting: dict[str, list[dict[str, Any]]] = {key: [] for key, _ in LEFT_GROUPS}
|
|
268
|
+
for paper in papers:
|
|
269
|
+
if paper.get("state") not in ("open", "school"):
|
|
270
|
+
continue
|
|
271
|
+
now = bool(current) and str(paper.get("doi") or "").lower() == current
|
|
272
|
+
way = "机构下载" if paper["state"] == "school" else OPEN_DOWNLOAD
|
|
273
|
+
waiting["now" if now else paper["state"]].append(row(paper, paper.get("journal"), way if now else ""))
|
|
274
|
+
left = [group(label, waiting[key]) for key, label in LEFT_GROUPS if waiting[key]]
|
|
275
|
+
return {"ok": first_open(saved), "failed": first_open(failed), "left": first_open(left)}
|
|
276
|
+
|
|
277
|
+
|
|
222
278
|
def view(state: dict[str, Any] | None, now: float) -> dict[str, Any]:
|
|
223
279
|
"""Everything the capsule shows for one snapshot of the progress file.
|
|
224
280
|
|
|
@@ -312,6 +368,8 @@ def view(state: dict[str, Any] | None, now: float) -> dict[str, Any]:
|
|
|
312
368
|
"title": str(state.get("title") or ""), "current": current,
|
|
313
369
|
"run_id": str(state.get("run_id") or ""),
|
|
314
370
|
"step": step, "steps": list(STEPS), "line": status_text(state, running) if running else "",
|
|
371
|
+
# What each lane got in a batch checking open access beside its downloads, on one line.
|
|
372
|
+
"lanes": str(state.get("lanes") or "") if running else "",
|
|
315
373
|
"elapsed": elapsed, "attention": prompt, "notice": notice,
|
|
316
374
|
"completion_detail": str(state.get("phase") or "")
|
|
317
375
|
if not running and state.get("stage") == "supplements_checked" else "",
|
|
@@ -375,6 +433,29 @@ def open_folder(path: str) -> bool:
|
|
|
375
433
|
"""Open a folder in Finder / Explorer; False when it is missing."""
|
|
376
434
|
if not path or not os.path.isdir(path):
|
|
377
435
|
return False
|
|
436
|
+
return _open(path)
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
def reveal_file(path: str) -> bool:
|
|
440
|
+
"""Show a file selected in its folder (Finder / Explorer); False when it is missing."""
|
|
441
|
+
if not path or not os.path.isfile(path):
|
|
442
|
+
return False
|
|
443
|
+
if sys.platform.startswith("linux"):
|
|
444
|
+
return _open(os.path.dirname(path)) # file managers differ in selecting a file
|
|
445
|
+
try:
|
|
446
|
+
import subprocess
|
|
447
|
+
|
|
448
|
+
if os.name == "nt":
|
|
449
|
+
# Explorer reads "/select," and the quoted path as one argument.
|
|
450
|
+
subprocess.Popen(f'explorer /select,"{os.path.normpath(path)}"')
|
|
451
|
+
else:
|
|
452
|
+
subprocess.Popen(["open", "-R", path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
453
|
+
return True
|
|
454
|
+
except Exception:
|
|
455
|
+
return False
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
def _open(path: str) -> bool:
|
|
378
459
|
try:
|
|
379
460
|
if os.name == "nt":
|
|
380
461
|
os.startfile(path) # type: ignore[attr-defined]
|
|
@@ -213,6 +213,7 @@ def carsi_batch_progress(
|
|
|
213
213
|
results: dict[str, Any] | None = None,
|
|
214
214
|
phase: str = "",
|
|
215
215
|
channel: str = "",
|
|
216
|
+
lanes: str = "",
|
|
216
217
|
) -> str:
|
|
217
218
|
"""Update the progress window of a serial batch without downloading.
|
|
218
219
|
|
|
@@ -223,18 +224,39 @@ def carsi_batch_progress(
|
|
|
223
224
|
started (epoch seconds), stopped, main/supplements/no_supplements counts, sources
|
|
224
225
|
([label, count]) and failures ([{cls, reason, title, journal, doi, note}]).
|
|
225
226
|
|
|
226
|
-
phase: the status line while the batch waits for its next item, e.g. "
|
|
227
|
-
channel: where the caller is fetching from, shown in place of a publisher, e.g. "
|
|
227
|
+
phase: the status line while the batch waits for its next item, e.g. "开放下载:已查 15/40 篇".
|
|
228
|
+
channel: where the caller is fetching from, shown in place of a publisher, e.g. "开放下载".
|
|
229
|
+
lanes: one line on the papers each lane got in a batch whose open-access checks run
|
|
230
|
+
beside its institutional downloads ("开放下载 15 篇 · 机构下载 9 篇"). Sent beside a
|
|
231
|
+
running download of the batch too: then only the counts and this line change.
|
|
228
232
|
"""
|
|
229
233
|
from . import progress_reporter
|
|
230
234
|
|
|
231
235
|
label = current if _DOI_RE.fullmatch(current or "") else ""
|
|
232
236
|
updated = progress_reporter.sync_batch(batch_id, total, done, succeeded, failed,
|
|
233
237
|
current=label, finished=finished, results=results,
|
|
234
|
-
phase=phase, channel=channel)
|
|
238
|
+
phase=phase, channel=channel, lanes=lanes)
|
|
235
239
|
return json.dumps({"updated": updated})
|
|
236
240
|
|
|
237
241
|
|
|
242
|
+
@mcp_app.tool()
|
|
243
|
+
def carsi_batch_papers(batch_id: str, folder: str, papers: list[dict[str, Any]]) -> str:
|
|
244
|
+
"""Each paper of a batch for the progress window's lists (成功, 失败, 剩余).
|
|
245
|
+
|
|
246
|
+
Send every paper once, then the ones that changed; merged by index, a paper's
|
|
247
|
+
state only moves forward (open → school → ok or failed). papers: [{index (1..N),
|
|
248
|
+
doi, title, journal, state ("open": open access not checked yet, "school": waiting
|
|
249
|
+
for or in the institutional download, "ok", "failed"); a saved one adds via
|
|
250
|
+
(开放下载 or 机构下载), detail (出版社 API, Sci-Hub, 预印本) and path (the PDF,
|
|
251
|
+
absolute); a failed one cls (no_access, user_or_external, unsupported, unexplained)
|
|
252
|
+
and reason}]. folder: the batch's download folder (absolute); the window opens
|
|
253
|
+
a PDF only from inside it. Never touches the running download's progress.
|
|
254
|
+
"""
|
|
255
|
+
from . import progress_reporter
|
|
256
|
+
|
|
257
|
+
return json.dumps({"updated": progress_reporter.sync_papers(batch_id, folder, papers)})
|
|
258
|
+
|
|
259
|
+
|
|
238
260
|
@mcp_app.tool()
|
|
239
261
|
def carsi_cache_clear(identifier: str | None = None) -> str:
|
|
240
262
|
"""Clear cached download results (identifier optional; omit to clear all)."""
|
|
@@ -111,7 +111,7 @@ export async function downloadWithFallback(searchers, options, tiers = createDef
|
|
|
111
111
|
try {
|
|
112
112
|
const destination = result.version === "preprint"
|
|
113
113
|
? createOutputLayout(savePath, `arxiv:${result.arxivId}`, context.arxivPaper || {}, true) : layout;
|
|
114
|
-
organizeFiles(result, destination, context.savePath);
|
|
114
|
+
organizeFiles(result, destination, context.savePath, undefined, options.recordsDir);
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
117
|
// Keep the retrieved file and report a concrete filing failure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAccessFallbackService.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/OpenAccessFallbackService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAWlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAY3D,MAAM,UAAU,0BAA0B,CACxC,YAA2B;IAE3B,OAAO;QACL,iBAAiB,EAAE;QACnB,sBAAsB,EAAE;QACxB,oBAAoB,EAAE;QACtB,mBAAmB,EAAE;QACrB,sBAAsB,EAAE;QACxB,gBAAgB,EAAE;QAClB,wBAAwB,CAAC,YAAY,CAAC;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
|
|
1
|
+
{"version":3,"file":"OpenAccessFallbackService.js","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/OpenAccessFallbackService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAWlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAY3D,MAAM,UAAU,0BAA0B,CACxC,YAA2B;IAE3B,OAAO;QACL,iBAAiB,EAAE;QACnB,sBAAsB,EAAE;QACxB,oBAAoB,EAAE;QACtB,mBAAmB,EAAE;QACrB,sBAAsB,EAAE;QACxB,gBAAgB,EAAE;QAClB,wBAAwB,CAAC,YAAY,CAAC;QACtC,kBAAkB,EAAE;KACrB,CAAC;A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AAS,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAC5C,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;QAClC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,UAAU,KAAK,gBAAgB;QAAE,OAAO,eAAe,CAAC;IAC5D,IAAI,UAAU,KAAK,gBAAgB;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,WAAW,CAAC;IACpD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -15,9 +15,10 @@ export interface DownloadBatchItem {
|
|
|
15
15
|
savePath?: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* two_phase (default): every item first tries the open stages;
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* two_phase (default): every item first tries the open stages; the items they
|
|
19
|
+
* miss go through entitled access one after another, starting with the first
|
|
20
|
+
* one missed while the open stages go on with the rest (the browser and the
|
|
21
|
+
* school's login come within seconds, not after the whole open stretch).
|
|
21
22
|
* per_item: each item runs the whole funnel before the next one starts.
|
|
22
23
|
* entitled_only: skip the open stages; every item goes straight to entitled
|
|
23
24
|
* access (testing the institutional route, or a list already known closed).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/capabilities/pdf-discovery/batch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,6CAA6C,CAAC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