lalph 0.3.74 → 0.3.76
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 +77 -73
- package/package.json +3 -3
- package/src/Clanka.ts +39 -41
- package/src/ClankaModels.ts +26 -1
- package/src/commands/root.ts +5 -2
package/dist/cli.mjs
CHANGED
|
@@ -181199,7 +181199,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
|
|
|
181199
181199
|
});
|
|
181200
181200
|
Ze.glob = Ze;
|
|
181201
181201
|
//#endregion
|
|
181202
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
181202
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/ApplyPatch.js
|
|
181203
181203
|
/**
|
|
181204
181204
|
* @since 1.0.0
|
|
181205
181205
|
*/
|
|
@@ -196072,7 +196072,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
196072
196072
|
}
|
|
196073
196073
|
};
|
|
196074
196074
|
//#endregion
|
|
196075
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
196075
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/McpClient.js
|
|
196076
196076
|
/**
|
|
196077
196077
|
* @since 1.0.0
|
|
196078
196078
|
*/
|
|
@@ -196117,7 +196117,7 @@ const layer$13 = effect$1(McpClient, gen(function* () {
|
|
|
196117
196117
|
});
|
|
196118
196118
|
}));
|
|
196119
196119
|
//#endregion
|
|
196120
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
196120
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/ExaSearch.js
|
|
196121
196121
|
/**
|
|
196122
196122
|
* @since 1.0.0
|
|
196123
196123
|
*/
|
|
@@ -211067,7 +211067,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
211067
211067
|
exports.impl = impl;
|
|
211068
211068
|
}));
|
|
211069
211069
|
//#endregion
|
|
211070
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
211070
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/WebToMarkdown.js
|
|
211071
211071
|
/**
|
|
211072
211072
|
* @since 1.0.0
|
|
211073
211073
|
*/
|
|
@@ -214684,7 +214684,7 @@ const mapProviderResults = (inputLength, results) => {
|
|
|
214684
214684
|
return succeed$3(embeddings);
|
|
214685
214685
|
};
|
|
214686
214686
|
//#endregion
|
|
214687
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
214687
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/ChunkRepo.js
|
|
214688
214688
|
/**
|
|
214689
214689
|
* @since 1.0.0
|
|
214690
214690
|
* @category Models
|
|
@@ -214812,7 +214812,7 @@ const layer$10 = effect$1(ChunkRepo, gen(function* () {
|
|
|
214812
214812
|
});
|
|
214813
214813
|
}));
|
|
214814
214814
|
//#endregion
|
|
214815
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
214815
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/CodeChunker.js
|
|
214816
214816
|
/**
|
|
214817
214817
|
* @since 1.0.0
|
|
214818
214818
|
*/
|
|
@@ -215190,7 +215190,7 @@ const run$1 = /* @__PURE__ */ make$25({});
|
|
|
215190
215190
|
*/
|
|
215191
215191
|
const layer$7 = (options) => effectDiscard(run$1(options));
|
|
215192
215192
|
//#endregion
|
|
215193
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215193
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/internal/sqlite-vector.js
|
|
215194
215194
|
/**
|
|
215195
215195
|
* Binary extension for each platform
|
|
215196
215196
|
*/
|
|
@@ -215307,7 +215307,7 @@ function getExtensionPath() {
|
|
|
215307
215307
|
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`);
|
|
215308
215308
|
}
|
|
215309
215309
|
//#endregion
|
|
215310
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215310
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/Sqlite.js
|
|
215311
215311
|
/**
|
|
215312
215312
|
* @since 1.0.0
|
|
215313
215313
|
*/
|
|
@@ -215337,7 +215337,7 @@ const SqliteLayer = (database) => layer$7({ loader: fromRecord({ "0001_create_ch
|
|
|
215337
215337
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
215338
215338
|
}))));
|
|
215339
215339
|
//#endregion
|
|
215340
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215340
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/SemanticSearch.js
|
|
215341
215341
|
/**
|
|
215342
215342
|
* @since 1.0.0
|
|
215343
215343
|
*/
|
|
@@ -215470,7 +215470,7 @@ const maybeRemoveFile = (path) => serviceOption(SemanticSearch).pipe(flatMap$4(m
|
|
|
215470
215470
|
onSome: (service) => service.removeFile(path)
|
|
215471
215471
|
})));
|
|
215472
215472
|
//#endregion
|
|
215473
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215473
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/AgentTools.js
|
|
215474
215474
|
/**
|
|
215475
215475
|
* @since 1.0.0
|
|
215476
215476
|
*/
|
|
@@ -215522,6 +215522,11 @@ const AgentTools = make$14(make$13("readFile", {
|
|
|
215522
215522
|
parameters: String$1.annotate({ identifier: "pattern" }),
|
|
215523
215523
|
success: Array$1(String$1),
|
|
215524
215524
|
dependencies: [CurrentDirectory]
|
|
215525
|
+
}), make$13("gh", {
|
|
215526
|
+
description: "Use the GitHub CLI to run a command - use this instead of the bash tool.",
|
|
215527
|
+
parameters: Array$1(String$1).annotate({ identifier: "args" }),
|
|
215528
|
+
success: String$1,
|
|
215529
|
+
dependencies: [CurrentDirectory]
|
|
215525
215530
|
}), make$13("bash", {
|
|
215526
215531
|
description: "Run a bash command and return the output",
|
|
215527
215532
|
parameters: Struct$2({
|
|
@@ -215553,20 +215558,11 @@ const AgentTools = make$14(make$13("readFile", {
|
|
|
215553
215558
|
to: String$1
|
|
215554
215559
|
}),
|
|
215555
215560
|
dependencies: [CurrentDirectory]
|
|
215556
|
-
}), make$13("mkdir", {
|
|
215557
|
-
description: "Make a directory, creating parent directories if needed.",
|
|
215558
|
-
parameters: String$1.annotate({ identifier: "path" }),
|
|
215559
|
-
dependencies: [CurrentDirectory]
|
|
215560
215561
|
}), make$13("ls", {
|
|
215561
215562
|
description: "List the contents of a directory",
|
|
215562
215563
|
parameters: String$1.annotate({ identifier: "directory" }),
|
|
215563
215564
|
success: Array$1(String$1),
|
|
215564
215565
|
dependencies: [CurrentDirectory]
|
|
215565
|
-
}), make$13("gh", {
|
|
215566
|
-
description: "Use the GitHub CLI to run a command and return the output",
|
|
215567
|
-
parameters: Array$1(String$1).annotate({ identifier: "args" }),
|
|
215568
|
-
success: String$1,
|
|
215569
|
-
dependencies: [CurrentDirectory]
|
|
215570
215566
|
}), make$13("webSearch", {
|
|
215571
215567
|
description: "Search the web for recent information.",
|
|
215572
215568
|
parameters: ExaSearchOptions,
|
|
@@ -215590,7 +215586,7 @@ const AgentTools = make$14(make$13("readFile", {
|
|
|
215590
215586
|
const AgentToolsWithSearch = merge$1(make$14(make$13("search", {
|
|
215591
215587
|
description: "Semantic code search",
|
|
215592
215588
|
parameters: Struct$2({
|
|
215593
|
-
query: String$1,
|
|
215589
|
+
query: String$1.annotate({ documentation: "Describe what you are looking for" }),
|
|
215594
215590
|
limit: optional$3(Finite).annotate({ documentation: "Number of results (defaults to 5, max 10)" })
|
|
215595
215591
|
}),
|
|
215596
215592
|
success: String$1,
|
|
@@ -215648,11 +215644,6 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
|
|
|
215648
215644
|
yield* maybeRemoveFile(pathService.relative(cwd, from));
|
|
215649
215645
|
yield* maybeUpdateFile(pathService.relative(cwd, to));
|
|
215650
215646
|
}, orDie$2),
|
|
215651
|
-
mkdir: fn("AgentTools.mkdir")(function* (path) {
|
|
215652
|
-
yield* logInfo(`Calling "mkdir"`).pipe(annotateLogs({ path }));
|
|
215653
|
-
const cwd = yield* CurrentDirectory;
|
|
215654
|
-
return yield* fs.makeDirectory(pathService.resolve(cwd, path), { recursive: true });
|
|
215655
|
-
}, orDie$2),
|
|
215656
215647
|
ls: fn("AgentTools.ls")(function* (path) {
|
|
215657
215648
|
yield* logInfo(`Calling "ls"`).pipe(annotateLogs({ path }));
|
|
215658
215649
|
const cwd = yield* CurrentDirectory;
|
|
@@ -215833,7 +215824,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$12, laye
|
|
|
215833
215824
|
AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
215834
215825
|
var ApplyPatchError = class extends TaggedClass$2("ApplyPatchError") {};
|
|
215835
215826
|
//#endregion
|
|
215836
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215827
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/TypeBuilder.js
|
|
215837
215828
|
const resolveDocumentation = resolveAt("documentation");
|
|
215838
215829
|
const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
|
|
215839
215830
|
const Precedence = {
|
|
@@ -216106,7 +216097,7 @@ const render = (schema, options) => {
|
|
|
216106
216097
|
return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
|
|
216107
216098
|
};
|
|
216108
216099
|
//#endregion
|
|
216109
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
216100
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/ToolkitRenderer.js
|
|
216110
216101
|
/**
|
|
216111
216102
|
* @since 1.0.0
|
|
216112
216103
|
*/
|
|
@@ -216128,7 +216119,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
|
|
|
216128
216119
|
}) });
|
|
216129
216120
|
};
|
|
216130
216121
|
//#endregion
|
|
216131
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
216122
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/AgentExecutor.js
|
|
216132
216123
|
/**
|
|
216133
216124
|
* @since 1.0.0
|
|
216134
216125
|
*/
|
|
@@ -216173,7 +216164,7 @@ const makeLocal = fnUntraced(function* (options) {
|
|
|
216173
216164
|
const console = yield* makeConsole(output);
|
|
216174
216165
|
const handlerScope = makeUnsafe$13("parallel");
|
|
216175
216166
|
const trackFiber = runIn(handlerScope);
|
|
216176
|
-
const taskServices = mutate$4(empty$16(), flow(add$3(TaskCompleter, opts.onTaskComplete), add$3(CurrentDirectory, options.directory), add$3(SubagentExecutor, opts.onSubagent), add$3(Console$1, console), isSome(search) ? add$3(SemanticSearch, search.value) : identity));
|
|
216167
|
+
const taskServices = mutate$4(empty$16(), flow(add$3(TaskCompleter, opts.onTaskComplete), add$3(CurrentDirectory, options.directory), add$3(SubagentExecutor, opts.onSubagent), add$3(Console$1, console), add$3(CurrentLogAnnotations, {}), isSome(search) ? add$3(SemanticSearch, search.value) : identity));
|
|
216177
216168
|
yield* gen(function* () {
|
|
216178
216169
|
const console = yield* Console$1;
|
|
216179
216170
|
let running = 0;
|
|
@@ -216297,7 +216288,7 @@ var QueueWriteStream = class extends Writable {
|
|
|
216297
216288
|
}
|
|
216298
216289
|
};
|
|
216299
216290
|
//#endregion
|
|
216300
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
216291
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/ScriptExtraction.js
|
|
216301
216292
|
const stripWrappingCodeFence = (script) => {
|
|
216302
216293
|
const lines = script.split(/\r?\n/);
|
|
216303
216294
|
if (lines.length < 2) return script;
|
|
@@ -217830,7 +217821,7 @@ const applySpanTransformer = (transformer, response, options) => {
|
|
|
217830
217821
|
});
|
|
217831
217822
|
};
|
|
217832
217823
|
//#endregion
|
|
217833
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
217824
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/Agent.js
|
|
217834
217825
|
/**
|
|
217835
217826
|
* @since 1.0.0
|
|
217836
217827
|
*/
|
|
@@ -217874,6 +217865,7 @@ ${content}
|
|
|
217874
217865
|
const modelConfig = yield* AgentModelConfig;
|
|
217875
217866
|
let finalSummary = none$4();
|
|
217876
217867
|
const output = yield* make$73();
|
|
217868
|
+
let inputTokens = 0;
|
|
217877
217869
|
let outputTokens = 0;
|
|
217878
217870
|
const prompt = opts.disableHistory ? make$75(empty) : history;
|
|
217879
217871
|
update(prompt, concat(opts.prompt));
|
|
@@ -218035,13 +218027,17 @@ ${content}
|
|
|
218035
218027
|
case "finish":
|
|
218036
218028
|
const usage = part.usage;
|
|
218037
218029
|
if (usage.outputTokens.total !== void 0) outputTokens += usage.outputTokens.total;
|
|
218038
|
-
if (usage.inputTokens.total !== void 0)
|
|
218039
|
-
|
|
218040
|
-
|
|
218041
|
-
|
|
218042
|
-
|
|
218043
|
-
|
|
218044
|
-
|
|
218030
|
+
if (usage.inputTokens.total !== void 0) {
|
|
218031
|
+
inputTokens += usage.inputTokens.total;
|
|
218032
|
+
maybeSend({
|
|
218033
|
+
agentId,
|
|
218034
|
+
part: new Usage({
|
|
218035
|
+
contextTokens: usage.inputTokens.total,
|
|
218036
|
+
inputTokens,
|
|
218037
|
+
outputTokens
|
|
218038
|
+
})
|
|
218039
|
+
});
|
|
218040
|
+
}
|
|
218045
218041
|
break;
|
|
218046
218042
|
}
|
|
218047
218043
|
return void_$2;
|
|
@@ -218113,17 +218109,18 @@ const generateSystemTools = (capabilities) => `**YOU ONLY HAVE ACCESS TO ONE TOO
|
|
|
218113
218109
|
|
|
218114
218110
|
- Use \`console.log\` to print any output you need.
|
|
218115
218111
|
- Top level await is supported.${capabilities.supportsSearch ? `
|
|
218116
|
-
- AVOID USING the "rg" function and instead use "search", unless you are targeting specific files or
|
|
218117
|
-
- AVOID passing scripts into the "bash" function, and instead write javascript.
|
|
218112
|
+
- AVOID USING the "rg" function and instead use "search", unless you are targeting specific files or patterns.` : ""}
|
|
218118
218113
|
- Do as much work as possible in a single script, using \`Promise.all\` to run multiple functions in parallel.
|
|
218119
|
-
-
|
|
218120
|
-
-
|
|
218114
|
+
- AVOID passing scripts into the "bash" function, and instead write javascript.
|
|
218115
|
+
- **Variables are not shared** between executions, so you must include all necessary code in each script you execute.
|
|
218116
|
+
- Use the "delegate" function to assign jobs to another software engineer.
|
|
218117
|
+
- DO NOT use \`require\`, \`import\`, \`process\`, or any other node apis.
|
|
218121
218118
|
|
|
218122
|
-
|
|
218119
|
+
When you have fully completed your task, call the "taskComplete" function with the final output.
|
|
218123
218120
|
DO NOT output the final result without wrapping it with "taskComplete".
|
|
218124
218121
|
Make sure every detail of the task is done before calling "taskComplete".
|
|
218125
218122
|
|
|
218126
|
-
|
|
218123
|
+
You have these functions available to you:
|
|
218127
218124
|
|
|
218128
218125
|
\`\`\`ts
|
|
218129
218126
|
${capabilities.toolsDts}
|
|
@@ -218244,6 +218241,7 @@ var ScriptEnd = class extends TaggedClass()("ScriptEnd", {}) {};
|
|
|
218244
218241
|
* @category Output
|
|
218245
218242
|
*/
|
|
218246
218243
|
var Usage = class extends TaggedClass()("Usage", {
|
|
218244
|
+
contextTokens: Number$1,
|
|
218247
218245
|
inputTokens: Number$1,
|
|
218248
218246
|
outputTokens: Number$1
|
|
218249
218247
|
}) {};
|
|
@@ -218494,7 +218492,7 @@ var Retry = class Retry extends TaggedClass$2("Retry") {
|
|
|
218494
218492
|
}
|
|
218495
218493
|
};
|
|
218496
218494
|
//#endregion
|
|
218497
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
218495
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/Generated.js
|
|
218498
218496
|
/**
|
|
218499
218497
|
* @since 1.0.0
|
|
218500
218498
|
*/ const AdminApiKey = /* @__PURE__ */ Struct$2({
|
|
@@ -226562,7 +226560,7 @@ const OpenAiClientError = (tag, cause, response) => new OpenAiClientErrorImpl({
|
|
|
226562
226560
|
request: response.request
|
|
226563
226561
|
});
|
|
226564
226562
|
//#endregion
|
|
226565
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
226563
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/internal/errors.js
|
|
226566
226564
|
/** @internal */
|
|
226567
226565
|
const OpenAiErrorBody$1 = /* @__PURE__ */ Struct$2({ error: /* @__PURE__ */ Struct$2({
|
|
226568
226566
|
message: String$1,
|
|
@@ -226775,7 +226773,7 @@ const mapStatusCodeToReason$1 = ({ status, headers, message, metadata, http }) =
|
|
|
226775
226773
|
}
|
|
226776
226774
|
};
|
|
226777
226775
|
//#endregion
|
|
226778
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
226776
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/OpenAiConfig.js
|
|
226779
226777
|
/**
|
|
226780
226778
|
* @since 1.0.0
|
|
226781
226779
|
*/
|
|
@@ -226790,7 +226788,7 @@ var OpenAiConfig$1 = class OpenAiConfig$1 extends Service$1()("@effect/ai-openai
|
|
|
226790
226788
|
static getOrUndefined = /* @__PURE__ */ map$9(/* @__PURE__ */ services(), (context) => context.mapUnsafe.get(OpenAiConfig$1.key));
|
|
226791
226789
|
};
|
|
226792
226790
|
//#endregion
|
|
226793
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
226791
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/OpenAiClient.js
|
|
226794
226792
|
/**
|
|
226795
226793
|
* OpenAI Client module for interacting with OpenAI's API.
|
|
226796
226794
|
*
|
|
@@ -226919,11 +226917,9 @@ const makeSocket = /* @__PURE__ */ gen(function* () {
|
|
|
226919
226917
|
module: "OpenAiClient",
|
|
226920
226918
|
method: "createResponseStream",
|
|
226921
226919
|
reason: reasonFromHttpStatus({
|
|
226920
|
+
description: json,
|
|
226922
226921
|
status: event.status,
|
|
226923
|
-
metadata:
|
|
226924
|
-
...event.error,
|
|
226925
|
-
description: json
|
|
226926
|
-
},
|
|
226922
|
+
metadata: event.error,
|
|
226927
226923
|
http: {
|
|
226928
226924
|
body: json,
|
|
226929
226925
|
request: {
|
|
@@ -227009,7 +227005,7 @@ const decodeEvent = /* @__PURE__ */ decodeUnknownSync(/* @__PURE__ */ fromJsonSt
|
|
|
227009
227005
|
*/
|
|
227010
227006
|
const layerWebSocketMode = /* @__PURE__ */ effectServices(makeSocket);
|
|
227011
227007
|
//#endregion
|
|
227012
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
227008
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/OpenAiEmbeddingModel.js
|
|
227013
227009
|
/**
|
|
227014
227010
|
* OpenAI Embedding Model implementation.
|
|
227015
227011
|
*
|
|
@@ -227394,7 +227390,7 @@ const formats = [
|
|
|
227394
227390
|
"uuid"
|
|
227395
227391
|
];
|
|
227396
227392
|
//#endregion
|
|
227397
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
227393
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/internal/utilities.js
|
|
227398
227394
|
const finishReasonMap$1 = {
|
|
227399
227395
|
content_filter: "content-filter",
|
|
227400
227396
|
function_call: "tool-calls",
|
|
@@ -227412,7 +227408,7 @@ const resolveFinishReason$1 = (finishReason, hasToolCalls) => {
|
|
|
227412
227408
|
return reason;
|
|
227413
227409
|
};
|
|
227414
227410
|
//#endregion
|
|
227415
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
227411
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/OpenAiTelemetry.js
|
|
227416
227412
|
/**
|
|
227417
227413
|
* OpenAI telemetry attributes for OpenTelemetry integration.
|
|
227418
227414
|
*
|
|
@@ -227441,7 +227437,7 @@ const addGenAIAnnotations$1 = /* @__PURE__ */ dual(2, (span, options) => {
|
|
|
227441
227437
|
}
|
|
227442
227438
|
});
|
|
227443
227439
|
//#endregion
|
|
227444
|
-
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@
|
|
227440
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+ai-openai@720d238_ef_5260e37a8a271da0467d5e5ba8e26136/node_modules/@effect/ai-openai/dist/OpenAiLanguageModel.js
|
|
227445
227441
|
/**
|
|
227446
227442
|
* OpenAI Language Model implementation.
|
|
227447
227443
|
*
|
|
@@ -229156,7 +229152,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
|
|
|
229156
229152
|
})));
|
|
229157
229153
|
});
|
|
229158
229154
|
//#endregion
|
|
229159
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
229155
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/CodexAuth.js
|
|
229160
229156
|
/**
|
|
229161
229157
|
* @since 1.0.0
|
|
229162
229158
|
*/
|
|
@@ -229376,7 +229372,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
|
|
|
229376
229372
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
|
|
229377
229373
|
};
|
|
229378
229374
|
//#endregion
|
|
229379
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
229375
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/Codex.js
|
|
229380
229376
|
/**
|
|
229381
229377
|
* @since 1.0.0
|
|
229382
229378
|
*/
|
|
@@ -230688,7 +230684,7 @@ const getUsageDetailNumber = (details, field) => {
|
|
|
230688
230684
|
return typeof value === "number" ? value : void 0;
|
|
230689
230685
|
};
|
|
230690
230686
|
//#endregion
|
|
230691
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
230687
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/CopilotAuth.js
|
|
230692
230688
|
/**
|
|
230693
230689
|
* @since 1.0.0
|
|
230694
230690
|
*/
|
|
@@ -230879,7 +230875,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
|
|
|
230879
230875
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
|
|
230880
230876
|
};
|
|
230881
230877
|
//#endregion
|
|
230882
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
230878
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/Copilot.js
|
|
230883
230879
|
/**
|
|
230884
230880
|
* @since 1.0.0
|
|
230885
230881
|
*/
|
|
@@ -231299,7 +231295,7 @@ Object.defineProperties(createChalk.prototype, styles);
|
|
|
231299
231295
|
const chalk = createChalk();
|
|
231300
231296
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
231301
231297
|
//#endregion
|
|
231302
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
231298
|
+
//#region node_modules/.pnpm/clanka@0.2.4_@effect+ai-openai-compat@4.0.0-beta.34_effect@4.0.0-beta.34__@effect+ai-op_c2e94c6996b9991019a87cdbb467f26b/node_modules/clanka/dist/OutputFormatter.js
|
|
231303
231299
|
/**
|
|
231304
231300
|
* @since 1.0.0
|
|
231305
231301
|
*/
|
|
@@ -231333,7 +231329,7 @@ ${output.summary}\n\n`;
|
|
|
231333
231329
|
return `${prefix}${chalkScriptHeading(`${scriptIcon} Script output`)}\n\n${chalk.dim(truncated)}\n\n`;
|
|
231334
231330
|
}
|
|
231335
231331
|
case "ErrorRetry": return `${prefix}${chalk.red(`Error: ${output.error.reason._tag}. Retrying...`)}\n\n${chalk.dim(pretty$1(fail$7(output.error)))}\n\n`;
|
|
231336
|
-
case "Usage": return `${prefix}${chalkInfoHeading(`${infoIcon} Usage:`)} ${numberFormat.format(output.inputTokens)} input / ${numberFormat.format(output.outputTokens)} output\n\n`;
|
|
231332
|
+
case "Usage": return `${prefix}${chalkInfoHeading(`${infoIcon} Usage:`)} ${numberFormat.format(output.contextTokens)} context / ${numberFormat.format(output.inputTokens)} input / ${numberFormat.format(output.outputTokens)} output\n\n`;
|
|
231337
231333
|
}
|
|
231338
231334
|
}), catchTag("AgentFinished", (finished) => succeed$1(`\n${chalk.bold.green(`${doneIcon} Task complete:`)}\n\n${finished.summary}`)));
|
|
231339
231335
|
const promptToString = (prompt) => {
|
|
@@ -231419,13 +231415,20 @@ var ClankaModels = class extends Service()("lalph/ClankaModels", {
|
|
|
231419
231415
|
lookup: fnUntraced(function* (input) {
|
|
231420
231416
|
const [provider, model, reasoning] = yield* parseInput(input.split("/"));
|
|
231421
231417
|
const layer = resolve$1(provider, model, reasoning);
|
|
231422
|
-
return merge$6(layer, layerSubagentModel(reasoning === "low" ? layer :
|
|
231418
|
+
return merge$6(layer, layerSubagentModel(reasoning === "low" ? layer : resolveSubagent(provider, model, reasoning === "medium" ? "low" : "medium")));
|
|
231423
231419
|
}, unwrap$3)
|
|
231424
231420
|
}) {};
|
|
231425
|
-
const resolve$1 = (provider, model$
|
|
231421
|
+
const resolve$1 = (provider, model$3, reasoning) => {
|
|
231422
|
+
switch (provider) {
|
|
231423
|
+
case "openai": return modelWebSocket(model$3, { reasoning: { effort: reasoning } }).pipe(provide$3(layerWebSocketConstructorWS), provide$3(layerClient$1));
|
|
231424
|
+
case "copilot": return model(model$3, { ...reasoningToCopilotConfig(model$3, reasoning) }).pipe(provide$3(layerClient));
|
|
231425
|
+
}
|
|
231426
|
+
};
|
|
231427
|
+
const resolveSubagent = (provider, model$2, reasoning) => {
|
|
231428
|
+
const flooredReasoning = reasoning === "medium" ? "low" : "medium";
|
|
231426
231429
|
switch (provider) {
|
|
231427
|
-
case "openai": return modelWebSocket(
|
|
231428
|
-
case "copilot": return model(model$2, { ...reasoningToCopilotConfig(model$2,
|
|
231430
|
+
case "openai": return modelWebSocket("gpt-5.4-mini", { reasoning: { effort: "high" } }).pipe(provide$3(layerWebSocketConstructorWS), provide$3(layerClient$1));
|
|
231431
|
+
case "copilot": return model(model$2, { ...reasoningToCopilotConfig(model$2, flooredReasoning) }).pipe(provide$3(layerClient));
|
|
231429
231432
|
}
|
|
231430
231433
|
};
|
|
231431
231434
|
const reasoningToCopilotConfig = (model, reasoning) => {
|
|
@@ -239860,14 +239863,15 @@ const ClankaMuxerLayer = effectDiscard(gen(function* () {
|
|
|
239860
239863
|
const stdio = yield* Stdio;
|
|
239861
239864
|
yield* muxer.output.pipe(run$8(stdio.stdout()), forkScoped);
|
|
239862
239865
|
})).pipe(provideMerge(layerMuxer(pretty)));
|
|
239863
|
-
const
|
|
239866
|
+
const SemanticSearchLayer = unwrap$3(gen(function* () {
|
|
239867
|
+
const worktree = yield* Worktree;
|
|
239864
239868
|
const pathService = yield* Path$1;
|
|
239865
239869
|
const apiKey = yield* redacted("LALPH_OPENAI_API_KEY").pipe(option);
|
|
239866
239870
|
if (isNone(apiKey)) return empty$15;
|
|
239867
239871
|
return layer$6({
|
|
239868
|
-
directory,
|
|
239869
|
-
database: pathService.join(directory, ".lalph", "shared", "search.sqlite")
|
|
239870
|
-
}).pipe(orDie$3, provide$3(model$1("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value })), tapCause$1((cause) => logWarning(`Failed to create SemanticSearch layer`, cause)), catchCause$2(() => empty$15));
|
|
239872
|
+
directory: worktree.directory,
|
|
239873
|
+
database: pathService.join(worktree.directory, ".lalph", "shared", "search.sqlite")
|
|
239874
|
+
}).pipe(orDie$3, provide$3(model$1("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value }).pipe(provide$3(layerUndici))), tapCause$1((cause) => logWarning(`Failed to create SemanticSearch layer`, cause)), catchCause$2(() => empty$15));
|
|
239871
239875
|
}).pipe(orDie$2));
|
|
239872
239876
|
const runClanka = fnUntraced(function* (options) {
|
|
239873
239877
|
const muxer = yield* Muxer;
|
|
@@ -239886,7 +239890,7 @@ const runClanka = fnUntraced(function* (options) {
|
|
|
239886
239890
|
}, scoped$1, (effect, options) => provide$1(effect, layerLocal({
|
|
239887
239891
|
directory: options.directory,
|
|
239888
239892
|
tools: options.withChoose ? TaskChooseTools : TaskTools
|
|
239889
|
-
}).pipe(
|
|
239893
|
+
}).pipe(merge$6(ClankaModels.get(options.model)))), provide$1([layerUndici, TaskToolsHandlers]));
|
|
239890
239894
|
//#endregion
|
|
239891
239895
|
//#region src/Agents/worker.ts
|
|
239892
239896
|
const agentWorker = fnUntraced(function* (options) {
|
|
@@ -240300,7 +240304,7 @@ const run = fnUntraced(function* (options) {
|
|
|
240300
240304
|
worktree
|
|
240301
240305
|
});
|
|
240302
240306
|
else yield* prd.maybeRevertIssue({ issueId: taskId });
|
|
240303
|
-
}, scoped$1, provide$1(Prd.layer, { local: true }));
|
|
240307
|
+
}, scoped$1, provide$1(SemanticSearchLayer.pipe(provideMerge(Prd.layer)), { local: true }));
|
|
240304
240308
|
const runProject = fnUntraced(function* (options) {
|
|
240305
240309
|
const isFinite = Number.isFinite(options.iterations);
|
|
240306
240310
|
const iterationsDisplay = isFinite ? options.iterations : "unlimited";
|
|
@@ -240677,7 +240681,7 @@ const commandEdit = make$58("edit").pipe(withDescription("Open the selected proj
|
|
|
240677
240681
|
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));
|
|
240678
240682
|
//#endregion
|
|
240679
240683
|
//#region package.json
|
|
240680
|
-
var version = "0.3.
|
|
240684
|
+
var version = "0.3.76";
|
|
240681
240685
|
//#endregion
|
|
240682
240686
|
//#region src/commands/projects/ls.ts
|
|
240683
240687
|
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* () {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lalph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.76",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@changesets/changelog-github": "^0.6.0",
|
|
36
36
|
"@changesets/cli": "^2.30.0",
|
|
37
|
-
"@effect/ai-openai": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/ai-openai@
|
|
37
|
+
"@effect/ai-openai": "https://pkg.pr.new/Effect-TS/effect-smol/@effect/ai-openai@720d238",
|
|
38
38
|
"@effect/ai-openai-compat": "4.0.0-beta.34",
|
|
39
39
|
"@effect/language-service": "^0.80.0",
|
|
40
40
|
"@effect/platform-node": "4.0.0-beta.34",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@octokit/plugin-rest-endpoint-methods": "^17.0.0",
|
|
43
43
|
"@octokit/types": "^16.0.0",
|
|
44
44
|
"@typescript/native-preview": "7.0.0-dev.20260317.1",
|
|
45
|
-
"clanka": "^0.2.
|
|
45
|
+
"clanka": "^0.2.4",
|
|
46
46
|
"concurrently": "^9.2.1",
|
|
47
47
|
"effect": "4.0.0-beta.34",
|
|
48
48
|
"husky": "^9.1.7",
|
package/src/Clanka.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { withStallTimeout } from "./shared/stream.ts"
|
|
|
15
15
|
import { NodeHttpClient } from "@effect/platform-node"
|
|
16
16
|
import type { Prompt } from "effect/unstable/ai"
|
|
17
17
|
import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai"
|
|
18
|
+
import { Worktree } from "./Worktree.ts"
|
|
18
19
|
|
|
19
20
|
export const ClankaMuxerLayer = Layer.effectDiscard(
|
|
20
21
|
Effect.gen(function* () {
|
|
@@ -24,43 +25,43 @@ export const ClankaMuxerLayer = Layer.effectDiscard(
|
|
|
24
25
|
}),
|
|
25
26
|
).pipe(Layer.provideMerge(OutputFormatter.layerMuxer(OutputFormatter.pretty)))
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
28
|
+
export const SemanticSearchLayer = Layer.unwrap(
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const worktree = yield* Worktree
|
|
31
|
+
const pathService = yield* Path.Path
|
|
32
|
+
const apiKey = yield* Config.redacted("LALPH_OPENAI_API_KEY").pipe(
|
|
33
|
+
Config.option,
|
|
34
|
+
)
|
|
35
|
+
if (Option.isNone(apiKey)) {
|
|
36
|
+
return Layer.empty
|
|
37
|
+
}
|
|
38
|
+
return SemanticSearch.layer({
|
|
39
|
+
directory: worktree.directory,
|
|
40
|
+
database: pathService.join(
|
|
41
|
+
worktree.directory,
|
|
42
|
+
".lalph",
|
|
43
|
+
"shared",
|
|
44
|
+
"search.sqlite",
|
|
45
|
+
),
|
|
46
|
+
}).pipe(
|
|
47
|
+
Layer.orDie,
|
|
48
|
+
Layer.provide(
|
|
49
|
+
OpenAiEmbeddingModel.model("text-embedding-3-small", {
|
|
50
|
+
dimensions: 1536,
|
|
51
|
+
}),
|
|
52
|
+
),
|
|
53
|
+
Layer.provide(
|
|
54
|
+
OpenAiClient.layer({
|
|
55
|
+
apiKey: apiKey.value,
|
|
56
|
+
}).pipe(Layer.provide(NodeHttpClient.layerUndici)),
|
|
57
|
+
),
|
|
58
|
+
Layer.tapCause((cause) =>
|
|
59
|
+
Effect.logWarning(`Failed to create SemanticSearch layer`, cause),
|
|
60
|
+
),
|
|
61
|
+
Layer.catchCause(() => Layer.empty),
|
|
62
|
+
)
|
|
63
|
+
}).pipe(Effect.orDie),
|
|
64
|
+
)
|
|
64
65
|
|
|
65
66
|
export const runClanka = Effect.fnUntraced(
|
|
66
67
|
function* (options: {
|
|
@@ -112,10 +113,7 @@ export const runClanka = Effect.fnUntraced(
|
|
|
112
113
|
Agent.layerLocal({
|
|
113
114
|
directory: options.directory,
|
|
114
115
|
tools: options.withChoose ? TaskChooseTools : TaskTools,
|
|
115
|
-
}).pipe(
|
|
116
|
-
Layer.provide(Search(options.directory)),
|
|
117
|
-
Layer.merge(ClankaModels.get(options.model)),
|
|
118
|
-
),
|
|
116
|
+
}).pipe(Layer.merge(ClankaModels.get(options.model))),
|
|
119
117
|
),
|
|
120
118
|
Effect.provide([NodeHttpClient.layerUndici, TaskToolsHandlers]),
|
|
121
119
|
)
|
package/src/ClankaModels.ts
CHANGED
|
@@ -32,7 +32,7 @@ export class ClankaModels extends LayerMap.Service<ClankaModels>()(
|
|
|
32
32
|
Agent.layerSubagentModel(
|
|
33
33
|
reasoning === "low"
|
|
34
34
|
? layer
|
|
35
|
-
:
|
|
35
|
+
: resolveSubagent(
|
|
36
36
|
provider,
|
|
37
37
|
model,
|
|
38
38
|
reasoning === "medium" ? "low" : "medium",
|
|
@@ -67,6 +67,31 @@ const resolve = (
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
const resolveSubagent = (
|
|
71
|
+
provider: "openai" | "copilot",
|
|
72
|
+
model: string,
|
|
73
|
+
reasoning: typeof Reasoning.Type,
|
|
74
|
+
) => {
|
|
75
|
+
const flooredReasoning = reasoning === "medium" ? "low" : "medium"
|
|
76
|
+
switch (provider) {
|
|
77
|
+
case "openai": {
|
|
78
|
+
return Codex.modelWebSocket("gpt-5.4-mini", {
|
|
79
|
+
reasoning: {
|
|
80
|
+
effort: "high",
|
|
81
|
+
},
|
|
82
|
+
}).pipe(
|
|
83
|
+
Layer.provide(NodeSocket.layerWebSocketConstructorWS),
|
|
84
|
+
Layer.provide(Codex.layerClient),
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
case "copilot": {
|
|
88
|
+
return Copilot.model(model, {
|
|
89
|
+
...reasoningToCopilotConfig(model, flooredReasoning),
|
|
90
|
+
}).pipe(Layer.provide(Copilot.layerClient))
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
70
95
|
const reasoningToCopilotConfig = (
|
|
71
96
|
model: string,
|
|
72
97
|
reasoning: typeof Reasoning.Type,
|
package/src/commands/root.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
FiberSet,
|
|
7
7
|
FileSystem,
|
|
8
8
|
Iterable,
|
|
9
|
+
Layer,
|
|
9
10
|
MutableRef,
|
|
10
11
|
Option,
|
|
11
12
|
Path,
|
|
@@ -54,7 +55,7 @@ import type { AiError } from "effect/unstable/ai/AiError"
|
|
|
54
55
|
import type { PrdIssue } from "../domain/PrdIssue.ts"
|
|
55
56
|
import { CurrentTaskRef } from "../TaskTools.ts"
|
|
56
57
|
import type { OutputFormatter } from "clanka"
|
|
57
|
-
import { ClankaMuxerLayer } from "../Clanka.ts"
|
|
58
|
+
import { ClankaMuxerLayer, SemanticSearchLayer } from "../Clanka.ts"
|
|
58
59
|
import { agentResearcher } from "../Agents/researcher.ts"
|
|
59
60
|
|
|
60
61
|
// Main iteration run logic
|
|
@@ -330,7 +331,9 @@ const run = Effect.fnUntraced(
|
|
|
330
331
|
}
|
|
331
332
|
},
|
|
332
333
|
Effect.scoped,
|
|
333
|
-
Effect.provide(Prd.layer, {
|
|
334
|
+
Effect.provide(SemanticSearchLayer.pipe(Layer.provideMerge(Prd.layer)), {
|
|
335
|
+
local: true,
|
|
336
|
+
}),
|
|
334
337
|
)
|
|
335
338
|
|
|
336
339
|
const runProject = Effect.fnUntraced(
|