/** * Core SEO type foundation (spec-20260715-ultimate-seo-suite, Sprint 1). * * Pure `type` declarations only — no runtime code, no imports. These shapes * are quoted verbatim from the architecture Component Breakdown / Data Model * (.bober/architecture/arch-20260715-ultimate-seo-agents-skills-architecture.md). * * Deliberately NOT included this sprint (later-sprint nonGoals): the * `SeoDataSource` seam, capability/query types, adapters, and any import of * `src/hub/finding.js` — `SeoFinding.severity` stays a plain 1..5 numeric * union until the hub emitter sprint maps it onto `Finding`. */ /** The 8 SEO workflows the CLI dispatches on (architecture lines 65-73). */ export type SeoWorkflow = "technical-audit" | "rank-track" | "content-decay" | "topical-map" | "ai-visibility" | "parasite-watch" | "internal-linking" | "schema-audit"; /** * Provenance stamped on every `DataOutcome` `"data"` arm (architecture * lines 165-169). `costUsd` is set only by costed live sources (DataForSEO). * `path`/`mtimeMs` are set only by file-backed sources (LocalExportSource, * Sprint 6) for freshness auditing — optional so `gsc`/`dataforseo` * provenance stays byte-compatible (same optional idiom as `costUsd`). * * Widened (spec-20260717-seo-improver-builder, Sprint 1) with `"ai-visibility"` * and `"damcrawler"` — additive only; no consumer exhaustively switches on * `source` (`analyzer.ts` switches on `DataOutcome.kind`, not `source`). */ export type DataProvenance = { source: "local-export" | "gsc" | "dataforseo" | "ai-visibility" | "damcrawler"; retrievedAt: string; costUsd?: number; path?: string; mtimeMs?: number; }; /** * Three-arm outcome for every `SeoDataSource` capability call (architecture * lines 160-163; mirrors `RetrievalOutcome`, medline-source.ts:25-28). */ export type DataOutcome = { kind: "disabled"; } | { kind: "abstain"; reason: string; } | { kind: "data"; rows: T; provenance: DataProvenance; }; /** * Parsed from each `skills/bober.seo-*` directory's `SKILL.md`, strong/ * read-only, memoised per process (architecture lines 349-360). * * `liveWeightStatus` (spec-20260717-seo-improver-builder, Sprint 3) is a * soft field encoding the documented-vs-live-weight caveat: whether the * signature's invariant is corroborated by a LIVE ranking signal * (`live-corroborated`), is documented-only guidance not (yet) confirmed * live (`documented-only`), or unknown/unstated (`unknown`, the default). * It lives ONLY on the signature — `SeoFinding` is unchanged (ADR-2). */ export type SeoSignature = { playbookId: string; workflows: SeoWorkflow[]; title: string; tactic: string; invariant: string; primarySourceUrl: string; policyClass: "auto-safe" | "human-approve"; evidenceGrade: "verified" | "primary-unverified" | "single-source"; liveWeightStatus: "live-corroborated" | "documented-only" | "unknown"; keywords: string[]; skillRef: string; }; /** * One SEO recommendation (architecture lines 258-267). `severity` maps to * hub `Finding` urgency/severity 1..5 (finding.ts:15-16) in a LATER sprint — * `Finding` is not imported here. */ export type SeoFinding = { recommendation: string; workflow: SeoWorkflow; playbookRef: string; citationUrl: string; evidence: Array<{ metric: string; value: string; source: string; url: string; }>; severity: 1 | 2 | 3 | 4 | 5; humanApprovalRequired: boolean; confidence: "firm" | "tentative"; }; /** * Persisted at `.bober/seo/reports/-seo-report.json` (architecture * lines 363-372). * * `droppedNeverEncode` (spec-20260717-seo-improver-builder, Sprint 1 field / * Sprint 2 wiring) mirrors `droppedUncited` exactly — a required plain * `number` counter. Populated by `NeverEncodeFilter` (`never-encode-filter.ts`, * Sprint 2), which runs in `SeoWorkflowRunner.run` between the * `analysis.parsed` check and `SeoCitationGate.apply`. */ export type SeoReport = { reportId: string; workflow: SeoWorkflow; target: string; generatedAt: string; findings: SeoFinding[]; droppedUncited: number; droppedNeverEncode: number; dataProvenance: DataProvenance[]; verdict: "pass" | "blocked"; }; /** * Persisted at `.bober/seo/quota-ledger.json` (architecture calls this * shape `QuotaLedger`, lines 375-385; named `SeoQuotaLedger` per * generatorNotes to match the `Seo*` naming convention of this module). */ export type SeoQuotaLedger = { [dateKey: string]: { spentUsd: number; scopes: { [scopeKey: string]: { rowsToday: number; urlInspectionsToday: number; }; }; }; }; //# sourceMappingURL=types.d.ts.map