@bilalimamoglu/sift 0.2.2 → 0.2.3
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/README.md +139 -89
- package/dist/cli.js +1132 -347
- package/dist/index.d.ts +29 -1
- package/dist/index.js +530 -47
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type ProviderName = "openai" | "openai-compatible";
|
|
2
2
|
type OutputFormat = "brief" | "bullets" | "json" | "verdict";
|
|
3
|
+
type DetailLevel = "standard" | "focused" | "verbose";
|
|
3
4
|
type ResponseMode = "text" | "json";
|
|
4
5
|
type JsonResponseFormatMode = "auto" | "on" | "off";
|
|
5
6
|
type PromptPolicyName = "test-status" | "audit-critical" | "diff-summary" | "build-failure" | "log-errors" | "infra-risk" | "typecheck-summary" | "lint-failures";
|
|
@@ -70,6 +71,8 @@ interface RunRequest {
|
|
|
70
71
|
stdin: string;
|
|
71
72
|
config: SiftConfig;
|
|
72
73
|
dryRun?: boolean;
|
|
74
|
+
showRaw?: boolean;
|
|
75
|
+
detail?: DetailLevel;
|
|
73
76
|
presetName?: string;
|
|
74
77
|
policyName?: PromptPolicyName;
|
|
75
78
|
outputContract?: string;
|
|
@@ -88,11 +91,35 @@ interface PreparedInput {
|
|
|
88
91
|
};
|
|
89
92
|
}
|
|
90
93
|
|
|
94
|
+
declare class BoundedCapture {
|
|
95
|
+
private readonly headBudget;
|
|
96
|
+
private readonly tailBudget;
|
|
97
|
+
private readonly maxChars;
|
|
98
|
+
private full;
|
|
99
|
+
private head;
|
|
100
|
+
private tail;
|
|
101
|
+
private overflowed;
|
|
102
|
+
private totalChars;
|
|
103
|
+
constructor(maxChars: number);
|
|
104
|
+
push(chunk: string): void;
|
|
105
|
+
render(): string;
|
|
106
|
+
getTotalChars(): number;
|
|
107
|
+
wasTruncated(): boolean;
|
|
108
|
+
}
|
|
109
|
+
declare function looksInteractivePrompt(windowText: string): boolean;
|
|
110
|
+
declare function normalizeChildExitCode(status: number | null, signal: NodeJS.Signals | null): number;
|
|
91
111
|
interface ExecRequest extends Omit<RunRequest, "stdin"> {
|
|
92
112
|
command?: string[];
|
|
93
113
|
failOn?: boolean;
|
|
114
|
+
showRaw?: boolean;
|
|
94
115
|
shellCommand?: string;
|
|
95
116
|
}
|
|
117
|
+
declare function buildCommandPreview(request: ExecRequest): string;
|
|
118
|
+
declare function getExecSuccessShortcut(args: {
|
|
119
|
+
presetName?: string;
|
|
120
|
+
exitCode: number;
|
|
121
|
+
capturedOutput: string;
|
|
122
|
+
}): string | null;
|
|
96
123
|
declare function runExec(request: ExecRequest): Promise<number>;
|
|
97
124
|
|
|
98
125
|
declare function runSift(request: RunRequest): Promise<string>;
|
|
@@ -102,6 +129,7 @@ interface LLMProvider {
|
|
|
102
129
|
generate(input: GenerateInput): Promise<GenerateResult>;
|
|
103
130
|
}
|
|
104
131
|
|
|
132
|
+
declare function mergeDefined<T>(base: T, override: unknown): T;
|
|
105
133
|
interface ResolveOptions {
|
|
106
134
|
configPath?: string;
|
|
107
135
|
env?: NodeJS.ProcessEnv;
|
|
@@ -109,4 +137,4 @@ interface ResolveOptions {
|
|
|
109
137
|
}
|
|
110
138
|
declare function resolveConfig(options?: ResolveOptions): SiftConfig;
|
|
111
139
|
|
|
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 };
|
|
140
|
+
export { BoundedCapture, type DetailLevel, 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, buildCommandPreview, getExecSuccessShortcut, looksInteractivePrompt, mergeDefined, normalizeChildExitCode, resolveConfig, runExec, runSift };
|