lalph 0.3.90 → 0.3.92

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
@@ -181596,7 +181596,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
181596
181596
  });
181597
181597
  Ze.glob = Ze;
181598
181598
  //#endregion
181599
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ApplyPatch.js
181599
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ApplyPatch.js
181600
181600
  /**
181601
181601
  * @since 1.0.0
181602
181602
  */
@@ -196469,7 +196469,7 @@ var StreamableHTTPClientTransport = class {
196469
196469
  }
196470
196470
  };
196471
196471
  //#endregion
196472
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/McpClient.js
196472
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/McpClient.js
196473
196473
  /**
196474
196474
  * @since 1.0.0
196475
196475
  */
@@ -196514,7 +196514,7 @@ const layer$13 = effect$1(McpClient, gen(function* () {
196514
196514
  });
196515
196515
  }));
196516
196516
  //#endregion
196517
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ExaSearch.js
196517
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ExaSearch.js
196518
196518
  /**
196519
196519
  * @since 1.0.0
196520
196520
  */
@@ -211464,7 +211464,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
211464
211464
  exports.impl = impl;
211465
211465
  }));
211466
211466
  //#endregion
211467
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/WebToMarkdown.js
211467
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/WebToMarkdown.js
211468
211468
  /**
211469
211469
  * @since 1.0.0
211470
211470
  */
@@ -215082,7 +215082,7 @@ const mapProviderResults = (inputLength, results) => {
215082
215082
  return succeed$3(embeddings);
215083
215083
  };
215084
215084
  //#endregion
215085
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ChunkRepo.js
215085
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ChunkRepo.js
215086
215086
  /**
215087
215087
  * @since 1.0.0
215088
215088
  * @category Models
@@ -215213,7 +215213,7 @@ const layer$10 = effect$1(ChunkRepo, gen(function* () {
215213
215213
  });
215214
215214
  }));
215215
215215
  //#endregion
215216
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/CodeChunker.js
215216
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/CodeChunker.js
215217
215217
  /**
215218
215218
  * @since 1.0.0
215219
215219
  */
@@ -215806,7 +215806,7 @@ const run$1 = /* @__PURE__ */ make$25({});
215806
215806
  */
215807
215807
  const layer$7 = (options) => effectDiscard(run$1(options));
215808
215808
  //#endregion
215809
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/internal/sqlite-vector.js
215809
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/internal/sqlite-vector.js
215810
215810
  /**
215811
215811
  * Binary extension for each platform
215812
215812
  */
@@ -215923,7 +215923,7 @@ function getExtensionPath() {
215923
215923
  throw new ExtensionNotFoundError(`SQLite Vector extension not found for platform: ${getCurrentPlatform()}\n\nThe platform-specific package "${getPlatformPackageName()}" is not installed.\nThis usually happens when:\n 1. Your platform is not supported\n 2. npm failed to install optional dependencies\n 3. You're installing with --no-optional flag\n\nTry running: npm install --force`);
215924
215924
  }
215925
215925
  //#endregion
215926
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/Sqlite.js
215926
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/Sqlite.js
215927
215927
  /**
215928
215928
  * @since 1.0.0
215929
215929
  */
@@ -215951,7 +215951,7 @@ const SqliteLayer = (database) => layer$7({ loader: fromRecord({ "0001_create_ch
215951
215951
  yield* fs.makeDirectory(directory, { recursive: true });
215952
215952
  }))));
215953
215953
  //#endregion
215954
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/SemanticSearch.js
215954
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/SemanticSearch.js
215955
215955
  /**
215956
215956
  * @since 1.0.0
215957
215957
  */
@@ -216093,7 +216093,7 @@ const maybeRemoveFile = (path) => serviceOption(SemanticSearch).pipe(flatMap$4(m
216093
216093
  onSome: (service) => service.removeFile(path)
216094
216094
  })));
216095
216095
  //#endregion
216096
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/AgentTools.js
216096
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/AgentTools.js
216097
216097
  /**
216098
216098
  * @since 1.0.0
216099
216099
  */
@@ -216444,7 +216444,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$12, laye
216444
216444
  AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
216445
216445
  var ApplyPatchError = class extends TaggedClass$2("ApplyPatchError") {};
216446
216446
  //#endregion
216447
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/TypeBuilder.js
216447
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/TypeBuilder.js
216448
216448
  const resolveDocumentation = resolveAt("documentation");
216449
216449
  const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
216450
216450
  const Precedence = {
@@ -216717,7 +216717,7 @@ const render = (schema, options) => {
216717
216717
  return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
216718
216718
  };
216719
216719
  //#endregion
216720
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ToolkitRenderer.js
216720
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ToolkitRenderer.js
216721
216721
  /**
216722
216722
  * @since 1.0.0
216723
216723
  */
@@ -216739,7 +216739,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
216739
216739
  }) });
216740
216740
  };
216741
216741
  //#endregion
216742
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ScriptPreprocessing.js
216742
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ScriptPreprocessing.js
216743
216743
  const isIdentifierChar = (char) => char !== void 0 && /[A-Za-z0-9_$]/.test(char);
216744
216744
  const isIdentifierStartChar = (char) => char !== void 0 && /[A-Za-z_$]/.test(char);
216745
216745
  const hasIdentifierBoundary = (text, index, length) => !isIdentifierChar(text[index - 1]) && !isIdentifierChar(text[index + length]);
@@ -216765,6 +216765,76 @@ const parseIdentifier = (text, start) => {
216765
216765
  end
216766
216766
  };
216767
216767
  };
216768
+ const findPreviousNonWhitespace = (text, from) => {
216769
+ let i = from;
216770
+ while (i >= 0 && /\s/.test(text[i])) i--;
216771
+ return i;
216772
+ };
216773
+ const findNextNonWhitespace = (text, from) => {
216774
+ let i = from;
216775
+ while (i < text.length && /\s/.test(text[i])) i++;
216776
+ return i;
216777
+ };
216778
+ const findObjectValueTerminator = (text, start) => {
216779
+ let parenDepth = 0;
216780
+ let bracketDepth = 0;
216781
+ let braceDepth = 0;
216782
+ let stringDelimiter;
216783
+ for (let i = start; i < text.length; i++) {
216784
+ const char = text[i];
216785
+ if (stringDelimiter !== void 0) {
216786
+ if (char === stringDelimiter && !isEscaped(text, i)) stringDelimiter = void 0;
216787
+ continue;
216788
+ }
216789
+ if (char === "\"" || char === "'" || char === "`") {
216790
+ stringDelimiter = char;
216791
+ continue;
216792
+ }
216793
+ if (char === "(") {
216794
+ parenDepth++;
216795
+ continue;
216796
+ }
216797
+ if (char === ")") {
216798
+ if (parenDepth > 0) parenDepth--;
216799
+ continue;
216800
+ }
216801
+ if (char === "[") {
216802
+ bracketDepth++;
216803
+ continue;
216804
+ }
216805
+ if (char === "]") {
216806
+ if (bracketDepth > 0) bracketDepth--;
216807
+ continue;
216808
+ }
216809
+ if (char === "{") {
216810
+ braceDepth++;
216811
+ continue;
216812
+ }
216813
+ if (char === "}") {
216814
+ if (parenDepth === 0 && bracketDepth === 0 && braceDepth === 0) return i;
216815
+ if (braceDepth > 0) braceDepth--;
216816
+ continue;
216817
+ }
216818
+ if (char === "," && parenDepth === 0 && bracketDepth === 0 && braceDepth === 0) return i;
216819
+ }
216820
+ return -1;
216821
+ };
216822
+ const collectExpressionIdentifiers = (text, start, end) => {
216823
+ const out = /* @__PURE__ */ new Set();
216824
+ let cursor = start;
216825
+ while (cursor < end) {
216826
+ const identifier = parseIdentifier(text, cursor);
216827
+ if (identifier === void 0) {
216828
+ cursor++;
216829
+ continue;
216830
+ }
216831
+ const previousNonWhitespace = findPreviousNonWhitespace(text, cursor - 1);
216832
+ const nextNonWhitespace = findNextNonWhitespace(text, identifier.end);
216833
+ if (text[previousNonWhitespace] !== "." && text[nextNonWhitespace] !== "." && text[nextNonWhitespace] !== "(") out.add(identifier.name);
216834
+ cursor = identifier.end;
216835
+ }
216836
+ return out;
216837
+ };
216768
216838
  const isEscaped = (text, index) => {
216769
216839
  let slashCount = 0;
216770
216840
  let i = index - 1;
@@ -216782,11 +216852,18 @@ const needsTemplateEscaping = (text) => {
216782
216852
  }
216783
216853
  return false;
216784
216854
  };
216785
- const normalizePatchEscapedQuotes = (text) => text.includes("*** Begin Patch") ? text.replace(/\\"([A-Za-z0-9_$.-]+)\\"/g, "\"$1\"") : text;
216855
+ const normalizePatchEscapedQuotes = (text) => text.includes("*** Begin Patch") ? text.replace(/\\"([A-Za-z0-9_$.-]+)\\"/g, (match, content, index) => {
216856
+ const previous = text[findPreviousNonWhitespace(text, index - 1)];
216857
+ const next = text[findNextNonWhitespace(text, index + match.length)];
216858
+ if (previous === "{" || previous === "[" || previous === ":" || previous === "," || next === ":" || next === "}" || next === "]" || next === ",") return match;
216859
+ return `"${content}"`;
216860
+ }) : text;
216861
+ const normalizeNonPatchEscapedTemplateMarkers = (text) => text.replace(/\\{2,}(?=`|\$\{)/g, "\\").replace(/(^|\s)\\+(?=\.[A-Za-z0-9_-]+\/)/g, "$1");
216786
216862
  const escapeTemplateLiteralContent = (text) => {
216787
- const normalized = normalizePatchEscapedQuotes(text);
216788
- const isPatchContent = normalized.includes("*** Begin Patch");
216789
- if (!needsTemplateEscaping(normalized)) return normalized;
216863
+ const normalizedPatchQuotes = normalizePatchEscapedQuotes(text);
216864
+ const isPatchContent = normalizedPatchQuotes.includes("*** Begin Patch");
216865
+ const normalized = isPatchContent ? normalizedPatchQuotes : normalizeNonPatchEscapedTemplateMarkers(normalizedPatchQuotes);
216866
+ if (!needsTemplateEscaping(normalized) && !(isPatchContent && normalized.includes("\\"))) return normalized;
216790
216867
  let out = "";
216791
216868
  for (let i = 0; i < normalized.length; i++) {
216792
216869
  const char = normalized[i];
@@ -216814,6 +216891,10 @@ const findTemplateEnd = (text, start, isTerminator) => {
216814
216891
  let end = -1;
216815
216892
  for (let i = start + 1; i < text.length; i++) {
216816
216893
  if (text[i] !== "`" || isEscaped(text, i)) continue;
216894
+ if (isTerminator(text[i + 1])) {
216895
+ end = i;
216896
+ continue;
216897
+ }
216817
216898
  if (isTerminator(text[skipWhitespace(text, i + 1)])) end = i;
216818
216899
  }
216819
216900
  return end;
@@ -216964,11 +217045,8 @@ const collectCallObjectPropertyIdentifiers = (script, functionName, propertyName
216964
217045
  const afterProperty = skipWhitespace(script, propertyKey + propertyName.length);
216965
217046
  if (script[afterProperty] === ":") {
216966
217047
  const valueStart = skipWhitespace(script, afterProperty + 1);
216967
- const identifier = parseIdentifier(script, valueStart);
216968
- if (identifier !== void 0) {
216969
- const valueEnd = skipWhitespace(script, identifier.end);
216970
- if (script[valueEnd] === "}" || script[valueEnd] === ",") out.add(identifier.name);
216971
- }
217048
+ const valueEnd = findObjectValueTerminator(script, valueStart);
217049
+ if (valueEnd !== -1) for (const identifier of collectExpressionIdentifiers(script, valueStart, valueEnd)) out.add(identifier);
216972
217050
  cursor = valueStart + 1;
216973
217051
  continue;
216974
217052
  }
@@ -217006,7 +217084,7 @@ const fixAssignedTemplate = (script, variableName) => {
217006
217084
  cursor = templateStart + 1;
217007
217085
  continue;
217008
217086
  }
217009
- const templateEnd = findTemplateEnd(out, templateStart, (char) => char === void 0 || char === ";" || char === "," || char === ")" || char === "}" || char === "]");
217087
+ const templateEnd = findTemplateEnd(out, templateStart, (char) => char === void 0 || char === "\n" || char === "\r" || char === ";" || char === "," || char === ")" || char === "}" || char === "]");
217010
217088
  if (templateEnd === -1) {
217011
217089
  cursor = templateStart + 1;
217012
217090
  continue;
@@ -217033,7 +217111,7 @@ const fixAssignedTemplatesForToolCalls = (script) => {
217033
217111
  };
217034
217112
  const preprocessScript = (script) => fixAssignedTemplatesForToolCalls(["applyPatch", "taskComplete"].reduce((current, functionName) => fixCallTemplateArgument(current, functionName), fixTargetCallObjectPropertyTemplates(script)));
217035
217113
  //#endregion
217036
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/AgentExecutor.js
217114
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/AgentExecutor.js
217037
217115
  /**
217038
217116
  * @since 1.0.0
217039
217117
  */
@@ -217218,7 +217296,7 @@ var QueueWriteStream = class extends Writable {
217218
217296
  }
217219
217297
  };
217220
217298
  //#endregion
217221
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/ScriptExtraction.js
217299
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/ScriptExtraction.js
217222
217300
  const stripWrappingCodeFence = (script) => {
217223
217301
  const lines = script.split(/\r?\n/);
217224
217302
  if (lines.length < 2) return script;
@@ -218767,7 +218845,7 @@ const applySpanTransformer = (transformer, response, options) => {
218767
218845
  });
218768
218846
  };
218769
218847
  //#endregion
218770
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/Agent.js
218848
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/Agent.js
218771
218849
  /**
218772
218850
  * @since 1.0.0
218773
218851
  */
@@ -230097,7 +230175,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
230097
230175
  })));
230098
230176
  });
230099
230177
  //#endregion
230100
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/CodexAuth.js
230178
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/CodexAuth.js
230101
230179
  /**
230102
230180
  * @since 1.0.0
230103
230181
  */
@@ -230317,7 +230395,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
230317
230395
  static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
230318
230396
  };
230319
230397
  //#endregion
230320
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/Codex.js
230398
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/Codex.js
230321
230399
  /**
230322
230400
  * @since 1.0.0
230323
230401
  */
@@ -231629,7 +231707,7 @@ const getUsageDetailNumber = (details, field) => {
231629
231707
  return typeof value === "number" ? value : void 0;
231630
231708
  };
231631
231709
  //#endregion
231632
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/CopilotAuth.js
231710
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/CopilotAuth.js
231633
231711
  /**
231634
231712
  * @since 1.0.0
231635
231713
  */
@@ -231820,7 +231898,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
231820
231898
  static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
231821
231899
  };
231822
231900
  //#endregion
231823
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/Copilot.js
231901
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/Copilot.js
231824
231902
  /**
231825
231903
  * @since 1.0.0
231826
231904
  */
@@ -232240,7 +232318,7 @@ Object.defineProperties(createChalk.prototype, styles);
232240
232318
  const chalk = createChalk();
232241
232319
  createChalk({ level: stderrColor ? stderrColor.level : 0 });
232242
232320
  //#endregion
232243
- //#region node_modules/.pnpm/clanka@0.2.18_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_500c9c5f2cf95b88472d3c06656714c8/node_modules/clanka/dist/OutputFormatter.js
232321
+ //#region node_modules/.pnpm/clanka@0.2.19_@effect+ai-openai-compat@4.0.0-beta.35_effect@https+++pkg.pr.new+Effect-T_3ecf2271901c4565ca12cd64815ad5c2/node_modules/clanka/dist/OutputFormatter.js
232244
232322
  /**
232245
232323
  * @since 1.0.0
232246
232324
  */
@@ -232359,14 +232437,11 @@ const parseInput = flow(decodeUnknownEffect(Tuple([
232359
232437
  String$1,
232360
232438
  Reasoning
232361
232439
  ])), orDie$2);
232362
- var ClankaModels = class extends Service()("lalph/ClankaModels", {
232363
- dependencies: [ModelServices],
232364
- lookup: fnUntraced(function* (input) {
232365
- const [provider, model, reasoning] = yield* parseInput(input.split("/"));
232366
- const layer = resolve$1(provider, model, reasoning);
232367
- return merge$6(layer, layerSubagentModel(reasoning === "low" ? layer : resolveSubagent(provider, model, reasoning === "medium" ? "low" : "medium")));
232368
- }, unwrap$3)
232369
- }) {};
232440
+ const layerClankaModel = (input) => unwrap$3(gen(function* () {
232441
+ const [provider, model, reasoning] = yield* parseInput(input.split("/"));
232442
+ const layer = resolve$1(provider, model, reasoning);
232443
+ return merge$6(layer, layerSubagentModel(reasoning === "low" ? layer : resolveSubagent(provider, model, reasoning === "medium" ? "low" : "medium")));
232444
+ }));
232370
232445
  const resolve$1 = (provider, model$3, reasoning) => {
232371
232446
  switch (provider) {
232372
232447
  case "openai": return modelWebSocket(model$3, { reasoning: { effort: reasoning } }).pipe(provide$3(layerWebSocketConstructorWS), provide$3(layerClient$1));
@@ -232458,7 +232533,7 @@ const addOrUpdatePreset = fnUntraced(function* (options) {
232458
232533
  });
232459
232534
  if (cliAgent.id === "clanka") {
232460
232535
  yield* log$1("Verifying Clanka model configuration...");
232461
- yield* generateText({ prompt: "say hello" }).pipe(ignore$1, provide$1(ClankaModels.get(preset.extraArgs.join(" "))));
232536
+ yield* generateText({ prompt: "say hello" }).pipe(ignore$1, provide$1(layerClankaModel(preset.extraArgs.join(" ")), { local: true }), provide$1(ModelServices));
232462
232537
  }
232463
232538
  if (id !== CliAgentPreset.defaultId) preset = yield* (yield* IssueSource).updateCliAgentPreset(preset);
232464
232539
  yield* Settings.set(allCliAgentPresets, some$2(options?.existing ? presets.map((p) => p.id === preset.id ? preset : p) : [...presets, preset]));
@@ -240897,7 +240972,7 @@ const runClanka = fnUntraced(function* (options) {
240897
240972
  }, scoped$1, (effect, options) => provide$1(effect, layerLocal({
240898
240973
  directory: options.directory,
240899
240974
  tools: options.mode === "ralph" ? void 0 : options.mode === "choose" ? TaskChooseTools : TaskTools
240900
- }).pipe(merge$6(ClankaModels.get(options.model)))), provide$1([layerUndici, TaskToolsHandlers]));
240975
+ }).pipe(merge$6(layerClankaModel(options.model))), { local: true }), provide$1([ModelServices, TaskToolsHandlers]));
240901
240976
  //#endregion
240902
240977
  //#region src/domain/CurrentTask.ts
240903
240978
  const CurrentTask = taggedEnum();
@@ -241914,7 +241989,7 @@ const commandEdit = make$58("edit").pipe(withDescription("Open the selected proj
241914
241989
  const commandSource = make$58("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));
241915
241990
  //#endregion
241916
241991
  //#region package.json
241917
- var version = "0.3.90";
241992
+ var version = "0.3.92";
241918
241993
  //#endregion
241919
241994
  //#region src/commands/projects/ls.ts
241920
241995
  const commandProjectsLs = make$58("ls").pipe(withDescription("List configured projects and how they run (enabled state, concurrency, branch, git flow, review agent)."), withHandler(fnUntraced(function* () {
@@ -242060,6 +242135,6 @@ commandRoot.pipe(withSubcommands([
242060
242135
  const logLevel = succeed$4(MinimumLogLevel, "All");
242061
242136
  atomRuntime.addGlobalLayer(logLevel);
242062
242137
  return logLevel;
242063
- }), run$5({ version }), provide$1([ClankaModels.layer, PlatformServices]), provideService$2(CurrentMemoMap, lalphMemoMap), runMain);
242138
+ }), run$5({ version }), provide$1(PlatformServices), provideService$2(CurrentMemoMap, lalphMemoMap), runMain);
242064
242139
  //#endregion
242065
242140
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lalph",
3
3
  "type": "module",
4
- "version": "0.3.90",
4
+ "version": "0.3.92",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -45,7 +45,7 @@
45
45
  "@octokit/plugin-rest-endpoint-methods": "^17.0.0",
46
46
  "@octokit/types": "^16.0.0",
47
47
  "@typescript/native-preview": "7.0.0-dev.20260319.1",
48
- "clanka": "^0.2.18",
48
+ "clanka": "^0.2.19",
49
49
  "concurrently": "^9.2.1",
50
50
  "effect": "https://pkg.pr.new/Effect-TS/effect-smol/effect@89c3e98",
51
51
  "husky": "^9.1.7",
package/src/Clanka.ts CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  Stream,
13
13
  } from "effect"
14
14
  import { TaskChooseTools, TaskTools, TaskToolsHandlers } from "./TaskTools.ts"
15
- import { ClankaModels } from "./ClankaModels.ts"
15
+ import { layerClankaModel, ModelServices } from "./ClankaModels.ts"
16
16
  import { withStallTimeout } from "./shared/stream.ts"
17
17
  import { NodeHttpClient } from "@effect/platform-node"
18
18
  import type { Prompt } from "effect/unstable/ai"
@@ -129,7 +129,8 @@ export const runClanka = Effect.fnUntraced(
129
129
  : options.mode === "choose"
130
130
  ? TaskChooseTools
131
131
  : TaskTools,
132
- }).pipe(Layer.merge(ClankaModels.get(options.model))),
132
+ }).pipe(Layer.merge(layerClankaModel(options.model))),
133
+ { local: true },
133
134
  ),
134
- Effect.provide([NodeHttpClient.layerUndici, TaskToolsHandlers]),
135
+ Effect.provide([ModelServices, TaskToolsHandlers]),
135
136
  )
@@ -1,7 +1,7 @@
1
1
  // oxlint-disable typescript/no-explicit-any
2
2
  import { NodeHttpClient, NodeSocket } from "@effect/platform-node"
3
3
  import { Agent, Codex, Copilot } from "clanka"
4
- import { Effect, flow, Layer, LayerMap, Schema } from "effect"
4
+ import { Effect, flow, Layer, Schema } from "effect"
5
5
  import { layerKvs } from "./Kvs.ts"
6
6
 
7
7
  export const ModelServices = NodeHttpClient.layerUndici.pipe(
@@ -20,11 +20,9 @@ const parseInput = flow(
20
20
  Effect.orDie,
21
21
  )
22
22
 
23
- export class ClankaModels extends LayerMap.Service<ClankaModels>()(
24
- "lalph/ClankaModels",
25
- {
26
- dependencies: [ModelServices],
27
- lookup: Effect.fnUntraced(function* (input: string) {
23
+ export const layerClankaModel = (input: string) =>
24
+ Layer.unwrap(
25
+ Effect.gen(function* () {
28
26
  const [provider, model, reasoning] = yield* parseInput(input.split("/"))
29
27
  const layer = resolve(provider, model, reasoning)
30
28
  return Layer.merge(
@@ -39,9 +37,8 @@ export class ClankaModels extends LayerMap.Service<ClankaModels>()(
39
37
  ),
40
38
  ),
41
39
  )
42
- }, Layer.unwrap),
43
- },
44
- ) {}
40
+ }),
41
+ )
45
42
 
46
43
  const resolve = (
47
44
  provider: "openai" | "copilot",
package/src/Presets.ts CHANGED
@@ -5,7 +5,7 @@ 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"
8
+ import { layerClankaModel, ModelServices } from "./ClankaModels.ts"
9
9
  import { LanguageModel } from "effect/unstable/ai"
10
10
 
11
11
  export const allCliAgentPresets = new Setting(
@@ -131,9 +131,13 @@ export const addOrUpdatePreset = Effect.fnUntraced(function* (options?: {
131
131
 
132
132
  if (cliAgent.id === "clanka") {
133
133
  yield* Effect.log("Verifying Clanka model configuration...")
134
+ // @effect-diagnostics-next-line multipleEffectProvide:off
134
135
  yield* LanguageModel.generateText({ prompt: "say hello" }).pipe(
135
136
  Effect.ignore,
136
- Effect.provide(ClankaModels.get(preset.extraArgs.join(" "))),
137
+ Effect.provide(layerClankaModel(preset.extraArgs.join(" ")), {
138
+ local: true,
139
+ }),
140
+ Effect.provide(ModelServices),
137
141
  )
138
142
  }
139
143
 
package/src/cli.ts CHANGED
@@ -17,7 +17,6 @@ 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"
21
20
 
22
21
  commandRoot.pipe(
23
22
  Command.withSubcommands([
@@ -40,7 +39,7 @@ commandRoot.pipe(
40
39
  Command.run({
41
40
  version: PackageJson.version,
42
41
  }),
43
- Effect.provide([ClankaModels.layer, PlatformServices]),
42
+ Effect.provide(PlatformServices),
44
43
  Effect.provideService(Layer.CurrentMemoMap, lalphMemoMap),
45
44
  NodeRuntime.runMain,
46
45
  )
@@ -58,7 +58,6 @@ import { getDefaultCliAgentPreset } from "../Presets.ts"
58
58
  import type { QuitError } from "effect/Terminal"
59
59
  import type { TimeoutError } from "effect/Cause"
60
60
  import type { ChildProcessSpawner } from "effect/unstable/process"
61
- import { ClankaModels } from "../ClankaModels.ts"
62
61
  import type { AiError } from "effect/unstable/ai/AiError"
63
62
  import type { PrdIssue } from "../domain/PrdIssue.ts"
64
63
  import { CurrentTaskRef } from "../TaskTools.ts"
@@ -103,7 +102,6 @@ const run = Effect.fnUntraced(
103
102
  | PromptGen
104
103
  | Prd
105
104
  | Worktree
106
- | ClankaModels
107
105
  | OutputFormatter.Muxer
108
106
  | Scope.Scope
109
107
  > {
@@ -382,7 +380,6 @@ const runRalph = Effect.fnUntraced(
382
380
  | PromptGen
383
381
  | Prd
384
382
  | Worktree
385
- | ClankaModels
386
383
  | OutputFormatter.Muxer
387
384
  | Scope.Scope
388
385
  > {