import { type TSchema } from "@sinclair/typebox"; import type { ScannerDependencyPolicyMode } from "./scanner-definition.js"; import type { Candidate, OiSnapshot, SharedArtifactKey } from "./types.js"; export interface PrescreenedCandidate extends Candidate { score: number; changePct: number; volume: number; openInterest: number; } export interface PrescreenedArtifact { timestamp: number; candidates: PrescreenedCandidate[]; } export type OiHistoryArtifact = Record; export type BtcCacheArtifact = Record; /** Macro market environment classification. */ export declare enum MarketRegime { BULLISH = "BULLISH", BEARISH = "BEARISH", NEUTRAL = "NEUTRAL" } /** Shared artifact published by the market-regime scanner. */ export interface MarketRegimeArtifact { regime: MarketRegime; confidence: number; btcBias: MarketRegime; ethBias: MarketRegime; btcWeight: number; ethWeight: number; timestamp: number; } /** * Compatibility map for built-in retained-context payloads. * * The runtime no longer treats shared-artifact keys as a closed set; any * scanner may publish one retained context contract in v1. Keep this map only * for built-in scanner/test typing and helper generics. */ export interface SharedArtifactValueMap { prescreened: PrescreenedArtifact; "oi-history": OiHistoryArtifact; "btc-cache": BtcCacheArtifact; "market-regime": MarketRegimeArtifact; } export type SharedArtifactValue = Key extends keyof SharedArtifactValueMap ? SharedArtifactValueMap[Key] : unknown; /** * Contract describing one shared artifact channel. * * Shared artifacts are internal shared market intelligence between scanners: * strategy-scoped persisted data products that scanners publish and consume. * They are not downstream trading signals and they are not scanner-local state. */ export interface SharedArtifactContract { key: Key; description: string; schema?: TSchema; } export declare function defineSharedArtifact(key: Key, options: { description: string; schema?: TSchema; }): SharedArtifactContract; /** * Optional provider-backed source that can satisfy an artifact input before store fallback. * Current support is intentionally small; expand it only when a shared artifact has a * clear provider-backed equivalent. */ export type ArtifactProviderSource = "oiHistory"; /** * Consumer-side binding for one shared artifact. * * This keeps the global artifact contract separate from scanner-local consumption policy. * A binding answers: how should this scanner load and validate this shared market intelligence? */ export interface ConsumedArtifactBinding { /** The shared artifact contract being consumed. */ contract: SharedArtifactContract; /** Fail the run when the artifact cannot be resolved from providers or store. */ required?: boolean; /** Maximum acceptable age in milliseconds when loading from the shared-artifact store. */ maxAgeMs?: number; /** Behavior when the artifact is missing after provider/store resolution. */ onMissing?: ScannerDependencyPolicyMode; /** Behavior when the artifact exists but is stale. */ onStale?: ScannerDependencyPolicyMode; /** * Optional provider-backed source that can populate this artifact input before * falling back to the persisted shared-artifact store. */ providerSource?: ArtifactProviderSource; } /** Creates one scanner-side binding for consumed shared market intelligence. */ export declare function consumeSharedArtifact(contract: SharedArtifactContract, options?: Omit, "contract">): ConsumedArtifactBinding; export declare const prescreenedArtifactSchema: import("@sinclair/typebox").TObject<{ timestamp: import("@sinclair/typebox").TNumber; candidates: import("@sinclair/typebox").TArray; maxLeverage: import("@sinclair/typebox").TNumber; score: import("@sinclair/typebox").TNumber; changePct: import("@sinclair/typebox").TNumber; volume: import("@sinclair/typebox").TNumber; openInterest: import("@sinclair/typebox").TNumber; }>>; }>; export declare const oiHistoryArtifactSchema: import("@sinclair/typebox").TRecord>>; export declare const btcCacheArtifactSchema: import("@sinclair/typebox").TRecord; export declare const prescreenedArtifact: SharedArtifactContract<"prescreened">; export declare const oiHistoryArtifact: SharedArtifactContract<"oi-history">; export declare const btcCacheArtifact: SharedArtifactContract<"btc-cache">; export declare const marketRegimeArtifactSchema: import("@sinclair/typebox").TObject<{ regime: import("@sinclair/typebox").TEnum; confidence: import("@sinclair/typebox").TNumber; btcBias: import("@sinclair/typebox").TEnum; ethBias: import("@sinclair/typebox").TEnum; btcWeight: import("@sinclair/typebox").TNumber; ethWeight: import("@sinclair/typebox").TNumber; timestamp: import("@sinclair/typebox").TNumber; }>; export declare const marketRegimeArtifact: SharedArtifactContract<"market-regime">; //# sourceMappingURL=artifacts.d.ts.map