@bilalimamoglu/sift 0.4.5 → 0.5.1

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
@@ -14,7 +14,7 @@ type TestStatusRemainingMode = "none" | "subset_rerun" | "full_rerun_diff";
14
14
  type ResponseMode = "text" | "json";
15
15
  type JsonResponseFormatMode = "auto" | "on" | "off";
16
16
  type OperationMode = "agent-escalation" | "provider-assisted" | "local-only";
17
- type PromptPolicyName = "test-status" | "audit-critical" | "diff-summary" | "build-failure" | "log-errors" | "infra-risk" | "typecheck-summary" | "lint-failures";
17
+ type PromptPolicyName = "test-status" | "audit-critical" | "diff-summary" | "build-failure" | "contract-drift" | "log-errors" | "infra-risk" | "typecheck-summary" | "lint-failures";
18
18
  interface ProviderConfig {
19
19
  provider: ProviderName;
20
20
  model: string;
@@ -39,6 +39,15 @@ interface RuntimeConfig {
39
39
  rawFallback: boolean;
40
40
  verbose: boolean;
41
41
  }
42
+ interface SafetyConfig {
43
+ enabled: boolean;
44
+ extraRiskPatterns: string[];
45
+ ignoredRiskPatterns: string[];
46
+ }
47
+ interface HistoryConfig {
48
+ enabled: boolean;
49
+ retentionDays: number;
50
+ }
42
51
  interface PresetDefinition {
43
52
  question: string;
44
53
  format: OutputFormat;
@@ -50,6 +59,8 @@ interface SiftConfig {
50
59
  provider: ProviderConfig;
51
60
  input: InputConfig;
52
61
  runtime: RuntimeConfig;
62
+ safety: SafetyConfig;
63
+ history: HistoryConfig;
53
64
  presets: Record<string, PresetDefinition>;
54
65
  providerProfiles?: ProviderProfiles;
55
66
  }
@@ -57,6 +68,8 @@ interface PartialSiftConfig {
57
68
  provider?: Partial<ProviderConfig>;
58
69
  input?: Partial<InputConfig>;
59
70
  runtime?: Partial<RuntimeConfig>;
71
+ safety?: Partial<SafetyConfig>;
72
+ history?: Partial<HistoryConfig>;
60
73
  presets?: Record<string, PresetDefinition>;
61
74
  providerProfiles?: ProviderProfiles;
62
75
  }
@@ -106,6 +119,7 @@ interface PreparedInput {
106
119
  sanitized: string;
107
120
  redacted: string;
108
121
  truncated: string;
122
+ safety: SafetyReport | null;
109
123
  meta: {
110
124
  originalLength: number;
111
125
  finalLength: number;
@@ -113,6 +127,40 @@ interface PreparedInput {
113
127
  truncatedApplied: boolean;
114
128
  };
115
129
  }
130
+ interface SafetySignal {
131
+ category: "instruction-like" | "shell-like" | "exfiltration-like" | "unicode-control";
132
+ snippet: string;
133
+ source: "builtin" | "override";
134
+ }
135
+ interface SafetyReport {
136
+ suppressedLineCount: number;
137
+ signals: SafetySignal[];
138
+ }
139
+ type HistoryEntrypoint = "pipe" | "exec" | "hook" | "rerun" | "escalate" | "watch";
140
+ type HistoryResultKind = "reduced" | "insufficient" | "pass-through" | "watch-summary";
141
+ interface HistoryEvent {
142
+ version: 1;
143
+ timestamp: string;
144
+ cwdHash: string;
145
+ cwdLabel: string;
146
+ entrypoint: HistoryEntrypoint;
147
+ operationMode: OperationMode;
148
+ commandFamily: string | null;
149
+ presetName: string | null;
150
+ candidatePresetName: string | null;
151
+ providerCalled: boolean;
152
+ layer: RunLayer;
153
+ detail: DetailLevel | null;
154
+ resultKind: HistoryResultKind;
155
+ inputChars: number;
156
+ outputChars: number;
157
+ estimatedInputTokens: number;
158
+ estimatedOutputTokens: number;
159
+ exactProviderTokens: number | null;
160
+ durationMs: number | null;
161
+ safetySuppressedLineCount: number;
162
+ }
163
+ type RunLayer = "heuristic" | "provider" | "fallback" | "none";
116
164
 
117
165
  declare class BoundedCapture {
118
166
  private readonly headBudget;
@@ -143,6 +191,7 @@ interface ExecRequest extends Omit<RunRequest, "stdin"> {
143
191
  readCachedBaseline?: boolean;
144
192
  writeCachedBaseline?: boolean;
145
193
  watch?: boolean;
194
+ historyEntrypoint?: HistoryEntrypoint;
146
195
  }
147
196
  declare function buildCommandPreview(request: ExecRequest): string;
148
197
  type PackageManagerScriptKind = "npm" | "pnpm" | "yarn" | "bun";
@@ -159,7 +208,7 @@ declare function getExecSuccessShortcut(args: {
159
208
  declare function runExec(request: ExecRequest): Promise<number>;
160
209
 
161
210
  interface RunStats {
162
- layer: "heuristic" | "provider" | "fallback";
211
+ layer: RunLayer;
163
212
  providerCalled: boolean;
164
213
  totalTokens: number | null;
165
214
  durationMs: number;
@@ -188,4 +237,4 @@ interface ResolveOptions {
188
237
  declare function resolveConfig(options?: ResolveOptions): SiftConfig;
189
238
  declare function resolveEffectiveOperationMode(config: SiftConfig): OperationMode;
190
239
 
191
- export { BoundedCapture, type DetailLevel, type ExecRequest, type GenerateInput, type GenerateResult, type Goal, type InputConfig, type JsonResponseFormatMode, type LLMProvider, type NativeProviderName, type OperationMode, type OutputFormat, type PackageManagerScriptKind, type PartialSiftConfig, type PreparedInput, type PresetDefinition, type PromptPolicyName, type ProviderConfig, type ProviderName, type ProviderProfile, type ProviderProfiles, type RawSliceStrategy, type ResolveOptions, type ResponseMode, type RunRequest, type RuntimeConfig, type SiftConfig, type TestStatusRemainingMode, type UsageInfo, buildCommandPreview, detectPackageManagerScriptKind, getExecSuccessShortcut, looksInteractivePrompt, mergeDefined, normalizeChildExitCode, normalizeScriptWrapperOutput, resolveConfig, resolveEffectiveOperationMode, runExec, runSift, runSiftWithStats, startPendingNotice };
240
+ export { BoundedCapture, type DetailLevel, type ExecRequest, type GenerateInput, type GenerateResult, type Goal, type HistoryConfig, type HistoryEntrypoint, type HistoryEvent, type HistoryResultKind, type InputConfig, type JsonResponseFormatMode, type LLMProvider, type NativeProviderName, type OperationMode, type OutputFormat, type PackageManagerScriptKind, type PartialSiftConfig, type PreparedInput, type PresetDefinition, type PromptPolicyName, type ProviderConfig, type ProviderName, type ProviderProfile, type ProviderProfiles, type RawSliceStrategy, type ResolveOptions, type ResponseMode, type RunLayer, type RunRequest, type RuntimeConfig, type SafetyConfig, type SafetyReport, type SafetySignal, type SiftConfig, type TestStatusRemainingMode, type UsageInfo, buildCommandPreview, detectPackageManagerScriptKind, getExecSuccessShortcut, looksInteractivePrompt, mergeDefined, normalizeChildExitCode, normalizeScriptWrapperOutput, resolveConfig, resolveEffectiveOperationMode, runExec, runSift, runSiftWithStats, startPendingNotice };