@bilalimamoglu/sift 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,106 @@
1
+ type ProviderName = "openai-compatible";
2
+ type OutputFormat = "brief" | "bullets" | "json" | "verdict";
3
+ type ResponseMode = "text" | "json";
4
+ type PromptPolicyName = "test-status" | "audit-critical" | "diff-summary" | "build-failure" | "log-errors" | "infra-risk";
5
+ interface ProviderConfig {
6
+ provider: ProviderName;
7
+ model: string;
8
+ baseUrl: string;
9
+ apiKey?: string;
10
+ timeoutMs: number;
11
+ temperature: number;
12
+ maxOutputTokens: number;
13
+ }
14
+ interface InputConfig {
15
+ stripAnsi: boolean;
16
+ redact: boolean;
17
+ redactStrict: boolean;
18
+ maxCaptureChars: number;
19
+ maxInputChars: number;
20
+ headChars: number;
21
+ tailChars: number;
22
+ }
23
+ interface RuntimeConfig {
24
+ rawFallback: boolean;
25
+ verbose: boolean;
26
+ }
27
+ interface PresetDefinition {
28
+ question: string;
29
+ format: OutputFormat;
30
+ policy?: PromptPolicyName;
31
+ outputContract?: string;
32
+ fallbackJson?: unknown;
33
+ }
34
+ interface SiftConfig {
35
+ provider: ProviderConfig;
36
+ input: InputConfig;
37
+ runtime: RuntimeConfig;
38
+ presets: Record<string, PresetDefinition>;
39
+ }
40
+ interface PartialSiftConfig {
41
+ provider?: Partial<ProviderConfig>;
42
+ input?: Partial<InputConfig>;
43
+ runtime?: Partial<RuntimeConfig>;
44
+ presets?: Record<string, PresetDefinition>;
45
+ }
46
+ interface GenerateInput {
47
+ model: string;
48
+ prompt: string;
49
+ temperature: number;
50
+ maxOutputTokens: number;
51
+ timeoutMs: number;
52
+ responseMode: ResponseMode;
53
+ }
54
+ interface UsageInfo {
55
+ inputTokens?: number;
56
+ outputTokens?: number;
57
+ totalTokens?: number;
58
+ }
59
+ interface GenerateResult {
60
+ text: string;
61
+ usage?: UsageInfo;
62
+ raw?: unknown;
63
+ }
64
+ interface RunRequest {
65
+ question: string;
66
+ format: OutputFormat;
67
+ stdin: string;
68
+ config: SiftConfig;
69
+ policyName?: PromptPolicyName;
70
+ outputContract?: string;
71
+ fallbackJson?: unknown;
72
+ }
73
+ interface PreparedInput {
74
+ raw: string;
75
+ sanitized: string;
76
+ redacted: string;
77
+ truncated: string;
78
+ meta: {
79
+ originalLength: number;
80
+ finalLength: number;
81
+ redactionApplied: boolean;
82
+ truncatedApplied: boolean;
83
+ };
84
+ }
85
+
86
+ interface ExecRequest extends Omit<RunRequest, "stdin"> {
87
+ command?: string[];
88
+ shellCommand?: string;
89
+ }
90
+ declare function runExec(request: ExecRequest): Promise<number>;
91
+
92
+ declare function runSift(request: RunRequest): Promise<string>;
93
+
94
+ interface LLMProvider {
95
+ readonly name: string;
96
+ generate(input: GenerateInput): Promise<GenerateResult>;
97
+ }
98
+
99
+ interface ResolveOptions {
100
+ configPath?: string;
101
+ env?: NodeJS.ProcessEnv;
102
+ cliOverrides?: PartialSiftConfig;
103
+ }
104
+ declare function resolveConfig(options?: ResolveOptions): SiftConfig;
105
+
106
+ export { type ExecRequest, type GenerateInput, type GenerateResult, type InputConfig, type LLMProvider, type OutputFormat, type PartialSiftConfig, type PreparedInput, type PresetDefinition, type PromptPolicyName, type ProviderConfig, type ProviderName, type ResolveOptions, type ResponseMode, type RunRequest, type RuntimeConfig, type SiftConfig, type UsageInfo, resolveConfig, runExec, runSift };