/** * Science command layer (DESIGN D6/D6b; PRD AC-4b, AC-5d, AC-7, AC-7b). * * - `scoutline science search [--author --year --venue * --type --provider]` — data CommandResult with ScienceWork[]. * - `scoutline science get ` — data CommandResult with * one ScienceWork. * * Handlers RETURN CommandResult through the invocation seam * (`invokeCommand`) — the removed global command-output API was * retired in 22337a1 and is test-forbidden (tests/output.test.js; the * D6 envelope correction). The command is dispatched credential-free * by the `if (command === "science") {` arm in src/index.ts (the * `archive` precedent): the science suppliers are keyless, so a * corrupt or missing ~/.scoutline/config.json never blocks a run. * * Parse-level rejections (PRD AC-7/AC-7b/AC-4b) fire BEFORE any * supplier access: * - `--type` accepts exactly the union vocabulary; `component` (and * any non-union value) is rejected — never surfaced, never * requestable. * - `--year` accepts only "2020" | "2018:2022"; empty, malformed, * and reversed ranges throw. * - a missing query / identifier, a `doi:`-prefixed identifier, and * free-text identifiers throw ValidationError. * * Selection (T10, the full D5 grammar): no pin or `--provider all` → * fan-out across every enabled science supplier in the D5 * openalex-first arm order, merged with DOI-first dedup identity * (exact-url fallback) and D12 field-wise union enrichment; * `--provider ` pins one arm. Control-rejecting arms are EXCLUDED * at validation with a per-arm stderr notice (never a silent drop); * all enabled arms rejecting fails UNSUPPORTED_OPTION. `science get` * reroutes along the id-type-filtered arm order on supplier failure * with a stderr note; `--no-fallback` fails strict. */ import { type BudgetLadder } from "../lib/output-budget.js"; import type { OutputMode } from "../lib/output.js"; import type { HandlerDependencies } from "../index.js"; export declare const SCIENCE_HELP: string; /** The science Output Budget ladder (D6b; single ladder, both verbs). */ export declare const SCIENCE_LADDER: BudgetLadder; export declare function parseScienceArgs(args: readonly string[]): { readonly subcommand?: string; readonly positional: readonly string[]; readonly flags: Record; readonly showHelp: boolean; }; export interface HandleScienceOptions { /** Pin from the global `--provider` flag (command-local wins). */ readonly explicitProvider?: string; /** * Optional interrupt registrar injection (matches research.ts precedent). * Accepts a handler closure and returns a teardown. When absent, defaults * to process.on("SIGINT", handler) and returns () => process.off("SIGINT", handler). */ readonly registerInterrupt?: (handler: () => void) => () => void; } /** * T7: derive the journal entry's cacheKey from a supplier science * cache identity. Science identities are `{supplier, capability: * "science.search"|"science.get", credentialFingerprint, request}` — * the `supplier`/`capability` naming differs from the * provider-capability identities the capture wrapper keys off, so the * journal derives the SAME partitioned-key shape the supplier's * response cache is keyed under (since #140 science consults and * fills that cache at its own invoke sites, deriving the key right * there): `buildProviderCacheKey` over the identity, namespace * verbatim. */ export declare function scienceCacheKey(identity: unknown): string | undefined; export declare function handleScience(args: string[], outputMode: OutputMode, deps: HandlerDependencies, options?: HandleScienceOptions): Promise; //# sourceMappingURL=science.d.ts.map