@ordewell/core 0.10.1 → 0.10.3
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/{IFileSystem-Bj6fy1cG.d.mts → IFileSystem-B8Nkgg4e.d.mts} +1 -1
- package/dist/{IFileSystem-BCJBHFwB.d.ts → IFileSystem-DCd-rkeH.d.ts} +1 -1
- package/dist/{IRunner-hWAJC4hg.d.mts → IRunner-CXdYyIZo.d.mts} +213 -202
- package/dist/{IRunner-C7_SSpzG.d.ts → IRunner-QBdYcatb.d.ts} +213 -202
- package/dist/{ModeResolver-m1d8Cb-j.d.mts → ModeResolver-BOU90Nn-.d.ts} +1 -1
- package/dist/{ModeResolver-u5ZhRC8x.d.ts → ModeResolver-geqjKkLY.d.mts} +1 -1
- package/dist/{Task-CxwnCJLi.d.mts → Task-CRVIqSfy.d.mts} +58 -11
- package/dist/{Task-CxwnCJLi.d.ts → Task-CRVIqSfy.d.ts} +58 -11
- package/dist/{chunk-DNFT4SQG.mjs → chunk-645FALZX.mjs} +5 -5
- package/dist/chunk-645FALZX.mjs.map +1 -0
- package/dist/{chunk-DJAPDO6E.mjs → chunk-A57ITQE7.mjs} +41 -21
- package/dist/chunk-A57ITQE7.mjs.map +1 -0
- package/dist/{chunk-CH5IGWFS.mjs → chunk-FH6M5QZG.mjs} +168 -122
- package/dist/chunk-FH6M5QZG.mjs.map +1 -0
- package/dist/{chunk-2IIRSBEQ.mjs → chunk-SM6BV6XS.mjs} +20 -4
- package/dist/chunk-SM6BV6XS.mjs.map +1 -0
- package/dist/index.d.mts +454 -63
- package/dist/index.d.ts +454 -63
- package/dist/index.js +19575 -18631
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17991 -17137
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +15 -14
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/{plan-utils-CKXdD1AD.d.mts → plan-utils-KU1Rse82.d.mts} +1322 -1146
- package/dist/{plan-utils-B6yJdpgi.d.ts → plan-utils-oC8bO4pN.d.ts} +1322 -1146
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +60 -0
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +11 -3
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +4 -2
- package/dist/testing.mjs.map +1 -1
- package/package.json +5 -1
- package/dist/chunk-2IIRSBEQ.mjs.map +0 -1
- package/dist/chunk-CH5IGWFS.mjs.map +0 -1
- package/dist/chunk-DJAPDO6E.mjs.map +0 -1
- package/dist/chunk-DNFT4SQG.mjs.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOT_STARTED,
|
|
3
|
+
WAITS_FOR_APPROVAL_LABEL,
|
|
3
4
|
approvalLabel,
|
|
4
5
|
awaitingLabel,
|
|
5
6
|
isTaskRunning,
|
|
6
7
|
resumeLabel,
|
|
7
8
|
taskStatusKind
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-A57ITQE7.mjs";
|
|
9
10
|
import {
|
|
10
11
|
pausedOnLimit,
|
|
11
12
|
rejoinPlanTree,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
taskRefOf,
|
|
14
15
|
titledTaskRef,
|
|
15
16
|
titledTaskRefOf
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SM6BV6XS.mjs";
|
|
17
18
|
|
|
18
19
|
// src/models/Usage.ts
|
|
19
20
|
function partedPromptUsage(parts) {
|
|
@@ -800,78 +801,20 @@ function replayTaskLog(events, from = EMPTY_TASK_LOG) {
|
|
|
800
801
|
return events.reduce(reduceTaskLog, from);
|
|
801
802
|
}
|
|
802
803
|
|
|
803
|
-
// src/services/
|
|
804
|
-
function
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
function ellipsize(text2, max) {
|
|
810
|
-
const oneLine2 = text2.replace(/\s+/g, " ").trim();
|
|
811
|
-
return oneLine2.length > max ? `${oneLine2.slice(0, max)}\u2026` : oneLine2;
|
|
812
|
-
}
|
|
813
|
-
function summarizeToolCall(tool, argsJson, toolLabel) {
|
|
814
|
-
const display = toolLabel?.trim() || tool;
|
|
815
|
-
if (tool === "agent_tool") {
|
|
816
|
-
try {
|
|
817
|
-
const args = JSON.parse(argsJson);
|
|
818
|
-
const hint = args.path ?? args.file_path ?? args.filePath ?? args.pattern ?? args.query ?? args.url ?? args.command;
|
|
819
|
-
if (hint) return `${display} ${ellipsize(String(hint), 50)}`;
|
|
820
|
-
} catch {
|
|
821
|
-
}
|
|
822
|
-
return display;
|
|
823
|
-
}
|
|
824
|
-
if (tool === "spawn_research_agent") {
|
|
825
|
-
try {
|
|
826
|
-
const args = JSON.parse(argsJson);
|
|
827
|
-
const prompt = typeof args.prompt === "string" ? args.prompt : "";
|
|
828
|
-
const oneLine2 = prompt.replace(/\s+/g, " ").trim();
|
|
829
|
-
return `spawn: "${oneLine2.slice(0, 60)}${oneLine2.length > 60 ? "\u2026" : ""}"`;
|
|
830
|
-
} catch {
|
|
831
|
-
return "spawn_research_agent";
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
try {
|
|
835
|
-
const args = JSON.parse(argsJson);
|
|
836
|
-
if (tool === "find_symbol" && args.symbol) {
|
|
837
|
-
return `find_symbol ${args.symbol}${args.language ? ` [${args.language}]` : ""}`;
|
|
838
|
-
}
|
|
839
|
-
if (tool === "web_search" && args.query) {
|
|
840
|
-
return `web_search "${ellipsize(String(args.query), 50)}"`;
|
|
841
|
-
}
|
|
842
|
-
if (tool === "fetch" && args.url) {
|
|
843
|
-
return `fetch ${ellipsize(String(args.url), 60)}`;
|
|
844
|
-
}
|
|
845
|
-
if (tool === "glob" && args.pattern) {
|
|
846
|
-
return `glob ${ellipsize(String(args.pattern), 50)}`;
|
|
847
|
-
}
|
|
848
|
-
if (tool === "grep" && args.pattern) {
|
|
849
|
-
const mode = args.output_mode && args.output_mode !== "content" ? ` (${args.output_mode})` : "";
|
|
850
|
-
const scope = args.include ? ` in ${args.include}` : "";
|
|
851
|
-
return `grep ${ellipsize(String(args.pattern), 40)}${scope}${mode}`;
|
|
852
|
-
}
|
|
853
|
-
const path = args.filePath || args.file_path || args.path;
|
|
854
|
-
if (path) {
|
|
855
|
-
const basename = String(path).split("/").pop() || String(path);
|
|
856
|
-
return `${display} ${basename}`;
|
|
857
|
-
}
|
|
858
|
-
if (args.pattern) {
|
|
859
|
-
return `${display} ${args.pattern}`;
|
|
860
|
-
}
|
|
861
|
-
if (args.command) {
|
|
862
|
-
return `bash: ${String(args.command).slice(0, 40)}`;
|
|
863
|
-
}
|
|
864
|
-
} catch {
|
|
804
|
+
// src/services/continuation.ts
|
|
805
|
+
function continuability(task) {
|
|
806
|
+
const refuse = (reason) => ({ ok: false, reason: `Task "${task.title}" cannot be continued: ${reason}` });
|
|
807
|
+
if (task.type !== "ai") return refuse("it is not run by an agent.");
|
|
808
|
+
if (task.status === "awaiting_user" && task.awaitingReason === "conflict") {
|
|
809
|
+
return refuse("its work is waiting on a merge conflict. Resolve or repair the conflict instead.");
|
|
865
810
|
}
|
|
866
|
-
|
|
811
|
+
const finished = task.status === "completed" || task.status === "failed" || task.status === "skipped";
|
|
812
|
+
if (!finished && !pausedOnLimit(task)) return refuse("only a completed, failed or skipped task, or one paused on a usage limit, can be.");
|
|
813
|
+
if (!task.runnerSessionId) return refuse("its runner left no saved session to resume. Use Retry instead.");
|
|
814
|
+
return { ok: true, sessionId: task.runnerSessionId };
|
|
867
815
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
870
|
-
if (/^(Command|Fetch|Web search) refused:/.test(output) || /is not available\. You are a read-only research subagent/.test(output)) return "refused";
|
|
871
|
-
if (/not approved/i.test(output) || /^Access denied:/.test(output) || /needs user approval/i.test(output)) return "denied";
|
|
872
|
-
return "failure";
|
|
873
|
-
}
|
|
874
|
-
return "success";
|
|
816
|
+
function canContinue(task) {
|
|
817
|
+
return continuability(task).ok;
|
|
875
818
|
}
|
|
876
819
|
|
|
877
820
|
// src/services/blocking.ts
|
|
@@ -912,40 +855,6 @@ function blockingFailures(tasks) {
|
|
|
912
855
|
return blocked;
|
|
913
856
|
}
|
|
914
857
|
|
|
915
|
-
// src/services/continuation.ts
|
|
916
|
-
function continuability(task) {
|
|
917
|
-
const refuse = (reason) => ({ ok: false, reason: `Task "${task.title}" cannot be continued: ${reason}` });
|
|
918
|
-
if (task.type !== "ai") return refuse("it is not run by an agent.");
|
|
919
|
-
if (task.status === "awaiting_user" && task.awaitingReason === "conflict") {
|
|
920
|
-
return refuse("its work is waiting on a merge conflict. Resolve or repair the conflict instead.");
|
|
921
|
-
}
|
|
922
|
-
const finished = task.status === "completed" || task.status === "failed" || task.status === "skipped";
|
|
923
|
-
if (!finished && !pausedOnLimit(task)) return refuse("only a completed, failed or skipped task, or one paused on a usage limit, can be.");
|
|
924
|
-
if (!task.runnerSessionId) return refuse("its runner left no saved session to resume. Use Retry instead.");
|
|
925
|
-
return { ok: true, sessionId: task.runnerSessionId };
|
|
926
|
-
}
|
|
927
|
-
function canContinue(task) {
|
|
928
|
-
return continuability(task).ok;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
// src/services/runSettingsText.ts
|
|
932
|
-
var SUPERVISOR_LEVEL_LABEL = { off: "Off", watch: "Watch", act: "Act" };
|
|
933
|
-
var plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
934
|
-
var onOff = (value) => value ? "on" : "off";
|
|
935
|
-
var supervisorSummary = (run) => `Supervisor: ${SUPERVISOR_LEVEL_LABEL[run.supervisorLevel]}, ${plural(run.supervisorRetryLimit, "retry", "retries")} per task, ${plural(run.wakeUpReadBudget, "read", "reads")} per wake-up`;
|
|
936
|
-
var automergeSummary = (run) => `Merge automatically (gates, end of run): ${onOff(run.mergeAtGatesAutomatically)}`;
|
|
937
|
-
var autorunSummary = (run) => `Autorun: ${onOff(run.autorun)}`;
|
|
938
|
-
var ACT_RISK = "Tasks it adds run too, ops tasks included, which can act on real systems unattended.";
|
|
939
|
-
var AUTORUN_RISK = "Plans start without review, ops tasks included, which can act on real systems unattended. In Full, the planner may also start tasks it adds later.";
|
|
940
|
-
function parseSwitch(arg) {
|
|
941
|
-
return arg === "on" ? true : arg === "off" ? false : null;
|
|
942
|
-
}
|
|
943
|
-
function parseCount(arg, min) {
|
|
944
|
-
if (arg === void 0 || !/^\d+$/.test(arg)) return null;
|
|
945
|
-
const n = Number(arg);
|
|
946
|
-
return n >= min ? n : null;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
858
|
// src/services/SessionMessage.ts
|
|
950
859
|
function serializeTask(t) {
|
|
951
860
|
return {
|
|
@@ -974,7 +883,7 @@ function serializeTask(t) {
|
|
|
974
883
|
...t.addedBy ? { addedBy: t.addedBy } : {}
|
|
975
884
|
};
|
|
976
885
|
}
|
|
977
|
-
function serializeTaskStatus(t, idleSince = null, isolation = null, queued = [], awaitingApproval = 0, mergeGate = [], checkpoint = "") {
|
|
886
|
+
function serializeTaskStatus(t, idleSince = null, isolation = null, queued = [], awaitingApproval = 0, mergeGate = [], checkpoint = "", waitsForApproval = false) {
|
|
978
887
|
return {
|
|
979
888
|
id: t.id,
|
|
980
889
|
status: t.status,
|
|
@@ -990,7 +899,8 @@ function serializeTaskStatus(t, idleSince = null, isolation = null, queued = [],
|
|
|
990
899
|
...canContinue(t) ? { continuable: true } : {},
|
|
991
900
|
...awaitingApproval > 0 ? { awaitingApproval } : {},
|
|
992
901
|
...mergeGate.length > 0 ? { mergeGate: [...mergeGate] } : {},
|
|
993
|
-
...t.forcedPastGate?.length ? { forcedPastGate: [...t.forcedPastGate] } : {}
|
|
902
|
+
...t.forcedPastGate?.length ? { forcedPastGate: [...t.forcedPastGate] } : {},
|
|
903
|
+
...waitsForApproval ? { waitsForApproval: true } : {}
|
|
994
904
|
};
|
|
995
905
|
}
|
|
996
906
|
function surfaceConversation(history) {
|
|
@@ -1045,10 +955,102 @@ function truncateCheckpointSummary(summary) {
|
|
|
1045
955
|
return firstLine.slice(0, CHECKPOINT_TRUNCATE_LENGTH - 1) + "\u2026";
|
|
1046
956
|
}
|
|
1047
957
|
|
|
958
|
+
// src/services/conflictFiles.ts
|
|
959
|
+
function capConflictFiles(files, max = 5) {
|
|
960
|
+
return files.length <= max ? files.join(", ") : `${files.slice(0, max).join(", ")}, +${files.length - max} more`;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// src/services/researchStepSummary.ts
|
|
964
|
+
function ellipsize(text2, max) {
|
|
965
|
+
const oneLine2 = text2.replace(/\s+/g, " ").trim();
|
|
966
|
+
return oneLine2.length > max ? `${oneLine2.slice(0, max)}\u2026` : oneLine2;
|
|
967
|
+
}
|
|
968
|
+
function summarizeToolCall(tool, argsJson, toolLabel) {
|
|
969
|
+
const display = toolLabel?.trim() || tool;
|
|
970
|
+
if (tool === "agent_tool") {
|
|
971
|
+
try {
|
|
972
|
+
const args = JSON.parse(argsJson);
|
|
973
|
+
const hint = args.path ?? args.file_path ?? args.filePath ?? args.pattern ?? args.query ?? args.url ?? args.command;
|
|
974
|
+
if (hint) return `${display} ${ellipsize(String(hint), 50)}`;
|
|
975
|
+
} catch {
|
|
976
|
+
}
|
|
977
|
+
return display;
|
|
978
|
+
}
|
|
979
|
+
if (tool === "spawn_research_agent") {
|
|
980
|
+
try {
|
|
981
|
+
const args = JSON.parse(argsJson);
|
|
982
|
+
const prompt = typeof args.prompt === "string" ? args.prompt : "";
|
|
983
|
+
const oneLine2 = prompt.replace(/\s+/g, " ").trim();
|
|
984
|
+
return `spawn: "${oneLine2.slice(0, 60)}${oneLine2.length > 60 ? "\u2026" : ""}"`;
|
|
985
|
+
} catch {
|
|
986
|
+
return "spawn_research_agent";
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
try {
|
|
990
|
+
const args = JSON.parse(argsJson);
|
|
991
|
+
if (tool === "find_symbol" && args.symbol) {
|
|
992
|
+
return `find_symbol ${args.symbol}${args.language ? ` [${args.language}]` : ""}`;
|
|
993
|
+
}
|
|
994
|
+
if (tool === "web_search" && args.query) {
|
|
995
|
+
return `web_search "${ellipsize(String(args.query), 50)}"`;
|
|
996
|
+
}
|
|
997
|
+
if (tool === "fetch" && args.url) {
|
|
998
|
+
return `fetch ${ellipsize(String(args.url), 60)}`;
|
|
999
|
+
}
|
|
1000
|
+
if (tool === "glob" && args.pattern) {
|
|
1001
|
+
return `glob ${ellipsize(String(args.pattern), 50)}`;
|
|
1002
|
+
}
|
|
1003
|
+
if (tool === "grep" && args.pattern) {
|
|
1004
|
+
const mode = args.output_mode && args.output_mode !== "content" ? ` (${args.output_mode})` : "";
|
|
1005
|
+
const scope = args.include ? ` in ${args.include}` : "";
|
|
1006
|
+
return `grep ${ellipsize(String(args.pattern), 40)}${scope}${mode}`;
|
|
1007
|
+
}
|
|
1008
|
+
const path = args.filePath || args.file_path || args.path;
|
|
1009
|
+
if (path) {
|
|
1010
|
+
const basename = String(path).split("/").pop() || String(path);
|
|
1011
|
+
return `${display} ${basename}`;
|
|
1012
|
+
}
|
|
1013
|
+
if (args.pattern) {
|
|
1014
|
+
return `${display} ${args.pattern}`;
|
|
1015
|
+
}
|
|
1016
|
+
if (args.command) {
|
|
1017
|
+
return `bash: ${String(args.command).slice(0, 40)}`;
|
|
1018
|
+
}
|
|
1019
|
+
} catch {
|
|
1020
|
+
}
|
|
1021
|
+
return display;
|
|
1022
|
+
}
|
|
1023
|
+
function classifyOutcome(success, output) {
|
|
1024
|
+
if (!success) {
|
|
1025
|
+
if (/^(Command|Fetch|Web search) refused:/.test(output) || /is not available\. You are a read-only research subagent/.test(output)) return "refused";
|
|
1026
|
+
if (/not approved/i.test(output) || /^Access denied:/.test(output) || /needs user approval/i.test(output)) return "denied";
|
|
1027
|
+
return "failure";
|
|
1028
|
+
}
|
|
1029
|
+
return "success";
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
// src/services/runSettingsText.ts
|
|
1033
|
+
var SUPERVISOR_LEVEL_LABEL = { off: "Off", watch: "Watch", act: "Act" };
|
|
1034
|
+
var plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
1035
|
+
var onOff = (value) => value ? "on" : "off";
|
|
1036
|
+
var supervisorSummary = (run) => `Supervisor: ${SUPERVISOR_LEVEL_LABEL[run.supervisorLevel]}, ${plural(run.supervisorRetryLimit, "retry", "retries")} per task, ${plural(run.wakeUpReadBudget, "read", "reads")} per wake-up`;
|
|
1037
|
+
var automergeSummary = (run) => `Merge automatically (gates, end of run): ${onOff(run.mergeAtGatesAutomatically)}`;
|
|
1038
|
+
var autorunSummary = (run) => `Autorun: ${onOff(run.autorun)}`;
|
|
1039
|
+
var ACT_RISK = "Tasks it adds run too, ops tasks included, which can act on real systems unattended.";
|
|
1040
|
+
var AUTORUN_RISK = "Plans start without review, ops tasks included, which can act on real systems unattended. In Full, the planner may also start tasks it adds later.";
|
|
1041
|
+
function parseSwitch(arg) {
|
|
1042
|
+
return arg === "on" ? true : arg === "off" ? false : null;
|
|
1043
|
+
}
|
|
1044
|
+
function parseCount(arg, min) {
|
|
1045
|
+
if (arg === void 0 || !/^\d+$/.test(arg)) return null;
|
|
1046
|
+
const n = Number(arg);
|
|
1047
|
+
return n >= min ? n : null;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1048
1050
|
// src/services/runView.ts
|
|
1049
1051
|
var EMPTY_RUN = { tasks: [], runMerge: null, handoff: null, mergeResult: null };
|
|
1050
|
-
function split({ verdict, idleSince, isolation, checkpoint, queued, continuable, awaitingApproval, mergeGate, forcedPastGate, ...plan }) {
|
|
1051
|
-
return { plan, status: { verdict, idleSince, isolation, checkpoint, queued, continuable, awaitingApproval, mergeGate, forcedPastGate } };
|
|
1052
|
+
function split({ verdict, idleSince, isolation, checkpoint, queued, continuable, awaitingApproval, mergeGate, forcedPastGate, waitsForApproval, ...plan }) {
|
|
1053
|
+
return { plan, status: { verdict, idleSince, isolation, checkpoint, queued, continuable, awaitingApproval, mergeGate, forcedPastGate, waitsForApproval } };
|
|
1052
1054
|
}
|
|
1053
1055
|
function refresh(previous, tasks) {
|
|
1054
1056
|
const held = /* @__PURE__ */ new Map();
|
|
@@ -1150,6 +1152,8 @@ function reduceRun(view, input) {
|
|
|
1150
1152
|
const tasks = changeTask(view.tasks, input.taskId, (task) => input.type === "task_started" ? startTask(task) : patchTask(task, input.changes));
|
|
1151
1153
|
return tasks === view.tasks ? view : { ...view, tasks };
|
|
1152
1154
|
}
|
|
1155
|
+
case "plan_edit_held":
|
|
1156
|
+
return { ...view, heldEdit: input.held ?? void 0 };
|
|
1153
1157
|
case "isolation_handoff":
|
|
1154
1158
|
return { ...view, handoff: handoffOf(input) };
|
|
1155
1159
|
case "isolation_merge":
|
|
@@ -1400,6 +1404,13 @@ function syncTranscript(view, { plan, turnId }) {
|
|
|
1400
1404
|
}
|
|
1401
1405
|
return next === view && latest === view.transcriptAt ? view : { ...next, transcriptAt: latest };
|
|
1402
1406
|
}
|
|
1407
|
+
function reconcileApprovals(view, waiting) {
|
|
1408
|
+
const ids = new Set(waiting.map((request) => request.id));
|
|
1409
|
+
const answered2 = (block) => block.type === "approval" && block.status === "pending" && block.approvalId !== void 0 && !ids.has(block.approvalId);
|
|
1410
|
+
const kept = view.blocks.some(answered2) ? { ...view, blocks: view.blocks.filter((block) => !answered2(block)) } : view;
|
|
1411
|
+
const carded = new Set(kept.blocks.flatMap((block) => block.type === "approval" && block.approvalId ? [block.approvalId] : []));
|
|
1412
|
+
return waiting.filter((request) => !carded.has(request.id)).reduce(requestApproval2, kept);
|
|
1413
|
+
}
|
|
1403
1414
|
function reduceConversation(view, input) {
|
|
1404
1415
|
switch (input.type) {
|
|
1405
1416
|
case "local_entry":
|
|
@@ -1648,6 +1659,36 @@ function taskStartedNotice(title, runner) {
|
|
|
1648
1659
|
return runner ? `Started "${title}" \xB7 ${runner}` : `Started "${title}"`;
|
|
1649
1660
|
}
|
|
1650
1661
|
|
|
1662
|
+
// src/conversation/markdown.ts
|
|
1663
|
+
import MarkdownIt from "markdown-it";
|
|
1664
|
+
var md = new MarkdownIt({ html: false, linkify: true, breaks: true });
|
|
1665
|
+
md.linkify.set({ fuzzyLink: false, fuzzyEmail: false });
|
|
1666
|
+
md.validateLink = (url) => /^https?:/i.test(url);
|
|
1667
|
+
md.core.ruler.after("linkify", "image_as_text", (state) => {
|
|
1668
|
+
for (const block of state.tokens) {
|
|
1669
|
+
if (!block.children) continue;
|
|
1670
|
+
block.children = block.children.map((token) => {
|
|
1671
|
+
if (token.type !== "image") return token;
|
|
1672
|
+
const text2 = new state.Token("text", "", 0);
|
|
1673
|
+
text2.content = token.content || (token.attrGet("src") ?? "");
|
|
1674
|
+
return text2;
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
});
|
|
1678
|
+
md.renderer.rules.link_open = (tokens, idx, options, _env, self) => {
|
|
1679
|
+
tokens[idx].attrSet("target", "_blank");
|
|
1680
|
+
tokens[idx].attrSet("rel", "noopener");
|
|
1681
|
+
return self.renderToken(tokens, idx, options);
|
|
1682
|
+
};
|
|
1683
|
+
md.renderer.rules.table_open = (tokens, idx, options, _env, self) => `<div class="md-table">${self.renderToken(tokens, idx, options)}`;
|
|
1684
|
+
md.renderer.rules.table_close = () => "</table></div>\n";
|
|
1685
|
+
function markdownTokens(text2) {
|
|
1686
|
+
return md.parse(text2, {});
|
|
1687
|
+
}
|
|
1688
|
+
function markdownHtml(text2) {
|
|
1689
|
+
return md.render(text2);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1651
1692
|
// src/taskRow/actions.ts
|
|
1652
1693
|
var UNSTARTED_AI = (t) => t.type === "ai" && NOT_STARTED.has(t.status);
|
|
1653
1694
|
var QUEUED = (t) => t.status === "pending" || t.status === "approved";
|
|
@@ -1716,6 +1757,7 @@ function taskRowView(task, context = {}) {
|
|
|
1716
1757
|
awaiting: awaitingLabel(task),
|
|
1717
1758
|
resumes: resumeLabel(task, context.now),
|
|
1718
1759
|
approvals: approvalLabel(task.awaitingApproval),
|
|
1760
|
+
waitsForApproval: task.waitsForApproval && NOT_STARTED.has(task.status) ? WAITS_FOR_APPROVAL_LABEL : null,
|
|
1719
1761
|
autonomous: task.type === "ai" && context.modes?.find((m) => m.id === task.taskMode)?.autonomous === true,
|
|
1720
1762
|
repos: namedRepos(isolation?.repos),
|
|
1721
1763
|
conflict: isolation?.state === "conflict" ? { repo: namedRepo(isolation.conflictRepo), files: filesOf(isolation.conflictFiles) } : null,
|
|
@@ -1780,12 +1822,21 @@ export {
|
|
|
1780
1822
|
runnerToolSubject,
|
|
1781
1823
|
reduceTaskLog,
|
|
1782
1824
|
replayTaskLog,
|
|
1825
|
+
continuability,
|
|
1826
|
+
canContinue,
|
|
1827
|
+
blockingFailures,
|
|
1828
|
+
serializeTask,
|
|
1829
|
+
serializeTaskStatus,
|
|
1830
|
+
surfaceTask,
|
|
1831
|
+
surfacePlan,
|
|
1832
|
+
surfacePlanState,
|
|
1833
|
+
serializePlan,
|
|
1834
|
+
executionSummary,
|
|
1835
|
+
CHECKPOINT_TRUNCATE_LENGTH,
|
|
1836
|
+
truncateCheckpointSummary,
|
|
1783
1837
|
capConflictFiles,
|
|
1784
1838
|
summarizeToolCall,
|
|
1785
1839
|
classifyOutcome,
|
|
1786
|
-
blockingFailures,
|
|
1787
|
-
continuability,
|
|
1788
|
-
canContinue,
|
|
1789
1840
|
SUPERVISOR_LEVEL_LABEL,
|
|
1790
1841
|
supervisorSummary,
|
|
1791
1842
|
automergeSummary,
|
|
@@ -1794,17 +1845,10 @@ export {
|
|
|
1794
1845
|
AUTORUN_RISK,
|
|
1795
1846
|
parseSwitch,
|
|
1796
1847
|
parseCount,
|
|
1797
|
-
serializeTask,
|
|
1798
|
-
serializeTaskStatus,
|
|
1799
|
-
surfacePlan,
|
|
1800
|
-
surfacePlanState,
|
|
1801
|
-
serializePlan,
|
|
1802
|
-
executionSummary,
|
|
1803
|
-
CHECKPOINT_TRUNCATE_LENGTH,
|
|
1804
|
-
truncateCheckpointSummary,
|
|
1805
1848
|
EMPTY_RUN,
|
|
1806
1849
|
reduceRun,
|
|
1807
1850
|
EMPTY_CONVERSATION,
|
|
1851
|
+
reconcileApprovals,
|
|
1808
1852
|
reduceConversation,
|
|
1809
1853
|
fromTranscript,
|
|
1810
1854
|
EMPTY_HOLD,
|
|
@@ -1819,6 +1863,8 @@ export {
|
|
|
1819
1863
|
stopTurn,
|
|
1820
1864
|
hasHiddenDetail,
|
|
1821
1865
|
taskStartedNotice,
|
|
1866
|
+
markdownTokens,
|
|
1867
|
+
markdownHtml,
|
|
1822
1868
|
taskRowActions,
|
|
1823
1869
|
markAction,
|
|
1824
1870
|
markRequestFor,
|
|
@@ -1830,4 +1876,4 @@ export {
|
|
|
1830
1876
|
pastGateConfirmation,
|
|
1831
1877
|
newTaskFields
|
|
1832
1878
|
};
|
|
1833
|
-
//# sourceMappingURL=chunk-
|
|
1879
|
+
//# sourceMappingURL=chunk-FH6M5QZG.mjs.map
|