import type { KnowledgeStore } from '../store.js'; import type { KnowledgeSemanticService } from '../semantic/index.js'; import type { HomeGraphSpaceInput } from './types.js'; /** * Default auto-apply threshold for LLM triage decisions, expressed on the SDK's * 0-100 confidence scale. This mirrors the Home Assistant Python triage engine's * `0.85` gate and reuses the same "trust above a threshold" idiom as the semantic * gap-repair `minConfidence` precedent (`knowledge/semantic/gap-repair.ts`). */ export declare const HOME_GRAPH_TRIAGE_DEFAULT_MIN_CONFIDENCE = 85; /** Issues sent to the model per completion call. */ export declare const HOME_GRAPH_TRIAGE_DEFAULT_CHUNK_SIZE = 25; /** Untriaged open issues examined in a single run by default. */ export declare const HOME_GRAPH_TRIAGE_DEFAULT_LIMIT = 25; /** * One entry in the extensible issue-code → applicability-rule framework. Adding a * rule for a new `homegraph.*` issue code makes that code eligible for LLM triage * without touching the loop itself. This replaces the two hardcoded codes the * heuristic layer knows about. */ export interface HomeGraphTriageRule { /** The issue code this rule governs, e.g. `homegraph.device.unknown_battery`. */ readonly code: string; /** Extra model guidance appended to the triage instruction for this code. */ readonly promptGuidance?: string | undefined; /** Review category recorded when the model omits one for a reject. */ readonly defaultCategory?: string | undefined; } /** * The built-in rules. These reproduce the applicability judgment the Python triage * prompt asked for, for exactly the two codes `quality.ts` raises today. The * `deriveIssueFacts` mapping in `review.ts` supplies the code-specific facts when a * reject is applied, so rules only carry the prompt guidance and default category. */ export declare const DEFAULT_HOME_GRAPH_TRIAGE_RULES: readonly HomeGraphTriageRule[]; export interface HomeGraphTriageOptions { /** Auto-apply threshold on the 0-100 scale. Default 85. */ readonly minConfidence?: number | undefined; /** Max untriaged open issues to examine this run. Default 25. */ readonly limit?: number | undefined; /** Issues per model completion. Default 25. */ readonly chunkSize?: number | undefined; /** Re-triage even issues whose cached fingerprint is unchanged. */ readonly force?: boolean | undefined; /** Issue ids to leave untouched this run. */ readonly skipIssueIds?: readonly string[] | undefined; /** Restrict triage to this subset of issue codes (must still have a rule). */ readonly issueCodes?: readonly string[] | undefined; /** Extra rules merged over the built-ins (by code), the extensibility hook. */ readonly additionalRules?: readonly HomeGraphTriageRule[] | undefined; /** Per-completion model timeout in ms. */ readonly timeoutMs?: number | undefined; /** Reviewer label recorded on applied decisions. */ readonly reviewer?: string | undefined; } export interface HomeGraphTriageDecision { readonly issueId: string; readonly code: string; readonly action: 'reject' | 'review'; readonly category?: string | undefined; readonly confidence: number; readonly reason?: string | undefined; /** True when the decision cleared the threshold and was auto-applied. */ readonly applied: boolean; /** Facts written to the device node when applied. */ readonly appliedFacts?: Record | undefined; /** Provenance tag, always `homegraph-triage`. */ readonly source: string; } export interface HomeGraphTriageResult { readonly ok: true; readonly spaceId: string; /** False when no semantic LLM is configured, the loop is a no-op. */ readonly configured: boolean; readonly processed: number; /** Open triageable issues skipped because their cached fingerprint was unchanged. */ readonly skipped: number; readonly applied: number; readonly reviewed: number; readonly decisions: readonly HomeGraphTriageDecision[]; /** Open triageable issues still unresolved after this run. */ readonly remaining: number; readonly minConfidence: number; readonly reason?: string | undefined; } /** * LLM-driven triage over open Home Graph device-quality issues. Operates strictly * on the resolved Home Assistant knowledge space: it reads that space's issues and * nodes, prompts the configured semantic LLM to classify each open issue as * `reject` (safe to auto-dismiss) or `review` (needs a human), auto-applies rejects * at or above the confidence threshold via {@link reviewHomeGraphFact}, and caches * every decision on the issue so an unchanged issue is never re-sent to the model. * * This never reads or writes any other knowledge space, Home Graph shares this * code with the wiki/agent knowledge functions but never their data. */ export declare function runHomeGraphIssueTriage(input: HomeGraphSpaceInput & { readonly store: KnowledgeStore; readonly semanticService?: KnowledgeSemanticService | undefined; readonly options?: HomeGraphTriageOptions | undefined; readonly signal?: AbortSignal | undefined; }): Promise; //# sourceMappingURL=triage.d.ts.map