lalph 0.3.52 → 0.3.53

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.52",
4
+ "version": "0.3.53",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -22,23 +22,23 @@
22
22
  "devDependencies": {
23
23
  "@changesets/changelog-github": "^0.6.0",
24
24
  "@changesets/cli": "^2.30.0",
25
- "@effect/ai-openai": "4.0.0-beta.30",
26
- "@effect/ai-openai-compat": "4.0.0-beta.30",
25
+ "@effect/ai-openai": "4.0.0-beta.31",
26
+ "@effect/ai-openai-compat": "4.0.0-beta.31",
27
27
  "@effect/language-service": "^0.79.0",
28
- "@effect/platform-node": "4.0.0-beta.30",
28
+ "@effect/platform-node": "4.0.0-beta.31",
29
29
  "@linear/sdk": "^77.0.0",
30
30
  "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
31
31
  "@octokit/types": "^16.0.0",
32
- "@typescript/native-preview": "7.0.0-dev.20260310.1",
33
- "clanka": "^0.0.26",
32
+ "@typescript/native-preview": "7.0.0-dev.20260311.1",
33
+ "clanka": "^0.0.28",
34
34
  "concurrently": "^9.2.1",
35
- "effect": "4.0.0-beta.30",
35
+ "effect": "4.0.0-beta.31",
36
36
  "husky": "^9.1.7",
37
37
  "lint-staged": "^16.3.3",
38
38
  "octokit": "^5.0.5",
39
39
  "oxlint": "^1.53.0",
40
40
  "prettier": "^3.8.1",
41
- "tsdown": "^0.21.1",
41
+ "tsdown": "^0.21.2",
42
42
  "typescript": "^5.9.3",
43
43
  "yaml": "^2.8.2"
44
44
  },
package/src/Clanka.ts CHANGED
@@ -1,13 +1,9 @@
1
1
  import { Agent, OutputFormatter } from "clanka"
2
2
  import { Duration, Effect, Layer, Stdio, Stream } from "effect"
3
- import {
4
- TaskChooseTools,
5
- TaskTools,
6
- TaskToolsHandlers,
7
- TaskToolsWithChoose,
8
- } from "./TaskTools.ts"
3
+ import { TaskChooseTools, TaskTools, TaskToolsHandlers } from "./TaskTools.ts"
9
4
  import { ClankaModels, clankaSubagent } from "./ClankaModels.ts"
10
5
  import { withStallTimeout } from "./shared/stream.ts"
6
+ import { NodeHttpClient } from "@effect/platform-node"
11
7
 
12
8
  export const ClankaMuxerLayer = Layer.effectDiscard(
13
9
  Effect.gen(function* () {
@@ -32,9 +28,7 @@ export const runClanka = Effect.fnUntraced(
32
28
 
33
29
  const agent = yield* Agent.make({
34
30
  ...options,
35
- tools: (options.withChoose
36
- ? TaskChooseTools
37
- : TaskTools) as unknown as typeof TaskToolsWithChoose,
31
+ tools: options.withChoose ? TaskChooseTools : TaskTools,
38
32
  subagentModel: clankaSubagent(models, options.model),
39
33
  }).pipe(Effect.provide(models.get(options.model)))
40
34
 
@@ -63,5 +57,8 @@ export const runClanka = Effect.fnUntraced(
63
57
  )
64
58
  },
65
59
  Effect.scoped,
66
- Effect.provide([Agent.layerServices, TaskToolsHandlers]),
60
+ Effect.provide([
61
+ Agent.layerServices.pipe(Layer.provide(NodeHttpClient.layerUndici)),
62
+ TaskToolsHandlers,
63
+ ]),
67
64
  )
package/src/Linear.ts CHANGED
@@ -61,9 +61,9 @@ class Linear extends ServiceMap.Service<Linear>()("lalph/Linear", {
61
61
  readonly schema: S
62
62
  }) => {
63
63
  const decode: (
64
- input: S["Encoded"],
64
+ input: unknown,
65
65
  ) => Effect.Effect<S["Type"], Schema.SchemaError, S["DecodingServices"]> =
66
- Schema.decodeEffect(Schema.toCodecJson(options.schema))
66
+ Schema.decodeUnknownEffect(Schema.toCodecJson(options.schema))
67
67
  return use((c) =>
68
68
  c.client.rawRequest(options.query, options.variables),
69
69
  ).pipe(Effect.flatMap((r) => decode(r.data)))
package/src/Presets.ts CHANGED
@@ -5,6 +5,8 @@ import { Prompt } from "effect/unstable/cli"
5
5
  import { allCliAgents, type AnyCliAgent } from "./domain/CliAgent.ts"
6
6
  import { parseCommand } from "./shared/child-process.ts"
7
7
  import { IssueSource } from "./IssueSource.ts"
8
+ import { ClankaModels } from "./ClankaModels.ts"
9
+ import { LanguageModel } from "effect/unstable/ai"
8
10
 
9
11
  export const allCliAgentPresets = new Setting(
10
12
  "cliAgentPresets",
@@ -127,6 +129,14 @@ export const addOrUpdatePreset = Effect.fnUntraced(function* (options?: {
127
129
  sourceMetadata: {},
128
130
  })
129
131
 
132
+ if (cliAgent.id === "clanka") {
133
+ yield* Effect.log("Verifying Clanka model configuration...")
134
+ yield* LanguageModel.generateText({ prompt: "say hello" }).pipe(
135
+ Effect.ignore,
136
+ Effect.provide(ClankaModels.get(preset.extraArgs.join(" "))),
137
+ )
138
+ }
139
+
130
140
  if (id !== CliAgentPreset.defaultId) {
131
141
  const source = yield* IssueSource
132
142
  preset = yield* source.updateCliAgentPreset(preset)
package/src/cli.ts CHANGED
@@ -17,6 +17,7 @@ import { PlatformServices } from "./shared/platform.ts"
17
17
  import { commandProjects } from "./commands/projects.ts"
18
18
  import { commandSh } from "./commands/sh.ts"
19
19
  import { commandAgents } from "./commands/agents.ts"
20
+ import { ClankaModels } from "./ClankaModels.ts"
20
21
 
21
22
  commandRoot.pipe(
22
23
  Command.withSubcommands([
@@ -39,7 +40,7 @@ commandRoot.pipe(
39
40
  Command.run({
40
41
  version: PackageJson.version,
41
42
  }),
42
- Effect.provide(PlatformServices),
43
+ Effect.provide([ClankaModels.layer, PlatformServices]),
43
44
  Effect.provideService(Layer.CurrentMemoMap, lalphMemoMap),
44
45
  NodeRuntime.runMain,
45
46
  )
@@ -10,7 +10,6 @@ import { commandRoot } from "../root.ts"
10
10
  import { selectCliAgentPreset } from "../../Presets.ts"
11
11
  import { CurrentIssueSource } from "../../CurrentIssueSource.ts"
12
12
  import type { CliAgentPreset } from "../../domain/CliAgentPreset.ts"
13
- import { ClankaModels } from "../../ClankaModels.ts"
14
13
  import { ClankaMuxerLayer } from "../../Clanka.ts"
15
14
 
16
15
  const specificationPath = Argument.path("spec", {
@@ -72,7 +71,6 @@ const generateTasks = Effect.fnUntraced(
72
71
  })
73
72
  },
74
73
  Effect.provide([
75
- ClankaModels.layer,
76
74
  ClankaMuxerLayer,
77
75
  Settings.layer,
78
76
  PromptGen.layer,
@@ -24,7 +24,6 @@ import { selectCliAgentPreset } from "../Presets.ts"
24
24
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
25
25
  import { parseBranch } from "../shared/git.ts"
26
26
  import type { CliAgentPreset } from "../domain/CliAgentPreset.ts"
27
- import { ClankaModels } from "../ClankaModels.ts"
28
27
  import { ClankaMuxerLayer } from "../Clanka.ts"
29
28
 
30
29
  const dangerous = Flag.boolean("dangerous").pipe(
@@ -99,7 +98,6 @@ export const commandPlan = Command.make("plan", {
99
98
  Effect.provide([
100
99
  Settings.layer,
101
100
  CurrentIssueSource.layer,
102
- ClankaModels.layer,
103
101
  ClankaMuxerLayer,
104
102
  ]),
105
103
  )
@@ -491,7 +491,6 @@ export const commandRoot = Command.make("lalph", {
491
491
  },
492
492
  Effect.scoped,
493
493
  Effect.provide([
494
- ClankaModels.layer,
495
494
  ClankaMuxerLayer,
496
495
  PromptGen.layer,
497
496
  GithubCli.layer,