/** * arXiv Provider Adapter — science search + get via the Atom API. * * Keyless supplier (DESIGN D2 supplier table: no credential model * exists for arXiv at all) — hence no credentials.ts in this * directory: `credentialEnvVars` is pinned `[]` and the cache * fingerprint is always `""` (D4b note: keyless `""` partition, the * seed-18 Q4 ruling). * * Controls (DESIGN D7 table + D7 amendment): arXiv rejects ALL FOUR * science controls (`author`, `year`, `venue`, `type`) at validate, * before any transport call — honest UNSUPPORTED_OPTION, never * accept-and-drop and never post-filter. The year rejection is * meaning-based: `submittedDate` filters submission date, not * publication year, so a same-meaning wire mapping does not exist. * * Parsing (DESIGN D3): a deterministic hand Atom parser — no XML * dependency. The tokenizer is ``-block scoped: feed-level * ``/`<id>`/`<updated>`/`opensearch:*` elements outside any * entry never surface as a phantom work. CDATA sections, unicode text, * and per-element xmlns redeclaration (`arxiv:doi`) are handled. * ponytail: swap for `fast-xml-parser` if fields ever go missing. * * Mapping pins (PRD AC-7d): `url` = the `rel="alternate"` link href; * `pdfUrl` = the `rel="related"` pdf link; `type` = the * `arxiv:primary_category` term (NOT the plain categories); `year` * from `<published>`; `summary` trimmed; `arxivId` version-stripped; * `citationCount` stays absent (the Atom feed carries none — absent, * never fabricated, AC-7c honesty). */ import type { ScienceCacheIdentity, ScienceSearchRequest, ScienceGetRequest, ScienceWork } from "../../capabilities/science.js"; import type { ProviderCapability, ProviderContext } from "../types.js"; import { type ArxivTransportDeps } from "./client.js"; import { createArxivDiagnosticsCapability } from "./diagnostics.js"; /** * Parse a full arXiv Atom feed into normalized works. Entry-block * scoped by construction: a feed with no `<entry>` maps to `[]` and * feed-level `<title>`/`<id>`/`<updated>` can never surface. */ export declare function parseArxivFeed(feed: string): readonly ScienceWork[]; /** Local science search contract — see the module header. */ interface ArxivScienceSearchCapability { validate(request: ScienceSearchRequest): void; cacheIdentity(request: ScienceSearchRequest): ScienceCacheIdentity; invoke(request: ScienceSearchRequest, signal?: AbortSignal): Promise<readonly ScienceWork[]>; } /** Local science get contract — see the module header. */ interface ArxivScienceGetCapability { validate(request: ScienceGetRequest): void; cacheIdentity(request: ScienceGetRequest): ScienceCacheIdentity; invoke(request: ScienceGetRequest, signal?: AbortSignal): Promise<ScienceWork>; } /** Local ScienceCapability surface. */ interface ArxivScienceCapability { readonly search: ArxivScienceSearchCapability; readonly get: ArxivScienceGetCapability; } /** * Dependencies the arXiv Adapter accepts. The unified `transport` seam * carries `fetch` and timer injection (house spider/linkup pattern). */ export interface ArxivAdapterDependencies { readonly transport?: ArxivTransportDeps; } /** Local Adapter contract — see the module header. */ interface ArxivAdapter { readonly id: "arxiv"; readonly science: ArxivScienceCapability; readonly diagnostics: ReturnType<typeof createArxivDiagnosticsCapability>; } /** Local Descriptor contract — see the module header. */ interface ArxivDescriptor { readonly id: "arxiv"; isConfigured(env: NodeJS.ProcessEnv, capabilityId?: ProviderCapability): boolean; capabilities(): ReadonlySet<ProviderCapability>; create(context: ProviderContext): ArxivAdapter; readonly credentialEnvVars: readonly string[]; } /** * Build the arXiv Provider Descriptor. Keyless and always configured: * `isConfigured` is true only for the no-capability form (doctor) and * the science trio + diagnostics — never `quota` or non-science * capabilities (D2 ruling, inverting the Jina keyless pattern). * `create()` is side-effect-free; transport runs per capability call. */ export declare function createArxivDescriptor(dependencies?: ArxivAdapterDependencies): ArxivDescriptor; export {}; //# sourceMappingURL=adapter.d.ts.map