lalph 0.3.64 → 0.3.65

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.64",
4
+ "version": "0.3.65",
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.31",
26
- "@effect/ai-openai-compat": "4.0.0-beta.31",
25
+ "@effect/ai-openai": "4.0.0-beta.33",
26
+ "@effect/ai-openai-compat": "4.0.0-beta.33",
27
27
  "@effect/language-service": "^0.80.0",
28
- "@effect/platform-node": "4.0.0-beta.31",
28
+ "@effect/platform-node": "4.0.0-beta.33",
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
32
  "@typescript/native-preview": "7.0.0-dev.20260315.1",
33
- "clanka": "^0.1.12",
33
+ "clanka": "^0.1.15",
34
34
  "concurrently": "^9.2.1",
35
- "effect": "4.0.0-beta.31",
35
+ "effect": "4.0.0-beta.33",
36
36
  "husky": "^9.1.7",
37
37
  "lint-staged": "^16.4.0",
38
38
  "octokit": "^5.0.5",
39
39
  "oxlint": "^1.55.0",
40
40
  "prettier": "^3.8.1",
41
- "tsdown": "^0.21.2",
41
+ "tsdown": "^0.21.3",
42
42
  "typescript": "^5.9.3",
43
43
  "yaml": "^2.8.2"
44
44
  },
package/src/Clanka.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Agent, OutputFormatter } from "clanka"
2
- import { Duration, Effect, Layer, pipe, Stdio, Stream } from "effect"
2
+ import { Duration, Effect, Layer, Stdio, Stream } from "effect"
3
3
  import { TaskChooseTools, TaskTools, TaskToolsHandlers } from "./TaskTools.ts"
4
4
  import { ClankaModels } from "./ClankaModels.ts"
5
5
  import { withStallTimeout } from "./shared/stream.ts"
@@ -24,17 +24,13 @@ export const runClanka = Effect.fnUntraced(
24
24
  readonly steer?: Stream.Stream<string> | undefined
25
25
  readonly withChoose?: boolean | undefined
26
26
  }) {
27
- const models = yield* ClankaModels
28
27
  const muxer = yield* OutputFormatter.Muxer
29
28
  const agent = yield* Agent.Agent
30
29
 
31
- const output = yield* pipe(
32
- agent.send({
33
- prompt: options.prompt,
34
- system: options.system,
35
- }),
36
- Effect.provide(models.get(options.model)),
37
- )
30
+ const output = yield* agent.send({
31
+ prompt: options.prompt,
32
+ system: options.system,
33
+ })
38
34
 
39
35
  yield* muxer.add(output)
40
36
 
@@ -68,8 +64,7 @@ export const runClanka = Effect.fnUntraced(
68
64
  Agent.layerLocal({
69
65
  directory: options.directory,
70
66
  tools: options.withChoose ? TaskChooseTools : TaskTools,
71
- }),
72
- { local: true },
67
+ }).pipe(Layer.merge(ClankaModels.get(options.model))),
73
68
  ),
74
69
  Effect.provide([NodeHttpClient.layerUndici, TaskToolsHandlers]),
75
70
  )
@@ -1,5 +1,5 @@
1
1
  // oxlint-disable typescript/no-explicit-any
2
- import { NodeHttpClient } from "@effect/platform-node"
2
+ import { NodeHttpClient, NodeSocket } from "@effect/platform-node"
3
3
  import { Agent, Codex, Copilot } from "clanka"
4
4
  import { Effect, flow, Layer, LayerMap, Schema } from "effect"
5
5
  import { layerKvs } from "./Kvs.ts"
@@ -27,13 +27,16 @@ export class ClankaModels extends LayerMap.Service<ClankaModels>()(
27
27
  lookup: Effect.fnUntraced(function* (input: string) {
28
28
  const [provider, model, reasoning] = yield* parseInput(input.split("/"))
29
29
  const layer = resolve(provider, model, reasoning)
30
- if (reasoning === "low") {
31
- return layer
32
- }
33
30
  return Layer.merge(
34
31
  layer,
35
32
  Agent.layerSubagentModel(
36
- resolve(provider, model, reasoning === "medium" ? "low" : "medium"),
33
+ reasoning === "low"
34
+ ? layer
35
+ : resolve(
36
+ provider,
37
+ model,
38
+ reasoning === "medium" ? "low" : "medium",
39
+ ),
37
40
  ),
38
41
  )
39
42
  }, Layer.unwrap),
@@ -47,16 +50,19 @@ const resolve = (
47
50
  ) => {
48
51
  switch (provider) {
49
52
  case "openai": {
50
- return Codex.model(model, {
53
+ return Codex.modelWebSocket(model, {
51
54
  reasoning: {
52
55
  effort: reasoning,
53
56
  },
54
- })
57
+ }).pipe(
58
+ Layer.provide(NodeSocket.layerWebSocketConstructorWS),
59
+ Layer.provide(Codex.layerClient),
60
+ )
55
61
  }
56
62
  case "copilot": {
57
63
  return Copilot.model(model, {
58
64
  ...reasoningToCopilotConfig(model, reasoning),
59
- })
65
+ }).pipe(Layer.provide(Copilot.layerClient))
60
66
  }
61
67
  }
62
68
  }