lalph 0.3.34 → 0.3.35

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/cli.mjs CHANGED
@@ -159757,10 +159757,16 @@ const specificationPath = path("spec", {
159757
159757
  }).pipe(withDescription$2("Required. Path to an existing specification file to convert into tasks"));
159758
159758
  const commandPlanTasks = make$35("tasks", { specificationPath }).pipe(withDescription("Convert an existing specification file into PRD tasks (without re-running plan mode)"), withHandler(fnUntraced(function* ({ specificationPath }) {
159759
159759
  const { specsDirectory } = yield* commandRoot;
159760
+ yield* generateTasks({
159761
+ specsDirectory,
159762
+ specificationPath,
159763
+ preset: yield* selectCliAgentPreset
159764
+ });
159765
+ }, provide$1(CurrentIssueSource.layer))));
159766
+ const generateTasks = fnUntraced(function* ({ specsDirectory, specificationPath, preset }) {
159760
159767
  const fs = yield* FileSystem;
159761
159768
  const pathService = yield* Path$1;
159762
159769
  const worktree = yield* Worktree;
159763
- const preset = yield* selectCliAgentPreset;
159764
159770
  const content = yield* fs.readFileString(specificationPath);
159765
159771
  const relative = pathService.relative(pathService.resolve("."), specificationPath);
159766
159772
  const worktreeSpecPath = pathService.join(worktree.directory, relative);
@@ -159774,9 +159780,8 @@ const commandPlanTasks = make$35("tasks", { specificationPath }).pipe(withDescri
159774
159780
  }, provide$1([
159775
159781
  Settings.layer,
159776
159782
  PromptGen.layer,
159777
- Prd.layerProvided.pipe(provide$3(layerProjectIdPrompt)),
159778
- CurrentIssueSource.layer
159779
- ]))));
159783
+ Prd.layerProvided.pipe(provide$3(layerProjectIdPrompt))
159784
+ ]));
159780
159785
 
159781
159786
  //#endregion
159782
159787
  //#region src/shared/config.ts
@@ -159833,11 +159838,13 @@ const commandPlan = make$35("plan", {
159833
159838
  yield* gen(function* () {
159834
159839
  const project = withNewProject ? yield* addOrUpdateProject() : yield* selectProject;
159835
159840
  const { specsDirectory } = yield* commandRoot;
159841
+ const preset = yield* selectCliAgentPreset;
159836
159842
  yield* plan({
159837
159843
  plan: thePlan.value,
159838
159844
  specsDirectory,
159839
159845
  targetBranch: project.targetBranch,
159840
- dangerous
159846
+ dangerous,
159847
+ preset
159841
159848
  }).pipe(provideService(CurrentProjectId, project.id));
159842
159849
  }).pipe(provide$1([Settings.layer, CurrentIssueSource.layer]));
159843
159850
  }, provide$1(Editor.layer))), withSubcommands([commandPlanTasks]));
@@ -159845,12 +159852,11 @@ const plan = fnUntraced(function* (options) {
159845
159852
  const fs = yield* FileSystem;
159846
159853
  const pathService = yield* Path$1;
159847
159854
  const worktree = yield* Worktree;
159848
- const preset = yield* selectCliAgentPreset;
159849
159855
  yield* agentPlanner({
159850
159856
  plan: options.plan,
159851
159857
  specsDirectory: options.specsDirectory,
159852
159858
  dangerous: options.dangerous,
159853
- preset
159859
+ preset: options.preset
159854
159860
  });
159855
159861
  const planDetails = yield* pipe(fs.readFileString(pathService.join(worktree.directory, ".lalph", "plan.json")), flatMap$2(decodeEffect(PlanDetails)), mapError$2(() => new SpecNotFound()));
159856
159862
  if (isSome(options.targetBranch)) yield* commitAndPushSpecification({
@@ -159861,7 +159867,7 @@ const plan = fnUntraced(function* (options) {
159861
159867
  yield* agentTasker({
159862
159868
  specificationPath: planDetails.specification,
159863
159869
  specsDirectory: options.specsDirectory,
159864
- preset
159870
+ preset: options.preset
159865
159871
  });
159866
159872
  if (!worktree.inExisting) yield* pipe(fs.copy(pathService.join(worktree.directory, options.specsDirectory), options.specsDirectory, { overwrite: true }), ignore$1);
159867
159873
  }, scoped$1, provide$1([
@@ -159969,7 +159975,7 @@ const commandSource = make$35("source").pipe(withDescription("Select the issue s
159969
159975
 
159970
159976
  //#endregion
159971
159977
  //#region package.json
159972
- var version = "0.3.34";
159978
+ var version = "0.3.35";
159973
159979
 
159974
159980
  //#endregion
159975
159981
  //#region src/commands/projects/ls.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.34",
4
+ "version": "0.3.35",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -9,6 +9,7 @@ import { Worktree } from "../../Worktree.ts"
9
9
  import { commandRoot } from "../root.ts"
10
10
  import { selectCliAgentPreset } from "../../Presets.ts"
11
11
  import { CurrentIssueSource } from "../../CurrentIssueSource.ts"
12
+ import type { CliAgentPreset } from "../../domain/CliAgentPreset.ts"
12
13
 
13
14
  const specificationPath = Argument.path("spec", {
14
15
  pathType: "file",
@@ -26,37 +27,51 @@ export const commandPlanTasks = Command.make("tasks", {
26
27
  "Convert an existing specification file into PRD tasks (without re-running plan mode)",
27
28
  ),
28
29
  Command.withHandler(
29
- Effect.fnUntraced(
30
- function* ({ specificationPath }) {
31
- const { specsDirectory } = yield* commandRoot
32
- const fs = yield* FileSystem.FileSystem
33
- const pathService = yield* Path.Path
34
- const worktree = yield* Worktree
35
- const preset = yield* selectCliAgentPreset
30
+ Effect.fnUntraced(function* ({ specificationPath }) {
31
+ const { specsDirectory } = yield* commandRoot
32
+ const preset = yield* selectCliAgentPreset
33
+ yield* generateTasks({
34
+ specsDirectory,
35
+ specificationPath,
36
+ preset,
37
+ })
38
+ }, Effect.provide(CurrentIssueSource.layer)),
39
+ ),
40
+ )
41
+ const generateTasks = Effect.fnUntraced(
42
+ function* ({
43
+ specsDirectory,
44
+ specificationPath,
45
+ preset,
46
+ }: {
47
+ readonly specsDirectory: string
48
+ readonly specificationPath: string
49
+ readonly preset: CliAgentPreset
50
+ }) {
51
+ const fs = yield* FileSystem.FileSystem
52
+ const pathService = yield* Path.Path
53
+ const worktree = yield* Worktree
36
54
 
37
- const content = yield* fs.readFileString(specificationPath)
38
- const relative = pathService.relative(
39
- pathService.resolve("."),
40
- specificationPath,
41
- )
42
- const worktreeSpecPath = pathService.join(worktree.directory, relative)
43
- yield* fs.makeDirectory(pathService.dirname(worktreeSpecPath), {
44
- recursive: true,
45
- })
46
- yield* fs.writeFileString(worktreeSpecPath, content)
55
+ const content = yield* fs.readFileString(specificationPath)
56
+ const relative = pathService.relative(
57
+ pathService.resolve("."),
58
+ specificationPath,
59
+ )
60
+ const worktreeSpecPath = pathService.join(worktree.directory, relative)
61
+ yield* fs.makeDirectory(pathService.dirname(worktreeSpecPath), {
62
+ recursive: true,
63
+ })
64
+ yield* fs.writeFileString(worktreeSpecPath, content)
47
65
 
48
- yield* agentTasker({
49
- specsDirectory,
50
- specificationPath: relative,
51
- preset,
52
- })
53
- },
54
- Effect.provide([
55
- Settings.layer,
56
- PromptGen.layer,
57
- Prd.layerProvided.pipe(Layer.provide(layerProjectIdPrompt)),
58
- CurrentIssueSource.layer,
59
- ]),
60
- ),
61
- ),
66
+ yield* agentTasker({
67
+ specsDirectory,
68
+ specificationPath: relative,
69
+ preset,
70
+ })
71
+ },
72
+ Effect.provide([
73
+ Settings.layer,
74
+ PromptGen.layer,
75
+ Prd.layerProvided.pipe(Layer.provide(layerProjectIdPrompt)),
76
+ ]),
62
77
  )
@@ -14,6 +14,7 @@ import { Editor } from "../Editor.ts"
14
14
  import { selectCliAgentPreset } from "../Presets.ts"
15
15
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
16
16
  import { parseBranch } from "../shared/git.ts"
17
+ import type { CliAgentPreset } from "../domain/CliAgentPreset.ts"
17
18
 
18
19
  const dangerous = Flag.boolean("dangerous").pipe(
19
20
  Flag.withAlias("d"),
@@ -64,12 +65,14 @@ export const commandPlan = Command.make("plan", {
64
65
  ? yield* addOrUpdateProject()
65
66
  : yield* selectProject
66
67
  const { specsDirectory } = yield* commandRoot
68
+ const preset = yield* selectCliAgentPreset
67
69
 
68
70
  yield* plan({
69
71
  plan: thePlan.value,
70
72
  specsDirectory,
71
73
  targetBranch: project.targetBranch,
72
74
  dangerous,
75
+ preset,
73
76
  }).pipe(Effect.provideService(CurrentProjectId, project.id))
74
77
  }).pipe(Effect.provide([Settings.layer, CurrentIssueSource.layer]))
75
78
  }, Effect.provide(Editor.layer)),
@@ -83,17 +86,17 @@ const plan = Effect.fnUntraced(
83
86
  readonly specsDirectory: string
84
87
  readonly targetBranch: Option.Option<string>
85
88
  readonly dangerous: boolean
89
+ readonly preset: CliAgentPreset
86
90
  }) {
87
91
  const fs = yield* FileSystem.FileSystem
88
92
  const pathService = yield* Path.Path
89
93
  const worktree = yield* Worktree
90
- const preset = yield* selectCliAgentPreset
91
94
 
92
95
  yield* agentPlanner({
93
96
  plan: options.plan,
94
97
  specsDirectory: options.specsDirectory,
95
98
  dangerous: options.dangerous,
96
- preset,
99
+ preset: options.preset,
97
100
  })
98
101
 
99
102
  const planDetails = yield* pipe(
@@ -116,7 +119,7 @@ const plan = Effect.fnUntraced(
116
119
  yield* agentTasker({
117
120
  specificationPath: planDetails.specification,
118
121
  specsDirectory: options.specsDirectory,
119
- preset,
122
+ preset: options.preset,
120
123
  })
121
124
 
122
125
  if (!worktree.inExisting) {