@imricci/zaker 0.1.1 → 0.1.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/dist/commands/app-server.d.ts +67 -0
- package/dist/commands/app-server.js +601 -0
- package/dist/commands/app-server.js.map +1 -0
- package/dist/commands/audit.js +2 -1
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.js +22 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/confirm.d.ts +0 -2
- package/dist/commands/confirm.js +2 -16
- package/dist/commands/confirm.js.map +1 -1
- package/dist/commands/dialog-handlers/auth.d.ts +3 -0
- package/dist/commands/dialog-handlers/auth.js +174 -0
- package/dist/commands/dialog-handlers/auth.js.map +1 -0
- package/dist/commands/dialog-handlers/basic.d.ts +7 -0
- package/dist/commands/dialog-handlers/basic.js +82 -0
- package/dist/commands/dialog-handlers/basic.js.map +1 -0
- package/dist/commands/dialog-handlers/bootstrap.d.ts +10 -0
- package/dist/commands/dialog-handlers/bootstrap.js +38 -0
- package/dist/commands/dialog-handlers/bootstrap.js.map +1 -0
- package/dist/commands/dialog-handlers/index.d.ts +2 -0
- package/dist/commands/dialog-handlers/index.js +6 -0
- package/dist/commands/dialog-handlers/index.js.map +1 -0
- package/dist/commands/dialog-handlers/message.d.ts +2 -0
- package/dist/commands/dialog-handlers/message.js +103 -0
- package/dist/commands/dialog-handlers/message.js.map +1 -0
- package/dist/commands/dialog-handlers/model.d.ts +2 -0
- package/dist/commands/dialog-handlers/model.js +168 -0
- package/dist/commands/dialog-handlers/model.js.map +1 -0
- package/dist/commands/dialog-handlers/new.d.ts +2 -0
- package/dist/commands/dialog-handlers/new.js +53 -0
- package/dist/commands/dialog-handlers/new.js.map +1 -0
- package/dist/commands/dialog-handlers/resume.d.ts +2 -0
- package/dist/commands/dialog-handlers/resume.js +25 -0
- package/dist/commands/dialog-handlers/resume.js.map +1 -0
- package/dist/commands/dialog-handlers/router.d.ts +11 -0
- package/dist/commands/dialog-handlers/router.js +112 -0
- package/dist/commands/dialog-handlers/router.js.map +1 -0
- package/dist/commands/dialog-handlers/run.d.ts +2 -0
- package/dist/commands/dialog-handlers/run.js +161 -0
- package/dist/commands/dialog-handlers/run.js.map +1 -0
- package/dist/commands/dialog-handlers/status.d.ts +2 -0
- package/dist/commands/dialog-handlers/status.js +13 -0
- package/dist/commands/dialog-handlers/status.js.map +1 -0
- package/dist/commands/dialog-handlers/types.d.ts +107 -0
- package/dist/commands/dialog-handlers/types.js +3 -0
- package/dist/commands/dialog-handlers/types.js.map +1 -0
- package/dist/commands/dialog.d.ts +92 -0
- package/dist/commands/dialog.js +1784 -236
- package/dist/commands/dialog.js.map +1 -1
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/init.js +6 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plan.js +10 -6
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/run.js +8 -10
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/status.js +6 -12
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tui-launcher.d.ts +1 -0
- package/dist/commands/tui-launcher.js +8 -0
- package/dist/commands/tui-launcher.js.map +1 -0
- package/dist/core/alignment-reply.d.ts +1 -0
- package/dist/core/alignment-reply.js +44 -0
- package/dist/core/alignment-reply.js.map +1 -0
- package/dist/core/checkpoint.js +3 -1
- package/dist/core/checkpoint.js.map +1 -1
- package/dist/core/planner.d.ts +16 -16
- package/dist/core/planner.js +3 -1
- package/dist/core/planner.js.map +1 -1
- package/dist/core/planning-prep.d.ts +12 -0
- package/dist/core/planning-prep.js +26 -0
- package/dist/core/planning-prep.js.map +1 -0
- package/dist/core/preflight.js +1 -2
- package/dist/core/preflight.js.map +1 -1
- package/dist/core/provider-onboarding.js +6 -11
- package/dist/core/provider-onboarding.js.map +1 -1
- package/dist/core/readonly-checkpoint.d.ts +2 -0
- package/dist/core/readonly-checkpoint.js +35 -0
- package/dist/core/readonly-checkpoint.js.map +1 -0
- package/dist/core/run-loop.js +3 -1
- package/dist/core/run-loop.js.map +1 -1
- package/dist/core/types.d.ts +20 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/infra/artifact-schema.d.ts +25 -0
- package/dist/infra/artifact-schema.js +353 -0
- package/dist/infra/artifact-schema.js.map +1 -0
- package/dist/infra/config.d.ts +14 -1
- package/dist/infra/config.js +542 -22
- package/dist/infra/config.js.map +1 -1
- package/dist/infra/dependency-report.d.ts +5 -0
- package/dist/infra/dependency-report.js +22 -0
- package/dist/infra/dependency-report.js.map +1 -0
- package/dist/infra/dialog-session.d.ts +29 -0
- package/dist/infra/dialog-session.js +244 -0
- package/dist/infra/dialog-session.js.map +1 -0
- package/dist/infra/intent.js +63 -13
- package/dist/infra/intent.js.map +1 -1
- package/dist/infra/model-accounts.d.ts +22 -0
- package/dist/infra/model-accounts.js +172 -0
- package/dist/infra/model-accounts.js.map +1 -0
- package/dist/infra/model-catalog.d.ts +4 -1
- package/dist/infra/model-catalog.js +102 -27
- package/dist/infra/model-catalog.js.map +1 -1
- package/dist/infra/openai-codex-oauth.d.ts +18 -0
- package/dist/infra/openai-codex-oauth.js +267 -0
- package/dist/infra/openai-codex-oauth.js.map +1 -0
- package/dist/infra/provider-registry.d.ts +36 -0
- package/dist/infra/provider-registry.js +403 -0
- package/dist/infra/provider-registry.js.map +1 -0
- package/dist/infra/session-status.d.ts +6 -0
- package/dist/infra/session-status.js +34 -0
- package/dist/infra/session-status.js.map +1 -0
- package/dist/infra/tui-utils.d.ts +6 -0
- package/dist/infra/tui-utils.js +163 -0
- package/dist/infra/tui-utils.js.map +1 -0
- package/dist/infra/tui-view.d.ts +44 -0
- package/dist/infra/tui-view.js +314 -0
- package/dist/infra/tui-view.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { IntentCard, SessionStore } from "../../core/types";
|
|
2
|
+
import type { ConversationIndex, ConversationRuntime } from "../../infra/dialog-session";
|
|
3
|
+
import type { PipelineRunOutput, PipelineStageEvent } from "../run";
|
|
4
|
+
export type { ConversationIndex, ConversationRuntime } from "../../infra/dialog-session";
|
|
5
|
+
export interface HandleDialogInputResult {
|
|
6
|
+
action: "continue" | "exit";
|
|
7
|
+
notice?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TaskBoardState {
|
|
10
|
+
run_stage: string;
|
|
11
|
+
run_status: "IDLE" | "RUNNING" | "COMPLETED" | "FAILED";
|
|
12
|
+
verification_status: "PASS" | "FAIL" | "PENDING";
|
|
13
|
+
verification_passed: number;
|
|
14
|
+
verification_total: number;
|
|
15
|
+
risk_hit: string;
|
|
16
|
+
audit_verdict: "PASS" | "CHALLENGE" | "FAIL" | "PENDING";
|
|
17
|
+
audit_reason: string;
|
|
18
|
+
audit_conclusion: string;
|
|
19
|
+
retry_allowed: "YES" | "NO" | "-";
|
|
20
|
+
budget_plan_calls: number;
|
|
21
|
+
budget_audit_calls: number;
|
|
22
|
+
budget_challenge_used: number;
|
|
23
|
+
}
|
|
24
|
+
export interface HandleDialogInputOptions {
|
|
25
|
+
sopOut: string;
|
|
26
|
+
checkpointOut: string;
|
|
27
|
+
interactive: boolean;
|
|
28
|
+
quiet: boolean;
|
|
29
|
+
turnAbortSignal?: AbortSignal;
|
|
30
|
+
board: TaskBoardState;
|
|
31
|
+
conversations: ConversationRuntime;
|
|
32
|
+
redraw?: (nextNotice?: string) => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export interface DialogLogger {
|
|
35
|
+
info(message: string): void;
|
|
36
|
+
warn(message: string): void;
|
|
37
|
+
success(message: string): void;
|
|
38
|
+
error(message: string): void;
|
|
39
|
+
}
|
|
40
|
+
export interface DialogRunSummaryPanel {
|
|
41
|
+
verdict: "PASS" | "CHALLENGE" | "FAIL";
|
|
42
|
+
test_status: "PASS" | "FAIL" | "PENDING";
|
|
43
|
+
tests_passed: number;
|
|
44
|
+
tests_total: number;
|
|
45
|
+
risk_hit: string;
|
|
46
|
+
reason_code: string;
|
|
47
|
+
audit_conclusion: string;
|
|
48
|
+
retry_allowed: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface DialogRunSummary {
|
|
51
|
+
lines: string[];
|
|
52
|
+
historyEntry: string;
|
|
53
|
+
panel: DialogRunSummaryPanel;
|
|
54
|
+
}
|
|
55
|
+
export interface DialogHandlerServices {
|
|
56
|
+
now(): string;
|
|
57
|
+
maxDialogRounds: number;
|
|
58
|
+
defaultConversationId: string;
|
|
59
|
+
helpText(): string;
|
|
60
|
+
createDefaultConversationIndex(): ConversationIndex;
|
|
61
|
+
resetBoard(board: TaskBoardState): void;
|
|
62
|
+
readSessionStore(cwd: string): Promise<SessionStore | null>;
|
|
63
|
+
requireSessionWithDialog(cwd: string): Promise<SessionStore>;
|
|
64
|
+
mutateDialogSession(cwd: string, updater: (session: SessionStore) => SessionStore): Promise<SessionStore>;
|
|
65
|
+
appendDialogEntry(cwd: string, role: "user" | "system", kind: "message" | "command" | "status" | "result", content: string): Promise<void>;
|
|
66
|
+
readIntentCard(cwd: string): Promise<IntentCard | null>;
|
|
67
|
+
upsertDraftIntent(cwd: string, content: string, replace?: boolean): Promise<string>;
|
|
68
|
+
generateAssistantReply(cwd: string, userMessage: string, intentUpdate: string, options?: {
|
|
69
|
+
abort_signal?: AbortSignal;
|
|
70
|
+
}): Promise<string>;
|
|
71
|
+
detectBuildIntent(cwd: string, userMessage: string, intentUpdate: string, options?: {
|
|
72
|
+
abort_signal?: AbortSignal;
|
|
73
|
+
}): Promise<{
|
|
74
|
+
ready: boolean;
|
|
75
|
+
confidence: number;
|
|
76
|
+
signal: string;
|
|
77
|
+
}>;
|
|
78
|
+
setPendingBuildChoice(cwd: string, intentId: string | null): Promise<void>;
|
|
79
|
+
buildSessionStatusLines(cwd: string): Promise<string[]>;
|
|
80
|
+
runInit(cwd: string): Promise<void>;
|
|
81
|
+
persistActiveConversation(runtime: ConversationRuntime, cwd: string): Promise<void>;
|
|
82
|
+
listConversationIds(index: ConversationIndex, cwd: string): Promise<string[]>;
|
|
83
|
+
switchConversation(runtime: ConversationRuntime, targetId: string, cwd: string): Promise<{
|
|
84
|
+
previous: string;
|
|
85
|
+
current: string;
|
|
86
|
+
}>;
|
|
87
|
+
normalizeConversationId(raw: string): string;
|
|
88
|
+
buildIntent(cwd: string): Promise<{
|
|
89
|
+
intent: IntentCard;
|
|
90
|
+
binding: {
|
|
91
|
+
intent_sha256: string;
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
runConfirmedPipeline(sopOut: string, checkpointOut: string, cwd: string, onStage: (event: PipelineStageEvent) => Promise<void>): Promise<PipelineRunOutput>;
|
|
95
|
+
summarizeVerdict(output: PipelineRunOutput, debug: boolean): DialogRunSummary;
|
|
96
|
+
printVerdictLines(lines: string[], verdict: "PASS" | "CHALLENGE" | "FAIL"): void;
|
|
97
|
+
}
|
|
98
|
+
export interface DialogHandlerContext {
|
|
99
|
+
cwd: string;
|
|
100
|
+
input: string;
|
|
101
|
+
command: string;
|
|
102
|
+
rest: string;
|
|
103
|
+
options: HandleDialogInputOptions;
|
|
104
|
+
services: DialogHandlerServices;
|
|
105
|
+
logger: DialogLogger;
|
|
106
|
+
}
|
|
107
|
+
export type DialogCommandHandler = (context: DialogHandlerContext) => Promise<HandleDialogInputResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/dialog-handlers/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,101 @@
|
|
|
1
|
+
import type { Key as ReadlineKey } from "node:readline";
|
|
1
2
|
import { Command } from "commander";
|
|
3
|
+
import { ModelMenuSnapshot } from "../infra/model-accounts";
|
|
4
|
+
import { TwoPaneRenderParams } from "../infra/tui-view";
|
|
5
|
+
import { HandleDialogInputOptions, HandleDialogInputResult, TaskBoardState } from "./dialog-handlers";
|
|
6
|
+
export declare function buildCommandCompletionCandidates(): string[];
|
|
7
|
+
export declare function resolveSlashMenuCandidates(buffer: string, sessionIds?: string[], modelMenu?: ModelMenuSnapshot): string[];
|
|
2
8
|
export interface DialogueSessionOptions {
|
|
3
9
|
script?: string[];
|
|
4
10
|
quiet?: boolean;
|
|
5
11
|
sopOut?: string;
|
|
6
12
|
checkpointOut?: string;
|
|
13
|
+
debug?: boolean;
|
|
7
14
|
}
|
|
15
|
+
export declare function createTaskBoardState(): TaskBoardState;
|
|
16
|
+
export declare function buildTuiFramePreview(params: TwoPaneRenderParams, viewport?: {
|
|
17
|
+
columns?: number;
|
|
18
|
+
rows?: number;
|
|
19
|
+
}): string[];
|
|
20
|
+
interface NormalizedInputChunk {
|
|
21
|
+
text: string;
|
|
22
|
+
hasLineBreak: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function normalizeInteractiveInputChunk(chunk: string): NormalizedInputChunk;
|
|
25
|
+
export declare function parseMouseWheelDeltas(chunk: string): number[];
|
|
26
|
+
export declare function shouldAppendInteractiveTextChunk(chunk: string, key: ReadlineKey, normalizedChunk: NormalizedInputChunk): boolean;
|
|
27
|
+
export declare function shouldSubmitOnUnparsedLineBreak(key: ReadlineKey, normalizedChunk: NormalizedInputChunk): boolean;
|
|
28
|
+
export declare function isPlainSubmitSequence(sequence: string): boolean;
|
|
29
|
+
interface BufferedInputEvent {
|
|
30
|
+
readonly sequence: string;
|
|
31
|
+
readonly parsedKey?: string;
|
|
32
|
+
readonly key: ReadlineKey;
|
|
33
|
+
}
|
|
34
|
+
type BufferedInputListener = (event: BufferedInputEvent) => void;
|
|
35
|
+
declare class DialogInputBuffer {
|
|
36
|
+
private readonly listeners;
|
|
37
|
+
subscribe(listener: BufferedInputListener): () => void;
|
|
38
|
+
clear(): void;
|
|
39
|
+
emitSequence(sequence: string): void;
|
|
40
|
+
}
|
|
41
|
+
export declare function resolveAutocompleteCommandCandidatesForTest(buffer: string, cursorIndex: number, resolveCandidates: (buffer: string) => string[]): string[];
|
|
42
|
+
export declare function renderCommandMenuWithSelectListForTest(items: string[], selectedIndex?: number, width?: number): string[];
|
|
43
|
+
export declare function moveCommandSelectionWithSelectListForTest(items: string[], selectedIndex: number, sequence: string): number;
|
|
44
|
+
interface MenuEnterOutcome {
|
|
45
|
+
buffer: string;
|
|
46
|
+
submit: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface InteractiveBufferState {
|
|
49
|
+
buffer: string;
|
|
50
|
+
cursorIndex: number;
|
|
51
|
+
}
|
|
52
|
+
export type InteractiveBufferEditAction = {
|
|
53
|
+
type: "move_left";
|
|
54
|
+
} | {
|
|
55
|
+
type: "move_right";
|
|
56
|
+
} | {
|
|
57
|
+
type: "backspace";
|
|
58
|
+
} | {
|
|
59
|
+
type: "delete";
|
|
60
|
+
} | {
|
|
61
|
+
type: "insert";
|
|
62
|
+
text: string;
|
|
63
|
+
};
|
|
64
|
+
export declare function applyInteractiveBufferEdit(state: InteractiveBufferState, action: InteractiveBufferEditAction): InteractiveBufferState;
|
|
65
|
+
export declare function runInteractiveEditorKeySequenceForTest(initialBuffer: string, sequences: string[]): {
|
|
66
|
+
buffer: string;
|
|
67
|
+
cursorIndex: number;
|
|
68
|
+
submissions: string[];
|
|
69
|
+
};
|
|
70
|
+
export declare function shouldTreatCtrlDAsExit(buffer: string, key: ReadlineKey): boolean;
|
|
71
|
+
export declare function resolveMenuEnterOutcome(buffer: string, selected: string | undefined, modelMenu?: ModelMenuSnapshot): MenuEnterOutcome;
|
|
72
|
+
interface InteractiveLoginResolution {
|
|
73
|
+
action: "continue" | "cancel" | "exit";
|
|
74
|
+
line?: string;
|
|
75
|
+
notice?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function resolveInteractiveLoginCommand(params: {
|
|
78
|
+
line: string;
|
|
79
|
+
cwd: string;
|
|
80
|
+
prompt: (notice: string) => Promise<string>;
|
|
81
|
+
input_source?: DialogInputBuffer;
|
|
82
|
+
oauth_browser?: {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
notify?: (notice: string) => Promise<void>;
|
|
85
|
+
run_openai_oauth?: (input: {
|
|
86
|
+
onAuth: (payload: {
|
|
87
|
+
url: string;
|
|
88
|
+
instructions: string;
|
|
89
|
+
}) => Promise<void>;
|
|
90
|
+
onProgress: (message: string) => Promise<void>;
|
|
91
|
+
onPrompt: (notice: string) => Promise<string>;
|
|
92
|
+
abort_signal?: AbortSignal;
|
|
93
|
+
}) => Promise<{
|
|
94
|
+
access_token: string;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
}): Promise<InteractiveLoginResolution>;
|
|
98
|
+
export declare function handleDialogInput(line: string, cwd: string, options: HandleDialogInputOptions): Promise<HandleDialogInputResult>;
|
|
8
99
|
export declare function runDialogueSession(cwd?: string, options?: DialogueSessionOptions): Promise<void>;
|
|
9
100
|
export declare function registerDialogCommand(program: Command): void;
|
|
101
|
+
export {};
|