MCPcopy
hub / github.com/ResearAI/AutoFigure-Edit / _scan_artifacts

Function _scan_artifacts

server.py:365–395  ·  view source on GitHub ↗
(job: Job)

Source from the content-addressed store, hash-verified

363
364
365def _scan_artifacts(job: Job) -> None:
366 output_dir = job.output_dir
367 candidates = [
368 output_dir / "figure.png",
369 output_dir / "samed.png",
370 output_dir / "template.svg",
371 output_dir / "final.svg",
372 ]
373
374 icons_dir = output_dir / "icons"
375 if icons_dir.is_dir():
376 candidates.extend(icons_dir.glob("icon_*.png"))
377
378 for path in candidates:
379 if not path.is_file():
380 continue
381 rel_path = path.relative_to(output_dir).as_posix()
382 if rel_path in job.seen:
383 continue
384 job.seen.add(rel_path)
385
386 kind = _classify_artifact(rel_path)
387 job.push(
388 "artifact",
389 {
390 "kind": kind,
391 "name": path.name,
392 "path": rel_path,
393 "url": f"/api/artifacts/{job.job_id}/{rel_path}",
394 },
395 )
396
397
398def _classify_artifact(rel_path: str) -> str:

Callers 1

_monitor_jobFunction · 0.85

Calls 2

_classify_artifactFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected