xparse-parse

Parse, read, search, navigate, summarize, and extract tables or structured evidence from PDFs, images, Office files, HTML, OFD, and other supported local documents or document URLs through xparse-cli. Use this Skill for single-document conversion, server-generated DOCX/PDF/XLSX files, targeted secti

By intsig-textin · 477 installs

npx skills add intsig-textin/xparse-skills --skill xparse-parse

Source repository · Upstream listing

xparse parse Use the installed xparse cli as the only parsing, authentication, quota, and document navigation execution kernel. Do not reproduce its HTTP, OAuth, quota, PDF splitting, or result merging logic in the Skill. Task context For every new user request, create one private 0600 JSON file before the first xParse command: Preserve the user's wording and keep the operational reason brief. Never include hidden reasoning, credentials, document content, or the final answer. Pass task context <FILE only on the first xParse invocation for that request. Delete the temporary file after that invocation. Later commands inherit the task. Do not pass inline JSON through shell arguments, echo , or a heredoc. Command integrity and structured error gate Run every operational xparse cli invocation as a standalone shell command. Do not pipe it through head , tail , grep , or another command, and do not append cleanup, printing, file reads, or other shell commands that can replace its exit status. Perform task context cleanup in a separate shell call. For every failed command, parse the final stderr object whose schema version is xparse error.v1 . Treat that object as failure even if a shell wrapper reports exit code 0. Apply this gate before issuing another xParse command: retryable=false means do not retry or reinterpret the same logical action. Follow only the declared next action . For CONTACT SUPPORT , report the error and preserved identifiers, then issue no more xParse commands for the current request. retryable=true permits at most one Agent layer retry of the same logical action. Keep the same Task, Run, Resource, and operation id where present. Changing flags, authentication options, selector form, Resource identifier, timing, or switching between task read and task export does not create a new logical action or reset its retry budget. Do not run diagnostic xParse commands unless the Task state or next action explicitly calls for them. Goal completion pressure is not a recovery signal; a correct failure report completes the Agent action. After a non retryable failure, another attempt is allowed only after the user confirms an external remediation or explicitly requests a new action. Reuse the preserved Task and Run identifiers; never recreate completed server work. Free, free package, and paid routing Use api auto by default. The CLI queries the service quota before parsing and uses the current server response as the authority instead of relying on a Skill snapshot. Mode CLI behavior Use it when api auto Uses the daily free API allowance first. When quota reports an AppKey authenticated free package with sufficient free remain count , it can use that package through the existing authenticated route. Default for supported PDF and image work. api free Forces the free endpoint and does not use the authenticated free package route. The user explicitly requires the free endpoint only. api paid Forces the paid endpoint and follows the service's existing package/balance billing behavior. The user explicitly approves paid use, or approves it after learning that the format requires the paid API. Authentication is identity, not permission to spend. Never choose api paid only because OAuth or AppKey credentials exist. Run xparse cli quota output json when the user asks about quota, when a routing failure needs explanation, or before proposing a paid retry. Read all returned facts: daily free parse pages remaining and reset time; independent extraction quota daily limit, used pages, remaining pages, and reset time when present; whether the request is authenticated; authenticated free package total, historical used count, and current free remain count when present (routing uses only free remain count ); maximum pages and file size per request. Do not cache or calculate an allowance in the Skill. parse api auto performs its own quota preflight, and the parse response remains authoritative if quota changes between inspection and execution. The Skill must not promise stronger billing guarantees than the existing server provides. Device OAuth and AppKey are different identities. If quota returns authenticated=false or omits free package , do not infer package access from an OAuth login indicator. Treat only fields in the current quota response as available. An authenticated default quota response may still omit extraction quota . Report that the server did not return the extraction allowance; do not claim that enterprise OAuth intrinsically cannot query it or substitute the parse allowance. Missing quota data alone does not prove that extraction is unavailable; use the actual extraction Task response for that conclusion. If authenticated=false , restore the intended login first. Keep the three paths separate: Unqualified quota reports parse allowance and, only when returned, extraction quota for structured extraction ( open kie vlm engine ). quota service manipulation detection reports only the manipulation detector's free package. It is not an extraction allowance or an extraction capability check. task run task type extract creates a structured extraction Task. Judge its availability and outcome from that Task's actual response, never from a manipulation quota response. Do not substitute detect manipulation when extraction quota is missing or extraction fails. The free endpoint supports PDF and images. Office, HTML, OFD, and other formats may require api paid ; explain this and obtain the user's approval before switching modes. If all reported free sources are insufficient, stop and explain the current quota rather than silently retrying as paid. Manipulation detection (domestic service only) When the user asks whether a supported image or PDF has been manipulated or AI generated, use xparse cli detect manipulation <FILE URL . This is a separate service from parsing. To inspect its current package, run xparse cli quota service manipulation detection output json and read free package.free remain count only when authenticated=true and the returned service is manipulation detection . A missing free package is unknown, not zero; never infer this package from the unqualified xparse cli quota command's pdf to markdown allowance. If the installed CLI does not recognize service , update it instead of using the default quota as a substitute. The CLI prechecks the current manipulation detection free package through the quota endpoint. If free quota is available, it makes one detection call without a paid flag. If free quota is exhausted or cannot be confirmed, it stops before detection; ask the user to approve one potentially paid call before repeating the command with approve paid . This is a precheck, not a billing reservation or guarantee. Do not carry paid approval into later calls. If the CLI reports quota service mismatch , the selected endpoint did not return manipulation detection quota. Stop that detection attempt and report the response incompatibility; do not interpret it as extraction service activation, extraction quota, or a reason to try a different operation. tamper threshold and aigc threshold are optional API inputs in [0,1] ; pass them only when requested or needed for an agreed detection criterion. The CLI leaves service defaults unchanged when they are omitted. Results go under ./xparse results/ by default, or output <DIR , in a unique run folder. It saves result.json and, when returned, a JPEG heatmap; terminal output contains absolute paths rather than inline Base64. Report the service's risk conclusion and risk types as detection signals, not proof of provenance. Do not send this domestic only request to a global endpoint or silently substitute another detector. Check detect manipulation help when the installed CLI may predate this command. Choose the workflow Choose by input shape and durability, not by whether authentication already exists: Workflow selection and billing selection are independent decisions. Task versus parse is chosen from the request's input shape and durability needs; auto , free , and paid choose only the billing route. A quota, eligibility, authorization, funding, or format outcome must never change an accepted multi document Task into individual parse calls. Only an explicit user request that narrows the original scope to a genuinely new one document action may be treated as a new parse operation. Use parse for one document or URL when the user needs an immediate result, conversion, or local outline/search navigation. Structured extraction is the exception: first decide whether new files belong to the current conversation's extraction Task or a genuinely new extraction request. A follow up for the same goal can be an append without the word "append". Choose the supported source path below; a new Parse Task is not a prerequisite for every append. Follow the semantic extraction section below instead of reading parsed content into the Host. Use the durable Task Runtime for two or more local documents, or when the user explicitly needs a persistent Task ID, later status checks, selective result reads, exports, debugging, or continuation. A one file request can therefore still be a Task when durability is explicit. Task Runtime control plane routes and OAuth authentication are available in both domestic and overseas environments. Free first Task billing is a separate capability: if the selected environment returns TASK FREE MODE UNAVAILABLE , stop and explain it. Never replace the Task with serial parse calls or silently switch to paid execution. Durable multi document Task Runtime For local files, start one server persisted Task instead of launching multiple parse commands: api auto is free first and fails closed: it does not silently create a paid Task. Use api paid only after the user explicitly approves paid service behavior. Do not parallelize individual parse commands for inputs that belong to one Task. task run returns after the server accepts the Run. When structured progress is enabled, stderr is an xparse event.v1 JSONL stream: run accepted exposes the accepted Task/Run identity immediately, and run status is emitted only when the state changes. Stdout contains exactly one final submission JSON. Preserve operation id , task id , and run id . If submission fails or the process loses its response, reuse the observed operation id with operation id ; never invent a new ID for the same logical submission. Keep Agent workflows on the default submit and return path. Do not add wait or a short fixed timeout automatically. When a user explicitly requests foreground waiting or wait and export, wait polls the same Run; its local timeout returns the current accepted identity with wait timed out: true and next action: POLL STATUS . It does not cancel or recreate the Run. Continue with task status for that exact Task and Run. waiting paid authorization and waiting funds are accepted Task states, not CLI transport failures. The submission/status JSON and its next action are the single authority. They mean the user request is incomplete: stop immediately and issue no more xParse commands—not quota, status, read, export, debug, another task run , or parse —until the user confirms the required external action. Then call task resume once for the exact Task and Run. Use task status <TASK ID run id <RUN ID for bounded progress checks. Start at 2 seconds, then back off to 5, 10, 20, and 30 seconds; do not spend more than about two minutes polling in one Agent turn. Return control with the IDs and current state when work is still running. Never start a duplicate Task merely because the Run is still scheduled or r