@defend-tech/opencode-optima 0.1.58 → 0.1.60
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/assets/agents/workflow_product_manager.md +5 -3
- package/dist/index.js +387 -109
- package/dist/sanitize_cli.js +387 -109
- package/docs/core/agent_orchestration.md +2 -2
- package/docs/core/agent_orchestration.prompt.md +1 -1
- package/docs/core/task_model.md +1 -1
- package/docs/core/task_model.prompt.md +1 -1
- package/package.json +1 -1
package/dist/sanitize_cli.js
CHANGED
|
@@ -633,8 +633,6 @@ var require_Alias = __commonJS({
|
|
|
633
633
|
* instance of the `source` anchor before this node.
|
|
634
634
|
*/
|
|
635
635
|
resolve(doc, ctx) {
|
|
636
|
-
if (ctx?.maxAliasCount === 0)
|
|
637
|
-
throw new ReferenceError("Alias resolution is disabled");
|
|
638
636
|
let nodes;
|
|
639
637
|
if (ctx?.aliasResolveCache) {
|
|
640
638
|
nodes = ctx.aliasResolveCache;
|
|
@@ -1434,7 +1432,6 @@ var require_stringify = __commonJS({
|
|
|
1434
1432
|
nullStr: "null",
|
|
1435
1433
|
simpleKeys: false,
|
|
1436
1434
|
singleQuote: null,
|
|
1437
|
-
trailingComma: false,
|
|
1438
1435
|
trueStr: "true",
|
|
1439
1436
|
verifyAliasOrder: true
|
|
1440
1437
|
}, doc.schema.toStringOptions, options);
|
|
@@ -1707,18 +1704,18 @@ var require_merge = __commonJS({
|
|
|
1707
1704
|
};
|
|
1708
1705
|
var isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
|
|
1709
1706
|
function addMergeToJSMap(ctx, map, value) {
|
|
1710
|
-
|
|
1711
|
-
if (identity.isSeq(
|
|
1712
|
-
for (const it of
|
|
1707
|
+
value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
1708
|
+
if (identity.isSeq(value))
|
|
1709
|
+
for (const it of value.items)
|
|
1713
1710
|
mergeValue(ctx, map, it);
|
|
1714
|
-
else if (Array.isArray(
|
|
1715
|
-
for (const it of
|
|
1711
|
+
else if (Array.isArray(value))
|
|
1712
|
+
for (const it of value)
|
|
1716
1713
|
mergeValue(ctx, map, it);
|
|
1717
1714
|
else
|
|
1718
|
-
mergeValue(ctx, map,
|
|
1715
|
+
mergeValue(ctx, map, value);
|
|
1719
1716
|
}
|
|
1720
1717
|
function mergeValue(ctx, map, value) {
|
|
1721
|
-
const source =
|
|
1718
|
+
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
1722
1719
|
if (!identity.isMap(source))
|
|
1723
1720
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1724
1721
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
@@ -1739,9 +1736,6 @@ var require_merge = __commonJS({
|
|
|
1739
1736
|
}
|
|
1740
1737
|
return map;
|
|
1741
1738
|
}
|
|
1742
|
-
function resolveAliasValue(ctx, value) {
|
|
1743
|
-
return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
1744
|
-
}
|
|
1745
1739
|
exports.addMergeToJSMap = addMergeToJSMap;
|
|
1746
1740
|
exports.isMergeKey = isMergeKey;
|
|
1747
1741
|
exports.merge = merge;
|
|
@@ -1955,19 +1949,12 @@ ${indent}${line}` : "\n";
|
|
|
1955
1949
|
if (comment)
|
|
1956
1950
|
reqNewline = true;
|
|
1957
1951
|
let str = stringify.stringify(item, itemCtx, () => comment = null);
|
|
1958
|
-
|
|
1959
|
-
if (i < items.length - 1) {
|
|
1952
|
+
if (i < items.length - 1)
|
|
1960
1953
|
str += ",";
|
|
1961
|
-
} else if (ctx.options.trailingComma) {
|
|
1962
|
-
if (ctx.options.lineWidth > 0) {
|
|
1963
|
-
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
|
|
1964
|
-
}
|
|
1965
|
-
if (reqNewline) {
|
|
1966
|
-
str += ",";
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
1954
|
if (comment)
|
|
1970
1955
|
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
|
|
1956
|
+
if (!reqNewline && (lines.length > linesAtValue || str.includes("\n")))
|
|
1957
|
+
reqNewline = true;
|
|
1971
1958
|
lines.push(str);
|
|
1972
1959
|
linesAtValue = lines.length;
|
|
1973
1960
|
}
|
|
@@ -2379,7 +2366,7 @@ var require_stringifyNumber = __commonJS({
|
|
|
2379
2366
|
if (!isFinite(num))
|
|
2380
2367
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
2381
2368
|
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
2382
|
-
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") &&
|
|
2369
|
+
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
|
|
2383
2370
|
let i = n.indexOf(".");
|
|
2384
2371
|
if (i < 0) {
|
|
2385
2372
|
i = n.length;
|
|
@@ -4751,7 +4738,7 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
4751
4738
|
while (next === " " || next === " ")
|
|
4752
4739
|
next = source[++i + 1];
|
|
4753
4740
|
} else if (next === "x" || next === "u" || next === "U") {
|
|
4754
|
-
const length =
|
|
4741
|
+
const length = { x: 2, u: 4, U: 8 }[next];
|
|
4755
4742
|
res += parseCharCode(source, i + 1, length, onError);
|
|
4756
4743
|
i += length;
|
|
4757
4744
|
} else {
|
|
@@ -4826,13 +4813,12 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
4826
4813
|
const cc = source.substr(offset, length);
|
|
4827
4814
|
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
|
|
4828
4815
|
const code = ok ? parseInt(cc, 16) : NaN;
|
|
4829
|
-
|
|
4830
|
-
return String.fromCodePoint(code);
|
|
4831
|
-
} catch {
|
|
4816
|
+
if (isNaN(code)) {
|
|
4832
4817
|
const raw = source.substr(offset - 2, length + 2);
|
|
4833
4818
|
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
4834
4819
|
return raw;
|
|
4835
4820
|
}
|
|
4821
|
+
return String.fromCodePoint(code);
|
|
4836
4822
|
}
|
|
4837
4823
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
4838
4824
|
}
|
|
@@ -4982,22 +4968,17 @@ var require_compose_node = __commonJS({
|
|
|
4982
4968
|
case "block-map":
|
|
4983
4969
|
case "block-seq":
|
|
4984
4970
|
case "flow-collection":
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
node.anchor = anchor.source.substring(1);
|
|
4989
|
-
} catch (error) {
|
|
4990
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
4991
|
-
onError(token, "RESOURCE_EXHAUSTION", message);
|
|
4992
|
-
}
|
|
4971
|
+
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
|
|
4972
|
+
if (anchor)
|
|
4973
|
+
node.anchor = anchor.source.substring(1);
|
|
4993
4974
|
break;
|
|
4994
4975
|
default: {
|
|
4995
4976
|
const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
|
|
4996
4977
|
onError(token, "UNEXPECTED_TOKEN", message);
|
|
4978
|
+
node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError);
|
|
4997
4979
|
isSrcToken = false;
|
|
4998
4980
|
}
|
|
4999
4981
|
}
|
|
5000
|
-
node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError));
|
|
5001
4982
|
if (anchor && node.anchor === "")
|
|
5002
4983
|
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
5003
4984
|
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
|
|
@@ -5182,10 +5163,8 @@ ${cb}` : comment;
|
|
|
5182
5163
|
}
|
|
5183
5164
|
}
|
|
5184
5165
|
if (afterDoc) {
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
for (let i = 0; i < this.warnings.length; ++i)
|
|
5188
|
-
doc.warnings.push(this.warnings[i]);
|
|
5166
|
+
Array.prototype.push.apply(doc.errors, this.errors);
|
|
5167
|
+
Array.prototype.push.apply(doc.warnings, this.warnings);
|
|
5189
5168
|
} else {
|
|
5190
5169
|
doc.errors = this.errors;
|
|
5191
5170
|
doc.warnings = this.warnings;
|
|
@@ -5918,7 +5897,7 @@ var require_lexer = __commonJS({
|
|
|
5918
5897
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
5919
5898
|
this.indentNext = this.indentValue + 1;
|
|
5920
5899
|
this.indentValue += n;
|
|
5921
|
-
return
|
|
5900
|
+
return yield* this.parseBlockStart();
|
|
5922
5901
|
}
|
|
5923
5902
|
return "doc";
|
|
5924
5903
|
}
|
|
@@ -6217,38 +6196,28 @@ var require_lexer = __commonJS({
|
|
|
6217
6196
|
return 0;
|
|
6218
6197
|
}
|
|
6219
6198
|
*pushIndicators() {
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
6239
|
-
if (!inFlow)
|
|
6240
|
-
this.indentNext = this.indentValue + 1;
|
|
6241
|
-
else if (this.flowKey)
|
|
6242
|
-
this.flowKey = false;
|
|
6243
|
-
n += yield* this.pushCount(1);
|
|
6244
|
-
n += yield* this.pushSpaces(true);
|
|
6245
|
-
continue loop;
|
|
6246
|
-
}
|
|
6199
|
+
switch (this.charAt(0)) {
|
|
6200
|
+
case "!":
|
|
6201
|
+
return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6202
|
+
case "&":
|
|
6203
|
+
return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6204
|
+
case "-":
|
|
6205
|
+
// this is an error
|
|
6206
|
+
case "?":
|
|
6207
|
+
// this is an error outside flow collections
|
|
6208
|
+
case ":": {
|
|
6209
|
+
const inFlow = this.flowLevel > 0;
|
|
6210
|
+
const ch1 = this.charAt(1);
|
|
6211
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
6212
|
+
if (!inFlow)
|
|
6213
|
+
this.indentNext = this.indentValue + 1;
|
|
6214
|
+
else if (this.flowKey)
|
|
6215
|
+
this.flowKey = false;
|
|
6216
|
+
return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
6247
6217
|
}
|
|
6248
6218
|
}
|
|
6249
|
-
break loop;
|
|
6250
6219
|
}
|
|
6251
|
-
return
|
|
6220
|
+
return 0;
|
|
6252
6221
|
}
|
|
6253
6222
|
*pushTag() {
|
|
6254
6223
|
if (this.charAt(1) === "<") {
|
|
@@ -6407,13 +6376,6 @@ var require_parser = __commonJS({
|
|
|
6407
6376
|
}
|
|
6408
6377
|
return prev.splice(i, prev.length);
|
|
6409
6378
|
}
|
|
6410
|
-
function arrayPushArray(target, source) {
|
|
6411
|
-
if (source.length < 1e5)
|
|
6412
|
-
Array.prototype.push.apply(target, source);
|
|
6413
|
-
else
|
|
6414
|
-
for (let i = 0; i < source.length; ++i)
|
|
6415
|
-
target.push(source[i]);
|
|
6416
|
-
}
|
|
6417
6379
|
function fixFlowSeqItems(fc) {
|
|
6418
6380
|
if (fc.start.type === "flow-seq-start") {
|
|
6419
6381
|
for (const it of fc.items) {
|
|
@@ -6423,11 +6385,11 @@ var require_parser = __commonJS({
|
|
|
6423
6385
|
delete it.key;
|
|
6424
6386
|
if (isFlowToken(it.value)) {
|
|
6425
6387
|
if (it.value.end)
|
|
6426
|
-
|
|
6388
|
+
Array.prototype.push.apply(it.value.end, it.sep);
|
|
6427
6389
|
else
|
|
6428
6390
|
it.value.end = it.sep;
|
|
6429
6391
|
} else
|
|
6430
|
-
|
|
6392
|
+
Array.prototype.push.apply(it.start, it.sep);
|
|
6431
6393
|
delete it.sep;
|
|
6432
6394
|
}
|
|
6433
6395
|
}
|
|
@@ -6782,7 +6744,7 @@ var require_parser = __commonJS({
|
|
|
6782
6744
|
const prev = map.items[map.items.length - 2];
|
|
6783
6745
|
const end = prev?.value?.end;
|
|
6784
6746
|
if (Array.isArray(end)) {
|
|
6785
|
-
|
|
6747
|
+
Array.prototype.push.apply(end, it.start);
|
|
6786
6748
|
end.push(this.sourceToken);
|
|
6787
6749
|
map.items.pop();
|
|
6788
6750
|
return;
|
|
@@ -6970,7 +6932,7 @@ var require_parser = __commonJS({
|
|
|
6970
6932
|
const prev = seq.items[seq.items.length - 2];
|
|
6971
6933
|
const end = prev?.value?.end;
|
|
6972
6934
|
if (Array.isArray(end)) {
|
|
6973
|
-
|
|
6935
|
+
Array.prototype.push.apply(end, it.start);
|
|
6974
6936
|
end.push(this.sourceToken);
|
|
6975
6937
|
seq.items.pop();
|
|
6976
6938
|
return;
|
|
@@ -8848,7 +8810,13 @@ function deriveClickUpBranchName({ taskType, parentTaskId, subtaskId, taskId } =
|
|
|
8848
8810
|
throw new Error("taskType and parentTaskId/taskId are required to derive a ClickUp branch name.");
|
|
8849
8811
|
}
|
|
8850
8812
|
if (typeSlug === "poc") return ["poc", parentSlug].join("/");
|
|
8851
|
-
return
|
|
8813
|
+
if (subtaskSlug) return `${typeSlug}/${parentSlug}-subtask-${subtaskSlug}`;
|
|
8814
|
+
return [typeSlug, parentSlug].join("/");
|
|
8815
|
+
}
|
|
8816
|
+
function isClickUpSubtaskRoute({ taskType, parentTaskId, subtaskId, taskId } = {}) {
|
|
8817
|
+
return Boolean(
|
|
8818
|
+
normalizeClickUpTaskType(taskType) !== "poc" && subtaskId && parentTaskId && String(parentTaskId) !== String(taskId || subtaskId)
|
|
8819
|
+
);
|
|
8852
8820
|
}
|
|
8853
8821
|
function deriveClickUpPrTarget({ isRelease = false, parentTaskId, parentBranch, parentTaskType, taskType, devBranch = "dev", mainBranch = "main" } = {}) {
|
|
8854
8822
|
if (isRelease) return mainBranch;
|
|
@@ -9037,15 +9005,17 @@ function deriveClickUpPendingSubtaskBranch({ taskType, parentTaskId, title } = {
|
|
|
9037
9005
|
const parentSlug = branchSafeClickUpId(parentTaskId);
|
|
9038
9006
|
if (!typeSlug || !parentSlug) throw new Error("taskType and parentTaskId are required to derive a pending subtask branch name.");
|
|
9039
9007
|
if (typeSlug === "poc") return ["poc", parentSlug].join("/");
|
|
9040
|
-
return
|
|
9008
|
+
return `${typeSlug}/${parentSlug}-pending-${normalizeLooseToken(title) || "subtask"}`;
|
|
9041
9009
|
}
|
|
9042
|
-
function buildClickUpSubtaskAgentMetadata({ parentTaskId, subtask, branch, prTarget, titleSlug } = {}) {
|
|
9010
|
+
function buildClickUpSubtaskAgentMetadata({ parentTaskId, subtask, branch, prTarget, titleSlug, parentBranch } = {}) {
|
|
9043
9011
|
return mergeClickUpAgentMetadata("", {
|
|
9044
9012
|
subtask: {
|
|
9045
9013
|
parent_task_id: parentTaskId,
|
|
9014
|
+
parent_branch: parentBranch || prTarget,
|
|
9046
9015
|
title: subtask.title,
|
|
9047
9016
|
title_slug: titleSlug,
|
|
9048
9017
|
branch,
|
|
9018
|
+
subtask_branch: branch,
|
|
9049
9019
|
pr_target: prTarget,
|
|
9050
9020
|
pending_clickup_subtask_id: true,
|
|
9051
9021
|
owner_role: subtask.ownerRole,
|
|
@@ -9065,7 +9035,7 @@ function buildClickUpCreateSubtasksPayload({ parentTaskId, markdown = "", source
|
|
|
9065
9035
|
const titleSlug = normalizeLooseToken(subtask.title) || "subtask";
|
|
9066
9036
|
const branch = subtask.branch || deriveClickUpPendingSubtaskBranch({ taskType: subtask.type, parentTaskId: parentId, title: subtask.title });
|
|
9067
9037
|
const prTarget = normalizeClickUpTaskType(subtask.type) === "poc" ? "dev" : parentBranchValue;
|
|
9068
|
-
const agentMetadata = buildClickUpSubtaskAgentMetadata({ parentTaskId: parentId, subtask, branch, prTarget, titleSlug });
|
|
9038
|
+
const agentMetadata = buildClickUpSubtaskAgentMetadata({ parentTaskId: parentId, subtask, branch, prTarget, titleSlug, parentBranch: parentBranchValue });
|
|
9069
9039
|
const descriptionParts = [
|
|
9070
9040
|
subtask.description,
|
|
9071
9041
|
subtask.acceptanceCriteria.length ? ["Acceptance Criteria:", ...subtask.acceptanceCriteria.map((item) => `- ${item}`)].join("\n") : ""
|
|
@@ -9243,27 +9213,261 @@ function safeExistingClickUpWorktree({ metadata = {}, branch = "" } = {}) {
|
|
|
9243
9213
|
return null;
|
|
9244
9214
|
}
|
|
9245
9215
|
}
|
|
9216
|
+
function clickUpGitRefExists(baseWorktree, ref, runGitFn = runGit) {
|
|
9217
|
+
try {
|
|
9218
|
+
runGitFn(baseWorktree, ["rev-parse", "--verify", ref]);
|
|
9219
|
+
return true;
|
|
9220
|
+
} catch {
|
|
9221
|
+
return false;
|
|
9222
|
+
}
|
|
9223
|
+
}
|
|
9224
|
+
function resolveClickUpDevStartPoint(baseWorktree, runGitFn = runGit) {
|
|
9225
|
+
return clickUpGitRefExists(baseWorktree, "dev", runGitFn) ? "dev" : "origin/dev";
|
|
9226
|
+
}
|
|
9227
|
+
function addClickUpWorktreeForBranch({ baseWorktree, branch, worktreePath, startPoint, runGitFn = runGit } = {}) {
|
|
9228
|
+
if (clickUpGitRefExists(baseWorktree, branch, runGitFn)) {
|
|
9229
|
+
runGitFn(baseWorktree, ["worktree", "add", worktreePath, branch]);
|
|
9230
|
+
} else {
|
|
9231
|
+
runGitFn(baseWorktree, ["worktree", "add", "-b", branch, worktreePath, startPoint]);
|
|
9232
|
+
}
|
|
9233
|
+
}
|
|
9234
|
+
function clickUpOpenChamberWorktreeName(branch = "") {
|
|
9235
|
+
return String(branch || "").trim().replace(/\//g, "-");
|
|
9236
|
+
}
|
|
9237
|
+
function openChamberUrl(baseUrl, pathname, query = {}) {
|
|
9238
|
+
const url = new URL(pathname, normalizeOpenCodeBaseUrl(baseUrl));
|
|
9239
|
+
for (const [key, value] of Object.entries(query)) {
|
|
9240
|
+
if (value !== void 0 && value !== null && String(value).trim()) url.searchParams.set(key, String(value));
|
|
9241
|
+
}
|
|
9242
|
+
return url.toString();
|
|
9243
|
+
}
|
|
9244
|
+
async function readOpenChamberJson(response, endpoint) {
|
|
9245
|
+
const text = await response.text();
|
|
9246
|
+
let data = null;
|
|
9247
|
+
if (text.trim()) {
|
|
9248
|
+
try {
|
|
9249
|
+
data = JSON.parse(text);
|
|
9250
|
+
} catch {
|
|
9251
|
+
throw new Error(`OpenChamber ${endpoint} returned non-JSON response.`);
|
|
9252
|
+
}
|
|
9253
|
+
}
|
|
9254
|
+
if (!response.ok) {
|
|
9255
|
+
const message = data?.error?.message || data?.message || data?.data?.message || text.slice(0, 200) || `HTTP ${response.status}`;
|
|
9256
|
+
throw new Error(`OpenChamber ${endpoint} failed: ${response.status} ${message}`);
|
|
9257
|
+
}
|
|
9258
|
+
return data;
|
|
9259
|
+
}
|
|
9260
|
+
async function requestOpenChamberJson({ baseUrl, endpoint, method = "GET", directory, body, fetchImpl = globalThis.fetch } = {}) {
|
|
9261
|
+
if (typeof fetchImpl !== "function") throw new Error("OpenChamber worktree provisioning requires fetch.");
|
|
9262
|
+
const response = await fetchImpl(openChamberUrl(baseUrl, endpoint, { directory }), {
|
|
9263
|
+
method,
|
|
9264
|
+
headers: body ? { "content-type": "application/json" } : void 0,
|
|
9265
|
+
body: body ? JSON.stringify(body) : void 0
|
|
9266
|
+
});
|
|
9267
|
+
return readOpenChamberJson(response, endpoint);
|
|
9268
|
+
}
|
|
9269
|
+
function normalizeOpenChamberCollection(value) {
|
|
9270
|
+
if (Array.isArray(value)) return value;
|
|
9271
|
+
if (!isPlainObject(value)) return [];
|
|
9272
|
+
for (const key of ["worktrees", "items", "data", "result", "results", "directories", "sandboxes"]) {
|
|
9273
|
+
const nested = value[key];
|
|
9274
|
+
if (Array.isArray(nested)) return nested;
|
|
9275
|
+
if (isPlainObject(nested)) {
|
|
9276
|
+
const normalized = normalizeOpenChamberCollection(nested);
|
|
9277
|
+
if (normalized.length > 0) return normalized;
|
|
9278
|
+
}
|
|
9279
|
+
}
|
|
9280
|
+
return [];
|
|
9281
|
+
}
|
|
9282
|
+
function openChamberEntryDirectory(entry) {
|
|
9283
|
+
if (typeof entry === "string") return entry;
|
|
9284
|
+
return String(entry?.directory || entry?.path || entry?.worktreePath || entry?.worktree_path || entry?.worktree?.path || entry?.worktree?.directory || "");
|
|
9285
|
+
}
|
|
9286
|
+
function openChamberEntryBranch(entry) {
|
|
9287
|
+
if (typeof entry === "string") return "";
|
|
9288
|
+
return String(entry?.branch || entry?.branchName || entry?.branch_name || entry?.worktree?.branch || "").replace(/^refs\/heads\//, "");
|
|
9289
|
+
}
|
|
9290
|
+
function openChamberListIncludesDirectory(list, directory) {
|
|
9291
|
+
const resolved = path5.resolve(directory);
|
|
9292
|
+
return normalizeOpenChamberCollection(list).some((entry) => {
|
|
9293
|
+
const entryDirectory = openChamberEntryDirectory(entry);
|
|
9294
|
+
return entryDirectory && path5.resolve(entryDirectory) === resolved;
|
|
9295
|
+
});
|
|
9296
|
+
}
|
|
9297
|
+
function openChamberListIncludesBranch(list, directory, branch) {
|
|
9298
|
+
const resolved = path5.resolve(directory);
|
|
9299
|
+
return normalizeOpenChamberCollection(list).some((entry) => {
|
|
9300
|
+
const entryDirectory = openChamberEntryDirectory(entry);
|
|
9301
|
+
if (!entryDirectory || path5.resolve(entryDirectory) !== resolved) return false;
|
|
9302
|
+
const entryBranch = openChamberEntryBranch(entry);
|
|
9303
|
+
return !entryBranch || entryBranch === branch;
|
|
9304
|
+
});
|
|
9305
|
+
}
|
|
9306
|
+
async function findOpenChamberProject({ baseUrl, baseWorktree, fetchImpl = globalThis.fetch } = {}) {
|
|
9307
|
+
const projects = await requestOpenChamberJson({ baseUrl, endpoint: "/project", directory: baseWorktree, fetchImpl });
|
|
9308
|
+
if (!Array.isArray(projects)) return null;
|
|
9309
|
+
const resolvedBase = path5.resolve(baseWorktree);
|
|
9310
|
+
return projects.find((project) => path5.resolve(String(project?.worktree || project?.path || "")) === resolvedBase) || null;
|
|
9311
|
+
}
|
|
9312
|
+
async function refreshOpenChamberProjectCopy({ baseUrl, baseWorktree, projectId, fetchImpl = globalThis.fetch } = {}) {
|
|
9313
|
+
if (!projectId) return { refreshed: false, reason: "project_id_unavailable" };
|
|
9314
|
+
const response = await fetchImpl(openChamberUrl(baseUrl, `/experimental/project/${encodeURIComponent(projectId)}/copy/refresh`, {}), { method: "POST" });
|
|
9315
|
+
await readOpenChamberJson(response, "/experimental/project/{projectID}/copy/refresh");
|
|
9316
|
+
return { refreshed: true, projectId };
|
|
9317
|
+
}
|
|
9318
|
+
async function listOpenChamberGitWorktrees({ baseUrl, baseWorktree, fetchImpl = globalThis.fetch } = {}) {
|
|
9319
|
+
return requestOpenChamberJson({ baseUrl, endpoint: "/api/git/worktrees", directory: baseWorktree, fetchImpl });
|
|
9320
|
+
}
|
|
9321
|
+
async function verifyOpenChamberGitWorktree({ baseUrl, baseWorktree, worktreePath, branch, fetchImpl = globalThis.fetch } = {}) {
|
|
9322
|
+
const worktrees = await listOpenChamberGitWorktrees({ baseUrl, baseWorktree, fetchImpl });
|
|
9323
|
+
const verified = openChamberListIncludesBranch(worktrees, worktreePath, branch);
|
|
9324
|
+
if (!verified) {
|
|
9325
|
+
throw new Error(`OpenChamber Git worktree verification failed for ${worktreePath} on ${branch}.`);
|
|
9326
|
+
}
|
|
9327
|
+
return { worktree: true, branch: true };
|
|
9328
|
+
}
|
|
9329
|
+
async function syncOpenChamberWorktreeVisibility({ baseUrl, baseWorktree, worktreePath, branch, fetchImpl = globalThis.fetch } = {}) {
|
|
9330
|
+
const gitWorktree = await verifyOpenChamberGitWorktree({ baseUrl, baseWorktree, worktreePath, branch, fetchImpl });
|
|
9331
|
+
await requestOpenChamberJson({ baseUrl, endpoint: "/experimental/workspace/sync-list", method: "POST", directory: baseWorktree, fetchImpl });
|
|
9332
|
+
const project = await findOpenChamberProject({ baseUrl, baseWorktree, fetchImpl });
|
|
9333
|
+
if (!project?.id) throw new Error("OpenChamber project was not found after workspace sync; refusing to treat worktree as visible.");
|
|
9334
|
+
await refreshOpenChamberProjectCopy({ baseUrl, baseWorktree, projectId: project.id, fetchImpl });
|
|
9335
|
+
const [worktrees, workspaces, directories] = await Promise.all([
|
|
9336
|
+
listOpenChamberGitWorktrees({ baseUrl, baseWorktree, fetchImpl }),
|
|
9337
|
+
requestOpenChamberJson({ baseUrl, endpoint: "/experimental/workspace", directory: baseWorktree, fetchImpl }),
|
|
9338
|
+
requestOpenChamberJson({ baseUrl, endpoint: `/project/${encodeURIComponent(project.id)}/directories`, directory: baseWorktree, fetchImpl })
|
|
9339
|
+
]);
|
|
9340
|
+
const visibility = {
|
|
9341
|
+
worktree: openChamberListIncludesBranch(worktrees, worktreePath, branch),
|
|
9342
|
+
workspace: openChamberListIncludesBranch(workspaces, worktreePath, branch),
|
|
9343
|
+
projectDirectory: openChamberListIncludesDirectory(directories, worktreePath),
|
|
9344
|
+
gitWorktree,
|
|
9345
|
+
projectId: project.id
|
|
9346
|
+
};
|
|
9347
|
+
if (!visibility.worktree || !visibility.workspace || !visibility.projectDirectory) {
|
|
9348
|
+
throw new Error(`OpenChamber visibility verification failed for ${worktreePath}: ${JSON.stringify(visibility)}`);
|
|
9349
|
+
}
|
|
9350
|
+
return visibility;
|
|
9351
|
+
}
|
|
9352
|
+
function assertOpenChamberClickUpWorktreePath({ baseWorktree, worktreePath } = {}) {
|
|
9353
|
+
if (!isClickUpDerivedWorktreeSibling(worktreePath, baseWorktree)) {
|
|
9354
|
+
throw new Error(`OpenChamber worktree path is outside the configured ClickUp sibling scope: ${worktreePath}`);
|
|
9355
|
+
}
|
|
9356
|
+
}
|
|
9357
|
+
async function createOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch, worktreePath, startPoint, branchExists = false, fetchImpl = globalThis.fetch } = {}) {
|
|
9358
|
+
const worktreeName = clickUpOpenChamberWorktreeName(branch);
|
|
9359
|
+
const body = { name: worktreeName, mode: branchExists ? "existing" : "new", worktreeName, branchName: branch, startRef: branchExists ? branch : startPoint };
|
|
9360
|
+
let created;
|
|
9361
|
+
try {
|
|
9362
|
+
created = await requestOpenChamberJson({ baseUrl, endpoint: "/api/git/worktrees", method: "POST", directory: baseWorktree, body, fetchImpl });
|
|
9363
|
+
} catch (error) {
|
|
9364
|
+
throw new Error(`OpenChamber could not create ${branch} from ${branchExists ? branch : startPoint}; API may not support required branch/startRef semantics. Fail-closed: ${error.message}`);
|
|
9365
|
+
}
|
|
9366
|
+
const createdDirectory = openChamberEntryDirectory(created);
|
|
9367
|
+
const createdBranch = openChamberEntryBranch(created);
|
|
9368
|
+
if (!createdDirectory || !path5.isAbsolute(createdDirectory)) {
|
|
9369
|
+
throw new Error(`OpenChamber did not return an absolute worktree path for ${branch}.`);
|
|
9370
|
+
}
|
|
9371
|
+
if (createdBranch !== branch) {
|
|
9372
|
+
throw new Error(`OpenChamber created unexpected branch ${createdBranch || "<unknown>"}; expected ${branch}.`);
|
|
9373
|
+
}
|
|
9374
|
+
const verified = await verifyOpenChamberGitWorktree({ baseUrl, baseWorktree, worktreePath: createdDirectory, branch, fetchImpl });
|
|
9375
|
+
return { created, worktree: path5.resolve(createdDirectory), branch: createdBranch, verified };
|
|
9376
|
+
}
|
|
9377
|
+
async function registerOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch, worktreePath, fetchImpl = globalThis.fetch, source = "reuse" } = {}) {
|
|
9378
|
+
assertOpenChamberClickUpWorktreePath({ baseWorktree, worktreePath });
|
|
9379
|
+
const visibility = await syncOpenChamberWorktreeVisibility({ baseUrl, baseWorktree, worktreePath, branch, fetchImpl });
|
|
9380
|
+
return { branch, worktree: path5.resolve(worktreePath), reused: true, provider: "openchamber", openChamber: { source, visibility } };
|
|
9381
|
+
}
|
|
9382
|
+
async function ensureClickUpTaskWorktreeOpenChamber({ baseWorktree = "", taskId, taskType = "Tarea", parentTaskId = "", subtaskId = "", existingMetadata = {}, runGitFn = runGit, baseUrl = "", fetchImpl = globalThis.fetch, log = null } = {}) {
|
|
9383
|
+
const effectiveParent = parentTaskId || taskId;
|
|
9384
|
+
const isSubtask = isClickUpSubtaskRoute({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9385
|
+
const parentBranch = isSubtask ? deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent }) : "";
|
|
9386
|
+
const branch = deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9387
|
+
const prTarget = parentBranch || "dev";
|
|
9388
|
+
const existing = safeExistingClickUpWorktree({ metadata: existingMetadata, branch });
|
|
9389
|
+
if (existing) {
|
|
9390
|
+
const registered = await registerOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch, worktreePath: existing.worktree, fetchImpl, source: "metadata_reuse" });
|
|
9391
|
+
log?.({ type: "openchamber_worktree_registered", taskId, branch, worktree: registered.worktree, source: "metadata_reuse", visibility: registered.openChamber.visibility });
|
|
9392
|
+
return { ...registered, parentBranch: parentBranch || void 0, prTarget };
|
|
9393
|
+
}
|
|
9394
|
+
const worktreePath = deriveClickUpWorktree({ baseWorktree, taskId, taskType, parentTaskId: effectiveParent, subtaskId });
|
|
9395
|
+
if (fs5.existsSync(worktreePath)) {
|
|
9396
|
+
const registered = await registerOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch, worktreePath, fetchImpl, source: "existing_directory" });
|
|
9397
|
+
log?.({ type: "openchamber_worktree_registered", taskId, branch, worktree: registered.worktree, source: "existing_directory", visibility: registered.openChamber.visibility });
|
|
9398
|
+
return { ...registered, parentBranch: parentBranch || void 0, prTarget };
|
|
9399
|
+
}
|
|
9400
|
+
let parentBootstrap = null;
|
|
9401
|
+
if (isSubtask) {
|
|
9402
|
+
const parentWorktree = deriveClickUpWorktree({ baseWorktree, taskId: effectiveParent, taskType, parentTaskId: effectiveParent });
|
|
9403
|
+
if (fs5.existsSync(parentWorktree)) {
|
|
9404
|
+
const registeredParent = await registerOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch: parentBranch, worktreePath: parentWorktree, fetchImpl, source: "parent_existing_directory" });
|
|
9405
|
+
parentBootstrap = { branch: parentBranch, worktree: registeredParent.worktree, reused: true, provider: "openchamber", visibility: registeredParent.openChamber.visibility };
|
|
9406
|
+
} else {
|
|
9407
|
+
const parentStartPoint = resolveClickUpDevStartPoint(baseWorktree, runGitFn);
|
|
9408
|
+
const parentBranchExists = clickUpGitRefExists(baseWorktree, parentBranch, runGitFn);
|
|
9409
|
+
const createdParent = await createOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch: parentBranch, worktreePath: parentWorktree, startPoint: parentStartPoint, branchExists: parentBranchExists, fetchImpl });
|
|
9410
|
+
const parentVisibility = await syncOpenChamberWorktreeVisibility({ baseUrl, baseWorktree, worktreePath: createdParent.worktree, branch: parentBranch, fetchImpl });
|
|
9411
|
+
parentBootstrap = { branch: parentBranch, worktree: createdParent.worktree, startPoint: parentBranchExists ? parentBranch : parentStartPoint, reused: parentBranchExists, provider: "openchamber", visibility: parentVisibility };
|
|
9412
|
+
log?.({ type: "openchamber_worktree_created", taskId: effectiveParent, branch: parentBranch, worktree: parentBootstrap.worktree, startPoint: parentBootstrap.startPoint, visibility: parentVisibility });
|
|
9413
|
+
}
|
|
9414
|
+
}
|
|
9415
|
+
const startPoint = isSubtask ? parentBranch : resolveClickUpDevStartPoint(baseWorktree, runGitFn);
|
|
9416
|
+
const branchExists = clickUpGitRefExists(baseWorktree, branch, runGitFn);
|
|
9417
|
+
const created = await createOpenChamberClickUpWorktree({ baseUrl, baseWorktree, branch, worktreePath, startPoint, branchExists, fetchImpl });
|
|
9418
|
+
const visibility = await syncOpenChamberWorktreeVisibility({ baseUrl, baseWorktree, worktreePath: created.worktree, branch, fetchImpl });
|
|
9419
|
+
log?.({ type: "openchamber_worktree_created", taskId, branch, worktree: created.worktree, startPoint: branchExists ? branch : startPoint, visibility });
|
|
9420
|
+
return { branch, worktree: created.worktree, reused: false, startPoint, parentBranch: parentBranch || void 0, prTarget, parentBootstrap: parentBootstrap || void 0, provider: "openchamber", openChamber: { source: "created", visibility } };
|
|
9421
|
+
}
|
|
9422
|
+
async function ensureClickUpTaskWorktreeForWebhook({ opencodeBaseUrl = "", opencodeBaseUrlConfigured = false, openchamberBaseUrl = "", openchamberBaseUrlConfigured = false, clickupClient = null, webhookWorktree = process.cwd(), fetchImpl = globalThis.fetch, ...options } = {}) {
|
|
9423
|
+
void opencodeBaseUrl;
|
|
9424
|
+
void opencodeBaseUrlConfigured;
|
|
9425
|
+
if (!openchamberBaseUrlConfigured || !openchamberBaseUrl) return ensureClickUpTaskWorktree(options);
|
|
9426
|
+
try {
|
|
9427
|
+
return await ensureClickUpTaskWorktreeOpenChamber({ ...options, baseUrl: openchamberBaseUrl, fetchImpl, log: (entry) => appendClickUpWebhookLocalLog(webhookWorktree, entry) });
|
|
9428
|
+
} catch (error) {
|
|
9429
|
+
const message = `OpenChamber worktree provisioning failed for ${options.taskId || "unknown task"}; raw git fallback is disabled to avoid invisible worktrees. ${error.message}`;
|
|
9430
|
+
appendClickUpWebhookLocalLog(webhookWorktree, { type: "openchamber_worktree_failed", taskId: options.taskId || null, message });
|
|
9431
|
+
if (typeof clickupClient?.postTaskComment === "function") {
|
|
9432
|
+
try {
|
|
9433
|
+
await clickupClient.postTaskComment({ taskId: options.taskId, comment: `${message}
|
|
9434
|
+
|
|
9435
|
+
Optima did not run raw git worktree fallback. Please verify clickup.openchamber.base_url and OpenChamber Git API compatibility.` });
|
|
9436
|
+
} catch (commentError) {
|
|
9437
|
+
appendClickUpWebhookLocalLog(webhookWorktree, { type: "openchamber_worktree_blocker_comment_failed", taskId: options.taskId || null, message: commentError.message });
|
|
9438
|
+
}
|
|
9439
|
+
}
|
|
9440
|
+
throw new Error(message);
|
|
9441
|
+
}
|
|
9442
|
+
}
|
|
9246
9443
|
function ensureClickUpTaskWorktree({ baseWorktree = "", taskId, taskType = "Tarea", parentTaskId = "", subtaskId = "", existingMetadata = {}, runGitFn = runGit, allowNonGitFallback = false } = {}) {
|
|
9247
9444
|
const effectiveParent = parentTaskId || taskId;
|
|
9445
|
+
const isSubtask = isClickUpSubtaskRoute({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9446
|
+
const parentBranch = isSubtask ? deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent }) : "";
|
|
9248
9447
|
const branch = deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9249
9448
|
const existing = safeExistingClickUpWorktree({ metadata: existingMetadata, branch });
|
|
9250
|
-
if (existing) return { ...existing, branch };
|
|
9449
|
+
if (existing) return { ...existing, branch, parentBranch: parentBranch || void 0, prTarget: parentBranch || "dev" };
|
|
9251
9450
|
const worktreePath = deriveClickUpWorktree({ baseWorktree, taskId, taskType, parentTaskId: effectiveParent, subtaskId });
|
|
9252
|
-
if (fs5.existsSync(worktreePath)) return { branch, worktree: path5.resolve(worktreePath), reused: true };
|
|
9451
|
+
if (fs5.existsSync(worktreePath)) return { branch, worktree: path5.resolve(worktreePath), reused: true, parentBranch: parentBranch || void 0, prTarget: parentBranch || "dev" };
|
|
9253
9452
|
if (allowNonGitFallback) {
|
|
9254
9453
|
fs5.mkdirSync(worktreePath, { recursive: true });
|
|
9255
|
-
return { branch, worktree: path5.resolve(worktreePath), reused: false, fallback: "non_git" };
|
|
9454
|
+
return { branch, worktree: path5.resolve(worktreePath), reused: false, fallback: "non_git", parentBranch: parentBranch || void 0, prTarget: parentBranch || "dev", startPoint: parentBranch || "dev" };
|
|
9256
9455
|
}
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9456
|
+
let parentBootstrap = null;
|
|
9457
|
+
if (isSubtask) {
|
|
9458
|
+
const parentWorktree = deriveClickUpWorktree({ baseWorktree, taskId: effectiveParent, taskType, parentTaskId: effectiveParent });
|
|
9459
|
+
if (!fs5.existsSync(parentWorktree)) {
|
|
9460
|
+
const parentStartPoint = resolveClickUpDevStartPoint(baseWorktree, runGitFn);
|
|
9461
|
+
const parentBranchExists = clickUpGitRefExists(baseWorktree, parentBranch, runGitFn);
|
|
9462
|
+
addClickUpWorktreeForBranch({ baseWorktree, branch: parentBranch, worktreePath: parentWorktree, startPoint: parentStartPoint, runGitFn });
|
|
9463
|
+
parentBootstrap = { branch: parentBranch, worktree: path5.resolve(parentWorktree), startPoint: parentBranchExists ? parentBranch : parentStartPoint, reused: parentBranchExists };
|
|
9464
|
+
} else {
|
|
9465
|
+
parentBootstrap = { branch: parentBranch, worktree: path5.resolve(parentWorktree), reused: true };
|
|
9263
9466
|
}
|
|
9264
|
-
}
|
|
9265
|
-
|
|
9266
|
-
|
|
9467
|
+
}
|
|
9468
|
+
const startPoint = isSubtask ? parentBranch : resolveClickUpDevStartPoint(baseWorktree, runGitFn);
|
|
9469
|
+
addClickUpWorktreeForBranch({ baseWorktree, branch, worktreePath, startPoint, runGitFn });
|
|
9470
|
+
return { branch, worktree: path5.resolve(worktreePath), reused: false, startPoint, parentBranch: parentBranch || void 0, prTarget: parentBranch || "dev", parentBootstrap: parentBootstrap || void 0 };
|
|
9267
9471
|
}
|
|
9268
9472
|
function normalizeClickUpDefinitionDocParent(parent = {}) {
|
|
9269
9473
|
const docId = String(parent.doc_id || parent.docId || CLICKUP_DEFINITION_DOC_PARENT.doc_id).trim();
|
|
@@ -9285,13 +9489,22 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
|
|
|
9285
9489
|
if (!description) errors.push("taskDescription is required for the initial ClickUp task description rewrite.");
|
|
9286
9490
|
if (errors.length > 0) return clickUpPayloadValidationError(errors);
|
|
9287
9491
|
const effectiveParent = parentTaskId || taskId;
|
|
9492
|
+
const isSubtask = isClickUpSubtaskRoute({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9493
|
+
const parentBranch = isSubtask ? deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent }) : "";
|
|
9288
9494
|
const branch = deriveClickUpBranchName({ taskType, parentTaskId: effectiveParent, subtaskId, taskId });
|
|
9289
9495
|
const worktree = deriveClickUpWorktree({ baseWorktree, taskId, taskType, parentTaskId: effectiveParent, subtaskId });
|
|
9496
|
+
const prTarget = isSubtask ? parentBranch : "dev";
|
|
9497
|
+
const startFrom = isSubtask ? parentBranch : "dev";
|
|
9290
9498
|
const estimate = preEstimateClickUpWork({ complexity, filesChanged, acceptanceCriteria, unknowns });
|
|
9291
9499
|
const metadata = mergeClickUpAgentMetadata(existingAgentMetadata, {
|
|
9292
9500
|
task: {
|
|
9501
|
+
parent_task_id: isSubtask ? effectiveParent : void 0,
|
|
9502
|
+
parent_branch: parentBranch || void 0,
|
|
9293
9503
|
branch,
|
|
9504
|
+
subtask_branch: isSubtask ? branch : void 0,
|
|
9294
9505
|
worktree,
|
|
9506
|
+
subtask_worktree: isSubtask ? worktree : void 0,
|
|
9507
|
+
pr_target: prTarget,
|
|
9295
9508
|
mirror_task_path: `.optima/tasks/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}.md`,
|
|
9296
9509
|
evidence_path: `.optima/evidences/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}/SUMMARY.md`,
|
|
9297
9510
|
delivery_evidence_path: deliveryEvidencePathForClickUpTask(taskId || subtaskId || effectiveParent),
|
|
@@ -9304,17 +9517,18 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
|
|
|
9304
9517
|
dryRun: true,
|
|
9305
9518
|
required_first_actions: [
|
|
9306
9519
|
"Create or reuse the task-specific branch/worktree before planning or writing local .optima mirrors.",
|
|
9307
|
-
`Use branch ${branch} from
|
|
9520
|
+
`Use branch ${branch} from ${startFrom} and worktree ${worktree} for this task workspace.`,
|
|
9308
9521
|
"Write planning state, .optima/tasks/current.md, task mirrors, and local evidence only inside the task worktree.",
|
|
9309
9522
|
`Write merge-trackable final evidence under ${deliveryEvidencePathForClickUpTask(taskId || subtaskId || effectiveParent)}; .optima remains local mirror/staging.`,
|
|
9310
9523
|
"Do not update the principal dev workspace .optima/tasks/current.md for ClickUp task planning.",
|
|
9311
9524
|
"If another active task is present in current.md, move to or create this task worktree instead of stopping."
|
|
9312
9525
|
],
|
|
9313
9526
|
git: {
|
|
9314
|
-
startFrom
|
|
9527
|
+
startFrom,
|
|
9315
9528
|
branch,
|
|
9316
9529
|
worktree,
|
|
9317
|
-
|
|
9530
|
+
parentBranch: parentBranch || void 0,
|
|
9531
|
+
prTarget
|
|
9318
9532
|
},
|
|
9319
9533
|
mirror: {
|
|
9320
9534
|
taskPath: `.optima/tasks/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}.md`,
|
|
@@ -9326,7 +9540,7 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
|
|
|
9326
9540
|
wouldCreate: true
|
|
9327
9541
|
},
|
|
9328
9542
|
clickup: {
|
|
9329
|
-
comment: `Starting task from
|
|
9543
|
+
comment: `Starting task from ${startFrom}. Branch: ${branch}. Worktree: ${worktree}. Delivery evidence: ${deliveryEvidencePathForClickUpTask(taskId || subtaskId || effectiveParent)}.`,
|
|
9330
9544
|
description,
|
|
9331
9545
|
fields: {
|
|
9332
9546
|
Definition: definitionContent,
|
|
@@ -9587,6 +9801,11 @@ function normalizeClickUpWebhookConfig(rawClickUp = null, worktree = process.cwd
|
|
|
9587
9801
|
const webhook = isPlainObject(raw.webhook) ? raw.webhook : {};
|
|
9588
9802
|
const routing = isPlainObject(raw.routing) ? raw.routing : {};
|
|
9589
9803
|
const opencode = isPlainObject(raw.opencode) ? raw.opencode : {};
|
|
9804
|
+
const openchamber = isPlainObject(raw.openchamber) ? raw.openchamber : {};
|
|
9805
|
+
const rawOpenCodeBaseUrl = opencode.base_url ?? opencode.baseUrl ?? raw.opencode_base_url ?? raw.opencodeBaseUrl;
|
|
9806
|
+
const rawOpenChamberBaseUrl = openchamber.base_url ?? openchamber.baseUrl ?? raw.openchamber_base_url ?? raw.openchamberBaseUrl;
|
|
9807
|
+
const openCodeBaseUrlConfigured = rawOpenCodeBaseUrl !== void 0 && rawOpenCodeBaseUrl !== null && String(rawOpenCodeBaseUrl).trim() !== "";
|
|
9808
|
+
const openChamberBaseUrlConfigured = rawOpenChamberBaseUrl !== void 0 && rawOpenChamberBaseUrl !== null && String(rawOpenChamberBaseUrl).trim() !== "";
|
|
9590
9809
|
const location = isPlainObject(webhook.location) ? webhook.location : {};
|
|
9591
9810
|
const events = Array.isArray(webhook.events) && webhook.events.length > 0 ? [...new Set(webhook.events.map((event) => String(event || "").trim()).filter(Boolean))] : [...CLICKUP_WEBHOOK_EVENTS];
|
|
9592
9811
|
const ignoredStatuses = Array.isArray(routing.ignored_statuses) && routing.ignored_statuses.length > 0 ? routing.ignored_statuses : CLICKUP_WEBHOOK_TERMINAL_STATUSES;
|
|
@@ -9598,7 +9817,8 @@ function normalizeClickUpWebhookConfig(rawClickUp = null, worktree = process.cwd
|
|
|
9598
9817
|
apiToken: String(raw.api_token || raw.apiToken || "").trim(),
|
|
9599
9818
|
log: normalizeClickUpWebhookLogLevel(raw.log),
|
|
9600
9819
|
opencode: {
|
|
9601
|
-
baseUrl: normalizeOpenCodeBaseUrl(
|
|
9820
|
+
baseUrl: normalizeOpenCodeBaseUrl(rawOpenCodeBaseUrl),
|
|
9821
|
+
baseUrlConfigured: openCodeBaseUrlConfigured,
|
|
9602
9822
|
promptDelivery: ["http", "direct"].includes(String(opencode.prompt_delivery || opencode.promptDelivery || raw.prompt_delivery || raw.promptDelivery || "").trim().toLowerCase()) ? "http" : "sdk",
|
|
9603
9823
|
acceptPromptAdmission: opencode.accept_prompt_admission === true || opencode.acceptPromptAdmission === true || raw.accept_prompt_admission === true || raw.acceptPromptAdmission === true,
|
|
9604
9824
|
startupReconciliationDelayMs: normalizeNonNegativeInteger(
|
|
@@ -9606,6 +9826,10 @@ function normalizeClickUpWebhookConfig(rawClickUp = null, worktree = process.cwd
|
|
|
9606
9826
|
CLICKUP_WEBHOOK_STARTUP_RECONCILIATION_DELAY_MS
|
|
9607
9827
|
)
|
|
9608
9828
|
},
|
|
9829
|
+
openchamber: {
|
|
9830
|
+
baseUrl: normalizeOpenCodeBaseUrl(rawOpenChamberBaseUrl, ""),
|
|
9831
|
+
baseUrlConfigured: openChamberBaseUrlConfigured
|
|
9832
|
+
},
|
|
9609
9833
|
webhook: {
|
|
9610
9834
|
publicUrl: String(webhook.public_url || webhook.publicUrl || "").trim(),
|
|
9611
9835
|
bindHost: String(webhook.bind_host || webhook.bindHost || "127.0.0.1").trim(),
|
|
@@ -9647,6 +9871,13 @@ function normalizeClickUpWebhookConfig(rawClickUp = null, worktree = process.cwd
|
|
|
9647
9871
|
errors.push("clickup.opencode.base_url must be a valid URL");
|
|
9648
9872
|
}
|
|
9649
9873
|
}
|
|
9874
|
+
if (config.openchamber.baseUrl) {
|
|
9875
|
+
try {
|
|
9876
|
+
new URL(config.openchamber.baseUrl);
|
|
9877
|
+
} catch {
|
|
9878
|
+
errors.push("clickup.openchamber.base_url must be a valid URL");
|
|
9879
|
+
}
|
|
9880
|
+
}
|
|
9650
9881
|
const missingEvents = CLICKUP_WEBHOOK_EVENTS.filter((event) => !config.webhook.events.includes(event));
|
|
9651
9882
|
if (missingEvents.length > 0) errors.push(`clickup.webhook.events missing: ${missingEvents.join(", ")}`);
|
|
9652
9883
|
if (config.routing.targetAgent !== "workflow_product_manager") errors.push("clickup.routing.target_agent must be workflow_product_manager");
|
|
@@ -10570,6 +10801,16 @@ async function probeOpenCodeSessionControl(client, { directory, agent, omitAgent
|
|
|
10570
10801
|
const rawMessages = await readOpenCodeSessionMessages(client, { sessionId: create.session_id, directory, limit: 50 });
|
|
10571
10802
|
if (!rawMessages) throw new Error("OpenCode client does not expose session.messages.");
|
|
10572
10803
|
const fullMessageText = rawMessages.map(openCodeMessageText).join("\n");
|
|
10804
|
+
const respondingAgents = [...new Set(rawMessages.filter((message) => normalizeLooseToken(normalizeOpenCodeMessageRole(message)) === "assistant").flatMap((message) => [normalizeOpenCodeMessageAgent(message), normalizeOpenCodeMessageMode(message)]).map((value) => String(value || "").trim()).filter(Boolean))];
|
|
10805
|
+
const requestedAgent = normalizeLooseToken(agent);
|
|
10806
|
+
const assistantVisible = rawMessages.some((message) => normalizeLooseToken(normalizeOpenCodeMessageRole(message)) === "assistant");
|
|
10807
|
+
const markerVisible = fullMessageText.includes(marker);
|
|
10808
|
+
const deliveryVerified = markerVisible && assistantVisible;
|
|
10809
|
+
const requestedAgentVerified = requestedAgent ? deliveryVerified && rawMessages.some((message) => {
|
|
10810
|
+
const messageAgent = normalizeLooseToken(normalizeOpenCodeMessageAgent(message));
|
|
10811
|
+
const messageMode = normalizeLooseToken(normalizeOpenCodeMessageMode(message));
|
|
10812
|
+
return normalizeLooseToken(normalizeOpenCodeMessageRole(message)) === "assistant" && (messageAgent === requestedAgent || messageMode === requestedAgent);
|
|
10813
|
+
}) : null;
|
|
10573
10814
|
const messages = {
|
|
10574
10815
|
ok: true,
|
|
10575
10816
|
session_id: create.session_id,
|
|
@@ -10587,8 +10828,11 @@ async function probeOpenCodeSessionControl(client, { directory, agent, omitAgent
|
|
|
10587
10828
|
marker_length: marker.length,
|
|
10588
10829
|
marker_truncated: requestedMarker.length > marker.length,
|
|
10589
10830
|
marker_hash: hashOpenCodeSessionText(marker),
|
|
10590
|
-
marker_visible:
|
|
10591
|
-
assistant_visible:
|
|
10831
|
+
marker_visible: markerVisible,
|
|
10832
|
+
assistant_visible: assistantVisible,
|
|
10833
|
+
delivery_verified: deliveryVerified,
|
|
10834
|
+
requested_agent_verified: requestedAgentVerified,
|
|
10835
|
+
responding_agents: respondingAgents,
|
|
10592
10836
|
create,
|
|
10593
10837
|
prompt,
|
|
10594
10838
|
messages
|
|
@@ -10923,7 +11167,7 @@ async function withClickUpTaskRouteLock(taskId, operation) {
|
|
|
10923
11167
|
if (activeClickUpTaskRoutes.get(key) === current) activeClickUpTaskRoutes.delete(key);
|
|
10924
11168
|
}
|
|
10925
11169
|
}
|
|
10926
|
-
async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, worktree = process.cwd(), clickupClient, openCodeClient, sessionExists = openCodeSessionExists, createSession = createOpenCodeSession, sendSessionEvent = sendOpenCodeSessionEvent, ensureTaskWorktree =
|
|
11170
|
+
async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, worktree = process.cwd(), clickupClient, openCodeClient, sessionExists = openCodeSessionExists, createSession = createOpenCodeSession, sendSessionEvent = sendOpenCodeSessionEvent, ensureTaskWorktree = ensureClickUpTaskWorktreeForWebhook, verifySessionEventDelivery = verifyOpenCodeSessionEventDelivery, saveState = null, now = () => /* @__PURE__ */ new Date(), host = os.hostname(), commentLedgerPath = clickUpCommentLedgerPath(worktree) } = {}) {
|
|
10927
11171
|
const eventType = clickUpEventType(payload);
|
|
10928
11172
|
const eventKey = clickUpWebhookEventKey(payload);
|
|
10929
11173
|
const isStartupAssignmentReconciliation = payload?.startup_reconciliation === true && eventType === "taskAssigneeUpdated";
|
|
@@ -10979,7 +11223,7 @@ async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, w
|
|
|
10979
11223
|
const subtaskId = parentTaskId && parentTaskId !== taskId ? taskId : "";
|
|
10980
11224
|
let taskRoute;
|
|
10981
11225
|
try {
|
|
10982
|
-
taskRoute = ensureTaskWorktree({ baseWorktree: config.basePath, taskId, taskType, parentTaskId, subtaskId, existingMetadata: metadata, allowNonGitFallback: process.env.NODE_ENV === "test" || config.test === true });
|
|
11226
|
+
taskRoute = await ensureTaskWorktree({ baseWorktree: config.basePath, taskId, taskType, parentTaskId, subtaskId, existingMetadata: metadata, allowNonGitFallback: process.env.NODE_ENV === "test" || config.test === true, opencodeBaseUrl: config.opencode?.baseUrl, opencodeBaseUrlConfigured: config.opencode?.baseUrlConfigured === true, openchamberBaseUrl: config.openchamber?.baseUrl, openchamberBaseUrlConfigured: config.openchamber?.baseUrlConfigured === true, clickupClient, webhookWorktree: worktree });
|
|
10983
11227
|
} catch (error) {
|
|
10984
11228
|
const message = `Optima webhook could not create or reuse a task worktree for ${taskId}: ${error.message}`;
|
|
10985
11229
|
appendClickUpWebhookLocalLog(worktree, { type: "task_worktree_failed", taskId, message });
|
|
@@ -10988,8 +11232,13 @@ async function routeClickUpWebhookEventUnlocked({ payload, config, state = {}, w
|
|
|
10988
11232
|
}
|
|
10989
11233
|
const deliveryEvidencePath = deliveryEvidencePathForClickUpTask(taskId);
|
|
10990
11234
|
const routingMetadata = {
|
|
11235
|
+
parent_task_id: subtaskId ? parentTaskId : void 0,
|
|
11236
|
+
parent_branch: taskRoute.parentBranch,
|
|
10991
11237
|
branch: taskRoute.branch,
|
|
11238
|
+
subtask_branch: subtaskId ? taskRoute.branch : void 0,
|
|
10992
11239
|
worktree: taskRoute.worktree,
|
|
11240
|
+
subtask_worktree: subtaskId ? taskRoute.worktree : void 0,
|
|
11241
|
+
pr_target: taskRoute.prTarget || (subtaskId ? taskRoute.parentBranch : "dev"),
|
|
10993
11242
|
delivery_evidence_path: deliveryEvidencePath,
|
|
10994
11243
|
evidence_path: `.optima/evidences/${branchSafeClickUpId(taskId)}/SUMMARY.md`
|
|
10995
11244
|
};
|
|
@@ -12261,7 +12510,33 @@ function getModePromptFragment(agentId, operatingTeamMode, worktree) {
|
|
|
12261
12510
|
function shouldRegisterWorkflowProductManager(options = {}, worktree = process.cwd()) {
|
|
12262
12511
|
if (options.clickUpWebhookActive === true) return true;
|
|
12263
12512
|
const validation = options.clickUpWebhookValidation;
|
|
12264
|
-
|
|
12513
|
+
if (validation?.complete !== true || validation?.ok === false) return false;
|
|
12514
|
+
const basePath = validation.config?.basePath;
|
|
12515
|
+
return isSameOrNestedPath(worktree, basePath) || isClickUpDerivedWorktreeSibling(worktree, basePath);
|
|
12516
|
+
}
|
|
12517
|
+
function isClickUpDerivedWorktreeSibling(candidate, basePath) {
|
|
12518
|
+
if (typeof candidate !== "string" || typeof basePath !== "string" || !candidate.trim() || !basePath.trim()) return false;
|
|
12519
|
+
const resolvedCandidate = path5.resolve(candidate);
|
|
12520
|
+
const resolvedBase = path5.resolve(basePath);
|
|
12521
|
+
const baseParent = path5.dirname(resolvedBase);
|
|
12522
|
+
if (path5.dirname(resolvedCandidate) !== baseParent) return false;
|
|
12523
|
+
const baseName = path5.basename(resolvedBase);
|
|
12524
|
+
const candidateName = path5.basename(resolvedCandidate);
|
|
12525
|
+
if (!candidateName.startsWith(`${baseName}-`)) return false;
|
|
12526
|
+
const branchSlug = candidateName.slice(baseName.length + 1);
|
|
12527
|
+
const parts = branchSlug.split("-").filter(Boolean);
|
|
12528
|
+
if (parts.length < 2) return false;
|
|
12529
|
+
if (!(/* @__PURE__ */ new Set(["tarea", "bug", "doc", "poc", "idea"])).has(parts[0])) return false;
|
|
12530
|
+
if (!parts.slice(1).every((part) => /^[a-z0-9][a-z0-9-]*$/.test(part))) return false;
|
|
12531
|
+
try {
|
|
12532
|
+
const candidateStat = fs5.lstatSync(resolvedCandidate);
|
|
12533
|
+
if (!candidateStat.isDirectory() || candidateStat.isSymbolicLink()) return false;
|
|
12534
|
+
const realCandidate = fs5.realpathSync.native(resolvedCandidate);
|
|
12535
|
+
const realBaseParent = fs5.realpathSync.native(baseParent);
|
|
12536
|
+
return path5.dirname(realCandidate) === realBaseParent && path5.basename(realCandidate) === candidateName;
|
|
12537
|
+
} catch {
|
|
12538
|
+
return false;
|
|
12539
|
+
}
|
|
12265
12540
|
}
|
|
12266
12541
|
function resolveSessionToolDirectory({ requestedDirectory, context, pluginWorktree, clickUpWebhookValidation } = {}) {
|
|
12267
12542
|
const safe = safeWorktreeOrFailure(context, pluginWorktree);
|
|
@@ -12273,6 +12548,9 @@ function resolveSessionToolDirectory({ requestedDirectory, context, pluginWorktr
|
|
|
12273
12548
|
if (clickUpBasePath && isSameOrNestedPath(requested, clickUpBasePath)) {
|
|
12274
12549
|
return { ok: true, directory: requested, safeWorktree: safe.worktree, scope: "clickup_base_path", clickupBasePath: path5.resolve(clickUpBasePath) };
|
|
12275
12550
|
}
|
|
12551
|
+
if (clickUpBasePath && isClickUpDerivedWorktreeSibling(requested, clickUpBasePath)) {
|
|
12552
|
+
return { ok: true, directory: requested, safeWorktree: safe.worktree, scope: "clickup_derived_worktree", clickupBasePath: path5.resolve(clickUpBasePath) };
|
|
12553
|
+
}
|
|
12276
12554
|
return {
|
|
12277
12555
|
ok: false,
|
|
12278
12556
|
error: `Directory '${requested}' is outside the safe worktree '${safe.worktree}' and configured ClickUp base path.`
|
|
@@ -13104,7 +13382,7 @@ Follow-up: use optima_prompt_workflow with session_id '${sessionId}' to check in
|
|
|
13104
13382
|
}
|
|
13105
13383
|
};
|
|
13106
13384
|
}
|
|
13107
|
-
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, compactPromptPath, createClickUpApiClient, createTestClickUpApiClient, createOpenCodeSession, createOpenCodeSessionControl, deliveryEvidencePathForClickUpTask, ensureClickUpTaskWorktree, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpWebhookStateActive, isSameOrNestedPath, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, openCodeSessionExists, promptOpenCodeSessionControl, probeOpenCodeSessionControl, readClickUpCommentLedger, readClickUpWebhookState, readOpenCodeSessionControl, readOpenCodeSessionMessages, reconcileClickUpStartup, scheduleClickUpStartupReconciliation, waitForOpenCodeReadiness, recordClickUpCommentVersionProcessed, resyncClickUpWebhookForSignatureDrift, resolveIncludeFile, resolveIncludes, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, summarizeOpenCodeMessages, verifyOpenCodeSessionEventDelivery, stableClickUpCommentVersionMarker, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatRepairResult, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, optimaRepairDependencies, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, planOptimaRepair, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
13385
|
+
OptimaPlugin.__internals = { BUNDLE_AGENTS_DIR, BUNDLE_ASSETS_DIR, CLICKUP_DEFINITION_DOC_PARENT, activeClickUpWebhookLifecycleRegistry, cleanupManagedClickUpWebhook, deleteClickUpWebhookBestEffort, BUNDLE_POLICIES_DIR, buildClickUpApplyPayloadResult, buildClickUpCreateSubtasksPayload, buildClickUpStartTaskPayload, buildClickUpSummaryPayload, buildClickUpTransitionPayload, buildOptimaAgents, clickUpCommentLedgerKey, clickUpCommentMentionsProductManager, clickUpWebhookAuditLogDir, clickUpWebhookAuditLogPath, compactPromptPath, createClickUpApiClient, createTestClickUpApiClient, createOpenCodeSession, createOpenCodeSessionControl, deliveryEvidencePathForClickUpTask, ensureClickUpTaskWorktree, ensureClickUpTaskWorktreeForWebhook, ensureClickUpTaskWorktreeOpenChamber, ensureClickUpWebhookSubscription, handleClickUpWebhookRequest, isClickUpDerivedWorktreeSibling, isClickUpSubtaskRoute, isClickUpWebhookStateActive, isSameOrNestedPath, normalizeClickUpWebhookConfig, normalizeClickUpWebhookLogLevel, normalizeOpenCodeBaseUrl, openCodeSessionExists, promptOpenCodeSessionControl, probeOpenCodeSessionControl, readClickUpCommentLedger, readClickUpWebhookState, readOpenCodeSessionControl, readOpenCodeSessionMessages, reconcileClickUpStartup, registerOpenChamberClickUpWorktree, scheduleClickUpStartupReconciliation, syncOpenChamberWorktreeVisibility, waitForOpenCodeReadiness, recordClickUpCommentVersionProcessed, resyncClickUpWebhookForSignatureDrift, resolveIncludeFile, resolveIncludes, resolveOptimaPluginOptions, resolveSecretReference, routeClickUpWebhookEvent, sendOpenCodeSessionEvent, sendOpenCodeSessionEventDirect, summarizeOpenCodeMessages, verifyOpenCodeSessionEventDelivery, stableClickUpCommentVersionMarker, startClickUpWebhookListener, validateClickUpWebhookState, verifyClickUpSignature, writeClickUpWebhookState, decideClickUpStatusAction, deriveClickUpBranchName, deriveClickUpPendingSubtaskBranch, deriveClickUpPrTarget, deriveClickUpWorktree, determineClickUpMergeAuthority, ensureOptimaGitignoreRules, explicitSafeInputWorktree, finalApprovalAssignees, formatRepairResult, formatValidationResult, isIgnoredClickUpTaskType, isOptimaPluginPackageWorktree, isSafeWritableDirectory, loadHumansRegistry, mergeClickUpAgentMetadata, mergeClickUpSessionMetadata, migrateLegacyOptimaLayout, normalizeAgentMetadataJson, normalizeClickUpStatus, normalizeClickUpTaskType, normalizePromptResponseParts, normalizeWorkflowTaskPath, optimaRepairDependencies, parseClickUpSubtasksMarkdown, parseHumansRegistry, parseMarkdownArtifact, parseMarkdownSections, planOptimaRepair, preEstimateClickUpWork, readMarkdownArtifact, resolveHumanRoles, resolveSafeWorktree, safeWorktreeOrFailure, stripRawLogSections, validateMainWorkspaceBranchSafety, workflowFinalMessageFromPromptResponse };
|
|
13108
13386
|
|
|
13109
13387
|
// src/sanitize_cli.js
|
|
13110
13388
|
var { migrateLegacyOptimaLayout: migrateLegacyOptimaLayout2 } = OptimaPlugin.__internals;
|