export * from '@lumpcode/cli-types'; import { ContextList, MaybePromise, LumpVariables, CodeBasePath, Maybe, Context, ContextStatus, GetContextListFnOutput, StepVariables, PromptFnInput, PostCommandExecFn, Step, PromptFn, RunLumpInput, GitCommitMessageFn } from '@lumpcode/core'; type BaseBranchFnInput = { effectiveDiscoveryBranch: string; /** Pre-status raw list from the context source (not todo-filtered). */ contexts: ContextList; }; type BaseBranchFn = (input: BaseBranchFnInput) => MaybePromise; type CommandTag = string; type ContextMatchFn = (params: { codeBasePath: CodeBasePath; codeBasePaths: CodeBasePath[]; lumpVariables: V; discoveryBranch: string; }) => MaybePromise; contextOptions?: Maybe; }>>; type ContextOptionsFn = (contextWithoutOptions: Omit) => MaybePromise>; type ContextStatusRecordItem = { status: ContextStatus; contextName: Context['name']; branchName: string; commitMessage: string; }; type FilePath = string; type FilePathOrString = FilePath | string; /** * Author-facing CLI context list fn. Requires concrete `discoveryBranch`. * At the run boundary, CLI adapts this to core `GetContextListFn` (no discovery field). */ type GetContextListFnInput = { codeBasePaths: CodeBasePath[]; lumpVariables: V; discoveryBranch: string; }; type GetContextListFn = (params: GetContextListFnInput) => GetContextListFnOutput; type MergeObjs = Omit & U; type LumpJsConfigStepsFn = (input: Omit, 'stepVariables'>) => MaybePromise | LumpJsConfigStepsItem>; type LumpJsConfigStepsItem = LumpJsConfigStep | LumpJsConfigStepsFn | LumpJsConfigStep['promptTemplate']; type LumpJsConfigSteps = Array>; type LumpJsConfigPostCommandExecFn = (input: Parameters>[0]) => MaybePromise | LumpJsConfigStepsItem>; type LumpJsConfigStep = MergeObjs, { promptTemplate?: FilePathOrString; promptFn?: FilePath | PromptFn; postCommandExecFn?: FilePath | LumpJsConfigPostCommandExecFn; command?: CommandTag | FilePath | Step['commandFn']; }>; /** * How Lumpcode prepares the per-lump git workspace inside the preflight repo root. * * - `checkout`: switch the main worktree to a fresh lump branch (default). * - `worktree`: add a linked worktree under `.lumpcode/worktrees//`. */ type WorkspaceStrategy = 'checkout' | 'worktree'; type PostSetupWorkspaceFnInput = { baseBranch: string; branchName: string; contextList: ContextList; /** Branch workspace. Already prepared on a real run. Read-only. */ workspacePath: string; executionWorkspacePath: string; workspaceStrategy: WorkspaceStrategy; projectRoot: string; lumpVariables: V; }; type PostSetupWorkspaceFn = (input: PostSetupWorkspaceFnInput) => MaybePromise<{ command?: string; } | void>; type PostTeardownWorkspaceFn = (input: PostSetupWorkspaceFnInput) => MaybePromise<{ command?: string; } | void>; type LumpJsConfigSoloStep = LumpJsConfigStep | LumpJsConfigStep['promptTemplate'] | LumpJsConfigStep['promptFn']; /** Variable name → path template (`src/{NAME}.ts`). */ type ContextListJsonTemplate = Record; /** Inline JSON: a static list, or a path-template map. */ type ContextListJsonValue = ContextList | ContextListJsonTemplate; type LumpJsConfig = MergeObjs]?: NonNullable[K]> extends Function ? (RunLumpInput[K] | FilePath) : RunLumpInput[K]; }, 'gitCommitMessageFn' | 'projectRoot' | 'branchFn' | 'baseBranch' | 'setupWorkspaceFn' | 'teardownWorkspaceFn' | 'gitAddCommitFn' | 'gitPushFn' | 'getContextListFn' | 'refreshRemoteTrackingRefsFn' | 'onCommandOutput'>, { /** * Execution integration branch. Exact string, `BaseBranchFn`, or FilePath to a module. * Omit → concrete effective discovery branch. Pattern strings are rejected at resolve. */ baseBranch?: string | BaseBranchFn | FilePath; /** Which integration line this lump is discovered and scheduled on (defaults to primary). Exact or git-glob. */ discoveryBranch?: string; /** * Discovery rules (exact and/or git-glob). Mutually exclusive with `discoveryBranch`. */ discoveryBranches?: string[]; command?: LumpJsConfigStep['command']; contextListJson?: FilePath | ContextListJsonValue; contextMatchFn?: FilePath | ContextMatchFn; contextOptionsFn?: FilePath | ContextOptionsFn; /** Author context list fn (CLI shape with required `discoveryBranch`). */ getContextListFn?: FilePath | GetContextListFn; disabled?: boolean | (() => MaybePromise) | FilePath; maximumNumberOfConcurrentBranches?: number; prompt?: LumpJsConfigSoloStep; steps?: LumpJsConfigSteps | LumpJsConfigStepsItem; /** * Default agent/command timeout for steps that omit `timeoutMillis`. * Engine default is 30 minutes when both are omitted. */ timeoutMillis?: number; /** * Extra command tags to pre-load before composed setup/teardown. * A tag top-level `command` is pre-registered automatically; list other * tags that appear only in dynamic/recursive returns. */ registerCommands?: string[]; keepHistory?: boolean; writeTranscripts?: boolean; verbose?: boolean; /** * After generated checkout/worktree setup. Mutually exclusive with * `postSetupWorkspaceCommand`. */ postSetupWorkspaceFn?: FilePath | PostSetupWorkspaceFn; /** Shell fragment in the branch workspace. Mutually exclusive with `postSetupWorkspaceFn`. */ postSetupWorkspaceCommand?: string; /** * Before generated workspace teardown. Mutually exclusive with * `postTeardownWorkspaceCommand`. */ postTeardownWorkspaceFn?: FilePath | PostTeardownWorkspaceFn; /** Shell fragment in the branch workspace. Mutually exclusive with `postTeardownWorkspaceFn`. */ postTeardownWorkspaceCommand?: string; }>; declare function getContextStatuses(input: { projectRoot: string; lumpName: string; baseBranch: string; contextNames: string[]; /** * When true, skip the locked remote refresh and classify from existing * remote-tracking refs. Caller must have refreshed already when freshness matters. */ skipRefresh?: boolean; }): Promise>; declare function getContextStatus(input: { projectRoot: string; contextName: string; lumpName: string; baseBranch: string; }): Promise; declare function makeGitCommitMessageFnFromLumpName(lumpName: string): GitCommitMessageFn; declare function getGitCommitMessage(input: { contextName: string; lumpName: string; }): string; declare function getLumpCommitPrefixForLump(input: { lumpName: string; }): string; /** Reads a YAML file as a flat list; returns `[]` when missing or not an array. */ declare function readYamlList(filePath: string): Promise; declare function normalizeSteps({ prompt: originalPrompt, jsSteps: originalJsSteps, }: { prompt: LumpJsConfig['prompt']; jsSteps: LumpJsConfig['steps']; }): LumpJsConfigSteps; type PresetSessionStepVariables = { newChat?: boolean; chatIdIndex?: string | null; }; type CursorAgentPermissions = { cursorConfigDir?: string; }; type CursorPresetLumpVariables = { model?: string; agentPermissions?: CursorAgentPermissions; }; type CursorPresetStepVariables = CursorPresetLumpVariables & PresetSessionStepVariables; type CopilotAgentPermissions = { writablePaths?: readonly string[]; denyShell?: readonly string[]; }; type CopilotPresetLumpVariables = { model?: string; agentPermissions?: CopilotAgentPermissions; }; type CopilotPresetStepVariables = CopilotPresetLumpVariables & PresetSessionStepVariables; type ClaudeCodeAgentPermissions = { permissionMode?: 'default' | 'acceptEdits' | 'plan' | 'auto' | 'dontAsk' | 'bypassPermissions'; allowedTools?: readonly string[]; disallowedTools?: readonly string[]; bare?: boolean; addDirs?: readonly string[]; }; type ClaudeCodePresetLumpVariables = { model?: string; agentPermissions?: ClaudeCodeAgentPermissions; }; type ClaudeCodePresetStepVariables = ClaudeCodePresetLumpVariables & PresetSessionStepVariables; type OpenCodeAgentPermissions = { auto?: boolean; agent?: string; }; type OpenCodePresetLumpVariables = { model?: string; agentPermissions?: OpenCodeAgentPermissions; }; type OpenCodePresetStepVariables = OpenCodePresetLumpVariables & PresetSessionStepVariables; type CodexAgentPermissions = { sandbox?: 'read-only' | 'workspace-write' | 'danger-full-access'; dangerouslyBypassApprovalsAndSandbox?: boolean; addDirs?: readonly string[]; }; type CodexPresetLumpVariables = { model?: string; agentPermissions?: CodexAgentPermissions; }; type CodexPresetStepVariables = CodexPresetLumpVariables & PresetSessionStepVariables; export { getContextStatus, getContextStatuses, getGitCommitMessage, getLumpCommitPrefixForLump, makeGitCommitMessageFnFromLumpName, normalizeSteps, readYamlList }; export type { ClaudeCodeAgentPermissions, ClaudeCodePresetLumpVariables, ClaudeCodePresetStepVariables, CodexAgentPermissions, CodexPresetLumpVariables, CodexPresetStepVariables, CopilotAgentPermissions, CopilotPresetLumpVariables, CopilotPresetStepVariables, CursorAgentPermissions, CursorPresetLumpVariables, CursorPresetStepVariables, OpenCodeAgentPermissions, OpenCodePresetLumpVariables, OpenCodePresetStepVariables, PresetSessionStepVariables };