@lumpcode/core 0.0.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/LICENSE +202 -0
- package/README.md +489 -0
- package/dist/helpers/collectPromptStepsForContext/index.d.ts +2 -0
- package/dist/helpers/collectPromptStepsForContext/index.d.ts.map +1 -0
- package/dist/helpers/collectPromptStepsForContext/main.d.ts +24 -0
- package/dist/helpers/collectPromptStepsForContext/main.d.ts.map +1 -0
- package/dist/helpers/collectStepsForContext/index.d.ts +2 -0
- package/dist/helpers/collectStepsForContext/index.d.ts.map +1 -0
- package/dist/helpers/collectStepsForContext/main.d.ts +24 -0
- package/dist/helpers/collectStepsForContext/main.d.ts.map +1 -0
- package/dist/helpers/execAsync/index.d.ts +2 -0
- package/dist/helpers/execAsync/index.d.ts.map +1 -0
- package/dist/helpers/execAsync/main.d.ts +14 -0
- package/dist/helpers/execAsync/main.d.ts.map +1 -0
- package/dist/helpers/execBinary/index.d.ts +2 -0
- package/dist/helpers/execBinary/index.d.ts.map +1 -0
- package/dist/helpers/execBinary/main.d.ts +15 -0
- package/dist/helpers/execBinary/main.d.ts.map +1 -0
- package/dist/helpers/executePromptsForContextList/index.d.ts +2 -0
- package/dist/helpers/executePromptsForContextList/index.d.ts.map +1 -0
- package/dist/helpers/executePromptsForContextList/main.d.ts +15 -0
- package/dist/helpers/executePromptsForContextList/main.d.ts.map +1 -0
- package/dist/helpers/executePromptsForContextListOld/main.d.ts +1 -0
- package/dist/helpers/executePromptsForContextListOld/main.d.ts.map +1 -0
- package/dist/helpers/executeStepsForContextList/index.d.ts +2 -0
- package/dist/helpers/executeStepsForContextList/index.d.ts.map +1 -0
- package/dist/helpers/executeStepsForContextList/main.d.ts +15 -0
- package/dist/helpers/executeStepsForContextList/main.d.ts.map +1 -0
- package/dist/helpers/getCodeBasePaths/index.d.ts +2 -0
- package/dist/helpers/getCodeBasePaths/index.d.ts.map +1 -0
- package/dist/helpers/getCodeBasePaths/main.d.ts +7 -0
- package/dist/helpers/getCodeBasePaths/main.d.ts.map +1 -0
- package/dist/helpers/getContextStatus/index.d.ts +2 -0
- package/dist/helpers/getContextStatus/index.d.ts.map +1 -0
- package/dist/helpers/getContextStatus/main.d.ts +13 -0
- package/dist/helpers/getContextStatus/main.d.ts.map +1 -0
- package/dist/helpers/getToDoContextList/index.d.ts +2 -0
- package/dist/helpers/getToDoContextList/index.d.ts.map +1 -0
- package/dist/helpers/getToDoContextList/main.d.ts +12 -0
- package/dist/helpers/getToDoContextList/main.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +9 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/isRemoteBranchExistant/index.d.ts +2 -0
- package/dist/helpers/isRemoteBranchExistant/index.d.ts.map +1 -0
- package/dist/helpers/isRemoteBranchExistant/main.d.ts +14 -0
- package/dist/helpers/isRemoteBranchExistant/main.d.ts.map +1 -0
- package/dist/helpers/updateContextStatusRecord/index.d.ts +2 -0
- package/dist/helpers/updateContextStatusRecord/index.d.ts.map +1 -0
- package/dist/helpers/updateContextStatusRecord/main.d.ts +7 -0
- package/dist/helpers/updateContextStatusRecord/main.d.ts.map +1 -0
- package/dist/helpers/validateContextListNames/index.d.ts +2 -0
- package/dist/helpers/validateContextListNames/index.d.ts.map +1 -0
- package/dist/helpers/validateContextListNames/main.d.ts +3 -0
- package/dist/helpers/validateContextListNames/main.d.ts.map +1 -0
- package/dist/helpers/workspaceExecCwd/index.d.ts +2 -0
- package/dist/helpers/workspaceExecCwd/index.d.ts.map +1 -0
- package/dist/helpers/workspaceExecCwd/main.d.ts +5 -0
- package/dist/helpers/workspaceExecCwd/main.d.ts.map +1 -0
- package/dist/index.cjs +769 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +723 -0
- package/dist/index.js.map +1 -0
- package/dist/types/ArrayPaths.d.ts +10 -0
- package/dist/types/ArrayPaths.d.ts.map +1 -0
- package/dist/types/AsyncFnSuccess.d.ts +3 -0
- package/dist/types/AsyncFnSuccess.d.ts.map +1 -0
- package/dist/types/BranchFn.d.ts +10 -0
- package/dist/types/BranchFn.d.ts.map +1 -0
- package/dist/types/CodeBasePath.d.ts +5 -0
- package/dist/types/CodeBasePath.d.ts.map +1 -0
- package/dist/types/CommandFn.d.ts +22 -0
- package/dist/types/CommandFn.d.ts.map +1 -0
- package/dist/types/CommandResultInfos.d.ts +5 -0
- package/dist/types/CommandResultInfos.d.ts.map +1 -0
- package/dist/types/Context.d.ts +9 -0
- package/dist/types/Context.d.ts.map +1 -0
- package/dist/types/ContextList.d.ts +3 -0
- package/dist/types/ContextList.d.ts.map +1 -0
- package/dist/types/ContextRunState.d.ts +2 -0
- package/dist/types/ContextRunState.d.ts.map +1 -0
- package/dist/types/ContextStatus.d.ts +9 -0
- package/dist/types/ContextStatus.d.ts.map +1 -0
- package/dist/types/ExtractSuccess.d.ts +3 -0
- package/dist/types/ExtractSuccess.d.ts.map +1 -0
- package/dist/types/Failure.d.ts +5 -0
- package/dist/types/Failure.d.ts.map +1 -0
- package/dist/types/GetContextListFn.d.ts +11 -0
- package/dist/types/GetContextListFn.d.ts.map +1 -0
- package/dist/types/GitAddCommandFn.d.ts +6 -0
- package/dist/types/GitAddCommandFn.d.ts.map +1 -0
- package/dist/types/GitAndWorkspaceFnsInput.d.ts +8 -0
- package/dist/types/GitAndWorkspaceFnsInput.d.ts.map +1 -0
- package/dist/types/GitCommitCommandFn.d.ts +7 -0
- package/dist/types/GitCommitCommandFn.d.ts.map +1 -0
- package/dist/types/GitCommitMessageFn.d.ts +9 -0
- package/dist/types/GitCommitMessageFn.d.ts.map +1 -0
- package/dist/types/GitContextTagNameFn.d.ts +2 -0
- package/dist/types/GitContextTagNameFn.d.ts.map +1 -0
- package/dist/types/GitPushCommandFn.d.ts +3 -0
- package/dist/types/GitPushCommandFn.d.ts.map +1 -0
- package/dist/types/LumpConfig.d.ts +25 -0
- package/dist/types/LumpConfig.d.ts.map +1 -0
- package/dist/types/LumpConfigPromptItem.d.ts +8 -0
- package/dist/types/LumpConfigPromptItem.d.ts.map +1 -0
- package/dist/types/LumpConfigVariables.d.ts +2 -0
- package/dist/types/LumpConfigVariables.d.ts.map +1 -0
- package/dist/types/LumpContextStatusRecord.d.ts +2 -0
- package/dist/types/LumpContextStatusRecord.d.ts.map +1 -0
- package/dist/types/LumpVariables.d.ts +2 -0
- package/dist/types/LumpVariables.d.ts.map +1 -0
- package/dist/types/Maybe.d.ts +2 -0
- package/dist/types/Maybe.d.ts.map +1 -0
- package/dist/types/MaybePromise.d.ts +2 -0
- package/dist/types/MaybePromise.d.ts.map +1 -0
- package/dist/types/PostCommandExecFn.d.ts +16 -0
- package/dist/types/PostCommandExecFn.d.ts.map +1 -0
- package/dist/types/PromptFn.d.ts +15 -0
- package/dist/types/PromptFn.d.ts.map +1 -0
- package/dist/types/PromptItem.d.ts +12 -0
- package/dist/types/PromptItem.d.ts.map +1 -0
- package/dist/types/PromptItemVariables.d.ts +2 -0
- package/dist/types/PromptItemVariables.d.ts.map +1 -0
- package/dist/types/PromptItems.d.ts +5 -0
- package/dist/types/PromptItems.d.ts.map +1 -0
- package/dist/types/SetupFn.d.ts +13 -0
- package/dist/types/SetupFn.d.ts.map +1 -0
- package/dist/types/SetupWorkspaceCommand.d.ts +6 -0
- package/dist/types/SetupWorkspaceCommand.d.ts.map +1 -0
- package/dist/types/SetupWorkspaceFn.d.ts +6 -0
- package/dist/types/SetupWorkspaceFn.d.ts.map +1 -0
- package/dist/types/Step.d.ts +12 -0
- package/dist/types/Step.d.ts.map +1 -0
- package/dist/types/StepVariables.d.ts +2 -0
- package/dist/types/StepVariables.d.ts.map +1 -0
- package/dist/types/Steps.d.ts +5 -0
- package/dist/types/Steps.d.ts.map +1 -0
- package/dist/types/Success.d.ts +5 -0
- package/dist/types/Success.d.ts.map +1 -0
- package/dist/types/TeardownFn.d.ts +11 -0
- package/dist/types/TeardownFn.d.ts.map +1 -0
- package/dist/types/TeardownWorkspaceCommand.d.ts +3 -0
- package/dist/types/TeardownWorkspaceCommand.d.ts.map +1 -0
- package/dist/types/TeardownWorkspaceFn.d.ts +3 -0
- package/dist/types/TeardownWorkspaceFn.d.ts.map +1 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/usages/executePromptsForContextList/index.d.ts +2 -0
- package/dist/usages/executePromptsForContextList/index.d.ts.map +1 -0
- package/dist/usages/executePromptsForContextList/main.d.ts +45 -0
- package/dist/usages/executePromptsForContextList/main.d.ts.map +1 -0
- package/dist/usages/getToDoContextList/index.d.ts +2 -0
- package/dist/usages/getToDoContextList/index.d.ts.map +1 -0
- package/dist/usages/getToDoContextList/main.d.ts +10 -0
- package/dist/usages/getToDoContextList/main.d.ts.map +1 -0
- package/dist/usages/index.d.ts +2 -0
- package/dist/usages/index.d.ts.map +1 -0
- package/dist/usages/refreshContextStatusRecord/index.d.ts +1 -0
- package/dist/usages/refreshContextStatusRecord/index.d.ts.map +1 -0
- package/dist/usages/refreshContextStatusRecord/main.d.ts +1 -0
- package/dist/usages/refreshContextStatusRecord/main.d.ts.map +1 -0
- package/dist/usages/runLump/defaultInjectedFns.d.ts +10 -0
- package/dist/usages/runLump/defaultInjectedFns.d.ts.map +1 -0
- package/dist/usages/runLump/index.d.ts +3 -0
- package/dist/usages/runLump/index.d.ts.map +1 -0
- package/dist/usages/runLump/main.d.ts +28 -0
- package/dist/usages/runLump/main.d.ts.map +1 -0
- package/dist/usages/updateContextStatusRecord/index.d.ts +2 -0
- package/dist/usages/updateContextStatusRecord/index.d.ts.map +1 -0
- package/dist/usages/updateContextStatusRecord/main.d.ts +7 -0
- package/dist/usages/updateContextStatusRecord/main.d.ts.map +1 -0
- package/dist/utils/decision/index.d.ts +2 -0
- package/dist/utils/decision/index.d.ts.map +1 -0
- package/dist/utils/decision/main.d.ts +2 -0
- package/dist/utils/decision/main.d.ts.map +1 -0
- package/dist/utils/failure/index.d.ts +2 -0
- package/dist/utils/failure/index.d.ts.map +1 -0
- package/dist/utils/failure/main.d.ts +3 -0
- package/dist/utils/failure/main.d.ts.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/set/index.d.ts +2 -0
- package/dist/utils/set/index.d.ts.map +1 -0
- package/dist/utils/set/main.d.ts +4 -0
- package/dist/utils/set/main.d.ts.map +1 -0
- package/dist/utils/shellBestEffort/index.d.ts +2 -0
- package/dist/utils/shellBestEffort/index.d.ts.map +1 -0
- package/dist/utils/shellBestEffort/main.d.ts +7 -0
- package/dist/utils/shellBestEffort/main.d.ts.map +1 -0
- package/dist/utils/shellSingleQuote/index.d.ts +2 -0
- package/dist/utils/shellSingleQuote/index.d.ts.map +1 -0
- package/dist/utils/shellSingleQuote/main.d.ts +9 -0
- package/dist/utils/shellSingleQuote/main.d.ts.map +1 -0
- package/dist/utils/success/index.d.ts +2 -0
- package/dist/utils/success/index.d.ts.map +1 -0
- package/dist/utils/success/main.d.ts +3 -0
- package/dist/utils/success/main.d.ts.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# @lumpcode/core
|
|
2
|
+
|
|
3
|
+
The core engine of Lumpcode mainly exporting the `runLump` function.
|
|
4
|
+
|
|
5
|
+
`runLump` orchestrates prompts across multiple **contexts** — each context is a unit of work (often a file or a logical group of files). Lumpcode scans your codebase, builds a list of contexts, filters out those already completed (each completed context is materialized as exactly one normalized commit on a remote branch), then runs your prompts on the rest, managing git branches and commits and tracking progress via normalized commit messages.
|
|
6
|
+
|
|
7
|
+
`runLump` is very configurable but comes with sensible default behaviors.
|
|
8
|
+
|
|
9
|
+
> **Tip:** for a much smoother end-to-end experience — project bootstrap, an isolated working copy, an always-on daemon that calls `runLump` on a schedule, per-lump enable/disable, and built-in lump/context status — use the [Lumpcode CLI](https://lumpcode.com/cli) (based on the core package). It's the recommended way to drive this engine in real projects; this package is for basic usage on small projects.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @lumpcode/core@beta
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
During pre-launch, packages are published under the `beta` dist-tag. Omit `@beta` once `latest` is promoted.
|
|
18
|
+
|
|
19
|
+
## Quick Start Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { runLump } from "@lumpcode/core";
|
|
23
|
+
|
|
24
|
+
const runResult = await runLump({
|
|
25
|
+
projectRoot: "/path/to/a/copy/of/your/project",
|
|
26
|
+
baseBranch: "main",
|
|
27
|
+
|
|
28
|
+
getContextListFn({ codeBasePaths }) {
|
|
29
|
+
return codeBasePaths
|
|
30
|
+
.filter(({ isDir, path }) => !isDir && path.endsWith(".ts"))
|
|
31
|
+
.map(({ path }) => ({
|
|
32
|
+
name: path.replaceAll("/", "_").replaceAll(".", "_"),
|
|
33
|
+
variables: { FILE: path },
|
|
34
|
+
}));
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
branchFn({ contextList }) {
|
|
38
|
+
return `lump-rules-refactor/${contextList[0].name}`;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
steps: [
|
|
42
|
+
{
|
|
43
|
+
promptFn: ({ context }) =>
|
|
44
|
+
`Refactor @${context.variables.FILE} following all project rules`,
|
|
45
|
+
commandFn: ({ prompt, stepVariables }) => ({
|
|
46
|
+
executable: "claude",
|
|
47
|
+
args: ["-p", prompt, "--model", stepVariables.model],
|
|
48
|
+
}),
|
|
49
|
+
stepVariables: {
|
|
50
|
+
model: "claude-sonnet-4-6"
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
if (runResult.success) {
|
|
57
|
+
// result.data.result: { branchName, contextNames, contextRunStateList }
|
|
58
|
+
console.log("Done:", runResult.data.result);
|
|
59
|
+
} else {
|
|
60
|
+
console.error("Failed:", runResult.data.message);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Key Concepts
|
|
65
|
+
|
|
66
|
+
### Context
|
|
67
|
+
|
|
68
|
+
A `Context` represents one unit of work. It has a unique `name` (used to derive the normalized commit message used for tracking) and `variables` (a `Record<string, string>` available in your prompt and command functions). Optional fields in `options` can influence processing order and define dependencies between contexts.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
interface Context {
|
|
72
|
+
name: string;
|
|
73
|
+
variables: Record<string, string>;
|
|
74
|
+
options?: {
|
|
75
|
+
priority?: number;
|
|
76
|
+
dependsOnContexts?: string[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- **`priority`** — Lower values are processed first. Defaults to `0`.
|
|
82
|
+
- **`dependsOnContexts`** — An array of context names that must have a `finished` status before this context is eligible to run. If any dependency has not finished yet (`toDo` or `branchPushed`), the context is excluded from the current batch. If a dependency name doesn't exist in the context list at all, the context is also blocked (safe default).
|
|
83
|
+
|
|
84
|
+
### CodeBasePath
|
|
85
|
+
|
|
86
|
+
The shape of each entry returned when scanning the project's file tree. Your `getContextListFn` receives an array of these and maps them into contexts.
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
interface CodeBasePath {
|
|
90
|
+
isDir: boolean;
|
|
91
|
+
path: string;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### ContextRunState
|
|
96
|
+
|
|
97
|
+
A mutable `Record<string, unknown>` that persists across prompt executions within a single context. Initialize it in `setupFn` and read/write it from `promptFn`, `commandFn`, or `postCommandExecFn`.
|
|
98
|
+
|
|
99
|
+
### Steps
|
|
100
|
+
|
|
101
|
+
An array of `Step` objects that are executed sequentially for each context. Each `Step` groups the following fields:
|
|
102
|
+
|
|
103
|
+
| Field | Type | Description |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| `promptFn` | `PromptFn \| undefined` | Optional. Generates the prompt string from the current context, run state, and variables. When omitted, `commandFn` receives an empty prompt string. |
|
|
106
|
+
| `commandFn` | `CommandFn` | Required. Returns `{ executable, args }` to run a subprocess, or `null` / `undefined` to skip execution while still running `postCommandExecFn`. |
|
|
107
|
+
| `stepVariables` | `StepVariables \| undefined` | Optional extra variables passed into `promptFn`, `commandFn`, and `postCommandExecFn`. |
|
|
108
|
+
| `postCommandExecFn` | `PostCommandExecFn \| undefined` | Optional hook called after the command finishes, receiving the command output. |
|
|
109
|
+
| `timeoutMillis` | `number \| undefined` | Maximum time in milliseconds allowed for the command execution. Defaults to `1800000` (30 minutes). |
|
|
110
|
+
|
|
111
|
+
Elements in the array can also be **functions** that return more `Steps` at runtime, enabling dynamic and recursive prompt chains. See [Recursive Steps](#recursive-steps) for details.
|
|
112
|
+
|
|
113
|
+
## Basic Parameters
|
|
114
|
+
|
|
115
|
+
**Required**
|
|
116
|
+
|
|
117
|
+
#### `projectRoot`
|
|
118
|
+
|
|
119
|
+
**Type:** `string`
|
|
120
|
+
|
|
121
|
+
Absolute path to the root of the project Lumpcode will operate on. This directory is scanned to build the list of `CodeBasePath` entries.
|
|
122
|
+
|
|
123
|
+
We recommend pointing `projectRoot` to a **separate copy** of your project rather than the directory you are manually working in, so that Lumpcode's git operations don't interfere with your own work. Where prompts and git commands actually run is determined by [`setupWorkspaceFn`](#setupworkspacefn) (see `workspacePath` there). The [Lumpcode CLI](https://lumpcode.com/cli) handles this isolated copy for you.
|
|
124
|
+
|
|
125
|
+
#### `baseBranch`
|
|
126
|
+
|
|
127
|
+
**Type:** `string`
|
|
128
|
+
|
|
129
|
+
The base git branch to branch off from (e.g. `"main"`, `"dev"`). Lumpcode checks out this branch before creating work branches.
|
|
130
|
+
|
|
131
|
+
#### `getContextListFn`
|
|
132
|
+
|
|
133
|
+
**Type:** `GetContextListFn`
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
type GetContextListFn = (params: {
|
|
137
|
+
codeBasePaths: CodeBasePath[];
|
|
138
|
+
lumpVariables: LumpVariables;
|
|
139
|
+
}) => MaybePromise<ContextList>;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Receives the full list of files and directories in the project and returns the `Context[]` representing the units of work. This is where you filter for specific file types, group files, or create contexts from any logic you need.
|
|
143
|
+
|
|
144
|
+
#### `branchFn`
|
|
145
|
+
|
|
146
|
+
**Type:** `BranchFn`
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
type BranchFn = (params: {
|
|
150
|
+
contextList: Context[];
|
|
151
|
+
contextRunStateList: ContextRunState[];
|
|
152
|
+
lumpVariables: LumpVariables;
|
|
153
|
+
}) => MaybePromise<string>;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Generates the git branch name for a batch of contexts. Called once per branch.
|
|
157
|
+
|
|
158
|
+
#### `steps`
|
|
159
|
+
|
|
160
|
+
**Type:** `Steps`
|
|
161
|
+
|
|
162
|
+
The array of prompt items (or dynamic prompt-generating functions) to execute for each context. See the [Steps](#steps) section above for the full shape.
|
|
163
|
+
|
|
164
|
+
**Optional**
|
|
165
|
+
|
|
166
|
+
#### `numberOfContextsPerBranch`
|
|
167
|
+
|
|
168
|
+
**Type:** `number` -- **Default:** `1`
|
|
169
|
+
|
|
170
|
+
How many contexts to include in a single branch. For example, `1` means each context gets its own branch; `5` groups up to five contexts per branch.
|
|
171
|
+
|
|
172
|
+
#### `verbose`
|
|
173
|
+
|
|
174
|
+
**Type:** `boolean` -- **Default:** `false`
|
|
175
|
+
|
|
176
|
+
When `true`, logs extra diagnostic information during workspace setup and prompt execution (e.g. branch names, commands, git status).
|
|
177
|
+
|
|
178
|
+
#### `getKeepHistoryFilePathFn`
|
|
179
|
+
|
|
180
|
+
**Type:** `(context: Context) => string | undefined` -- **Default:** `() => undefined`
|
|
181
|
+
|
|
182
|
+
When this function returns a non-empty path for a context, the engine appends one JSON object per prompt step (after each successful agent command) to that file. The file is a JSON array; each element has the same shape as `postCommandExecFn` input (`commandResult`, `context`, `prompt`, `stepIndex`, `contextRunState`, `lumpVariables`, optional `stepVariables`, `projectRoot`). Parent directories are created with `mkdir(..., { recursive: true })` before the initial `[]` write.
|
|
183
|
+
|
|
184
|
+
The Lumpcode CLI sets this from lump config **`keepHistory: true`**, writing to `.lumpcode/lumps/<lumpName>/history/<contextName>.json`. Library callers can supply a custom function for other paths or naming.
|
|
185
|
+
|
|
186
|
+
## Advanced Parameters
|
|
187
|
+
|
|
188
|
+
All advanced parameters are optional and have sensible defaults. Override them when you need custom lifecycle hooks, git behavior, or workspace management.
|
|
189
|
+
|
|
190
|
+
### `lumpVariables`
|
|
191
|
+
|
|
192
|
+
**Type:** `Record<string, unknown>` -- **Default:** `{}`
|
|
193
|
+
|
|
194
|
+
Custom variables that are passed through to every callback (`getContextListFn`, `branchFn`, `promptFn`, `commandFn`, etc.). Use this to share configuration across all stages without relying on closures.
|
|
195
|
+
|
|
196
|
+
### `setupFn`
|
|
197
|
+
|
|
198
|
+
**Type:** `SetupFn` -- **Default:** returns `{ contextRunState: {} }`
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
type SetupFn = (params: {
|
|
202
|
+
contextList: Context[];
|
|
203
|
+
lumpVariables: LumpVariables;
|
|
204
|
+
currentContextIndex: number;
|
|
205
|
+
}) => MaybePromise<Maybe<Partial<{
|
|
206
|
+
contextRunState: ContextRunState;
|
|
207
|
+
}>>>;
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Called before each context is processed. Use it to initialize the `contextRunState` or perform any per-context preparation.
|
|
211
|
+
|
|
212
|
+
### `teardownFn`
|
|
213
|
+
|
|
214
|
+
**Type:** `TeardownFn` -- **Default:** no-op
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
type TeardownFn = (params: {
|
|
218
|
+
lumpVariables: LumpVariables;
|
|
219
|
+
contextList: Context[];
|
|
220
|
+
contextRunState: ContextRunState;
|
|
221
|
+
currentContextIndex: number;
|
|
222
|
+
}) => MaybePromise<void>;
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Called after each context finishes. Use it for cleanup or logging.
|
|
226
|
+
|
|
227
|
+
### `gitCommitMessageFn`
|
|
228
|
+
|
|
229
|
+
**Type:** `GitCommitMessageFn` -- **Default:** `` `LUMP:${context.name}` ``
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
type GitCommitMessageFn = (input: {
|
|
233
|
+
context: Context;
|
|
234
|
+
lumpVariables: LumpVariables;
|
|
235
|
+
baseBranch: string;
|
|
236
|
+
}) => string;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Maps a context to its normalized git commit message. **The returned message must be unique per context** -- it is the source of truth used to track whether a context has already been processed (see [Context Tracking with Git Commits](#context-tracking-with-git-commits)).
|
|
240
|
+
|
|
241
|
+
### `gitAddCommandFn`
|
|
242
|
+
|
|
243
|
+
**Type:** `GitAddCommandFn` -- **Default:** `git add .`
|
|
244
|
+
|
|
245
|
+
Customize the git add command. Receives `{ baseBranch, branchName, contextList, workspacePath, context }` and is invoked **once per context**, right before that context's commit.
|
|
246
|
+
|
|
247
|
+
### `gitCommitCommandFn`
|
|
248
|
+
|
|
249
|
+
**Type:** `GitCommitCommandFn` -- **Default:** `` `git commit -m "${commitMessage}"` ``
|
|
250
|
+
|
|
251
|
+
Customize the git commit command. Receives the same input as `gitAddCommandFn` plus `{ commitMessage }`. Invoked **once per context**, producing exactly one commit per context on the work branch.
|
|
252
|
+
|
|
253
|
+
### `gitPushCommandFn`
|
|
254
|
+
|
|
255
|
+
**Type:** `GitPushCommandFn` -- **Default:** `` `git push origin ${branchName}` ``
|
|
256
|
+
|
|
257
|
+
Customize the git push command. Invoked **once per branch**, after all per-context commits are made.
|
|
258
|
+
|
|
259
|
+
### `setupWorkspaceFn`
|
|
260
|
+
|
|
261
|
+
**Type:** `SetupWorkspaceFn` -- **Default:** checkout-based setup
|
|
262
|
+
|
|
263
|
+
Prepares the workspace before prompt execution. It returns an object with two fields:
|
|
264
|
+
|
|
265
|
+
- `command` — the shell command to run (e.g. checkout the base branch, fetch, create the work branch).
|
|
266
|
+
- `workspacePath` — the directory where all subsequent operations (prompt execution, git add/commit/push) will take place. The default implementation returns `'.'`, so those commands run with `cwd: '.'` (the **host process's current working directory**). If your process's cwd is not `projectRoot`, pass an absolute path (e.g. `projectRoot` or a worktree path) so behavior is unambiguous.
|
|
267
|
+
|
|
268
|
+
> **Where commands run:** `setupWorkspaceFn` is the only function whose returned `command` runs at `projectRoot`. All other function parameters that return commands (`gitAddCommandFn`, `gitCommitCommandFn`, `gitPushCommandFn`, `commandFn`, `teardownWorkspaceFn`) execute their commands at `workspacePath`.
|
|
269
|
+
|
|
270
|
+
The default implementation command checks out the base branch, fetches, pulls, deletes and re-creates the work branch (with `cwd: projectRoot` for this setup command only):
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
git switch <baseBranch>;
|
|
274
|
+
git reset --hard origin/<baseBranch>;
|
|
275
|
+
git fetch --all;
|
|
276
|
+
git pull origin <baseBranch>;
|
|
277
|
+
git branch -D <branchName>;
|
|
278
|
+
git switch -c <branchName>;
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
An alternative **git-worktree-based** implementation is exported as `defaultSetupWorkspaceFnWithWorktree` for parallel workspace isolation.
|
|
282
|
+
|
|
283
|
+
### `teardownWorkspaceFn`
|
|
284
|
+
|
|
285
|
+
**Type:** `TeardownWorkspaceFn` -- **Default:** `git switch <baseBranch>`
|
|
286
|
+
|
|
287
|
+
Cleans up the workspace after all contexts on a branch are done. The default switches back to the base branch only. A worktree variant is exported as `defaultTeardownWorkspaceFnWithWorktree`.
|
|
288
|
+
|
|
289
|
+
## Return Value
|
|
290
|
+
|
|
291
|
+
`runLump` returns a `Promise` that resolves to a discriminated union:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
Promise<
|
|
295
|
+
| Success<{
|
|
296
|
+
result: {
|
|
297
|
+
branchName: string;
|
|
298
|
+
contextNames: string[];
|
|
299
|
+
contextRunStateList: ContextRunState[];
|
|
300
|
+
};
|
|
301
|
+
}>
|
|
302
|
+
| Failure<{ message: string }>
|
|
303
|
+
>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Check the `success` field to discriminate:
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
const result = await runLump({ ... });
|
|
310
|
+
|
|
311
|
+
if (result.success) {
|
|
312
|
+
const { branchName, contextNames, contextRunStateList } = result.data.result;
|
|
313
|
+
} else {
|
|
314
|
+
console.error(result.data.message);
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Recursive Steps
|
|
319
|
+
|
|
320
|
+
`Steps` is a recursive type. Each element is either a concrete `Step` or a **function that returns another `Steps` array**:
|
|
321
|
+
|
|
322
|
+
```typescript
|
|
323
|
+
type Steps = Array<
|
|
324
|
+
| Step
|
|
325
|
+
| ((input: PromptFnInput) => MaybePromise<Steps>)
|
|
326
|
+
>;
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
When the engine encounters a concrete `Step`, it runs optional `promptFn`, then `commandFn`, then `postCommandExecFn` (if provided). When `commandFn` returns `null`, `undefined`, or nothing, the subprocess is skipped and `postCommandExecFn` still runs with an empty `commandResult`. When it encounters a **function**, it calls it and recursively executes the returned `Steps` before moving to the next element. The returned array can itself contain more functions, allowing arbitrary nesting depth. An empty returned array is a no-op.
|
|
330
|
+
|
|
331
|
+
This makes it possible to build dynamic prompt chains: a function can inspect the current context, run state, or variables and decide at runtime how many prompts to produce, what they contain, or whether to skip entirely by returning an empty array.
|
|
332
|
+
|
|
333
|
+
`stepIndex` uses a **smart union** in every callback (concrete `promptFn` / `commandFn` / `postCommandExecFn` **and** function-form prompt items): at the top level it is a plain `number` (`0`, `1`, `2`, … — same as the item's position in the root `steps` array). When an item runs **inside** a nested array produced by a function-form parent, it is a `number[]` path from the root (e.g. a function-form item at root index `1` receives `1`; the items it returns receive `[1, 0]`, `[1, 1]`, …; and a function nested at `[1, 0]` would itself receive `[1, 0]`).
|
|
334
|
+
|
|
335
|
+
**Example:** a static first prompt, a dynamic middle section, and a static final prompt:
|
|
336
|
+
|
|
337
|
+
```typescript
|
|
338
|
+
const steps: Steps = [
|
|
339
|
+
// Index 0 -- always runs
|
|
340
|
+
{
|
|
341
|
+
promptFn: ({ context }) =>
|
|
342
|
+
`Analyze @${context.variables.FILE}. If it needs refactoring, return just TRUE.`,
|
|
343
|
+
commandFn: ({ prompt }) => ({
|
|
344
|
+
executable: "claude",
|
|
345
|
+
args: ["-p", prompt],
|
|
346
|
+
}),
|
|
347
|
+
stepVariables: {},
|
|
348
|
+
postCommandExecFn: ({ commandResult, contextRunState }) => {
|
|
349
|
+
contextRunState.needsRefactor = commandResult.includes("TRUE");
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
// Index 1 -- dynamic: returns 0-N sub-prompts at runtime
|
|
354
|
+
({ context, contextRunState }) => {
|
|
355
|
+
if (contextRunState.needsRefactor) {
|
|
356
|
+
return [
|
|
357
|
+
{
|
|
358
|
+
// Index [1, 0]
|
|
359
|
+
promptFn: () => `Refactor @${context.variables.FILE}`,
|
|
360
|
+
commandFn: ({ prompt }) => ({
|
|
361
|
+
executable: "claude",
|
|
362
|
+
args: ["-p", prompt],
|
|
363
|
+
}),
|
|
364
|
+
stepVariables: {},
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
// Index [1, 1]
|
|
368
|
+
promptFn: () =>
|
|
369
|
+
`Verify the refactoring @${context.variables.FILE} is well done`,
|
|
370
|
+
commandFn: ({ prompt }) => ({
|
|
371
|
+
executable: "claude",
|
|
372
|
+
args: ["-p", prompt],
|
|
373
|
+
}),
|
|
374
|
+
stepVariables: {},
|
|
375
|
+
},
|
|
376
|
+
];
|
|
377
|
+
}
|
|
378
|
+
return []; // skip this step
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
// Index 2 -- always runs
|
|
382
|
+
{
|
|
383
|
+
promptFn: ({ context }) => `Write tests for @${context.variables.FILE}`,
|
|
384
|
+
commandFn: ({ prompt }) => ({
|
|
385
|
+
executable: "claude",
|
|
386
|
+
args: ["-p", prompt],
|
|
387
|
+
}),
|
|
388
|
+
stepVariables: {},
|
|
389
|
+
},
|
|
390
|
+
];
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Context Tracking with Git Commits
|
|
394
|
+
|
|
395
|
+
Lumpcode uses normalized git commit messages to record which contexts have already been processed. Each completed context contributes **exactly one commit** whose subject equals `gitCommitMessageFn({ context, ... })`. On every subsequent call to `runLump`, contexts whose normalized commit message is already present on a remote branch are skipped so the run only works on what remains. This lets you call `runLump` repeatedly (e.g. in a cron job) and each invocation picks up where the previous one left off, progressively working through the full context list without ever re-processing a context.
|
|
396
|
+
|
|
397
|
+
> If you'd rather not wire up your own scheduler, the [Lumpcode CLI](https://lumpcode.com/cli) ships a built-in daemon (`lumpcode start`) that calls `runLump` on a tick, with concurrent-branch limits and per-lump enable/disable already wired in.
|
|
398
|
+
|
|
399
|
+
### Commit message naming
|
|
400
|
+
|
|
401
|
+
By default, a context named `my_component_ts` produces a commit with the subject:
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
LUMP:my_component_ts
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
You can customize this via the [`gitCommitMessageFn`](#gitcommitmessagefn) parameter. The returned subject **must be unique per context** -- it is the only thing tying the commit back to its context.
|
|
408
|
+
|
|
409
|
+
### Context statuses
|
|
410
|
+
|
|
411
|
+
When filtering contexts, Lumpcode resolves each context's normalized commit message to one of three statuses:
|
|
412
|
+
|
|
413
|
+
| Status | Meaning | Effect |
|
|
414
|
+
|---|---|---|
|
|
415
|
+
| `toDo` | No commit with the context's normalized message exists on any remote ref. | Will be processed (unless blocked by `dependsOnContexts`). |
|
|
416
|
+
| `branchPushed` | A commit with the context's normalized message exists on a remote branch other than the base branch. | Skipped. |
|
|
417
|
+
| `finished` | A commit with the context's normalized message is reachable from `origin/<baseBranch>`. | Skipped. |
|
|
418
|
+
|
|
419
|
+
A context with `dependsOnContexts` is only eligible when **all** of its listed dependencies have the `finished` status. This means the dependency's commit must be reachable from the remote base branch. Contexts stuck at `branchPushed` do not satisfy the dependency.
|
|
420
|
+
|
|
421
|
+
### Useful git commands for context tracking
|
|
422
|
+
|
|
423
|
+
**List all lump commits across remote branches:**
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
git fetch --all
|
|
427
|
+
git log --remotes=origin --grep="^LUMP:" --format='%H %s'
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
**Check if a specific context has been processed (any remote ref):**
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
git log --remotes=origin -F --grep="LUMP:my_component_ts" --format='%H'
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
(`-F` makes `--grep` a literal string match.)
|
|
437
|
+
|
|
438
|
+
**Check if a context is `finished`** (commit is reachable from the remote base branch):
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
hash="$(git log --remotes=origin -F --grep='LUMP:my_component_ts' --format='%H' -n 1)"
|
|
442
|
+
git merge-base --is-ancestor "$hash" origin/main && echo "finished" || echo "not finished"
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**Check which remote branches contain a context's commit** (`branchPushed` state):
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
git branch -r --contains "$(git log --remotes=origin -F --grep='LUMP:my_component_ts' --format='%H' -n 1)" --format='%(refname:short)'
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Reset a single context** by re-creating an empty marker commit on the remote base branch (so it counts as `finished`):
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
git commit --allow-empty -m "LUMP:my_component_ts"
|
|
455
|
+
git push origin main
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
To genuinely re-process a context, delete the work branch holding its commit (after which the commit becomes unreachable from any remote ref and the context flips back to `toDo`):
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
git push --delete origin <branch-containing-the-commit>
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
## How It Works
|
|
465
|
+
|
|
466
|
+
```mermaid
|
|
467
|
+
flowchart TD
|
|
468
|
+
Start["runLump()"] --> GetPaths["Scan codebase paths"]
|
|
469
|
+
GetPaths --> GetContexts["getContextListFn()"]
|
|
470
|
+
GetContexts --> FilterDone["Filter already-done contexts via git log --grep on remotes"]
|
|
471
|
+
FilterDone --> FilterDeps["Filter out contexts with unfinished dependsOnContexts"]
|
|
472
|
+
FilterDeps --> SortPriority["Sort by options.priority"]
|
|
473
|
+
SortPriority --> SliceContexts["Slice to numberOfContextsPerBranch"]
|
|
474
|
+
SliceContexts --> SetupWorkspace["setupWorkspaceFn()"]
|
|
475
|
+
SetupWorkspace --> LoopStart{"For each context"}
|
|
476
|
+
LoopStart --> Setup["setupFn()"]
|
|
477
|
+
Setup --> ExecPrompts["Execute steps sequentially"]
|
|
478
|
+
ExecPrompts --> Teardown["teardownFn()"]
|
|
479
|
+
Teardown --> AddCommit["git add + git commit -m gitCommitMessageFn(context)"]
|
|
480
|
+
AddCommit --> LoopCheck{"More contexts?"}
|
|
481
|
+
LoopCheck -->|Yes| LoopStart
|
|
482
|
+
LoopCheck -->|No| Push["gitPushCommandFn (branch only)"]
|
|
483
|
+
Push --> TeardownWorkspace["teardownWorkspaceFn()"]
|
|
484
|
+
TeardownWorkspace --> Done["Return Success or Failure"]
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
## Going further
|
|
488
|
+
|
|
489
|
+
`@lumpcode/core` is the engine. The [Lumpcode CLI](https://lumpcode.com/cli) wraps it with everything you'd otherwise have to build yourself: project bootstrap, a managed working copy isolated from your IDE, a background daemon, status/cleanup commands, authentication, and a single-binary distribution. Reach for it whenever you want the full experience.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectPromptStepsForContext/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Context, ContextList, LumpVariables, PostCommandExecFn, PromptItem, PromptItems, SetupFn } from '../../types';
|
|
2
|
+
export type CollectedPromptStep = {
|
|
3
|
+
promptIndex: number | number[];
|
|
4
|
+
prompt: string;
|
|
5
|
+
command: {
|
|
6
|
+
executable: string;
|
|
7
|
+
args: string[];
|
|
8
|
+
};
|
|
9
|
+
postCommandExecFn?: PostCommandExecFn;
|
|
10
|
+
promptItemVariables?: PromptItem['promptItemVariables'];
|
|
11
|
+
timeoutMillis?: number;
|
|
12
|
+
};
|
|
13
|
+
export type CollectPromptStepsForContextParams = {
|
|
14
|
+
context: Context;
|
|
15
|
+
contextList: ContextList;
|
|
16
|
+
currentContextIndex: number;
|
|
17
|
+
lumpVariables: LumpVariables;
|
|
18
|
+
promptItems: PromptItems;
|
|
19
|
+
setupFn: SetupFn;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
workspacePath: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function collectPromptStepsForContext(params: CollectPromptStepsForContextParams): Promise<CollectedPromptStep[]>;
|
|
24
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectPromptStepsForContext/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,WAAW,EAEX,aAAa,EACb,iBAAiB,EAEjB,UAAU,EACV,WAAW,EACX,OAAO,EACV,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,mBAAmB,GAAG;IAC9B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAChD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,CAAC,EAAE,UAAU,CAAC,qBAAqB,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAsB,4BAA4B,CAC9C,MAAM,EAAE,kCAAkC,GAC3C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAoFhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectStepsForContext/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Context, ContextList, LumpVariables, PostCommandExecFn, Step, Steps, SetupFn } from '../../types';
|
|
2
|
+
export type CollectedStep = {
|
|
3
|
+
stepIndex: number | number[];
|
|
4
|
+
prompt?: string;
|
|
5
|
+
command: {
|
|
6
|
+
executable: string;
|
|
7
|
+
args: string[];
|
|
8
|
+
} | null;
|
|
9
|
+
postCommandExecFn?: PostCommandExecFn;
|
|
10
|
+
stepVariables?: Step['stepVariables'];
|
|
11
|
+
timeoutMillis?: number;
|
|
12
|
+
};
|
|
13
|
+
export type CollectStepsForContextParams = {
|
|
14
|
+
context: Context;
|
|
15
|
+
contextList: ContextList;
|
|
16
|
+
currentContextIndex: number;
|
|
17
|
+
lumpVariables: LumpVariables;
|
|
18
|
+
steps: Steps;
|
|
19
|
+
setupFn: SetupFn;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
workspacePath: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function collectStepsForContext(params: CollectStepsForContextParams): Promise<CollectedStep[]>;
|
|
24
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectStepsForContext/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,WAAW,EAEX,aAAa,EACb,iBAAiB,EAEjB,IAAI,EACJ,KAAK,EACL,OAAO,EACV,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IACvD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,aAAa,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,4BAA4B,GACrC,OAAO,CAAC,aAAa,EAAE,CAAC,CAwF1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/execAsync/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function execAsync(command: string, options?: {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
}): Promise<import("../..").Failure<{
|
|
4
|
+
message: string;
|
|
5
|
+
info: {
|
|
6
|
+
command: string;
|
|
7
|
+
stdout: any;
|
|
8
|
+
stderr: any;
|
|
9
|
+
};
|
|
10
|
+
}> | import("../..").Success<{
|
|
11
|
+
stdout: any;
|
|
12
|
+
stderr: any;
|
|
13
|
+
}>>;
|
|
14
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/execAsync/main.ts"],"names":[],"mappings":"AAMA,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;IA4B1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/execBinary/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SpawnOptions } from 'node:child_process';
|
|
2
|
+
import { Failure, Success } from '../../types';
|
|
3
|
+
export declare function execBinary(binaryPath: string, args: string[], timeoutMillis?: number, options?: SpawnOptions): Promise<Success<{
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
}> | Failure<{
|
|
7
|
+
message: string;
|
|
8
|
+
binaryPath: string;
|
|
9
|
+
args: string[];
|
|
10
|
+
code?: number;
|
|
11
|
+
stdout?: string;
|
|
12
|
+
stderr?: string;
|
|
13
|
+
}>>;
|
|
14
|
+
export type ExecBinaryResponse = ReturnType<typeof execBinary>;
|
|
15
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/execBinary/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG/C,wBAAgB,UAAU,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,EACd,aAAa,GAAE,MAAuB,EACtC,OAAO,CAAC,EAAE,YAAY,GACvB,OAAO,CACN,OAAO,CAAC;IACJ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC,GAAG,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,CACL,CAwDA;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/executePromptsForContextList/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContextList, ContextRunState, Failure } from "../../types";
|
|
2
|
+
import type { RunLumpInput } from '../../usages';
|
|
3
|
+
export type ExecutePromptForContexListParams = Required<Pick<RunLumpInput, 'baseBranch' | 'branchFn' | 'lumpVariables' | 'promptItems' | 'setupFn' | 'teardownFn' | 'gitAddCommandFn' | 'gitCommitCommandFn' | 'gitPushCommandFn' | 'gitCommitMessageFn' | 'projectRoot' | 'setupWorkspaceFn' | 'teardownWorkspaceFn' | 'getKeepHistoryFilePathFn'>> & {
|
|
4
|
+
contextList: ContextList;
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function executePromptsForContextList({ baseBranch, branchFn, lumpVariables, contextList, gitAddCommandFn, gitCommitCommandFn, gitPushCommandFn, gitCommitMessageFn, projectRoot, promptItems, setupFn, setupWorkspaceFn, teardownFn, teardownWorkspaceFn, getKeepHistoryFilePathFn, verbose, }: ExecutePromptForContexListParams): Promise<Failure<{
|
|
8
|
+
message: string;
|
|
9
|
+
}> | import("../../types").Success<{
|
|
10
|
+
branchName: string;
|
|
11
|
+
contextNames: string[];
|
|
12
|
+
contextRunStateList: ContextRunState[];
|
|
13
|
+
}>>;
|
|
14
|
+
export type ExecutePromptForContexListResult = Awaited<ReturnType<typeof executePromptsForContextList>>;
|
|
15
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/executePromptsForContextList/main.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EACX,eAAe,EACf,OAAO,EAIV,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC,IAAI,CACxD,YAAY,EACV,YAAY,GACZ,UAAU,GACV,eAAe,GACf,aAAa,GACb,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,qBAAqB,GACrB,0BAA0B,CAC/B,CAAC,GAAG;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA;AAED,wBAAsB,4BAA4B,CAAC,EAC/C,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,wBAAwB,EACxB,OAAO,GACV,EAAE,gCAAgC;aAyDe,MAAM;;;;;IA8MvD;AAED,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/executePromptsForContextListOld/main.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/executeStepsForContextList/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|