lalph 0.3.106 → 0.3.108

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
@@ -178369,6 +178369,7 @@ const IssuesChange = taggedEnum();
178369
178369
  var IssueSource = class IssueSource extends Service$1()("lalph/IssueSource") {
178370
178370
  static make(impl) {
178371
178371
  return gen(function* () {
178372
+ const handle = yield* make$58();
178372
178373
  const refs = yield* make$48({
178373
178374
  lookup: fnUntraced(function* (projectId) {
178374
178375
  const ref = yield* make$47(IssuesChange.Internal({ issues: yield* pipe$1(impl.issues(projectId), orElseSucceed(empty$17)) }));
@@ -178377,10 +178378,15 @@ var IssueSource = class IssueSource extends Service$1()("lalph/IssueSource") {
178377
178378
  }),
178378
178379
  capacity: Number.MAX_SAFE_INTEGER
178379
178380
  });
178381
+ const updateIssues = fnUntraced(function* (projectId) {
178382
+ const issues = yield* impl.issues(projectId);
178383
+ yield* set$3(yield* get$6(refs, projectId), IssuesChange.Internal({ issues }));
178384
+ return issues;
178385
+ });
178380
178386
  const update$2 = fnUntraced(function* (projectId, f) {
178381
178387
  yield* update(yield* get$6(refs, projectId), (change) => IssuesChange.Internal({ issues: f(change.issues) }));
178388
+ yield* run$4(handle, delay(updateIssues(projectId), "5 seconds"));
178382
178389
  });
178383
- const updateIssues = (projectId) => pipe$1(impl.issues(projectId), tap$1((issues) => update$2(projectId, () => issues)));
178384
178390
  return IssueSource.of({
178385
178391
  ...impl,
178386
178392
  ref: (projectId) => get$6(refs, projectId),
@@ -240815,9 +240821,6 @@ ${options.gitFlow.reviewInstructions}
240815
240821
  # Previous instructions (only for context, do not repeat)
240816
240822
 
240817
240823
  ${options.prompt}`;
240818
- const promptReviewCustom = (options) => options.removePrdNotes ? options.prompt : `${options.prompt}
240819
-
240820
- ${prdNotes(options)}`;
240821
240824
  const promptTimeout = (options) => `Your earlier attempt to complete the task with id \`${options.taskId}\` took too
240822
240825
  long and has timed out. You can find the task details in the prd.yml file.
240823
240826
 
@@ -240958,7 +240961,6 @@ Make sure to setup dependencies between the tasks using the \`blockedBy\` field.
240958
240961
  promptClanka,
240959
240962
  promptResearch,
240960
240963
  promptReview,
240961
- promptReviewCustom,
240962
240964
  promptTimeout,
240963
240965
  promptTimeoutClanka,
240964
240966
  promptTimeoutRalph,
@@ -241915,34 +241917,20 @@ const agentReviewer = fnUntraced(function* (options) {
241915
241917
  directory: worktree.directory,
241916
241918
  model: options.preset.extraArgs.join(" "),
241917
241919
  system,
241918
- prompt: match$10(customInstructions, {
241919
- onNone: () => promptGen.promptReview({
241920
- prompt: options.instructions,
241921
- gitFlow
241922
- }),
241923
- onSome: (prompt) => promptGen.promptReviewCustom({
241924
- prompt,
241925
- specsDirectory: options.specsDirectory,
241926
- removePrdNotes: true
241927
- })
241928
- }),
241920
+ prompt: getOrElse$2(customInstructions, () => promptGen.promptReview({
241921
+ prompt: options.instructions,
241922
+ gitFlow
241923
+ })),
241929
241924
  stallTimeout: options.stallTimeout,
241930
241925
  mode
241931
241926
  });
241932
241927
  return ExitCode(0);
241933
241928
  }
241934
241929
  return yield* pipe$1(options.preset.cliAgent.command({
241935
- prompt: match$10(customInstructions, {
241936
- onNone: () => promptGen.promptReview({
241937
- prompt: options.instructions,
241938
- gitFlow
241939
- }),
241940
- onSome: (prompt) => promptGen.promptReviewCustom({
241941
- prompt,
241942
- specsDirectory: options.specsDirectory,
241943
- removePrdNotes: false
241944
- })
241945
- }),
241930
+ prompt: getOrElse$2(customInstructions, () => promptGen.promptReview({
241931
+ prompt: options.instructions,
241932
+ gitFlow
241933
+ })),
241946
241934
  prdFilePath: pathService.join(".lalph", "prd.yml"),
241947
241935
  extraArgs: options.preset.extraArgs
241948
241936
  }), setCwd(worktree.directory), options.preset.withCommandPrefix).pipe(worktree.execWithStallTimeout({
@@ -242700,7 +242688,7 @@ const commandEdit = make$60("edit").pipe(withDescription("Open the selected proj
242700
242688
  const commandSource = make$60("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
242701
242689
  //#endregion
242702
242690
  //#region package.json
242703
- var version = "0.3.106";
242691
+ var version = "0.3.108";
242704
242692
  //#endregion
242705
242693
  //#region src/Tracing.ts
242706
242694
  const TracingLayer = unwrap$3(gen(function* () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.106",
4
+ "version": "0.3.108",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -42,19 +42,12 @@ export const agentReviewer = Effect.fnUntraced(function* (options: {
42
42
  directory: worktree.directory,
43
43
  model: options.preset.extraArgs.join(" "),
44
44
  system,
45
- prompt: Option.match(customInstructions, {
46
- onNone: () =>
47
- promptGen.promptReview({
48
- prompt: options.instructions,
49
- gitFlow,
50
- }),
51
- onSome: (prompt) =>
52
- promptGen.promptReviewCustom({
53
- prompt,
54
- specsDirectory: options.specsDirectory,
55
- removePrdNotes: true,
56
- }),
57
- }),
45
+ prompt: Option.getOrElse(customInstructions, () =>
46
+ promptGen.promptReview({
47
+ prompt: options.instructions,
48
+ gitFlow,
49
+ }),
50
+ ),
58
51
  stallTimeout: options.stallTimeout,
59
52
  mode,
60
53
  })
@@ -63,19 +56,12 @@ export const agentReviewer = Effect.fnUntraced(function* (options: {
63
56
 
64
57
  const cliCommand = pipe(
65
58
  options.preset.cliAgent.command({
66
- prompt: Option.match(customInstructions, {
67
- onNone: () =>
68
- promptGen.promptReview({
69
- prompt: options.instructions,
70
- gitFlow,
71
- }),
72
- onSome: (prompt) =>
73
- promptGen.promptReviewCustom({
74
- prompt,
75
- specsDirectory: options.specsDirectory,
76
- removePrdNotes: false,
77
- }),
78
- }),
59
+ prompt: Option.getOrElse(customInstructions, () =>
60
+ promptGen.promptReview({
61
+ prompt: options.instructions,
62
+ gitFlow,
63
+ }),
64
+ ),
79
65
  prdFilePath: pathService.join(".lalph", "prd.yml"),
80
66
  extraArgs: options.preset.extraArgs,
81
67
  }),
@@ -3,6 +3,7 @@ import {
3
3
  Data,
4
4
  Duration,
5
5
  Effect,
6
+ FiberHandle,
6
7
  Option,
7
8
  Schema,
8
9
  ScopedCache,
@@ -94,6 +95,8 @@ export class IssueSource extends ServiceMap.Service<
94
95
  >()("lalph/IssueSource") {
95
96
  static make(impl: Omit<IssueSource["Service"], "ref" | "findById">) {
96
97
  return Effect.gen(function* () {
98
+ const handle = yield* FiberHandle.make()
99
+
97
100
  const refs = yield* ScopedCache.make({
98
101
  lookup: Effect.fnUntraced(function* (projectId: ProjectId) {
99
102
  const ref = yield* SubscriptionRef.make<IssuesChange>(
@@ -125,6 +128,13 @@ export class IssueSource extends ServiceMap.Service<
125
128
  capacity: Number.MAX_SAFE_INTEGER,
126
129
  })
127
130
 
131
+ const updateIssues = Effect.fnUntraced(function* (projectId: ProjectId) {
132
+ const issues = yield* impl.issues(projectId)
133
+ const ref = yield* ScopedCache.get(refs, projectId)
134
+ yield* SubscriptionRef.set(ref, IssuesChange.Internal({ issues }))
135
+ return issues
136
+ })
137
+
128
138
  const update = Effect.fnUntraced(function* (
129
139
  projectId: ProjectId,
130
140
  f: (_: ReadonlyArray<PrdIssue>) => ReadonlyArray<PrdIssue>,
@@ -135,13 +145,11 @@ export class IssueSource extends ServiceMap.Service<
135
145
  issues: f(change.issues),
136
146
  }),
137
147
  )
138
- })
139
-
140
- const updateIssues = (projectId: ProjectId) =>
141
- pipe(
142
- impl.issues(projectId),
143
- Effect.tap((issues) => update(projectId, () => issues)),
148
+ yield* FiberHandle.run(
149
+ handle,
150
+ Effect.delay(updateIssues(projectId), "5 seconds"),
144
151
  )
152
+ })
145
153
 
146
154
  return IssueSource.of({
147
155
  ...impl,
package/src/PromptGen.ts CHANGED
@@ -315,17 +315,6 @@ ${options.gitFlow.reviewInstructions}
315
315
 
316
316
  ${options.prompt}`
317
317
 
318
- const promptReviewCustom = (options: {
319
- readonly prompt: string
320
- readonly specsDirectory: string
321
- readonly removePrdNotes: boolean
322
- }) =>
323
- options.removePrdNotes
324
- ? options.prompt
325
- : `${options.prompt}
326
-
327
- ${prdNotes(options)}`
328
-
329
318
  const promptTimeout = (options: {
330
319
  readonly taskId: string
331
320
  readonly specsDirectory: string
@@ -490,7 +479,6 @@ Make sure to setup dependencies between the tasks using the \`blockedBy\` field.
490
479
  promptClanka,
491
480
  promptResearch,
492
481
  promptReview,
493
- promptReviewCustom,
494
482
  promptTimeout,
495
483
  promptTimeoutClanka,
496
484
  promptTimeoutRalph,