lalph 0.1.74 → 0.1.75
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/README.md +1 -0
- package/dist/cli.mjs +31 -17
- package/package.json +1 -1
- package/src/commands/plan.ts +17 -7
- package/src/domain/CliAgent.ts +29 -9
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ npx -y lalph@latest
|
|
|
27
27
|
- Run the main loop: `lalph`
|
|
28
28
|
- Run multiple iterations with concurrency: `lalph --iterations 4 --concurrency 2`
|
|
29
29
|
- Start plan mode: `lalph plan`
|
|
30
|
+
- Start plan mode without permission prompts: `lalph plan --dangerous`
|
|
30
31
|
- Choose your issue source: `lalph source`
|
|
31
32
|
|
|
32
33
|
It is recommended to add `.lalph/` to your `.gitignore` to avoid committing your
|
package/dist/cli.mjs
CHANGED
|
@@ -60671,8 +60671,9 @@ const opencode = new CliAgent({
|
|
|
60671
60671
|
stderr: outputMode,
|
|
60672
60672
|
stdin: "inherit"
|
|
60673
60673
|
})`opencode run ${prompt} -f ${prdFilePath}`,
|
|
60674
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) => make$21({
|
|
60674
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous: dangerous$1 }) => make$21({
|
|
60675
60675
|
extendEnv: true,
|
|
60676
|
+
...dangerous$1 ? { env: { OPENCODE_PERMISSION: "{\"*\":\"allow\"}" } } : {},
|
|
60676
60677
|
stdout: outputMode,
|
|
60677
60678
|
stderr: outputMode,
|
|
60678
60679
|
stdin: "inherit"
|
|
@@ -60690,13 +60691,18 @@ const claude = new CliAgent({
|
|
|
60690
60691
|
})`claude --dangerously-skip-permissions --output-format stream-json -p ${`@${prdFilePath}
|
|
60691
60692
|
|
|
60692
60693
|
${prompt}`}`,
|
|
60693
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) =>
|
|
60694
|
-
|
|
60695
|
-
|
|
60696
|
-
|
|
60697
|
-
|
|
60694
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous: dangerous$1 }) => {
|
|
60695
|
+
const run$7 = make$21({
|
|
60696
|
+
stdout: outputMode,
|
|
60697
|
+
stderr: outputMode,
|
|
60698
|
+
stdin: "inherit"
|
|
60699
|
+
});
|
|
60700
|
+
return dangerous$1 ? run$7`claude --dangerously-skip-permissions ${`@${prdFilePath}
|
|
60698
60701
|
|
|
60699
|
-
${prompt}`}`
|
|
60702
|
+
${prompt}`}` : run$7`claude ${`@${prdFilePath}
|
|
60703
|
+
|
|
60704
|
+
${prompt}`}`;
|
|
60705
|
+
}
|
|
60700
60706
|
});
|
|
60701
60707
|
const codex = new CliAgent({
|
|
60702
60708
|
id: "codex",
|
|
@@ -60708,13 +60714,18 @@ const codex = new CliAgent({
|
|
|
60708
60714
|
})`codex exec --dangerously-bypass-approvals-and-sandbox ${`@${prdFilePath}
|
|
60709
60715
|
|
|
60710
60716
|
${prompt}`}`,
|
|
60711
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) =>
|
|
60712
|
-
|
|
60713
|
-
|
|
60714
|
-
|
|
60715
|
-
|
|
60717
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous: dangerous$1 }) => {
|
|
60718
|
+
const run$7 = make$21({
|
|
60719
|
+
stdout: outputMode,
|
|
60720
|
+
stderr: outputMode,
|
|
60721
|
+
stdin: "inherit"
|
|
60722
|
+
});
|
|
60723
|
+
return dangerous$1 ? run$7`codex --dangerously-bypass-approvals-and-sandbox ${`@${prdFilePath}
|
|
60716
60724
|
|
|
60717
|
-
${prompt}`}`
|
|
60725
|
+
${prompt}`}` : run$7`codex ${`@${prdFilePath}
|
|
60726
|
+
|
|
60727
|
+
${prompt}`}`;
|
|
60728
|
+
}
|
|
60718
60729
|
});
|
|
60719
60730
|
const amp = new CliAgent({
|
|
60720
60731
|
id: "amp",
|
|
@@ -142338,12 +142349,14 @@ const ChosenTask = fromJsonString(Struct({
|
|
|
142338
142349
|
|
|
142339
142350
|
//#endregion
|
|
142340
142351
|
//#region src/commands/plan.ts
|
|
142341
|
-
const
|
|
142352
|
+
const dangerous = boolean("dangerous").pipe(withDescription$1("Enable dangerous mode (skip permission prompts) during plan generation"));
|
|
142353
|
+
const commandPlan = make$27("plan", { dangerous }).pipe(withDescription("Iterate on an issue plan and create PRD tasks"), withHandler(fnUntraced(function* ({ dangerous: dangerous$1 }) {
|
|
142342
142354
|
const { specsDirectory: specsDirectory$1, targetBranch: targetBranch$1 } = yield* commandRoot;
|
|
142343
142355
|
yield* plan({
|
|
142344
142356
|
specsDirectory: specsDirectory$1,
|
|
142345
142357
|
targetBranch: targetBranch$1,
|
|
142346
|
-
commandPrefix: yield* getCommandPrefix
|
|
142358
|
+
commandPrefix: yield* getCommandPrefix,
|
|
142359
|
+
dangerous: dangerous$1
|
|
142347
142360
|
}).pipe(provide$1(CurrentIssueSource.layer));
|
|
142348
142361
|
})));
|
|
142349
142362
|
const plan = fnUntraced(function* (options) {
|
|
@@ -142360,7 +142373,8 @@ const plan = fnUntraced(function* (options) {
|
|
|
142360
142373
|
const exitCode$1 = yield* pipe(cliAgent.commandPlan({
|
|
142361
142374
|
outputMode: "inherit",
|
|
142362
142375
|
prompt: promptGen.planPrompt(options),
|
|
142363
|
-
prdFilePath: pathService.join(worktree.directory, ".lalph", "prd.yml")
|
|
142376
|
+
prdFilePath: pathService.join(worktree.directory, ".lalph", "prd.yml"),
|
|
142377
|
+
dangerous: options.dangerous
|
|
142364
142378
|
}), setCwd(worktree.directory), options.commandPrefix, exitCode);
|
|
142365
142379
|
yield* log$1(`Agent exited with code: ${exitCode$1}`);
|
|
142366
142380
|
if (!worktree.inExisting) yield* pipe(fs.copy(pathService.join(worktree.directory, options.specsDirectory), options.specsDirectory, { overwrite: true }), ignore);
|
|
@@ -142464,7 +142478,7 @@ const commandSource = make$27("source").pipe(withDescription("Select the issue s
|
|
|
142464
142478
|
|
|
142465
142479
|
//#endregion
|
|
142466
142480
|
//#region package.json
|
|
142467
|
-
var version = "0.1.
|
|
142481
|
+
var version = "0.1.75";
|
|
142468
142482
|
|
|
142469
142483
|
//#endregion
|
|
142470
142484
|
//#region src/cli.ts
|
package/package.json
CHANGED
package/src/commands/plan.ts
CHANGED
|
@@ -4,23 +4,31 @@ import { Prd } from "../Prd.ts"
|
|
|
4
4
|
import { ChildProcess } from "effect/unstable/process"
|
|
5
5
|
import { Worktree } from "../Worktree.ts"
|
|
6
6
|
import { getCommandPrefix, getOrSelectCliAgent } from "./agent.ts"
|
|
7
|
-
import { Command } from "effect/unstable/cli"
|
|
7
|
+
import { Command, Flag } from "effect/unstable/cli"
|
|
8
8
|
import { CurrentIssueSource } from "../IssueSources.ts"
|
|
9
9
|
import { commandRoot } from "./root.ts"
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const dangerous = Flag.boolean("dangerous").pipe(
|
|
12
|
+
Flag.withDescription(
|
|
13
|
+
"Enable dangerous mode (skip permission prompts) during plan generation",
|
|
14
|
+
),
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
export const commandPlan = Command.make("plan", { dangerous }).pipe(
|
|
12
18
|
Command.withDescription("Iterate on an issue plan and create PRD tasks"),
|
|
13
19
|
Command.withHandler(
|
|
14
|
-
Effect.fnUntraced(function* () {
|
|
20
|
+
Effect.fnUntraced(function* ({ dangerous }) {
|
|
15
21
|
const { specsDirectory, targetBranch } = yield* commandRoot
|
|
16
22
|
const commandPrefix = yield* getCommandPrefix
|
|
17
|
-
yield* plan({
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
yield* plan({
|
|
24
|
+
specsDirectory,
|
|
25
|
+
targetBranch,
|
|
26
|
+
commandPrefix,
|
|
27
|
+
dangerous,
|
|
28
|
+
}).pipe(Effect.provide(CurrentIssueSource.layer))
|
|
20
29
|
}),
|
|
21
30
|
),
|
|
22
31
|
)
|
|
23
|
-
|
|
24
32
|
const plan = Effect.fnUntraced(
|
|
25
33
|
function* (options: {
|
|
26
34
|
readonly specsDirectory: string
|
|
@@ -28,6 +36,7 @@ const plan = Effect.fnUntraced(
|
|
|
28
36
|
readonly commandPrefix: (
|
|
29
37
|
command: ChildProcess.Command,
|
|
30
38
|
) => ChildProcess.Command
|
|
39
|
+
readonly dangerous: boolean
|
|
31
40
|
}) {
|
|
32
41
|
const fs = yield* FileSystem.FileSystem
|
|
33
42
|
const pathService = yield* Path.Path
|
|
@@ -55,6 +64,7 @@ const plan = Effect.fnUntraced(
|
|
|
55
64
|
outputMode: "inherit",
|
|
56
65
|
prompt: promptGen.planPrompt(options),
|
|
57
66
|
prdFilePath: pathService.join(worktree.directory, ".lalph", "prd.yml"),
|
|
67
|
+
dangerous: options.dangerous,
|
|
58
68
|
}),
|
|
59
69
|
ChildProcess.setCwd(worktree.directory),
|
|
60
70
|
options.commandPrefix,
|
package/src/domain/CliAgent.ts
CHANGED
|
@@ -13,6 +13,7 @@ export class CliAgent extends Data.Class<{
|
|
|
13
13
|
readonly outputMode: "pipe" | "inherit"
|
|
14
14
|
readonly prompt: string
|
|
15
15
|
readonly prdFilePath: string
|
|
16
|
+
readonly dangerous: boolean
|
|
16
17
|
}) => ChildProcess.Command
|
|
17
18
|
}> {}
|
|
18
19
|
|
|
@@ -29,9 +30,16 @@ const opencode = new CliAgent({
|
|
|
29
30
|
stderr: outputMode,
|
|
30
31
|
stdin: "inherit",
|
|
31
32
|
})`opencode run ${prompt} -f ${prdFilePath}`,
|
|
32
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) =>
|
|
33
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous }) =>
|
|
33
34
|
ChildProcess.make({
|
|
34
35
|
extendEnv: true,
|
|
36
|
+
...(dangerous
|
|
37
|
+
? {
|
|
38
|
+
env: {
|
|
39
|
+
OPENCODE_PERMISSION: '{"*":"allow"}',
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
: {}),
|
|
35
43
|
stdout: outputMode,
|
|
36
44
|
stderr: outputMode,
|
|
37
45
|
stdin: "inherit",
|
|
@@ -51,14 +59,20 @@ const claude = new CliAgent({
|
|
|
51
59
|
})`claude --dangerously-skip-permissions --output-format stream-json -p ${`@${prdFilePath}
|
|
52
60
|
|
|
53
61
|
${prompt}`}`,
|
|
54
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) =>
|
|
55
|
-
ChildProcess.make({
|
|
62
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous }) => {
|
|
63
|
+
const run = ChildProcess.make({
|
|
56
64
|
stdout: outputMode,
|
|
57
65
|
stderr: outputMode,
|
|
58
66
|
stdin: "inherit",
|
|
59
|
-
})
|
|
67
|
+
})
|
|
68
|
+
return dangerous
|
|
69
|
+
? run`claude --dangerously-skip-permissions ${`@${prdFilePath}
|
|
60
70
|
|
|
61
|
-
${prompt}`}
|
|
71
|
+
${prompt}`}`
|
|
72
|
+
: run`claude ${`@${prdFilePath}
|
|
73
|
+
|
|
74
|
+
${prompt}`}`
|
|
75
|
+
},
|
|
62
76
|
})
|
|
63
77
|
|
|
64
78
|
const codex = new CliAgent({
|
|
@@ -72,14 +86,20 @@ const codex = new CliAgent({
|
|
|
72
86
|
})`codex exec --dangerously-bypass-approvals-and-sandbox ${`@${prdFilePath}
|
|
73
87
|
|
|
74
88
|
${prompt}`}`,
|
|
75
|
-
commandPlan: ({ outputMode, prompt, prdFilePath }) =>
|
|
76
|
-
ChildProcess.make({
|
|
89
|
+
commandPlan: ({ outputMode, prompt, prdFilePath, dangerous }) => {
|
|
90
|
+
const run = ChildProcess.make({
|
|
77
91
|
stdout: outputMode,
|
|
78
92
|
stderr: outputMode,
|
|
79
93
|
stdin: "inherit",
|
|
80
|
-
})
|
|
94
|
+
})
|
|
95
|
+
return dangerous
|
|
96
|
+
? run`codex --dangerously-bypass-approvals-and-sandbox ${`@${prdFilePath}
|
|
81
97
|
|
|
82
|
-
${prompt}`}
|
|
98
|
+
${prompt}`}`
|
|
99
|
+
: run`codex ${`@${prdFilePath}
|
|
100
|
+
|
|
101
|
+
${prompt}`}`
|
|
102
|
+
},
|
|
83
103
|
})
|
|
84
104
|
|
|
85
105
|
const amp = new CliAgent({
|