hwp-mcp icon indicating copy to clipboard operation
hwp-mcp copied to clipboard

Expose header/footer SUMMERY property fields and support binding-preserving property updates

Open 11kkw opened this issue 1 month ago • 0 comments

Summary

Please support discovery and property-aware editing of HWPX SUMMERY fields in headers/footers, or expose an explicit unsupported status. Tested with installed [email protected] (@rhwp/[email protected]). This is a synthetic reproduction, not a customer document.

Synthetic case

A generated HWPX contains a header with a field linked to document property subject, plus a body field linked to title with the same display text. Simplified header run contents:

<hp:ctrl><hp:fieldBegin id="101" type="SUMMERY" editable="0" dirty="0" zorder="-1" fieldid="901"><hp:parameters cnt="0"><hp:integerParam name="Prop">8</hp:integerParam><hp:stringParam name="Command">$subject</hp:stringParam></hp:parameters></hp:fieldBegin></hp:ctrl>
<hp:t>지난 사업명</hp:t>
<hp:ctrl><hp:fieldEnd beginIDRef="101" fieldid="901"/></hp:ctrl><hp:t/>

Contents/content.hpf has:

<opf:meta name="subject" content="text">지난 사업명</opf:meta>

The body control has a separate ID/reference and Command=$title. The identical display text must not make it a target of a subject update.

Actual public MCP observations

  1. get_hwp_info({file_path}) successfully opens the generated file and reports one header.
  2. list_hwp_fields({file_path}) returns 1. [unknown] = 지난 사업명, without an addressable identity for the header subject field.
  3. A deliberately negative probe calls set_hwp_field_value({file_path, name:"$subject", value:"새 사업명", output_path}).
  4. Response: 필드를 찾지 못했습니다 (field not found): $subject; no output file is created and input bytes remain unchanged.

Important: $subject is the raw XML Command, NOT an advertised field name. This negative probe is NOT proof that a valid discovered name fails. The core problem is that the header property-bound occurrence is not exposed with an addressable identity, and a supported binding-preserving update path was not found.

For comparison, read-only inspection with @rhwp/[email protected] finds the header, but getFieldList() returns the synthetic body $title field and not the header field ID 101. getFieldValue(101) reports that ID 101 does not exist. This is an observation for those pinned versions, not a claim about every engine version.

Requested behavior

  • Enumerate header/footer summary/property fields with stable identity, story/location, raw binding metadata, and explicit writability.
  • If supported, provide an explicit property-aware update that preserves fieldBegin/fieldEnd IDs, Command/Prop semantics, formatting, and unrelated fields.
  • Specify whether an operation updates the underlying document property plus all linked display occurrences or just a selected occurrence. Do not silently replace a bound field with ordinary text.
  • Save to a new file, reopen it, and verify the property/display relationship, non-target preservation, duplicate-text isolation, XML escaping, and failure/no-output behavior.
  • If editable="0" makes editing intentionally unsupported, return a clear capability result and document a supported property-update alternative if one exists.

Why not use paragraph replacement?

Replacing the whole run with ordinary text can remove control/binding semantics. We intentionally reject that route instead of flattening fields or globally replacing matching strings.

Scope

No real document, credentials, or customer content is included. No patch is claimed in this issue; this is a reproducible capability gap / enhancement request with a safe expected contract.

11kkw avatar Oct 28 '26 05:10 11kkw