lalph 0.3.25 → 0.3.27

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.25",
4
+ "version": "0.3.27",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -23,12 +23,12 @@
23
23
  "@changesets/changelog-github": "^0.5.2",
24
24
  "@changesets/cli": "^2.29.8",
25
25
  "@effect/language-service": "^0.73.1",
26
- "@effect/platform-node": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/platform-node@0a6d33c",
26
+ "@effect/platform-node": "4.0.0-beta.2",
27
27
  "@linear/sdk": "^75.0.0",
28
28
  "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
29
29
  "@octokit/types": "^16.0.0",
30
30
  "concurrently": "^9.2.1",
31
- "effect": "https://pkg.pr.new/Effect-TS/effect-smol/effect@0a6d33c",
31
+ "effect": "4.0.0-beta.2",
32
32
  "husky": "^9.1.7",
33
33
  "lint-staged": "^16.2.7",
34
34
  "octokit": "^5.0.5",
package/src/Github.ts CHANGED
@@ -325,6 +325,25 @@ export const GithubIssueSource = Layer.effect(
325
325
  options.projectId,
326
326
  )
327
327
  const issueNumber = Number(options.issueId.slice(1))
328
+ const currentIssue = yield* github.request((rest) =>
329
+ rest.issues.get({
330
+ owner: cli.owner,
331
+ repo: cli.repo,
332
+ issue_number: issueNumber,
333
+ }),
334
+ )
335
+ const labels = Array.from(
336
+ new Set([
337
+ ...currentIssue.data.labels.flatMap((label) =>
338
+ typeof label === "string"
339
+ ? [label]
340
+ : label.name
341
+ ? [label.name]
342
+ : [],
343
+ ),
344
+ ...Option.toArray(labelFilter),
345
+ ]),
346
+ )
328
347
  const update: {
329
348
  owner: string
330
349
  repo: string
@@ -337,7 +356,7 @@ export const GithubIssueSource = Layer.effect(
337
356
  owner: cli.owner,
338
357
  repo: cli.repo,
339
358
  issue_number: issueNumber,
340
- labels: Option.toArray(labelFilter),
359
+ labels,
341
360
  }
342
361
 
343
362
  if (options.title) {
@@ -349,15 +368,28 @@ export const GithubIssueSource = Layer.effect(
349
368
  if (options.state) {
350
369
  update.state = options.state === "done" ? "closed" : "open"
351
370
 
371
+ update.labels = update.labels.filter(
372
+ (label) => label !== "in-review" && label !== "in-progress",
373
+ )
374
+
352
375
  if (options.state === "in-review") {
353
376
  update.labels.push("in-review")
354
377
  } else if (options.state === "in-progress") {
355
378
  update.labels.push("in-progress")
356
379
  }
357
380
  }
358
- if (options.autoMerge !== undefined) {
381
+ if (
382
+ options.autoMerge !== undefined &&
383
+ Option.isSome(autoMergeLabelName)
384
+ ) {
359
385
  if (options.autoMerge) {
360
- update.labels.push(...Option.toArray(autoMergeLabelName))
386
+ if (!update.labels.includes(autoMergeLabelName.value)) {
387
+ update.labels.push(autoMergeLabelName.value)
388
+ }
389
+ } else {
390
+ update.labels = update.labels.filter(
391
+ (label) => label !== autoMergeLabelName.value,
392
+ )
361
393
  }
362
394
  }
363
395
 
package/src/Tracing.ts CHANGED
@@ -41,21 +41,16 @@ const TracerLogger = Effect.gen(function* () {
41
41
  }
42
42
 
43
43
  return Tracer.make({
44
- span(name, parent, annotations, links, startTime, kind, options) {
45
- const span = tracer.span(
46
- name,
47
- parent,
48
- annotations,
49
- links,
50
- startTime,
51
- kind,
52
- options,
53
- )
54
- log(`${name}: started`, startTime)
44
+ span(options) {
45
+ const span = tracer.span(options)
46
+ log(`${options.name}: started`, options.startTime)
55
47
  const oldEnd = span.end
56
48
  span.end = (endTime, cause) => {
57
49
  const duration = Duration.nanos(endTime - span.status.startTime)
58
- log(`${name}: completed. Took ${Duration.format(duration)}`, endTime)
50
+ log(
51
+ `${options.name}: completed. Took ${Duration.format(duration)}`,
52
+ endTime,
53
+ )
59
54
  return oldEnd.call(span, endTime, cause)
60
55
  }
61
56
  return span
package/src/Workers.ts CHANGED
@@ -103,6 +103,7 @@ export const withWorkerState =
103
103
  unmountState()
104
104
  unmountOutput()
105
105
  registry.update(activeWorkersAtom, HashMap.remove(workerId))
106
+ return Effect.void
106
107
  }),
107
108
  Effect.provideService(CurrentWorkerState, { state, output }),
108
109
  )
@@ -84,6 +84,7 @@ const claude = new CliAgent({
84
84
  "--disallowed-tools",
85
85
  "AskUserQuestion",
86
86
  ...extraArgs,
87
+ "--",
87
88
  `@${prdFilePath}
88
89
 
89
90
  ${prompt}`,
@@ -1,12 +1,10 @@
1
- import { Effect, Filter, flow, Schema, Stream } from "effect"
1
+ import { Effect, flow, Schema, Stream } from "effect"
2
2
 
3
3
  export const streamFilterJson = <S extends Schema.Top>(schema: S) => {
4
4
  const fromString = Schema.fromJsonString(schema)
5
5
  const decode = Schema.decodeEffect(fromString)
6
6
  return flow(
7
7
  Stream.splitLines,
8
- Stream.filterMapEffect((line) =>
9
- decode(line).pipe(Effect.catch(() => Effect.succeed(Filter.failVoid))),
10
- ),
8
+ Stream.filterEffect((line) => decode(line).pipe(Effect.result)),
11
9
  )
12
10
  }