Skip to content

[landing] extract: pptx/docx/xlsx(+pdf/html/md) 텍스트를 로컬에서 뽑아 descriptor 로 올리기 #1

Description

@younjihoon

목표

서버 내장 baseline 은 pdf/html/md 텍스트만 뽑는다. Office 포맷(pptx·docx·xlsx)은 서버가 skipped 로 남기므로, CLI 가 로컬에서 결정적으로(모델 없이) 텍스트를 뽑아 PUT /api/proposals/:id/descriptors 로 올린다. free/pro 테넌트의 기본 경로이자, 서버가 Office 추출을 내장하기 전까지의 공백 메우기.

동작

cloudbtl extract <prop_id | file...> [--local-only] [--producer-version x]
  • 입력이 파일이면 먼저 land 와 같은 방식으로 올리거나(--land), 이미 올라간 prop_ 이면 GET …/raw 로 바이트를 받아 로컬 파일과 X-Cloudbtl-Content-Hash 를 대조한 뒤 처리.
  • pptx: 슬라이드 단위 → text.page (page = 슬라이드 번호), 노트는 text.notes (page 동일).
  • docx: 본문 단일 페이지 text.page p1 (섹션 분할은 후속), 표는 탭 구분 텍스트로 포함.
  • xlsx: 시트 단위 → text.page (page = 시트 순번), payload 에 sheetName.
  • pdf/html/md: 서버가 이미 했으면 건너뜀(descriptors/summary 확인), --local-only 면 로컬에서 다시 뽑아 producer cloudbtl-cli 로 별도 저장(서버 baseline 과 공존).
  • 공통 doc.meta p0: { documentType, pageCount, charCount, hasTextLayer, extractor }.
  • producer = cloudbtl-cli, producerVersion = CLI 버전(+추출 라이브러리 버전은 payload/detail 에).
  • 실패는 POST …/jobs { kind: "enrich.cloudbtl-cli", status: "failed", error }.

구현 메모

  • 순수 JS 로: pptx/docx/xlsx = zip + XML(jszip/fflate + 가벼운 XML 파서). 네이티브 의존 금지(CLI 설치 마찰).
  • 상한은 서버 스펙과 동일(페이지 200k자, 문서 5M자, 2,000 페이지) → 초과 시 truncated.
  • 서버 교체 의미론 주의: 같은 producer 의 같은 kind 는 통째로 대체되므로 페이지 전체를 한 번에 보낸다.

완료 기준

  • 24MB pptx 를 extract 하면 슬라이드 수만큼 text.page 가 cloudbtl descriptors <id> -k text.page 에 보인다.
  • jobs 에 enrich.cloudbtl-cli succeeded 가 남는다.
  • 같은 명령을 두 번 실행해도 행 수가 늘지 않는다(교체).

참고: 서버 계약 cloudbtl-site/docs/spec/landing-layer.md §5.4, §6.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanding-layerLanding layer: local extraction, render, enrich, watch, bulk land

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions