lalph 0.1.61 → 0.1.63

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
@@ -141367,6 +141367,9 @@ are:
141367
141367
  To add a new task, append a new item to the prd.yml file with the id set to
141368
141368
  \`null\`, a title, state set to "todo", and a concise description that includes
141369
141369
  a short summary of the task and a brief list of steps to complete it.
141370
+ When creating tasks, make sure each task is independently shippable without
141371
+ failing validation checks (typechecks, linting, tests). If a task would only
141372
+ pass validations when combined with another, combine the work into one task.
141370
141373
 
141371
141374
  When adding a new task, it will take about 5 seconds for the system to update the
141372
141375
  prd.yml file with a new id for the task.
@@ -141541,7 +141544,8 @@ var Worktree = class extends Service()("lalph/Worktree", { make: gen(function* (
141541
141544
  }));
141542
141545
  yield* make$21`git worktree add ${directory$2} -d HEAD`.pipe(exitCode);
141543
141546
  yield* fs.makeDirectory(pathService.join(directory$2, ".lalph"), { recursive: true });
141544
- const setupPath = pathService.resolve(pathService.join("scripts", "worktree-setup.sh"));
141547
+ const setupPath = pathService.resolve("scripts", "worktree-setup.sh");
141548
+ yield* seedSetupScript(setupPath);
141545
141549
  if (yield* fs.exists(setupPath)) yield* make$21({
141546
141550
  cwd: directory$2,
141547
141551
  extendEnv: true,
@@ -141563,6 +141567,29 @@ var Worktree = class extends Service()("lalph/Worktree", { make: gen(function* (
141563
141567
  }));
141564
141568
  };
141565
141569
  const execIgnore = (command) => command.pipe(exitCode, catchCause$1(logWarning));
141570
+ const seedSetupScript = fnUntraced(function* (setupPath) {
141571
+ const fs = yield* FileSystem;
141572
+ const pathService = yield* Path$1;
141573
+ if (yield* fs.exists(setupPath)) return;
141574
+ const baseBranch = yield* discoverBaseBranch;
141575
+ yield* fs.makeDirectory(pathService.dirname(setupPath), { recursive: true });
141576
+ yield* fs.writeFileString(setupPath, setupScriptTemplate(baseBranch));
141577
+ yield* fs.chmod(setupPath, 493);
141578
+ });
141579
+ const discoverBaseBranch = gen(function* () {
141580
+ const originHead = yield* make$21`git symbolic-ref --short refs/remotes/origin/HEAD`.pipe(string, catch_$1((_) => succeed$1("")), map$5((output) => output.trim()));
141581
+ if (originHead !== "") return originHead.startsWith("origin/") ? originHead.slice(7) : originHead;
141582
+ const currentBranch = yield* make$21`git branch --show-current`.pipe(string, catch_$1((_) => succeed$1("")), map$5((output) => output.trim()));
141583
+ return currentBranch === "" ? "main" : currentBranch;
141584
+ });
141585
+ const setupScriptTemplate = (baseBranch) => `#!/usr/bin/env bash
141586
+ set -euo pipefail
141587
+
141588
+ git fetch origin
141589
+ git checkout origin/${baseBranch}
141590
+
141591
+ # Seeded by lalph. Customize this to prepare new worktrees.
141592
+ `;
141566
141593
 
141567
141594
  //#endregion
141568
141595
  //#region src/Prd.ts
@@ -142004,7 +142031,7 @@ const commandAgent = make$27("agent").pipe(withDescription("Select the CLI agent
142004
142031
 
142005
142032
  //#endregion
142006
142033
  //#region package.json
142007
- var version = "0.1.61";
142034
+ var version = "0.1.63";
142008
142035
 
142009
142036
  //#endregion
142010
142037
  //#region src/cli.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.1.61",
4
+ "version": "0.1.63",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/src/PromptGen.ts CHANGED
@@ -28,6 +28,9 @@ are:
28
28
  To add a new task, append a new item to the prd.yml file with the id set to
29
29
  \`null\`, a title, state set to "todo", and a concise description that includes
30
30
  a short summary of the task and a brief list of steps to complete it.
31
+ When creating tasks, make sure each task is independently shippable without
32
+ failing validation checks (typechecks, linting, tests). If a task would only
33
+ pass validations when combined with another, combine the work into one task.
31
34
 
32
35
  When adding a new task, it will take about 5 seconds for the system to update the
33
36
  prd.yml file with a new id for the task.
package/src/Worktree.ts CHANGED
@@ -30,9 +30,8 @@ export class Worktree extends ServiceMap.Service<Worktree>()("lalph/Worktree", {
30
30
  recursive: true,
31
31
  })
32
32
 
33
- const setupPath = pathService.resolve(
34
- pathService.join("scripts", "worktree-setup.sh"),
35
- )
33
+ const setupPath = pathService.resolve("scripts", "worktree-setup.sh")
34
+ yield* seedSetupScript(setupPath)
36
35
  if (yield* fs.exists(setupPath)) {
37
36
  yield* ChildProcess.make({
38
37
  cwd: directory,
@@ -61,3 +60,53 @@ export class Worktree extends ServiceMap.Service<Worktree>()("lalph/Worktree", {
61
60
 
62
61
  const execIgnore = (command: ChildProcess.Command) =>
63
62
  command.pipe(ChildProcess.exitCode, Effect.catchCause(Effect.logWarning))
63
+
64
+ const seedSetupScript = Effect.fnUntraced(function* (setupPath: string) {
65
+ const fs = yield* FileSystem.FileSystem
66
+ const pathService = yield* Path.Path
67
+
68
+ if (yield* fs.exists(setupPath)) {
69
+ return
70
+ }
71
+
72
+ const baseBranch = yield* discoverBaseBranch
73
+
74
+ yield* fs.makeDirectory(pathService.dirname(setupPath), {
75
+ recursive: true,
76
+ })
77
+ yield* fs.writeFileString(setupPath, setupScriptTemplate(baseBranch))
78
+ yield* fs.chmod(setupPath, 0o755)
79
+ })
80
+
81
+ const discoverBaseBranch = Effect.gen(function* () {
82
+ const originHead =
83
+ yield* ChildProcess.make`git symbolic-ref --short refs/remotes/origin/HEAD`.pipe(
84
+ ChildProcess.string,
85
+ Effect.catch((_) => Effect.succeed("")),
86
+ Effect.map((output) => output.trim()),
87
+ )
88
+
89
+ if (originHead !== "") {
90
+ return originHead.startsWith("origin/")
91
+ ? originHead.slice("origin/".length)
92
+ : originHead
93
+ }
94
+
95
+ const currentBranch =
96
+ yield* ChildProcess.make`git branch --show-current`.pipe(
97
+ ChildProcess.string,
98
+ Effect.catch((_) => Effect.succeed("")),
99
+ Effect.map((output) => output.trim()),
100
+ )
101
+
102
+ return currentBranch === "" ? "main" : currentBranch
103
+ })
104
+
105
+ const setupScriptTemplate = (baseBranch: string) => `#!/usr/bin/env bash
106
+ set -euo pipefail
107
+
108
+ git fetch origin
109
+ git checkout origin/${baseBranch}
110
+
111
+ # Seeded by lalph. Customize this to prepare new worktrees.
112
+ `