@llm4ts/shell 2.40.1 → 2.42.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.
@@ -60,6 +60,9 @@ export const epicUsage = [
60
60
  " --fail-fast stop the epic at the first failed story",
61
61
  " --judge-rounds <n> judge attempts per story (default 2 = one revision); a story the judge",
62
62
  " has not cleared after n attempts fails. LLM4TS_JUDGE_ROUNDS sets it too",
63
+ " --task-concurrency <n> coders one story may hold at once (default 2): a task the plan",
64
+ " says needs nothing still running goes to a free coder in its own",
65
+ " worktree; 1 runs every task in order. LLM4TS_TASK_CONCURRENCY sets it too",
63
66
  " --merge-revisions <n> times a story whose merge turns the epic gates red goes back to",
64
67
  " catch up and fix it before failing (default 1; 0 fails at once).",
65
68
  " LLM4TS_MERGE_REVISIONS sets it too",
@@ -87,6 +90,7 @@ export const parseEpicArgs = (argv) => Effect.gen(function* () {
87
90
  let judgeRounds;
88
91
  let deferFindings = false;
89
92
  let mergeRevisions;
93
+ let taskConcurrency;
90
94
  let land;
91
95
  let keepWorktrees = false;
92
96
  let list = false;
@@ -146,6 +150,21 @@ export const parseEpicArgs = (argv) => Effect.gen(function* () {
146
150
  }
147
151
  concurrency = parsed;
148
152
  }
153
+ else if (argument === "--task-concurrency" || argument.startsWith("--task-concurrency=")) {
154
+ const raw = argument.includes("=")
155
+ ? argument.slice("--task-concurrency=".length)
156
+ : argv[index + 1];
157
+ if (!argument.includes("=")) {
158
+ index += 1;
159
+ }
160
+ const parsed = Number.parseInt(raw ?? "", 10);
161
+ if (!Number.isInteger(parsed) || parsed < 1 || String(parsed) !== (raw ?? "").trim()) {
162
+ return yield* ScriptUsage.make({
163
+ message: `--task-concurrency requires a positive integer\n${epicUsage}`
164
+ });
165
+ }
166
+ taskConcurrency = parsed;
167
+ }
149
168
  else if (argument === "--merge-revisions" || argument.startsWith("--merge-revisions=")) {
150
169
  const raw = argument.includes("=")
151
170
  ? argument.slice("--merge-revisions=".length)
@@ -187,6 +206,7 @@ export const parseEpicArgs = (argv) => Effect.gen(function* () {
187
206
  judgeRounds,
188
207
  deferFindings,
189
208
  mergeRevisions,
209
+ taskConcurrency,
190
210
  land,
191
211
  keepWorktrees,
192
212
  list,
@@ -206,6 +226,18 @@ export const mergeRevisionsOption = (flag, environment) => {
206
226
  const raw = environment.LLM4TS_MERGE_REVISIONS?.trim() ?? "";
207
227
  return /^\d+$/u.test(raw) ? { mergeRevisions: Number.parseInt(raw, 10) } : {};
208
228
  };
229
+ /**
230
+ * Coders per story (ADR 0034): `--task-concurrency`, else
231
+ * `LLM4TS_TASK_CONCURRENCY`, else the executor's default. An unusable
232
+ * environment value falls back.
233
+ */
234
+ export const taskConcurrencyOption = (flag, environment) => {
235
+ if (flag !== undefined) {
236
+ return { taskConcurrency: flag };
237
+ }
238
+ const raw = environment.LLM4TS_TASK_CONCURRENCY?.trim() ?? "";
239
+ return /^[1-9]\d*$/u.test(raw) ? { taskConcurrency: Number.parseInt(raw, 10) } : {};
240
+ };
209
241
  /** `--defer-findings`, or `LLM4TS_DEFER_FINDINGS` set to 1/true/on/yes (ADR 0031). */
210
242
  export const deferFindingsEnabled = (flag, environment) => flag || /^(1|true|on|yes)$/i.test(environment.LLM4TS_DEFER_FINDINGS?.trim() ?? "");
211
243
  /**
@@ -1690,6 +1722,7 @@ export const runEpicStories = (options) => Effect.gen(function* () {
1690
1722
  ].join("\n")),
1691
1723
  ...judgeRoundsOption(flags.judgeRounds, process.env),
1692
1724
  ...mergeRevisionsOption(flags.mergeRevisions, process.env),
1725
+ ...taskConcurrencyOption(flags.taskConcurrency, process.env),
1693
1726
  concurrency,
1694
1727
  ...(deferring ? { deferNonBlocking: true } : {}),
1695
1728
  failFast: flags.failFast
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llm4ts/shell",
3
- "version": "2.40.1",
3
+ "version": "2.42.0",
4
4
  "description": "Interactive shell and CLI for llm4ts: flow discovery, run-a-flow, and view",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,9 +52,9 @@
52
52
  "dependencies": {
53
53
  "@effect/platform-node": "4.0.0",
54
54
  "@effect/platform-node-shared": "4.0.0",
55
- "@llm4ts/core": "2.40.1",
56
- "@llm4ts/runner": "2.40.1",
57
- "@llm4ts/flow": "2.40.1"
55
+ "@llm4ts/core": "2.42.0",
56
+ "@llm4ts/flow": "2.42.0",
57
+ "@llm4ts/runner": "2.42.0"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "effect": "4.0.0"