@bilalimamoglu/sift 0.2.2 → 0.3.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  type ProviderName = "openai" | "openai-compatible";
2
2
  type OutputFormat = "brief" | "bullets" | "json" | "verdict";
3
+ type DetailLevel = "standard" | "focused" | "verbose";
4
+ type Goal = "summarize" | "diagnose";
5
+ type RawSliceStrategy = "none" | "bucket_evidence" | "traceback_window" | "head_tail";
3
6
  type ResponseMode = "text" | "json";
4
7
  type JsonResponseFormatMode = "auto" | "on" | "off";
5
8
  type PromptPolicyName = "test-status" | "audit-critical" | "diff-summary" | "build-failure" | "log-errors" | "infra-risk" | "typecheck-summary" | "lint-failures";
@@ -69,10 +72,20 @@ interface RunRequest {
69
72
  format: OutputFormat;
70
73
  stdin: string;
71
74
  config: SiftConfig;
75
+ goal?: Goal;
72
76
  dryRun?: boolean;
77
+ showRaw?: boolean;
78
+ includeTestIds?: boolean;
79
+ detail?: DetailLevel;
73
80
  presetName?: string;
74
81
  policyName?: PromptPolicyName;
75
82
  outputContract?: string;
83
+ analysisContext?: string;
84
+ testStatusContext?: {
85
+ resolvedTests?: string[];
86
+ remainingTests?: string[];
87
+ remainingSubsetAvailable?: boolean;
88
+ };
76
89
  fallbackJson?: unknown;
77
90
  }
78
91
  interface PreparedInput {
@@ -88,11 +101,39 @@ interface PreparedInput {
88
101
  };
89
102
  }
90
103
 
104
+ declare class BoundedCapture {
105
+ private readonly headBudget;
106
+ private readonly tailBudget;
107
+ private readonly maxChars;
108
+ private full;
109
+ private head;
110
+ private tail;
111
+ private overflowed;
112
+ private totalChars;
113
+ constructor(maxChars: number);
114
+ push(chunk: string): void;
115
+ render(): string;
116
+ getTotalChars(): number;
117
+ wasTruncated(): boolean;
118
+ }
119
+ declare function looksInteractivePrompt(windowText: string): boolean;
120
+ declare function normalizeChildExitCode(status: number | null, signal: NodeJS.Signals | null): number;
91
121
  interface ExecRequest extends Omit<RunRequest, "stdin"> {
92
122
  command?: string[];
123
+ cwd?: string;
124
+ diff?: boolean;
93
125
  failOn?: boolean;
126
+ showRaw?: boolean;
94
127
  shellCommand?: string;
128
+ skipCacheWrite?: boolean;
129
+ watch?: boolean;
95
130
  }
131
+ declare function buildCommandPreview(request: ExecRequest): string;
132
+ declare function getExecSuccessShortcut(args: {
133
+ presetName?: string;
134
+ exitCode: number;
135
+ capturedOutput: string;
136
+ }): string | null;
96
137
  declare function runExec(request: ExecRequest): Promise<number>;
97
138
 
98
139
  declare function runSift(request: RunRequest): Promise<string>;
@@ -102,6 +143,7 @@ interface LLMProvider {
102
143
  generate(input: GenerateInput): Promise<GenerateResult>;
103
144
  }
104
145
 
146
+ declare function mergeDefined<T>(base: T, override: unknown): T;
105
147
  interface ResolveOptions {
106
148
  configPath?: string;
107
149
  env?: NodeJS.ProcessEnv;
@@ -109,4 +151,4 @@ interface ResolveOptions {
109
151
  }
110
152
  declare function resolveConfig(options?: ResolveOptions): SiftConfig;
111
153
 
112
- export { type ExecRequest, type GenerateInput, type GenerateResult, type InputConfig, type JsonResponseFormatMode, 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 };
154
+ export { BoundedCapture, type DetailLevel, type ExecRequest, type GenerateInput, type GenerateResult, type Goal, type InputConfig, type JsonResponseFormatMode, type LLMProvider, type OutputFormat, type PartialSiftConfig, type PreparedInput, type PresetDefinition, type PromptPolicyName, type ProviderConfig, type ProviderName, type RawSliceStrategy, type ResolveOptions, type ResponseMode, type RunRequest, type RuntimeConfig, type SiftConfig, type UsageInfo, buildCommandPreview, getExecSuccessShortcut, looksInteractivePrompt, mergeDefined, normalizeChildExitCode, resolveConfig, runExec, runSift };