@lumpcode/cli-types 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +51 -3
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -72,6 +72,34 @@ type GetContextListFnInput<V extends LumpVariables = LumpVariables> = {
72
72
  };
73
73
  type GetContextListFn<V extends LumpVariables = LumpVariables> = (params: GetContextListFnInput<V>) => GetContextListFnOutput;
74
74
 
75
+ /**
76
+ * How Lumpcode prepares the per-lump git workspace inside the preflight repo root.
77
+ *
78
+ * - `checkout`: switch the main worktree to a fresh lump branch (default).
79
+ * - `worktree`: add a linked worktree under `.lumpcode/worktrees/<branch>/`.
80
+ */
81
+ type WorkspaceStrategy = 'checkout' | 'worktree';
82
+
83
+ type PostSetupWorkspaceFnInput<V extends LumpVariables = LumpVariables> = {
84
+ baseBranch: string;
85
+ branchName: string;
86
+ contextList: ContextList;
87
+ /** Branch workspace. Already prepared on a real run. Read-only. */
88
+ workspacePath: string;
89
+ executionWorkspacePath: string;
90
+ workspaceStrategy: WorkspaceStrategy;
91
+ projectRoot: string;
92
+ lumpVariables: V;
93
+ };
94
+
95
+ type PostSetupWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
96
+ command?: string;
97
+ } | void>;
98
+
99
+ type PostTeardownWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
100
+ command?: string;
101
+ } | void>;
102
+
75
103
  type LumpJsConfigSoloStep<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = LumpJsConfigStep<V, SV> | LumpJsConfigStep<V, SV>['promptTemplate'] | LumpJsConfigStep<V, SV>['promptFn'];
76
104
  type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = MergeObjs<Omit<{
77
105
  [K in keyof RunLumpInput<V, SV>]?: NonNullable<RunLumpInput<V, SV>[K]> extends Function ? (RunLumpInput<V, SV>[K] | FilePath) : RunLumpInput<V, SV>[K];
@@ -97,9 +125,28 @@ type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariab
97
125
  maximumNumberOfConcurrentBranches?: number;
98
126
  prompt?: LumpJsConfigSoloStep<V, SV>;
99
127
  steps?: LumpJsConfigSteps<V, SV> | LumpJsConfigStepsItem<V, SV>;
128
+ /**
129
+ * Extra command tags to pre-load before composed setup/teardown.
130
+ * A tag top-level `command` is pre-registered automatically; list other
131
+ * tags that appear only in dynamic/recursive returns.
132
+ */
100
133
  registerCommands?: string[];
101
134
  keepHistory?: boolean;
102
135
  verbose?: boolean;
136
+ /**
137
+ * After generated checkout/worktree setup. Mutually exclusive with
138
+ * `postSetupWorkspaceCommand`.
139
+ */
140
+ postSetupWorkspaceFn?: FilePath | PostSetupWorkspaceFn<V>;
141
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postSetupWorkspaceFn`. */
142
+ postSetupWorkspaceCommand?: string;
143
+ /**
144
+ * Before generated workspace teardown. Mutually exclusive with
145
+ * `postTeardownWorkspaceCommand`.
146
+ */
147
+ postTeardownWorkspaceFn?: FilePath | PostTeardownWorkspaceFn<V>;
148
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postTeardownWorkspaceFn`. */
149
+ postTeardownWorkspaceCommand?: string;
103
150
  }>;
104
151
 
105
152
  declare function defineConfig<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables>(config: NoInfer<LumpJsConfig<V, SV>>): LumpJsConfig<V, SV>;
@@ -142,6 +189,7 @@ type LumpJsonConfig<V extends LumpVariables = LumpVariables, SV extends StepVari
142
189
 
143
190
  declare const resolvedProjectLocalConfigSchema: z.ZodObject<{
144
191
  verbose: z.ZodOptional<z.ZodBoolean>;
192
+ refreshCommand: z.ZodOptional<z.ZodString>;
145
193
  command: z.ZodOptional<z.ZodString>;
146
194
  maximumNumberOfConcurrentBranches: z.ZodOptional<z.ZodNumber>;
147
195
  keepHistory: z.ZodOptional<z.ZodBoolean>;
@@ -166,7 +214,7 @@ type ResolvedProjectLocalConfig = z.infer<typeof resolvedProjectLocalConfigSchem
166
214
  * Shape of `.lumpcode/local.json` — Pick from resolved config.
167
215
  * `mode` is required on the file schema; other keys optional.
168
216
  */
169
- type LocalJsonConfig = Pick<ResolvedProjectLocalConfig, 'mode' | 'workspaceStrategy' | 'disabled' | 'maxParallelRun' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'verbose'>;
217
+ type LocalJsonConfig = Pick<ResolvedProjectLocalConfig, 'mode' | 'workspaceStrategy' | 'disabled' | 'maxParallelRun' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'verbose' | 'refreshCommand'>;
170
218
 
171
219
  /**
172
220
  * Shape of `.lumpcode/local.json` — alias of {@link LocalJsonConfig}.
@@ -188,7 +236,7 @@ type Mode = 'shared' | 'dedicated';
188
236
  * Shape of `.lumpcode/project.json` — Pick from resolved config.
189
237
  * `projectName` is required on the file schema; other keys optional.
190
238
  */
191
- type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory'>;
239
+ type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'refreshCommand'>;
192
240
 
193
241
  /**
194
242
  * Shape of `.lumpcode/project.json` — alias of {@link ProjectJsonConfig}.
@@ -196,4 +244,4 @@ type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'prima
196
244
  type ProjectConfig = ProjectJsonConfig;
197
245
 
198
246
  export { defineBranchFn, defineCommand, defineCommandModule, defineCommandSetup, defineCommandTeardown, defineConfig, defineContextMatchFn, defineContextOptionsFn, defineGetContextListFn, defineGitAddCommitFn, defineGitCommitMessageFn, defineGitPushFn, definePostCommandExecFn, definePromptFn, defineSetupFn, defineStep, defineTeardownFn };
199
- export type { BaseBranchFn, BaseBranchFnInput, CommandModule, CommandTag, ContextMatchFn, ContextOptionsFn, FilePath, FilePathOrString, GetContextListFn, GetContextListFnInput, LocalConfig, LumpJsConfig, LumpJsConfigPostCommandExecFn, LumpJsConfigStep, LumpJsConfigSteps, LumpJsConfigStepsFn, LumpJsConfigStepsItem, LumpJsonConfig, LumpJsonConfigStep, MergeObjs, Mode, ProjectConfig, StepFn };
247
+ export type { BaseBranchFn, BaseBranchFnInput, CommandModule, CommandTag, ContextMatchFn, ContextOptionsFn, FilePath, FilePathOrString, GetContextListFn, GetContextListFnInput, LocalConfig, LumpJsConfig, LumpJsConfigPostCommandExecFn, LumpJsConfigStep, LumpJsConfigSteps, LumpJsConfigStepsFn, LumpJsConfigStepsItem, LumpJsonConfig, LumpJsonConfigStep, MergeObjs, Mode, PostSetupWorkspaceFn, PostSetupWorkspaceFnInput, PostTeardownWorkspaceFn, ProjectConfig, StepFn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumpcode/cli-types",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Types and defineX helpers for Lumpcode CLI lump config and command modules",
5
5
  "keywords": [
6
6
  "lumpcode",
@@ -37,7 +37,7 @@
37
37
  "build": "rollup -c"
38
38
  },
39
39
  "dependencies": {
40
- "@lumpcode/core": "^0.2.0"
40
+ "@lumpcode/core": "^0.3.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@rollup/plugin-commonjs": "^28.0.1",