lalph 0.3.108 → 0.3.110
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 +65 -41
- package/package.json +2 -2
- package/src/Agents/chooser.ts +6 -4
- package/src/GitFlow.ts +3 -4
- package/src/Prd.ts +1 -15
- package/src/commands/root.ts +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -181743,7 +181743,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
|
|
|
181743
181743
|
});
|
|
181744
181744
|
Ze.glob = Ze;
|
|
181745
181745
|
//#endregion
|
|
181746
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
181746
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ApplyPatch.js
|
|
181747
181747
|
/**
|
|
181748
181748
|
* @since 1.0.0
|
|
181749
181749
|
*/
|
|
@@ -196616,7 +196616,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
196616
196616
|
}
|
|
196617
196617
|
};
|
|
196618
196618
|
//#endregion
|
|
196619
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
196619
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/McpClient.js
|
|
196620
196620
|
/**
|
|
196621
196621
|
* @since 1.0.0
|
|
196622
196622
|
*/
|
|
@@ -196661,7 +196661,7 @@ const layer$13 = effect$1(McpClient, gen(function* () {
|
|
|
196661
196661
|
});
|
|
196662
196662
|
}));
|
|
196663
196663
|
//#endregion
|
|
196664
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
196664
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ExaSearch.js
|
|
196665
196665
|
/**
|
|
196666
196666
|
* @since 1.0.0
|
|
196667
196667
|
*/
|
|
@@ -211611,7 +211611,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
211611
211611
|
exports.impl = impl;
|
|
211612
211612
|
}));
|
|
211613
211613
|
//#endregion
|
|
211614
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
211614
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/WebToMarkdown.js
|
|
211615
211615
|
/**
|
|
211616
211616
|
* @since 1.0.0
|
|
211617
211617
|
*/
|
|
@@ -214750,7 +214750,7 @@ function isEmptyParamsRecord(indexSignature) {
|
|
|
214750
214750
|
return indexSignature.parameter === string$3 && isNever(indexSignature.type);
|
|
214751
214751
|
}
|
|
214752
214752
|
//#endregion
|
|
214753
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
214753
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/SemanticSearch/Service.js
|
|
214754
214754
|
/**
|
|
214755
214755
|
* @since 1.0.0
|
|
214756
214756
|
*/
|
|
@@ -214776,7 +214776,7 @@ const maybeRemoveFile = (path) => serviceOption(SemanticSearch).pipe(flatMap$5(m
|
|
|
214776
214776
|
onSome: (service) => service.removeFile(path)
|
|
214777
214777
|
})));
|
|
214778
214778
|
//#endregion
|
|
214779
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
214779
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/AgentTools.js
|
|
214780
214780
|
/**
|
|
214781
214781
|
* @since 1.0.0
|
|
214782
214782
|
*/
|
|
@@ -215179,7 +215179,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$12, laye
|
|
|
215179
215179
|
AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
215180
215180
|
var ApplyPatchError = class extends TaggedClass$2("ApplyPatchError") {};
|
|
215181
215181
|
//#endregion
|
|
215182
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215182
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/TypeBuilder.js
|
|
215183
215183
|
const resolveDocumentation = resolveAt("documentation");
|
|
215184
215184
|
const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
|
|
215185
215185
|
const Precedence = {
|
|
@@ -215452,7 +215452,7 @@ const render = (schema, options) => {
|
|
|
215452
215452
|
return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
|
|
215453
215453
|
};
|
|
215454
215454
|
//#endregion
|
|
215455
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215455
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ToolkitRenderer.js
|
|
215456
215456
|
/**
|
|
215457
215457
|
* @since 1.0.0
|
|
215458
215458
|
*/
|
|
@@ -215474,7 +215474,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
|
|
|
215474
215474
|
}) });
|
|
215475
215475
|
};
|
|
215476
215476
|
//#endregion
|
|
215477
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
215477
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ScriptPreprocessing.js
|
|
215478
215478
|
const callTemplateTargets = ["applyPatch", "taskComplete"];
|
|
215479
215479
|
const objectPropertyTargets = [{
|
|
215480
215480
|
functionName: "writeFile",
|
|
@@ -215667,6 +215667,28 @@ const findStringLiteralEnd = (text, start, delimiter) => {
|
|
|
215667
215667
|
for (let index = start + 1; index < text.length; index++) if (text[index] === delimiter && !isEscaped(text, index)) return index;
|
|
215668
215668
|
return -1;
|
|
215669
215669
|
};
|
|
215670
|
+
const findEnclosingStringLiteral = (text, index) => {
|
|
215671
|
+
let start = index - 1;
|
|
215672
|
+
while (start >= 0) {
|
|
215673
|
+
const char = text[start];
|
|
215674
|
+
if ((char === "\"" || char === "'") && !isEscaped(text, start)) break;
|
|
215675
|
+
if (char === "\n" || char === "\r") return;
|
|
215676
|
+
start--;
|
|
215677
|
+
}
|
|
215678
|
+
if (start < 0) return;
|
|
215679
|
+
const end = findStringLiteralEnd(text, start, text[start]);
|
|
215680
|
+
if (end === -1 || index >= end) return;
|
|
215681
|
+
return {
|
|
215682
|
+
start,
|
|
215683
|
+
end
|
|
215684
|
+
};
|
|
215685
|
+
};
|
|
215686
|
+
const isRepeatedControlEscapeString = (text, index) => {
|
|
215687
|
+
const bounds = findEnclosingStringLiteral(text, index);
|
|
215688
|
+
if (bounds === void 0) return false;
|
|
215689
|
+
const content = text.slice(bounds.start + 1, bounds.end);
|
|
215690
|
+
return /^(?:\\\\[0bnrtvf]|\\\\r\\\\n){2,}$/.test(content);
|
|
215691
|
+
};
|
|
215670
215692
|
const findInterpolationExpressionEnd = (text, openBrace) => {
|
|
215671
215693
|
let depth = 1;
|
|
215672
215694
|
let cursor = openBrace + 1;
|
|
@@ -215732,11 +215754,17 @@ const escapeTemplateLiteralContent = (text) => {
|
|
|
215732
215754
|
for (let index = 0; index < normalized.length; index++) {
|
|
215733
215755
|
const char = normalized[index];
|
|
215734
215756
|
if (char === "\\") {
|
|
215735
|
-
|
|
215736
|
-
|
|
215757
|
+
let runEnd = index + 1;
|
|
215758
|
+
while (normalized[runEnd] === "\\") runEnd++;
|
|
215759
|
+
const runLength = runEnd - index;
|
|
215760
|
+
if (normalized[runEnd] === "`" || normalized[runEnd] === "$" && normalized[runEnd + 1] === "{") {
|
|
215761
|
+
out += "\\".repeat(runLength * 2 + (runLength % 2 === 0 ? 1 : -1)) + normalized[runEnd];
|
|
215762
|
+
index = runEnd;
|
|
215737
215763
|
continue;
|
|
215738
215764
|
}
|
|
215739
|
-
|
|
215765
|
+
const escapedRunLength = runLength % 2 === 0 && isRepeatedControlEscapeString(normalized, index) ? runLength : runLength * 2;
|
|
215766
|
+
out += "\\".repeat(escapedRunLength);
|
|
215767
|
+
index = runEnd - 1;
|
|
215740
215768
|
continue;
|
|
215741
215769
|
}
|
|
215742
215770
|
if (char === "`" && !isEscaped(normalized, index)) {
|
|
@@ -216019,7 +216047,7 @@ const rewriteAssignedTargets = (script) => {
|
|
|
216019
216047
|
};
|
|
216020
216048
|
const preprocessScript = (script) => rewriteAssignedTargets(rewriteDirectTemplates(script));
|
|
216021
216049
|
//#endregion
|
|
216022
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
216050
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/AgentExecutor.js
|
|
216023
216051
|
/**
|
|
216024
216052
|
* @since 1.0.0
|
|
216025
216053
|
*/
|
|
@@ -216204,7 +216232,7 @@ var QueueWriteStream = class extends Writable {
|
|
|
216204
216232
|
}
|
|
216205
216233
|
};
|
|
216206
216234
|
//#endregion
|
|
216207
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
216235
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ScriptExtraction.js
|
|
216208
216236
|
const stripWrappingCodeFence = (script) => {
|
|
216209
216237
|
const lines = script.split(/\r?\n/);
|
|
216210
216238
|
if (lines.length < 2) return script;
|
|
@@ -217753,7 +217781,7 @@ const applySpanTransformer = (transformer, response, options) => {
|
|
|
217753
217781
|
});
|
|
217754
217782
|
};
|
|
217755
217783
|
//#endregion
|
|
217756
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
217784
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/Agent.js
|
|
217757
217785
|
/**
|
|
217758
217786
|
* @since 1.0.0
|
|
217759
217787
|
*/
|
|
@@ -229260,7 +229288,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
|
|
|
229260
229288
|
})));
|
|
229261
229289
|
});
|
|
229262
229290
|
//#endregion
|
|
229263
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
229291
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/CodexAuth.js
|
|
229264
229292
|
/**
|
|
229265
229293
|
* @since 1.0.0
|
|
229266
229294
|
*/
|
|
@@ -229480,7 +229508,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
|
|
|
229480
229508
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
|
|
229481
229509
|
};
|
|
229482
229510
|
//#endregion
|
|
229483
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
229511
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/Codex.js
|
|
229484
229512
|
/**
|
|
229485
229513
|
* @since 1.0.0
|
|
229486
229514
|
*/
|
|
@@ -229506,7 +229534,7 @@ const layerModel = (model, options) => layer$7({
|
|
|
229506
229534
|
}
|
|
229507
229535
|
}).pipe(merge$6(AgentModelConfig.layer({ systemPromptTransform: (system, effect) => withConfigOverride(effect, { instructions: system }) })));
|
|
229508
229536
|
//#endregion
|
|
229509
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
229537
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/CodeChunker.js
|
|
229510
229538
|
/**
|
|
229511
229539
|
* @since 1.0.0
|
|
229512
229540
|
*/
|
|
@@ -231266,7 +231294,7 @@ const getUsageDetailNumber = (details, field) => {
|
|
|
231266
231294
|
return typeof value === "number" ? value : void 0;
|
|
231267
231295
|
};
|
|
231268
231296
|
//#endregion
|
|
231269
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
231297
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/CopilotAuth.js
|
|
231270
231298
|
/**
|
|
231271
231299
|
* @since 1.0.0
|
|
231272
231300
|
*/
|
|
@@ -231457,7 +231485,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
|
|
|
231457
231485
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
|
|
231458
231486
|
};
|
|
231459
231487
|
//#endregion
|
|
231460
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
231488
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/Copilot.js
|
|
231461
231489
|
/**
|
|
231462
231490
|
* @since 1.0.0
|
|
231463
231491
|
*/
|
|
@@ -231877,7 +231905,7 @@ Object.defineProperties(createChalk.prototype, styles);
|
|
|
231877
231905
|
const chalk = createChalk();
|
|
231878
231906
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
231879
231907
|
//#endregion
|
|
231880
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
231908
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/OutputFormatter.js
|
|
231881
231909
|
/**
|
|
231882
231910
|
* @since 1.0.0
|
|
231883
231911
|
*/
|
|
@@ -232585,7 +232613,7 @@ select * from ${sql(options.tableName)} where ${sql(idColumn)} = LAST_INSERT_ID(
|
|
|
232585
232613
|
};
|
|
232586
232614
|
});
|
|
232587
232615
|
//#endregion
|
|
232588
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
232616
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/ChunkRepo.js
|
|
232589
232617
|
/**
|
|
232590
232618
|
* @since 1.0.0
|
|
232591
232619
|
* @category Models
|
|
@@ -232851,7 +232879,7 @@ const run$1 = /* @__PURE__ */ make$25({});
|
|
|
232851
232879
|
*/
|
|
232852
232880
|
const layer$1 = (options) => effectDiscard(run$1(options));
|
|
232853
232881
|
//#endregion
|
|
232854
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
232882
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/internal/sqlite-vector.js
|
|
232855
232883
|
/**
|
|
232856
232884
|
* Binary extension for each platform
|
|
232857
232885
|
*/
|
|
@@ -232968,7 +232996,7 @@ function getExtensionPath() {
|
|
|
232968
232996
|
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`);
|
|
232969
232997
|
}
|
|
232970
232998
|
//#endregion
|
|
232971
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
232999
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/Sqlite.js
|
|
232972
233000
|
/**
|
|
232973
233001
|
* @since 1.0.0
|
|
232974
233002
|
*/
|
|
@@ -232996,7 +233024,7 @@ const SqliteLayer = (database) => layer$1({ loader: fromRecord({ "0001_create_ch
|
|
|
232996
233024
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
232997
233025
|
}))));
|
|
232998
233026
|
//#endregion
|
|
232999
|
-
//#region node_modules/.pnpm/clanka@0.2.
|
|
233027
|
+
//#region node_modules/.pnpm/clanka@0.2.35_@effect+ai-openai-compat@4.0.0-beta.38_effect@4.0.0-beta.38__@effect+ai-o_c5d004a52d3f1db02066baa2032cac86/node_modules/clanka/dist/SemanticSearch.js
|
|
233000
233028
|
/**
|
|
233001
233029
|
* @since 1.0.0
|
|
233002
233030
|
*/
|
|
@@ -241362,7 +241390,7 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
|
|
|
241362
241390
|
const getCurrentIssues = get$5(issuesRef).pipe(map$10((i) => i.issues));
|
|
241363
241391
|
const syncSemaphore = makeUnsafe$9(1);
|
|
241364
241392
|
const maybeRevertIssue = fnUntraced(function* (options) {
|
|
241365
|
-
const issue =
|
|
241393
|
+
const issue = yield* source.findById(projectId, options.issueId);
|
|
241366
241394
|
if (!issue || issue.state === "in-review") return;
|
|
241367
241395
|
yield* source.updateIssue({
|
|
241368
241396
|
projectId,
|
|
@@ -241459,9 +241487,6 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
|
|
|
241459
241487
|
}, scoped$1, withSpan$1("Prd.updateSync"), run$4(updateSyncHandle, { onlyIfMissing: true }), syncSemaphore.withPermitsIfAvailable(1));
|
|
241460
241488
|
yield* fs.watch(lalphDir).pipe(filter$3((event) => event.path.endsWith("prd.yml")), debounce(50), runForEach((_) => clear(updateSyncHandle).pipe(andThen(ignore$1(sync$3)))), retry$1(forever$1), forkScoped);
|
|
241461
241489
|
yield* changes(issuesRef).pipe(filter$3((change) => change._tag === "External"), runForEach((s) => updateSync(s.issues)), forkScoped);
|
|
241462
|
-
const findById = fnUntraced(function* (issueId) {
|
|
241463
|
-
return (yield* getCurrentIssues).find((i) => i.id === issueId) ?? null;
|
|
241464
|
-
});
|
|
241465
241490
|
return {
|
|
241466
241491
|
path: prdFile,
|
|
241467
241492
|
maybeRevertIssue,
|
|
@@ -241476,7 +241501,6 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
|
|
|
241476
241501
|
}
|
|
241477
241502
|
})),
|
|
241478
241503
|
flagUnmergable,
|
|
241479
|
-
findById,
|
|
241480
241504
|
setChosenIssueId,
|
|
241481
241505
|
setAutoMerge
|
|
241482
241506
|
};
|
|
@@ -241491,7 +241515,6 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
|
|
|
241491
241515
|
maybeRevertIssue: () => void_$2,
|
|
241492
241516
|
revertUpdatedIssues: void_$2,
|
|
241493
241517
|
flagUnmergable: () => void_$2,
|
|
241494
|
-
findById: () => succeed$4(null),
|
|
241495
241518
|
setChosenIssueId: () => void_$2,
|
|
241496
241519
|
setAutoMerge: () => void_$2
|
|
241497
241520
|
});
|
|
@@ -241760,7 +241783,7 @@ After making any changes, commit and push them to the same pull request.
|
|
|
241760
241783
|
prState = yield* worktree.viewPrState(prState.value.number);
|
|
241761
241784
|
yield* log$1("PR state after merge", prState);
|
|
241762
241785
|
if (isSome(prState) && prState.value.state === "MERGED") {
|
|
241763
|
-
const issue = yield*
|
|
241786
|
+
const issue = yield* source.findById(projectId, options.issueId);
|
|
241764
241787
|
if (issue && issue.state !== "done") yield* source.updateIssue({
|
|
241765
241788
|
projectId,
|
|
241766
241789
|
issueId: options.issueId,
|
|
@@ -241805,11 +241828,11 @@ But you **do not** need to git push your changes or switch branches.
|
|
|
241805
241828
|
}
|
|
241806
241829
|
}),
|
|
241807
241830
|
autoMerge: fnUntraced(function* (options) {
|
|
241808
|
-
const
|
|
241831
|
+
const source = yield* IssueSource;
|
|
241809
241832
|
const projectId = yield* CurrentProjectId;
|
|
241810
|
-
const issue = yield*
|
|
241833
|
+
const issue = yield* source.findById(projectId, options.issueId);
|
|
241811
241834
|
if (!issue || issue.state !== "in-review") return;
|
|
241812
|
-
yield*
|
|
241835
|
+
yield* source.updateIssue({
|
|
241813
241836
|
projectId,
|
|
241814
241837
|
issueId: options.issueId,
|
|
241815
241838
|
state: "done"
|
|
@@ -241846,11 +241869,12 @@ var GitFlowError = class extends TaggedError("GitFlowError") {};
|
|
|
241846
241869
|
//#endregion
|
|
241847
241870
|
//#region src/Agents/chooser.ts
|
|
241848
241871
|
const agentChooser = fnUntraced(function* (options) {
|
|
241872
|
+
const projectId = yield* CurrentProjectId;
|
|
241849
241873
|
const fs = yield* FileSystem;
|
|
241850
241874
|
const pathService = yield* Path$1;
|
|
241851
241875
|
const worktree = yield* Worktree;
|
|
241852
241876
|
const promptGen = yield* PromptGen;
|
|
241853
|
-
const
|
|
241877
|
+
const source = yield* IssueSource;
|
|
241854
241878
|
const gitFlow = yield* GitFlow;
|
|
241855
241879
|
const waitForFile = yield* makeWaitForFile;
|
|
241856
241880
|
if (!options.preset.cliAgent.command) {
|
|
@@ -241862,7 +241886,7 @@ const agentChooser = fnUntraced(function* (options) {
|
|
|
241862
241886
|
stallTimeout: options.stallTimeout,
|
|
241863
241887
|
mode: "choose"
|
|
241864
241888
|
}).pipe(provideService$2(ChosenTaskDeferred, deferred), flatMap$5(() => fail$6(new ChosenTaskNotFound$1())), raceFirst(_await(deferred)));
|
|
241865
|
-
const prdTask = yield*
|
|
241889
|
+
const prdTask = yield* source.findById(projectId, result.taskId);
|
|
241866
241890
|
if (!prdTask) return yield* new ChosenTaskNotFound$1();
|
|
241867
241891
|
return {
|
|
241868
241892
|
id: result.taskId,
|
|
@@ -241880,7 +241904,7 @@ const agentChooser = fnUntraced(function* (options) {
|
|
|
241880
241904
|
onTimeout: () => fail$6(new RunnerStalled())
|
|
241881
241905
|
}), raceFirst(taskJsonCreated));
|
|
241882
241906
|
return yield* pipe$1(fs.readFileString(pathService.join(worktree.directory, ".lalph", "task.json")), flatMap$5(decodeEffect(ChosenTask)), mapError$2((_) => new ChosenTaskNotFound$1()), flatMap$5(fnUntraced(function* (task) {
|
|
241883
|
-
const prdTask = yield*
|
|
241907
|
+
const prdTask = yield* source.findById(projectId, task.id);
|
|
241884
241908
|
if (prdTask) return {
|
|
241885
241909
|
...task,
|
|
241886
241910
|
prd: prdTask
|
|
@@ -242092,7 +242116,7 @@ const run = fnUntraced(function* (options) {
|
|
|
242092
242116
|
}
|
|
242093
242117
|
const taskPreset = getOrElse$2(yield* source.issueCliAgentPreset(chosenTask.prd), () => preset);
|
|
242094
242118
|
const catchStallInReview = (effect) => catchIf$2(effect, (u) => u instanceof RunnerStalled, fnUntraced(function* (e) {
|
|
242095
|
-
if ((yield*
|
|
242119
|
+
if ((yield* source.findById(projectId, taskId))?.state === "in-review") return;
|
|
242096
242120
|
return yield* e;
|
|
242097
242121
|
}));
|
|
242098
242122
|
if (yield* gen(function* () {
|
|
@@ -242163,7 +242187,7 @@ const run = fnUntraced(function* (options) {
|
|
|
242163
242187
|
targetBranch: getOrUndefined$2(options.targetBranch),
|
|
242164
242188
|
issueId: taskId
|
|
242165
242189
|
});
|
|
242166
|
-
if ((yield*
|
|
242190
|
+
if ((yield* source.findById(projectId, taskId))?.autoMerge) yield* gitFlow.autoMerge({
|
|
242167
242191
|
targetBranch: getOrUndefined$2(options.targetBranch),
|
|
242168
242192
|
issueId: taskId,
|
|
242169
242193
|
worktree
|
|
@@ -242688,7 +242712,7 @@ const commandEdit = make$60("edit").pipe(withDescription("Open the selected proj
|
|
|
242688
242712
|
const commandSource = make$60("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));
|
|
242689
242713
|
//#endregion
|
|
242690
242714
|
//#region package.json
|
|
242691
|
-
var version = "0.3.
|
|
242715
|
+
var version = "0.3.110";
|
|
242692
242716
|
//#endregion
|
|
242693
242717
|
//#region src/Tracing.ts
|
|
242694
242718
|
const TracingLayer = unwrap$3(gen(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.110",
|
|
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.20260323.1",
|
|
48
|
-
"clanka": "^0.2.
|
|
48
|
+
"clanka": "^0.2.35",
|
|
49
49
|
"concurrently": "^9.2.1",
|
|
50
50
|
"effect": "4.0.0-beta.38",
|
|
51
51
|
"husky": "^9.1.7",
|
package/src/Agents/chooser.ts
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
Schema,
|
|
10
10
|
} from "effect"
|
|
11
11
|
import { PromptGen } from "../PromptGen.ts"
|
|
12
|
-
import { Prd } from "../Prd.ts"
|
|
13
12
|
import { ChildProcess } from "effect/unstable/process"
|
|
14
13
|
import { Worktree } from "../Worktree.ts"
|
|
15
14
|
import { RunnerStalled } from "../domain/Errors.ts"
|
|
@@ -18,16 +17,19 @@ import { GitFlow } from "../GitFlow.ts"
|
|
|
18
17
|
import type { CliAgentPreset } from "../domain/CliAgentPreset.ts"
|
|
19
18
|
import { runClanka } from "../Clanka.ts"
|
|
20
19
|
import { ChosenTaskDeferred } from "../TaskTools.ts"
|
|
20
|
+
import { IssueSource } from "../IssueSource.ts"
|
|
21
|
+
import { CurrentProjectId } from "../Settings.ts"
|
|
21
22
|
|
|
22
23
|
export const agentChooser = Effect.fnUntraced(function* (options: {
|
|
23
24
|
readonly stallTimeout: Duration.Duration
|
|
24
25
|
readonly preset: CliAgentPreset
|
|
25
26
|
}) {
|
|
27
|
+
const projectId = yield* CurrentProjectId
|
|
26
28
|
const fs = yield* FileSystem.FileSystem
|
|
27
29
|
const pathService = yield* Path.Path
|
|
28
30
|
const worktree = yield* Worktree
|
|
29
31
|
const promptGen = yield* PromptGen
|
|
30
|
-
const
|
|
32
|
+
const source = yield* IssueSource
|
|
31
33
|
const gitFlow = yield* GitFlow
|
|
32
34
|
const waitForFile = yield* makeWaitForFile
|
|
33
35
|
|
|
@@ -45,7 +47,7 @@ export const agentChooser = Effect.fnUntraced(function* (options: {
|
|
|
45
47
|
Effect.flatMap(() => Effect.fail(new ChosenTaskNotFound())),
|
|
46
48
|
Effect.raceFirst(Deferred.await(deferred)),
|
|
47
49
|
)
|
|
48
|
-
const prdTask = yield*
|
|
50
|
+
const prdTask = yield* source.findById(projectId, result.taskId)
|
|
49
51
|
if (!prdTask) return yield* new ChosenTaskNotFound()
|
|
50
52
|
return {
|
|
51
53
|
id: result.taskId,
|
|
@@ -85,7 +87,7 @@ export const agentChooser = Effect.fnUntraced(function* (options: {
|
|
|
85
87
|
Effect.mapError((_) => new ChosenTaskNotFound()),
|
|
86
88
|
Effect.flatMap(
|
|
87
89
|
Effect.fnUntraced(function* (task) {
|
|
88
|
-
const prdTask = yield*
|
|
90
|
+
const prdTask = yield* source.findById(projectId, task.id)
|
|
89
91
|
if (prdTask) return { ...task, prd: prdTask }
|
|
90
92
|
return yield* new ChosenTaskNotFound()
|
|
91
93
|
}),
|
package/src/GitFlow.ts
CHANGED
|
@@ -103,7 +103,7 @@ After making any changes, commit and push them to the same pull request.
|
|
|
103
103
|
prState = yield* worktree.viewPrState(prState.value.number)
|
|
104
104
|
yield* Effect.log("PR state after merge", prState)
|
|
105
105
|
if (Option.isSome(prState) && prState.value.state === "MERGED") {
|
|
106
|
-
const issue = yield*
|
|
106
|
+
const issue = yield* source.findById(projectId, options.issueId)
|
|
107
107
|
if (issue && issue.state !== "done") {
|
|
108
108
|
yield* source.updateIssue({
|
|
109
109
|
projectId,
|
|
@@ -182,13 +182,12 @@ But you **do not** need to git push your changes or switch branches.
|
|
|
182
182
|
}
|
|
183
183
|
}),
|
|
184
184
|
autoMerge: Effect.fnUntraced(function* (options) {
|
|
185
|
-
const
|
|
185
|
+
const source = yield* IssueSource
|
|
186
186
|
const projectId = yield* CurrentProjectId
|
|
187
|
-
const issue = yield*
|
|
187
|
+
const issue = yield* source.findById(projectId, options.issueId)
|
|
188
188
|
if (!issue || issue.state !== "in-review") {
|
|
189
189
|
return
|
|
190
190
|
}
|
|
191
|
-
const source = yield* IssueSource
|
|
192
191
|
yield* source.updateIssue({
|
|
193
192
|
projectId,
|
|
194
193
|
issueId: options.issueId,
|
package/src/Prd.ts
CHANGED
|
@@ -32,12 +32,6 @@ export class Prd extends ServiceMap.Service<
|
|
|
32
32
|
readonly flagUnmergable: (options: {
|
|
33
33
|
readonly issueId: string
|
|
34
34
|
}) => Effect.Effect<void, IssueSourceError>
|
|
35
|
-
readonly findById: (
|
|
36
|
-
issueId: string,
|
|
37
|
-
) => Effect.Effect<
|
|
38
|
-
PrdIssue | null,
|
|
39
|
-
PlatformError.PlatformError | IssueSourceError
|
|
40
|
-
>
|
|
41
35
|
readonly setChosenIssueId: (issueId: string | null) => Effect.Effect<void>
|
|
42
36
|
readonly setAutoMerge: (enabled: boolean) => Effect.Effect<void>
|
|
43
37
|
}
|
|
@@ -68,8 +62,7 @@ export class Prd extends ServiceMap.Service<
|
|
|
68
62
|
const maybeRevertIssue = Effect.fnUntraced(function* (options: {
|
|
69
63
|
readonly issueId: string
|
|
70
64
|
}) {
|
|
71
|
-
const
|
|
72
|
-
const issue = updated.find((i) => i.id === options.issueId)
|
|
65
|
+
const issue = yield* source.findById(projectId, options.issueId)
|
|
73
66
|
if (!issue || issue.state === "in-review") return
|
|
74
67
|
yield* source.updateIssue({
|
|
75
68
|
projectId,
|
|
@@ -244,11 +237,6 @@ export class Prd extends ServiceMap.Service<
|
|
|
244
237
|
Effect.forkScoped,
|
|
245
238
|
)
|
|
246
239
|
|
|
247
|
-
const findById = Effect.fnUntraced(function* (issueId: string) {
|
|
248
|
-
const current = yield* getCurrentIssues
|
|
249
|
-
return current.find((i) => i.id === issueId) ?? null
|
|
250
|
-
})
|
|
251
|
-
|
|
252
240
|
return {
|
|
253
241
|
path: prdFile,
|
|
254
242
|
maybeRevertIssue,
|
|
@@ -265,7 +253,6 @@ export class Prd extends ServiceMap.Service<
|
|
|
265
253
|
}),
|
|
266
254
|
),
|
|
267
255
|
flagUnmergable,
|
|
268
|
-
findById,
|
|
269
256
|
setChosenIssueId,
|
|
270
257
|
setAutoMerge,
|
|
271
258
|
}
|
|
@@ -287,7 +274,6 @@ export class Prd extends ServiceMap.Service<
|
|
|
287
274
|
maybeRevertIssue: () => Effect.void,
|
|
288
275
|
revertUpdatedIssues: Effect.void,
|
|
289
276
|
flagUnmergable: () => Effect.void,
|
|
290
|
-
findById: () => Effect.succeed(null),
|
|
291
277
|
setChosenIssueId: () => Effect.void,
|
|
292
278
|
setAutoMerge: () => Effect.void,
|
|
293
279
|
})
|
package/src/commands/root.ts
CHANGED
|
@@ -200,7 +200,7 @@ const run = Effect.fnUntraced(
|
|
|
200
200
|
effect,
|
|
201
201
|
(u): u is RunnerStalled => u instanceof RunnerStalled,
|
|
202
202
|
Effect.fnUntraced(function* (e) {
|
|
203
|
-
const task = yield*
|
|
203
|
+
const task = yield* source.findById(projectId, taskId!)
|
|
204
204
|
const inReview = task?.state === "in-review"
|
|
205
205
|
if (inReview) return
|
|
206
206
|
return yield* e
|
|
@@ -315,7 +315,7 @@ const run = Effect.fnUntraced(
|
|
|
315
315
|
issueId: taskId,
|
|
316
316
|
})
|
|
317
317
|
|
|
318
|
-
const task = yield*
|
|
318
|
+
const task = yield* source.findById(projectId, taskId)
|
|
319
319
|
if (task?.autoMerge) {
|
|
320
320
|
yield* gitFlow.autoMerge({
|
|
321
321
|
targetBranch: Option.getOrUndefined(options.targetBranch),
|