lalph 0.3.88 → 0.3.90
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 +226 -130
- package/package.json +2 -2
- package/src/Agents/reviewer.ts +14 -3
- package/src/Agents/timeout.ts +30 -40
- package/src/Agents/worker.ts +14 -5
- package/src/Clanka.ts +11 -0
- package/src/commands/root.ts +133 -54
- package/src/domain/CurrentTask.ts +14 -0
package/dist/cli.mjs
CHANGED
|
@@ -12350,6 +12350,22 @@ const done = done$2;
|
|
|
12350
12350
|
*/
|
|
12351
12351
|
const isTimeoutError = isTimeoutError$1;
|
|
12352
12352
|
/**
|
|
12353
|
+
* Constructs a {@link TimeoutError} with an optional message.
|
|
12354
|
+
*
|
|
12355
|
+
* **Example** (creating a TimeoutError)
|
|
12356
|
+
*
|
|
12357
|
+
* ```ts
|
|
12358
|
+
* import { Cause } from "effect"
|
|
12359
|
+
*
|
|
12360
|
+
* const error = new Cause.TimeoutError("Operation timed out")
|
|
12361
|
+
* console.log(error.message) // "Operation timed out"
|
|
12362
|
+
* ```
|
|
12363
|
+
*
|
|
12364
|
+
* @category constructors
|
|
12365
|
+
* @since 4.0.0
|
|
12366
|
+
*/
|
|
12367
|
+
const TimeoutError = TimeoutError$1;
|
|
12368
|
+
/**
|
|
12353
12369
|
* Constructs an {@link IllegalArgumentError} with an optional message.
|
|
12354
12370
|
*
|
|
12355
12371
|
* **Example** (creating an IllegalArgumentError)
|
|
@@ -181580,7 +181596,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
|
|
|
181580
181596
|
});
|
|
181581
181597
|
Ze.glob = Ze;
|
|
181582
181598
|
//#endregion
|
|
181583
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
181584
181600
|
/**
|
|
181585
181601
|
* @since 1.0.0
|
|
181586
181602
|
*/
|
|
@@ -196453,7 +196469,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
196453
196469
|
}
|
|
196454
196470
|
};
|
|
196455
196471
|
//#endregion
|
|
196456
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
196457
196473
|
/**
|
|
196458
196474
|
* @since 1.0.0
|
|
196459
196475
|
*/
|
|
@@ -196498,7 +196514,7 @@ const layer$13 = effect$1(McpClient, gen(function* () {
|
|
|
196498
196514
|
});
|
|
196499
196515
|
}));
|
|
196500
196516
|
//#endregion
|
|
196501
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
196502
196518
|
/**
|
|
196503
196519
|
* @since 1.0.0
|
|
196504
196520
|
*/
|
|
@@ -211448,7 +211464,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
211448
211464
|
exports.impl = impl;
|
|
211449
211465
|
}));
|
|
211450
211466
|
//#endregion
|
|
211451
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
211452
211468
|
/**
|
|
211453
211469
|
* @since 1.0.0
|
|
211454
211470
|
*/
|
|
@@ -215066,7 +215082,7 @@ const mapProviderResults = (inputLength, results) => {
|
|
|
215066
215082
|
return succeed$3(embeddings);
|
|
215067
215083
|
};
|
|
215068
215084
|
//#endregion
|
|
215069
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
215070
215086
|
/**
|
|
215071
215087
|
* @since 1.0.0
|
|
215072
215088
|
* @category Models
|
|
@@ -215197,7 +215213,7 @@ const layer$10 = effect$1(ChunkRepo, gen(function* () {
|
|
|
215197
215213
|
});
|
|
215198
215214
|
}));
|
|
215199
215215
|
//#endregion
|
|
215200
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
215201
215217
|
/**
|
|
215202
215218
|
* @since 1.0.0
|
|
215203
215219
|
*/
|
|
@@ -215790,7 +215806,7 @@ const run$1 = /* @__PURE__ */ make$25({});
|
|
|
215790
215806
|
*/
|
|
215791
215807
|
const layer$7 = (options) => effectDiscard(run$1(options));
|
|
215792
215808
|
//#endregion
|
|
215793
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
215794
215810
|
/**
|
|
215795
215811
|
* Binary extension for each platform
|
|
215796
215812
|
*/
|
|
@@ -215907,7 +215923,7 @@ function getExtensionPath() {
|
|
|
215907
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`);
|
|
215908
215924
|
}
|
|
215909
215925
|
//#endregion
|
|
215910
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
215911
215927
|
/**
|
|
215912
215928
|
* @since 1.0.0
|
|
215913
215929
|
*/
|
|
@@ -215935,7 +215951,7 @@ const SqliteLayer = (database) => layer$7({ loader: fromRecord({ "0001_create_ch
|
|
|
215935
215951
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
215936
215952
|
}))));
|
|
215937
215953
|
//#endregion
|
|
215938
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
215939
215955
|
/**
|
|
215940
215956
|
* @since 1.0.0
|
|
215941
215957
|
*/
|
|
@@ -216077,7 +216093,7 @@ const maybeRemoveFile = (path) => serviceOption(SemanticSearch).pipe(flatMap$4(m
|
|
|
216077
216093
|
onSome: (service) => service.removeFile(path)
|
|
216078
216094
|
})));
|
|
216079
216095
|
//#endregion
|
|
216080
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
216081
216097
|
/**
|
|
216082
216098
|
* @since 1.0.0
|
|
216083
216099
|
*/
|
|
@@ -216428,7 +216444,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$12, laye
|
|
|
216428
216444
|
AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
216429
216445
|
var ApplyPatchError = class extends TaggedClass$2("ApplyPatchError") {};
|
|
216430
216446
|
//#endregion
|
|
216431
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
216432
216448
|
const resolveDocumentation = resolveAt("documentation");
|
|
216433
216449
|
const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
|
|
216434
216450
|
const Precedence = {
|
|
@@ -216701,7 +216717,7 @@ const render = (schema, options) => {
|
|
|
216701
216717
|
return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
|
|
216702
216718
|
};
|
|
216703
216719
|
//#endregion
|
|
216704
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
216705
216721
|
/**
|
|
216706
216722
|
* @since 1.0.0
|
|
216707
216723
|
*/
|
|
@@ -216723,7 +216739,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
|
|
|
216723
216739
|
}) });
|
|
216724
216740
|
};
|
|
216725
216741
|
//#endregion
|
|
216726
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
216727
216743
|
const isIdentifierChar = (char) => char !== void 0 && /[A-Za-z0-9_$]/.test(char);
|
|
216728
216744
|
const isIdentifierStartChar = (char) => char !== void 0 && /[A-Za-z_$]/.test(char);
|
|
216729
216745
|
const hasIdentifierBoundary = (text, index, length) => !isIdentifierChar(text[index - 1]) && !isIdentifierChar(text[index + length]);
|
|
@@ -216769,11 +216785,16 @@ const needsTemplateEscaping = (text) => {
|
|
|
216769
216785
|
const normalizePatchEscapedQuotes = (text) => text.includes("*** Begin Patch") ? text.replace(/\\"([A-Za-z0-9_$.-]+)\\"/g, "\"$1\"") : text;
|
|
216770
216786
|
const escapeTemplateLiteralContent = (text) => {
|
|
216771
216787
|
const normalized = normalizePatchEscapedQuotes(text);
|
|
216788
|
+
const isPatchContent = normalized.includes("*** Begin Patch");
|
|
216772
216789
|
if (!needsTemplateEscaping(normalized)) return normalized;
|
|
216773
216790
|
let out = "";
|
|
216774
216791
|
for (let i = 0; i < normalized.length; i++) {
|
|
216775
216792
|
const char = normalized[i];
|
|
216776
216793
|
if (char === "\\") {
|
|
216794
|
+
if (!isPatchContent && (normalized[i + 1] === "`" || normalized[i + 1] === "$" && normalized[i + 2] === "{")) {
|
|
216795
|
+
out += "\\";
|
|
216796
|
+
continue;
|
|
216797
|
+
}
|
|
216777
216798
|
out += "\\\\";
|
|
216778
216799
|
continue;
|
|
216779
216800
|
}
|
|
@@ -216860,47 +216881,25 @@ const fixCallTemplateArgument = (script, functionName) => {
|
|
|
216860
216881
|
}
|
|
216861
216882
|
return out;
|
|
216862
216883
|
};
|
|
216863
|
-
const
|
|
216864
|
-
const out = /* @__PURE__ */ new Set();
|
|
216865
|
-
let cursor = 0;
|
|
216866
|
-
while (cursor < script.length) {
|
|
216867
|
-
const callStart = findNextIdentifier(script, functionName, cursor);
|
|
216868
|
-
if (callStart === -1) break;
|
|
216869
|
-
const openParen = skipWhitespace(script, callStart + functionName.length);
|
|
216870
|
-
if (script[openParen] !== "(") {
|
|
216871
|
-
cursor = callStart + functionName.length;
|
|
216872
|
-
continue;
|
|
216873
|
-
}
|
|
216874
|
-
const identifier = parseIdentifier(script, skipWhitespace(script, openParen + 1));
|
|
216875
|
-
if (identifier === void 0) {
|
|
216876
|
-
cursor = openParen + 1;
|
|
216877
|
-
continue;
|
|
216878
|
-
}
|
|
216879
|
-
const argumentEnd = skipWhitespace(script, identifier.end);
|
|
216880
|
-
if (script[argumentEnd] === ")" || script[argumentEnd] === ",") out.add(identifier.name);
|
|
216881
|
-
cursor = identifier.end;
|
|
216882
|
-
}
|
|
216883
|
-
return out;
|
|
216884
|
-
};
|
|
216885
|
-
const fixWriteFileContentTemplates = (script) => {
|
|
216884
|
+
const fixCallObjectPropertyTemplate = (script, functionName, propertyName) => {
|
|
216886
216885
|
let out = script;
|
|
216887
216886
|
let cursor = 0;
|
|
216888
216887
|
while (cursor < out.length) {
|
|
216889
|
-
const callStart = findNextIdentifier(out,
|
|
216888
|
+
const callStart = findNextIdentifier(out, functionName, cursor);
|
|
216890
216889
|
if (callStart === -1) break;
|
|
216891
|
-
const openParen = skipWhitespace(out, callStart +
|
|
216890
|
+
const openParen = skipWhitespace(out, callStart + functionName.length);
|
|
216892
216891
|
if (out[openParen] !== "(") {
|
|
216893
|
-
cursor = callStart +
|
|
216892
|
+
cursor = callStart + functionName.length;
|
|
216894
216893
|
continue;
|
|
216895
216894
|
}
|
|
216896
|
-
const
|
|
216897
|
-
if (
|
|
216895
|
+
const propertyKey = findNextIdentifier(out, propertyName, openParen + 1);
|
|
216896
|
+
if (propertyKey === -1) {
|
|
216898
216897
|
cursor = openParen + 1;
|
|
216899
216898
|
continue;
|
|
216900
216899
|
}
|
|
216901
|
-
const colon = skipWhitespace(out,
|
|
216900
|
+
const colon = skipWhitespace(out, propertyKey + propertyName.length);
|
|
216902
216901
|
if (out[colon] !== ":") {
|
|
216903
|
-
cursor =
|
|
216902
|
+
cursor = propertyKey + propertyName.length;
|
|
216904
216903
|
continue;
|
|
216905
216904
|
}
|
|
216906
216905
|
const templateStart = skipWhitespace(out, colon + 1);
|
|
@@ -216924,25 +216923,47 @@ const fixWriteFileContentTemplates = (script) => {
|
|
|
216924
216923
|
}
|
|
216925
216924
|
return out;
|
|
216926
216925
|
};
|
|
216927
|
-
const
|
|
216926
|
+
const collectCallArgumentIdentifiers = (script, functionName) => {
|
|
216927
|
+
const out = /* @__PURE__ */ new Set();
|
|
216928
|
+
let cursor = 0;
|
|
216929
|
+
while (cursor < script.length) {
|
|
216930
|
+
const callStart = findNextIdentifier(script, functionName, cursor);
|
|
216931
|
+
if (callStart === -1) break;
|
|
216932
|
+
const openParen = skipWhitespace(script, callStart + functionName.length);
|
|
216933
|
+
if (script[openParen] !== "(") {
|
|
216934
|
+
cursor = callStart + functionName.length;
|
|
216935
|
+
continue;
|
|
216936
|
+
}
|
|
216937
|
+
const identifier = parseIdentifier(script, skipWhitespace(script, openParen + 1));
|
|
216938
|
+
if (identifier === void 0) {
|
|
216939
|
+
cursor = openParen + 1;
|
|
216940
|
+
continue;
|
|
216941
|
+
}
|
|
216942
|
+
const argumentEnd = skipWhitespace(script, identifier.end);
|
|
216943
|
+
if (script[argumentEnd] === ")" || script[argumentEnd] === ",") out.add(identifier.name);
|
|
216944
|
+
cursor = identifier.end;
|
|
216945
|
+
}
|
|
216946
|
+
return out;
|
|
216947
|
+
};
|
|
216948
|
+
const collectCallObjectPropertyIdentifiers = (script, functionName, propertyName) => {
|
|
216928
216949
|
const out = /* @__PURE__ */ new Set();
|
|
216929
216950
|
let cursor = 0;
|
|
216930
216951
|
while (cursor < script.length) {
|
|
216931
|
-
const callStart = findNextIdentifier(script,
|
|
216952
|
+
const callStart = findNextIdentifier(script, functionName, cursor);
|
|
216932
216953
|
if (callStart === -1) break;
|
|
216933
|
-
const openParen = skipWhitespace(script, callStart +
|
|
216954
|
+
const openParen = skipWhitespace(script, callStart + functionName.length);
|
|
216934
216955
|
if (script[openParen] !== "(") {
|
|
216935
|
-
cursor = callStart +
|
|
216956
|
+
cursor = callStart + functionName.length;
|
|
216936
216957
|
continue;
|
|
216937
216958
|
}
|
|
216938
|
-
const
|
|
216939
|
-
if (
|
|
216959
|
+
const propertyKey = findNextIdentifier(script, propertyName, openParen + 1);
|
|
216960
|
+
if (propertyKey === -1) {
|
|
216940
216961
|
cursor = openParen + 1;
|
|
216941
216962
|
continue;
|
|
216942
216963
|
}
|
|
216943
|
-
const
|
|
216944
|
-
if (script[
|
|
216945
|
-
const valueStart = skipWhitespace(script,
|
|
216964
|
+
const afterProperty = skipWhitespace(script, propertyKey + propertyName.length);
|
|
216965
|
+
if (script[afterProperty] === ":") {
|
|
216966
|
+
const valueStart = skipWhitespace(script, afterProperty + 1);
|
|
216946
216967
|
const identifier = parseIdentifier(script, valueStart);
|
|
216947
216968
|
if (identifier !== void 0) {
|
|
216948
216969
|
const valueEnd = skipWhitespace(script, identifier.end);
|
|
@@ -216951,15 +216972,17 @@ const collectWriteFileContentIdentifiers = (script) => {
|
|
|
216951
216972
|
cursor = valueStart + 1;
|
|
216952
216973
|
continue;
|
|
216953
216974
|
}
|
|
216954
|
-
if (script[
|
|
216955
|
-
out.add(
|
|
216956
|
-
cursor =
|
|
216975
|
+
if (script[afterProperty] === "}" || script[afterProperty] === ",") {
|
|
216976
|
+
out.add(propertyName);
|
|
216977
|
+
cursor = afterProperty + 1;
|
|
216957
216978
|
continue;
|
|
216958
216979
|
}
|
|
216959
|
-
cursor =
|
|
216980
|
+
cursor = afterProperty + 1;
|
|
216960
216981
|
}
|
|
216961
216982
|
return out;
|
|
216962
216983
|
};
|
|
216984
|
+
const callObjectPropertyTargets = [["writeFile", "content"], ["updateTask", "description"]];
|
|
216985
|
+
const fixTargetCallObjectPropertyTemplates = (script) => callObjectPropertyTargets.reduce((current, [functionName, propertyName]) => fixCallObjectPropertyTemplate(current, functionName, propertyName), script);
|
|
216963
216986
|
const fixAssignedTemplate = (script, variableName) => {
|
|
216964
216987
|
let out = script;
|
|
216965
216988
|
let cursor = 0;
|
|
@@ -217002,15 +217025,15 @@ const fixAssignedTemplate = (script, variableName) => {
|
|
|
217002
217025
|
const fixAssignedTemplatesForToolCalls = (script) => {
|
|
217003
217026
|
const identifiers = /* @__PURE__ */ new Set();
|
|
217004
217027
|
for (const functionName of ["applyPatch", "taskComplete"]) for (const identifier of collectCallArgumentIdentifiers(script, functionName)) identifiers.add(identifier);
|
|
217005
|
-
for (const identifier of
|
|
217028
|
+
for (const [functionName, propertyName] of callObjectPropertyTargets) for (const identifier of collectCallObjectPropertyIdentifiers(script, functionName, propertyName)) identifiers.add(identifier);
|
|
217006
217029
|
if (script.includes("*** Begin Patch")) identifiers.add("patch");
|
|
217007
217030
|
let out = script;
|
|
217008
217031
|
for (const identifier of identifiers) out = fixAssignedTemplate(out, identifier);
|
|
217009
217032
|
return out;
|
|
217010
217033
|
};
|
|
217011
|
-
const preprocessScript = (script) => fixAssignedTemplatesForToolCalls(["applyPatch", "taskComplete"].reduce((current, functionName) => fixCallTemplateArgument(current, functionName),
|
|
217034
|
+
const preprocessScript = (script) => fixAssignedTemplatesForToolCalls(["applyPatch", "taskComplete"].reduce((current, functionName) => fixCallTemplateArgument(current, functionName), fixTargetCallObjectPropertyTemplates(script)));
|
|
217012
217035
|
//#endregion
|
|
217013
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
217014
217037
|
/**
|
|
217015
217038
|
* @since 1.0.0
|
|
217016
217039
|
*/
|
|
@@ -217195,7 +217218,7 @@ var QueueWriteStream = class extends Writable {
|
|
|
217195
217218
|
}
|
|
217196
217219
|
};
|
|
217197
217220
|
//#endregion
|
|
217198
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
217199
217222
|
const stripWrappingCodeFence = (script) => {
|
|
217200
217223
|
const lines = script.split(/\r?\n/);
|
|
217201
217224
|
if (lines.length < 2) return script;
|
|
@@ -218744,7 +218767,7 @@ const applySpanTransformer = (transformer, response, options) => {
|
|
|
218744
218767
|
});
|
|
218745
218768
|
};
|
|
218746
218769
|
//#endregion
|
|
218747
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
218748
218771
|
/**
|
|
218749
218772
|
* @since 1.0.0
|
|
218750
218773
|
*/
|
|
@@ -230074,7 +230097,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
|
|
|
230074
230097
|
})));
|
|
230075
230098
|
});
|
|
230076
230099
|
//#endregion
|
|
230077
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
230078
230101
|
/**
|
|
230079
230102
|
* @since 1.0.0
|
|
230080
230103
|
*/
|
|
@@ -230294,7 +230317,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
|
|
|
230294
230317
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
|
|
230295
230318
|
};
|
|
230296
230319
|
//#endregion
|
|
230297
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
230298
230321
|
/**
|
|
230299
230322
|
* @since 1.0.0
|
|
230300
230323
|
*/
|
|
@@ -231606,7 +231629,7 @@ const getUsageDetailNumber = (details, field) => {
|
|
|
231606
231629
|
return typeof value === "number" ? value : void 0;
|
|
231607
231630
|
};
|
|
231608
231631
|
//#endregion
|
|
231609
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
231610
231633
|
/**
|
|
231611
231634
|
* @since 1.0.0
|
|
231612
231635
|
*/
|
|
@@ -231797,7 +231820,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
|
|
|
231797
231820
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
|
|
231798
231821
|
};
|
|
231799
231822
|
//#endregion
|
|
231800
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
231801
231824
|
/**
|
|
231802
231825
|
* @since 1.0.0
|
|
231803
231826
|
*/
|
|
@@ -232217,7 +232240,7 @@ Object.defineProperties(createChalk.prototype, styles);
|
|
|
232217
232240
|
const chalk = createChalk();
|
|
232218
232241
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
232219
232242
|
//#endregion
|
|
232220
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
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
|
|
232221
232244
|
/**
|
|
232222
232245
|
* @since 1.0.0
|
|
232223
232246
|
*/
|
|
@@ -240866,16 +240889,27 @@ const runClanka = fnUntraced(function* (options) {
|
|
|
240866
240889
|
yield* log$1(`Received steer message: ${message}`);
|
|
240867
240890
|
yield* agent.steer(message);
|
|
240868
240891
|
}, fromEffectDrain)), runDrain, forkScoped);
|
|
240869
|
-
return yield* stream.pipe(
|
|
240892
|
+
return yield* stream.pipe(options.maxContext ? tap((part) => {
|
|
240893
|
+
if (part._tag !== "Usage") return void_$2;
|
|
240894
|
+
if (part.contextTokens <= options.maxContext) return void_$2;
|
|
240895
|
+
return fail$6(new TimeoutError("Max context reached"));
|
|
240896
|
+
}) : identity, runDrain, as$1(""), catchTag$1("AgentFinished", (e) => succeed$3(e.summary)));
|
|
240870
240897
|
}, scoped$1, (effect, options) => provide$1(effect, layerLocal({
|
|
240871
240898
|
directory: options.directory,
|
|
240872
240899
|
tools: options.mode === "ralph" ? void 0 : options.mode === "choose" ? TaskChooseTools : TaskTools
|
|
240873
240900
|
}).pipe(merge$6(ClankaModels.get(options.model)))), provide$1([layerUndici, TaskToolsHandlers]));
|
|
240874
240901
|
//#endregion
|
|
240902
|
+
//#region src/domain/CurrentTask.ts
|
|
240903
|
+
const CurrentTask = taggedEnum();
|
|
240904
|
+
//#endregion
|
|
240875
240905
|
//#region src/Agents/worker.ts
|
|
240876
240906
|
const agentWorker = fnUntraced(function* (options) {
|
|
240877
240907
|
const pathService = yield* Path$1;
|
|
240878
240908
|
const worktree = yield* Worktree;
|
|
240909
|
+
const prdFilePath = CurrentTask.$match(options.currentTask, {
|
|
240910
|
+
task: () => pathService.join(".lalph", "prd.yml"),
|
|
240911
|
+
ralph: () => void 0
|
|
240912
|
+
});
|
|
240879
240913
|
if (!options.preset.cliAgent.command) {
|
|
240880
240914
|
yield* runClanka({
|
|
240881
240915
|
directory: worktree.directory,
|
|
@@ -240895,14 +240929,18 @@ ${research}`
|
|
|
240895
240929
|
}])
|
|
240896
240930
|
}),
|
|
240897
240931
|
stallTimeout: options.stallTimeout,
|
|
240932
|
+
maxContext: options.maxContext,
|
|
240898
240933
|
steer: options.steer,
|
|
240899
|
-
mode: options.
|
|
240934
|
+
mode: CurrentTask.$match(options.currentTask, {
|
|
240935
|
+
task: () => "default",
|
|
240936
|
+
ralph: () => "ralph"
|
|
240937
|
+
})
|
|
240900
240938
|
});
|
|
240901
240939
|
return ExitCode(0);
|
|
240902
240940
|
}
|
|
240903
240941
|
return yield* pipe$1(options.preset.cliAgent.command({
|
|
240904
240942
|
prompt: options.prompt,
|
|
240905
|
-
prdFilePath
|
|
240943
|
+
prdFilePath,
|
|
240906
240944
|
extraArgs: options.preset.extraArgs
|
|
240907
240945
|
}), setCwd(worktree.directory), options.preset.withCommandPrefix).pipe(worktree.execWithStallTimeout({
|
|
240908
240946
|
cliAgent: options.preset.cliAgent,
|
|
@@ -241092,12 +241130,20 @@ const agentReviewer = fnUntraced(function* (options) {
|
|
|
241092
241130
|
const worktree = yield* Worktree;
|
|
241093
241131
|
const promptGen = yield* PromptGen;
|
|
241094
241132
|
const gitFlow = yield* GitFlow;
|
|
241133
|
+
const mode = CurrentTask.$match(options.currentTask, {
|
|
241134
|
+
task: () => "default",
|
|
241135
|
+
ralph: () => "ralph"
|
|
241136
|
+
});
|
|
241137
|
+
const system = CurrentTask.$match(options.currentTask, {
|
|
241138
|
+
task: () => promptGen.systemClanka(options),
|
|
241139
|
+
ralph: () => void 0
|
|
241140
|
+
});
|
|
241095
241141
|
const customInstructions = yield* pipe$1(fs.readFileString(pathService.join(worktree.directory, "LALPH_REVIEW.md")), option$1);
|
|
241096
241142
|
if (!options.preset.cliAgent.command) {
|
|
241097
241143
|
yield* runClanka({
|
|
241098
241144
|
directory: worktree.directory,
|
|
241099
241145
|
model: options.preset.extraArgs.join(" "),
|
|
241100
|
-
system
|
|
241146
|
+
system,
|
|
241101
241147
|
prompt: match$10(customInstructions, {
|
|
241102
241148
|
onNone: () => promptGen.promptReview({
|
|
241103
241149
|
prompt: options.instructions,
|
|
@@ -241110,7 +241156,7 @@ const agentReviewer = fnUntraced(function* (options) {
|
|
|
241110
241156
|
})
|
|
241111
241157
|
}),
|
|
241112
241158
|
stallTimeout: options.stallTimeout,
|
|
241113
|
-
mode
|
|
241159
|
+
mode
|
|
241114
241160
|
});
|
|
241115
241161
|
return ExitCode(0);
|
|
241116
241162
|
}
|
|
@@ -241139,32 +241185,48 @@ const agentTimeout = fnUntraced(function* (options) {
|
|
|
241139
241185
|
const pathService = yield* Path$1;
|
|
241140
241186
|
const worktree = yield* Worktree;
|
|
241141
241187
|
const promptGen = yield* PromptGen;
|
|
241188
|
+
const timeoutMode = CurrentTask.$match(options.currentTask, {
|
|
241189
|
+
task: ({ task }) => ({
|
|
241190
|
+
mode: "default",
|
|
241191
|
+
system: promptGen.systemClanka(options),
|
|
241192
|
+
clankaPrompt: promptGen.promptTimeoutClanka({
|
|
241193
|
+
taskId: task.id,
|
|
241194
|
+
specsDirectory: options.specsDirectory
|
|
241195
|
+
}),
|
|
241196
|
+
cliPrompt: promptGen.promptTimeout({
|
|
241197
|
+
taskId: task.id,
|
|
241198
|
+
specsDirectory: options.specsDirectory
|
|
241199
|
+
}),
|
|
241200
|
+
prdFilePath: pathService.join(".lalph", "prd.yml")
|
|
241201
|
+
}),
|
|
241202
|
+
ralph: ({ task, specFile }) => ({
|
|
241203
|
+
mode: "ralph",
|
|
241204
|
+
system: void 0,
|
|
241205
|
+
clankaPrompt: promptGen.promptTimeoutRalph({
|
|
241206
|
+
task,
|
|
241207
|
+
specFile
|
|
241208
|
+
}),
|
|
241209
|
+
cliPrompt: promptGen.promptTimeoutRalph({
|
|
241210
|
+
task,
|
|
241211
|
+
specFile
|
|
241212
|
+
}),
|
|
241213
|
+
prdFilePath: void 0
|
|
241214
|
+
})
|
|
241215
|
+
});
|
|
241142
241216
|
if (!options.preset.cliAgent.command) {
|
|
241143
241217
|
yield* runClanka({
|
|
241144
241218
|
directory: worktree.directory,
|
|
241145
241219
|
model: options.preset.extraArgs.join(" "),
|
|
241146
|
-
system:
|
|
241147
|
-
prompt:
|
|
241148
|
-
task: options.task.task,
|
|
241149
|
-
specFile: options.task.specFile
|
|
241150
|
-
}) : promptGen.promptTimeoutClanka({
|
|
241151
|
-
taskId: options.task.task.id,
|
|
241152
|
-
specsDirectory: options.specsDirectory
|
|
241153
|
-
}),
|
|
241220
|
+
system: timeoutMode.system,
|
|
241221
|
+
prompt: timeoutMode.clankaPrompt,
|
|
241154
241222
|
stallTimeout: options.stallTimeout,
|
|
241155
|
-
mode:
|
|
241223
|
+
mode: timeoutMode.mode
|
|
241156
241224
|
});
|
|
241157
241225
|
return ExitCode(0);
|
|
241158
241226
|
}
|
|
241159
241227
|
return yield* pipe$1(options.preset.cliAgent.command({
|
|
241160
|
-
prompt:
|
|
241161
|
-
|
|
241162
|
-
specFile: options.task.specFile
|
|
241163
|
-
}) : promptGen.promptTimeout({
|
|
241164
|
-
taskId: options.task.task.id,
|
|
241165
|
-
specsDirectory: options.specsDirectory
|
|
241166
|
-
}),
|
|
241167
|
-
prdFilePath: options.task._tag === "ralph" ? void 0 : pathService.join(".lalph", "prd.yml"),
|
|
241228
|
+
prompt: timeoutMode.cliPrompt,
|
|
241229
|
+
prdFilePath: timeoutMode.prdFilePath,
|
|
241168
241230
|
extraArgs: options.preset.extraArgs
|
|
241169
241231
|
}), setCwd(worktree.directory), options.preset.withCommandPrefix).pipe(worktree.execWithStallTimeout({
|
|
241170
241232
|
cliAgent: options.preset.cliAgent,
|
|
@@ -241309,7 +241371,7 @@ const run = fnUntraced(function* (options) {
|
|
|
241309
241371
|
prompt: instructions,
|
|
241310
241372
|
research: researchResult,
|
|
241311
241373
|
steer,
|
|
241312
|
-
|
|
241374
|
+
currentTask: CurrentTask.task({ task: chosenTask.prd })
|
|
241313
241375
|
}).pipe(provideService$2(CurrentTaskRef, issueRef), catchStallInReview, withSpan$1("Main.agentWorker"))}`);
|
|
241314
241376
|
if (options.review) {
|
|
241315
241377
|
yield* source.updateIssue({
|
|
@@ -241323,7 +241385,7 @@ const run = fnUntraced(function* (options) {
|
|
|
241323
241385
|
stallTimeout: options.stallTimeout,
|
|
241324
241386
|
preset: taskPreset,
|
|
241325
241387
|
instructions,
|
|
241326
|
-
|
|
241388
|
+
currentTask: CurrentTask.task({ task: chosenTask.prd })
|
|
241327
241389
|
}).pipe(catchStallInReview, withSpan$1("Main.agentReviewer"));
|
|
241328
241390
|
yield* source.updateIssue({
|
|
241329
241391
|
projectId,
|
|
@@ -241335,10 +241397,7 @@ const run = fnUntraced(function* (options) {
|
|
|
241335
241397
|
specsDirectory: options.specsDirectory,
|
|
241336
241398
|
stallTimeout: options.stallTimeout,
|
|
241337
241399
|
preset: taskPreset,
|
|
241338
|
-
task:
|
|
241339
|
-
_tag: "task",
|
|
241340
|
-
task: chosenTask.prd
|
|
241341
|
-
}
|
|
241400
|
+
currentTask: CurrentTask.task({ task: chosenTask.prd })
|
|
241342
241401
|
})), raceFirst(watchTaskState({ issueId: taskId })), as$1(false), catchTag$1("TaskStateChanged", (error) => log$1(`Task ${error.issueId} moved to ${error.state}; cancelling run.`).pipe(as$1(true))))) return;
|
|
241343
241402
|
yield* gitFlow.postWork({
|
|
241344
241403
|
worktree,
|
|
@@ -241387,7 +241446,11 @@ const runRalph = fnUntraced(function* (options) {
|
|
|
241387
241446
|
preset,
|
|
241388
241447
|
prompt: instructions,
|
|
241389
241448
|
research: researchResult,
|
|
241390
|
-
|
|
241449
|
+
maxContext: options.maxContext,
|
|
241450
|
+
currentTask: CurrentTask.ralph({
|
|
241451
|
+
task: chosenTask,
|
|
241452
|
+
specFile: options.specFile
|
|
241453
|
+
})
|
|
241391
241454
|
}).pipe(withSpan$1("Main.worker"))}`);
|
|
241392
241455
|
if (options.review) {
|
|
241393
241456
|
registry.update(currentWorker.state, (s) => s.transitionTo(WorkerStatus.Reviewing({ issueId: "ralph" })));
|
|
@@ -241396,18 +241459,20 @@ const runRalph = fnUntraced(function* (options) {
|
|
|
241396
241459
|
stallTimeout: options.stallTimeout,
|
|
241397
241460
|
preset,
|
|
241398
241461
|
instructions,
|
|
241399
|
-
|
|
241462
|
+
currentTask: CurrentTask.ralph({
|
|
241463
|
+
task: chosenTask,
|
|
241464
|
+
specFile: options.specFile
|
|
241465
|
+
})
|
|
241400
241466
|
}).pipe(withSpan$1("Main.review"));
|
|
241401
241467
|
}
|
|
241402
241468
|
}).pipe(timeout(options.runTimeout), tapErrorTag("TimeoutError", () => agentTimeout({
|
|
241403
241469
|
specsDirectory: "",
|
|
241404
241470
|
stallTimeout: options.stallTimeout,
|
|
241405
241471
|
preset,
|
|
241406
|
-
|
|
241407
|
-
_tag: "ralph",
|
|
241472
|
+
currentTask: CurrentTask.ralph({
|
|
241408
241473
|
task: chosenTask,
|
|
241409
241474
|
specFile: options.specFile
|
|
241410
|
-
}
|
|
241475
|
+
})
|
|
241411
241476
|
})));
|
|
241412
241477
|
yield* gitFlow.postWork({
|
|
241413
241478
|
worktree,
|
|
@@ -241415,34 +241480,41 @@ const runRalph = fnUntraced(function* (options) {
|
|
|
241415
241480
|
issueId: ""
|
|
241416
241481
|
});
|
|
241417
241482
|
}, scoped$1, provide$1(SemanticSearchLayer.pipe(provideMerge([Prd.layerNoop, Worktree.layer])), { local: true }));
|
|
241483
|
+
var RalphSpecMissing = class extends TaggedError("RalphSpecMissing") {
|
|
241484
|
+
message = `Project "${this.projectId}" is configured with gitFlow="ralph" but is missing "ralphSpec". Run 'lalph projects edit' and set "Path to Ralph spec file".`;
|
|
241485
|
+
};
|
|
241418
241486
|
const runProject = fnUntraced(function* (options) {
|
|
241419
241487
|
const isFinite = Number.isFinite(options.iterations);
|
|
241420
241488
|
const iterationsDisplay = isFinite ? options.iterations : "unlimited";
|
|
241421
241489
|
const semaphore = makeUnsafe$9(options.project.concurrency);
|
|
241422
241490
|
const fibers = yield* make$54();
|
|
241423
|
-
|
|
241424
|
-
|
|
241425
|
-
|
|
241426
|
-
|
|
241427
|
-
|
|
241428
|
-
|
|
241429
|
-
|
|
241430
|
-
|
|
241431
|
-
|
|
241432
|
-
|
|
241433
|
-
|
|
241434
|
-
|
|
241435
|
-
|
|
241436
|
-
|
|
241437
|
-
|
|
241438
|
-
|
|
241491
|
+
let executionMode;
|
|
241492
|
+
if (options.project.gitFlow === "ralph") {
|
|
241493
|
+
if (!options.project.ralphSpec) return yield* new RalphSpecMissing({ projectId: options.project.id });
|
|
241494
|
+
executionMode = {
|
|
241495
|
+
_tag: "ralph",
|
|
241496
|
+
specFile: options.project.ralphSpec
|
|
241497
|
+
};
|
|
241498
|
+
} else executionMode = {
|
|
241499
|
+
_tag: "standard",
|
|
241500
|
+
gitFlow: options.project.gitFlow
|
|
241501
|
+
};
|
|
241502
|
+
const resolveGitFlowLayer = () => {
|
|
241503
|
+
if (executionMode._tag === "ralph") return GitFlowRalph;
|
|
241504
|
+
if (executionMode.gitFlow === "commit") return GitFlowCommit;
|
|
241505
|
+
return GitFlowPR;
|
|
241506
|
+
};
|
|
241507
|
+
const resolveRunEffect = (startedDeferred) => {
|
|
241508
|
+
if (executionMode._tag === "ralph") return runRalph({
|
|
241439
241509
|
targetBranch: options.project.targetBranch,
|
|
241440
241510
|
stallTimeout: options.stallTimeout,
|
|
241441
241511
|
runTimeout: options.runTimeout,
|
|
241442
241512
|
review: options.project.reviewAgent,
|
|
241443
241513
|
research: options.project.researchAgent,
|
|
241444
|
-
specFile:
|
|
241445
|
-
|
|
241514
|
+
specFile: executionMode.specFile,
|
|
241515
|
+
maxContext: options.maxContext
|
|
241516
|
+
});
|
|
241517
|
+
return run({
|
|
241446
241518
|
startedDeferred,
|
|
241447
241519
|
targetBranch: options.project.targetBranch,
|
|
241448
241520
|
specsDirectory: options.specsDirectory,
|
|
@@ -241450,27 +241522,48 @@ const runProject = fnUntraced(function* (options) {
|
|
|
241450
241522
|
runTimeout: options.runTimeout,
|
|
241451
241523
|
review: options.project.reviewAgent,
|
|
241452
241524
|
research: options.project.researchAgent
|
|
241453
|
-
})
|
|
241525
|
+
});
|
|
241526
|
+
};
|
|
241527
|
+
const handleNoMoreWork = (currentIteration, setIterations) => {
|
|
241528
|
+
if (executionMode._tag === "ralph") return void_$2;
|
|
241529
|
+
if (isFinite) {
|
|
241530
|
+
setIterations(currentIteration);
|
|
241531
|
+
return log$1(`No more work to process, ending after ${currentIteration} iteration(s).`);
|
|
241532
|
+
}
|
|
241533
|
+
return andThen(size$3(fibers) <= 1 ? log$1("No more work to process, waiting 30 seconds...") : void_$2, sleep(seconds(30)));
|
|
241534
|
+
};
|
|
241535
|
+
yield* resetInProgress.pipe(withSpan$1("Main.resetInProgress"));
|
|
241536
|
+
yield* log$1(`Executing ${iterationsDisplay} iteration(s) with concurrency ${options.project.concurrency}`);
|
|
241537
|
+
let iterations = options.iterations;
|
|
241538
|
+
let iteration = 0;
|
|
241539
|
+
let quit = false;
|
|
241540
|
+
yield* mount(activeWorkerLoggingAtom);
|
|
241541
|
+
while (true) {
|
|
241542
|
+
yield* semaphore.take(1);
|
|
241543
|
+
if (quit || isFinite && iteration >= iterations) break;
|
|
241544
|
+
const currentIteration = iteration;
|
|
241545
|
+
const startedDeferred = yield* make$85();
|
|
241546
|
+
let ralphDone = false;
|
|
241547
|
+
const gitFlowLayer = resolveGitFlowLayer();
|
|
241548
|
+
const fiber = yield* checkForWork(options.project).pipe(andThen(resolveRunEffect(startedDeferred).pipe(provide$1(gitFlowLayer, { local: true }), withWorkerState(options.project.id))), catchTags$1({
|
|
241454
241549
|
ChosenTaskNotFound(_error) {
|
|
241455
|
-
if (
|
|
241550
|
+
if (executionMode._tag !== "ralph") {
|
|
241456
241551
|
ralphDone = true;
|
|
241457
|
-
return
|
|
241552
|
+
return void_$2;
|
|
241458
241553
|
}
|
|
241459
|
-
return
|
|
241554
|
+
return log$1(`No more work to process for Ralph, ending after ${currentIteration + 1} iteration(s).`);
|
|
241460
241555
|
},
|
|
241461
241556
|
NoMoreWork(_error) {
|
|
241462
|
-
|
|
241463
|
-
iterations =
|
|
241464
|
-
|
|
241465
|
-
}
|
|
241466
|
-
return andThen(size$3(fibers) <= 1 ? log$1("No more work to process, waiting 30 seconds...") : void_$2, sleep(seconds(30)));
|
|
241557
|
+
return handleNoMoreWork(currentIteration, (newIterations) => {
|
|
241558
|
+
iterations = newIterations;
|
|
241559
|
+
});
|
|
241467
241560
|
},
|
|
241468
241561
|
QuitError(_error) {
|
|
241469
241562
|
quit = true;
|
|
241470
241563
|
return void_$2;
|
|
241471
241564
|
}
|
|
241472
241565
|
}), catchCause$1((cause) => logWarning(cause).pipe(andThen(sleep(seconds(10))))), ensuring$2(semaphore.release(1)), ensuring$2(completeWith(startedDeferred, void_$2)), run$2(fibers));
|
|
241473
|
-
if (
|
|
241566
|
+
if (executionMode._tag === "ralph") {
|
|
241474
241567
|
yield* await_(fiber);
|
|
241475
241568
|
if (ralphDone) break;
|
|
241476
241569
|
} else yield* _await(startedDeferred);
|
|
@@ -241480,17 +241573,19 @@ const runProject = fnUntraced(function* (options) {
|
|
|
241480
241573
|
}, (effect, options) => annotateLogs(effect, { project: options.project.id }));
|
|
241481
241574
|
const iterations = integer$1("iterations").pipe(withDescription$1("Limit how many task iterations run per enabled project (default: unlimited). Use -i 1 to run a single iteration and exit."), withAlias$1("i"), withDefault(Number.POSITIVE_INFINITY));
|
|
241482
241575
|
const maxIterationMinutes = integer$1("max-minutes").pipe(withDescription$1("Timeout an iteration if execution (and review, if enabled) exceeds this many minutes (default: LALPH_MAX_MINUTES or 90)."), withFallbackConfig(int$1("LALPH_MAX_MINUTES")), withDefault(90));
|
|
241576
|
+
const maxContext = integer$1("max-context").pipe(withDescription$1("If the context window reaches this number of tokens, try again (default: LALPH_MAX_CONTEXT or 250,000)."), withFallbackConfig(int$1("LALPH_MAX_TOKENS")), withDefault(25e4));
|
|
241483
241577
|
const stallMinutes = integer$1("stall-minutes").pipe(withDescription$1("Fail an iteration if the agent stops responding for this many minutes (default: LALPH_STALL_MINUTES or 5)."), withFallbackConfig(int$1("LALPH_STALL_MINUTES")), withDefault(5));
|
|
241484
241578
|
const specsDirectory = directory("specs").pipe(withDescription$1("Directory where plan specs are written and read (default: LALPH_SPECS or .specs)."), withAlias$1("s"), withFallbackConfig(string$2("LALPH_SPECS")), withDefault(".specs"));
|
|
241485
241579
|
const verbose = boolean$2("verbose").pipe(withDescription$1("Increase log output for debugging. Use -v when you need detailed logs."), withAlias$1("v"));
|
|
241486
241580
|
const commandRoot = make$58("lalph", {
|
|
241487
241581
|
iterations,
|
|
241488
241582
|
maxIterationMinutes,
|
|
241583
|
+
maxContext,
|
|
241489
241584
|
stallMinutes
|
|
241490
241585
|
}).pipe(withSharedFlags({
|
|
241491
241586
|
specsDirectory,
|
|
241492
241587
|
verbose
|
|
241493
|
-
}), withDescription("Run the task loop across all enabled projects in parallel: pull issues from the current issue source and execute them with your configured agent preset(s). Use --iterations for a bounded run, and configure per-project concurrency via lalph projects edit."), withHandler(fnUntraced(function* ({ iterations, maxIterationMinutes, stallMinutes, specsDirectory }) {
|
|
241588
|
+
}), withDescription("Run the task loop across all enabled projects in parallel: pull issues from the current issue source and execute them with your configured agent preset(s). Use --iterations for a bounded run, and configure per-project concurrency via lalph projects edit."), withHandler(fnUntraced(function* ({ iterations, maxIterationMinutes, maxContext, stallMinutes, specsDirectory }) {
|
|
241494
241589
|
yield* getDefaultCliAgentPreset;
|
|
241495
241590
|
let allProjects = yield* getAllProjects;
|
|
241496
241591
|
if (allProjects.length === 0) {
|
|
@@ -241504,7 +241599,8 @@ const commandRoot = make$58("lalph", {
|
|
|
241504
241599
|
project,
|
|
241505
241600
|
specsDirectory,
|
|
241506
241601
|
stallTimeout: minutes(stallMinutes),
|
|
241507
|
-
runTimeout: minutes(maxIterationMinutes)
|
|
241602
|
+
runTimeout: minutes(maxIterationMinutes),
|
|
241603
|
+
maxContext
|
|
241508
241604
|
}).pipe(provideService$2(CurrentProjectId, project.id)), {
|
|
241509
241605
|
concurrency: "unbounded",
|
|
241510
241606
|
discard: true
|
|
@@ -241818,7 +241914,7 @@ const commandEdit = make$58("edit").pipe(withDescription("Open the selected proj
|
|
|
241818
241914
|
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));
|
|
241819
241915
|
//#endregion
|
|
241820
241916
|
//#region package.json
|
|
241821
|
-
var version = "0.3.
|
|
241917
|
+
var version = "0.3.90";
|
|
241822
241918
|
//#endregion
|
|
241823
241919
|
//#region src/commands/projects/ls.ts
|
|
241824
241920
|
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* () {
|