@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
package/dist/plan-utils.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as ApprovalBlock, d as ApprovalStatus, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, G as GatedConversation,
|
|
2
|
-
export {
|
|
3
|
-
import './ModeResolver-
|
|
4
|
-
import './IRunner-
|
|
1
|
+
export { c as ApprovalBlock, d as ApprovalStatus, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, G as GatedConversation, x as LocalEntry, M as MarkdownToken, y as MessageBlock, z as MessageRole, N as NOT_STARTED, F as NO_TURN, J as NewTaskFields, P as OutputPreview, Q as PlanBlock, R as PlanMarkerStatus, V as PromptHold, X as RefTask, a2 as RunnerLoadedBlock, a4 as SUPERVISOR_LEVEL_LABEL, ae as SkillLoadBlock, ag as SkillToken, ai as SubagentBlock, aj as SubagentChild, ak as SubagentStatus, ao as TakenPrompt, as as TaskLogView, ay as TaskRef, az as TaskRowAction, aA as TaskRowContext, aB as TaskRowIsolation, aC as TaskRowKind, aD as TaskRowPlacement, aE as TaskRowSubject, aF as TaskRowUsage, aG as TaskRowView, aH as TaskStatusKind, aI as ThinkingDisplayBlock, aJ as ToolBlock, aK as ToolHeadline, aL as ToolStatus, aM as TurnGate, aN as UsageBlock, aP as WAITS_FOR_APPROVAL_LABEL, aQ as aheadOfDraft, aS as approvalLabel, aV as awaitingLabel, aW as blockedByLabel, aX as blockingFailures, aY as canMergeTasks, aZ as canSetDependencies, a_ as canSplitTask, a$ as capConflictFiles, b2 as dependencyCandidates, b3 as dependentsNotice, b4 as dependentsOf, b5 as diffRows, b6 as diffStat, b7 as diffSummary, b9 as drainNext, bb as followTurn, bc as fromTranscript, be as hasHiddenDetail, bf as holdPrompt, bg as isTaskRunning, bh as loadedSkillTokens, bi as markAction, bj as markRequestFor, bk as markdownHtml, bl as markdownTokens, bm as namedRepos, bn as newTaskFields, bo as opsEditable, bp as outputLines, bq as outputPreview, br as parseCount, bu as pastGateConfirmation, bv as reconcileApprovals, bw as reduceConversation, by as reduceTaskLog, bz as replayTaskLog, bA as resolveTaskRef, bB as resumeLabel, bC as resumeTime, bE as runnerToolSubject, bI as skillTokens, bJ as skippedLabel, bK as stopTurn, bL as summarizeToolCall, bP as takeAt, bR as taskOrderLabel, bS as taskRef, bT as taskRefOf, bU as taskRowActions, bV as taskRowView, bW as taskStartedNotice, bX as taskStatusKind, bZ as titledRefs, b_ as titledTaskRef, b$ as titledTaskRefOf, c1 as toolHeadline, c3 as truncateCheckpointSummary, c4 as unsendAll, c5 as unsendLatest } from './plan-utils-KU1Rse82.mjs';
|
|
2
|
+
export { a as AttemptUsage, D as DEFAULT_RUNNERS, M as ModelUsage, O as PlanUsage, Q as PlannerUsage, aq as UsageLine, ar as UsageRecord, as as UsageTotals, av as addAttemptUsage, aw as addModelUsage, ax as addPlannerUsage, ay as addUsage, az as addUsageTotals, aD as endAttemptUsage, aH as isMeasured, aL as partedPromptUsage, aM as pausedOnLimit, aN as planUsage, aO as plannerContextFill, aQ as startAttemptUsage, aR as usageLine } from './Task-CRVIqSfy.mjs';
|
|
3
|
+
import './ModeResolver-geqjKkLY.mjs';
|
|
4
|
+
import './IRunner-CXdYyIZo.mjs';
|
|
5
5
|
import 'child_process';
|
|
6
6
|
import 'zod/v4';
|
package/dist/plan-utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as ApprovalBlock, d as ApprovalStatus, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, G as GatedConversation,
|
|
2
|
-
export {
|
|
3
|
-
import './ModeResolver-
|
|
4
|
-
import './IRunner-
|
|
1
|
+
export { c as ApprovalBlock, d as ApprovalStatus, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, G as GatedConversation, x as LocalEntry, M as MarkdownToken, y as MessageBlock, z as MessageRole, N as NOT_STARTED, F as NO_TURN, J as NewTaskFields, P as OutputPreview, Q as PlanBlock, R as PlanMarkerStatus, V as PromptHold, X as RefTask, a2 as RunnerLoadedBlock, a4 as SUPERVISOR_LEVEL_LABEL, ae as SkillLoadBlock, ag as SkillToken, ai as SubagentBlock, aj as SubagentChild, ak as SubagentStatus, ao as TakenPrompt, as as TaskLogView, ay as TaskRef, az as TaskRowAction, aA as TaskRowContext, aB as TaskRowIsolation, aC as TaskRowKind, aD as TaskRowPlacement, aE as TaskRowSubject, aF as TaskRowUsage, aG as TaskRowView, aH as TaskStatusKind, aI as ThinkingDisplayBlock, aJ as ToolBlock, aK as ToolHeadline, aL as ToolStatus, aM as TurnGate, aN as UsageBlock, aP as WAITS_FOR_APPROVAL_LABEL, aQ as aheadOfDraft, aS as approvalLabel, aV as awaitingLabel, aW as blockedByLabel, aX as blockingFailures, aY as canMergeTasks, aZ as canSetDependencies, a_ as canSplitTask, a$ as capConflictFiles, b2 as dependencyCandidates, b3 as dependentsNotice, b4 as dependentsOf, b5 as diffRows, b6 as diffStat, b7 as diffSummary, b9 as drainNext, bb as followTurn, bc as fromTranscript, be as hasHiddenDetail, bf as holdPrompt, bg as isTaskRunning, bh as loadedSkillTokens, bi as markAction, bj as markRequestFor, bk as markdownHtml, bl as markdownTokens, bm as namedRepos, bn as newTaskFields, bo as opsEditable, bp as outputLines, bq as outputPreview, br as parseCount, bu as pastGateConfirmation, bv as reconcileApprovals, bw as reduceConversation, by as reduceTaskLog, bz as replayTaskLog, bA as resolveTaskRef, bB as resumeLabel, bC as resumeTime, bE as runnerToolSubject, bI as skillTokens, bJ as skippedLabel, bK as stopTurn, bL as summarizeToolCall, bP as takeAt, bR as taskOrderLabel, bS as taskRef, bT as taskRefOf, bU as taskRowActions, bV as taskRowView, bW as taskStartedNotice, bX as taskStatusKind, bZ as titledRefs, b_ as titledTaskRef, b$ as titledTaskRefOf, c1 as toolHeadline, c3 as truncateCheckpointSummary, c4 as unsendAll, c5 as unsendLatest } from './plan-utils-oC8bO4pN.js';
|
|
2
|
+
export { a as AttemptUsage, D as DEFAULT_RUNNERS, M as ModelUsage, O as PlanUsage, Q as PlannerUsage, aq as UsageLine, ar as UsageRecord, as as UsageTotals, av as addAttemptUsage, aw as addModelUsage, ax as addPlannerUsage, ay as addUsage, az as addUsageTotals, aD as endAttemptUsage, aH as isMeasured, aL as partedPromptUsage, aM as pausedOnLimit, aN as planUsage, aO as plannerContextFill, aQ as startAttemptUsage, aR as usageLine } from './Task-CRVIqSfy.js';
|
|
3
|
+
import './ModeResolver-BOU90Nn-.js';
|
|
4
|
+
import './IRunner-QBdYcatb.js';
|
|
5
5
|
import 'child_process';
|
|
6
6
|
import 'zod/v4';
|
package/dist/plan-utils.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/plan-utils.ts
|
|
@@ -29,6 +39,7 @@ __export(plan_utils_exports, {
|
|
|
29
39
|
NOT_STARTED: () => NOT_STARTED,
|
|
30
40
|
NO_TURN: () => NO_TURN,
|
|
31
41
|
SUPERVISOR_LEVEL_LABEL: () => SUPERVISOR_LEVEL_LABEL,
|
|
42
|
+
WAITS_FOR_APPROVAL_LABEL: () => WAITS_FOR_APPROVAL_LABEL,
|
|
32
43
|
addAttemptUsage: () => addAttemptUsage,
|
|
33
44
|
addModelUsage: () => addModelUsage,
|
|
34
45
|
addPlannerUsage: () => addPlannerUsage,
|
|
@@ -60,6 +71,8 @@ __export(plan_utils_exports, {
|
|
|
60
71
|
loadedSkillTokens: () => loadedSkillTokens,
|
|
61
72
|
markAction: () => markAction,
|
|
62
73
|
markRequestFor: () => markRequestFor,
|
|
74
|
+
markdownHtml: () => markdownHtml,
|
|
75
|
+
markdownTokens: () => markdownTokens,
|
|
63
76
|
namedRepos: () => namedRepos,
|
|
64
77
|
newTaskFields: () => newTaskFields,
|
|
65
78
|
opsEditable: () => opsEditable,
|
|
@@ -71,6 +84,7 @@ __export(plan_utils_exports, {
|
|
|
71
84
|
pausedOnLimit: () => pausedOnLimit,
|
|
72
85
|
planUsage: () => planUsage,
|
|
73
86
|
plannerContextFill: () => plannerContextFill,
|
|
87
|
+
reconcileApprovals: () => reconcileApprovals,
|
|
74
88
|
reduceConversation: () => reduceConversation,
|
|
75
89
|
reduceTaskLog: () => reduceTaskLog,
|
|
76
90
|
replayTaskLog: () => replayTaskLog,
|
|
@@ -178,6 +192,9 @@ function pausedOnLimit(task) {
|
|
|
178
192
|
return task.status === "awaiting_user" && task.awaitingReason === "usage-limit";
|
|
179
193
|
}
|
|
180
194
|
|
|
195
|
+
// src/services/TaskOps.ts
|
|
196
|
+
var import_uuid3 = require("uuid");
|
|
197
|
+
|
|
181
198
|
// src/taskRow/status.ts
|
|
182
199
|
var isTaskRunning = (task) => task.status === "in_progress" || task.status === "running";
|
|
183
200
|
var NOT_STARTED = /* @__PURE__ */ new Set(["pending", "approved", "blocked"]);
|
|
@@ -213,6 +230,7 @@ function blockedByLabel(refs) {
|
|
|
213
230
|
function skippedLabel(reason) {
|
|
214
231
|
return reason ? `Skipped: ${reason}` : "Skipped";
|
|
215
232
|
}
|
|
233
|
+
var WAITS_FOR_APPROVAL_LABEL = "Waiting for your approval to start";
|
|
216
234
|
function approvalLabel(count) {
|
|
217
235
|
if (!count) return null;
|
|
218
236
|
return count > 1 ? `Waiting for approval (${count})` : "Waiting for approval";
|
|
@@ -1103,6 +1121,13 @@ function syncTranscript(view, { plan, turnId }) {
|
|
|
1103
1121
|
}
|
|
1104
1122
|
return next === view && latest === view.transcriptAt ? view : { ...next, transcriptAt: latest };
|
|
1105
1123
|
}
|
|
1124
|
+
function reconcileApprovals(view, waiting) {
|
|
1125
|
+
const ids = new Set(waiting.map((request) => request.id));
|
|
1126
|
+
const answered2 = (block) => block.type === "approval" && block.status === "pending" && block.approvalId !== void 0 && !ids.has(block.approvalId);
|
|
1127
|
+
const kept = view.blocks.some(answered2) ? { ...view, blocks: view.blocks.filter((block) => !answered2(block)) } : view;
|
|
1128
|
+
const carded = new Set(kept.blocks.flatMap((block) => block.type === "approval" && block.approvalId ? [block.approvalId] : []));
|
|
1129
|
+
return waiting.filter((request) => !carded.has(request.id)).reduce(requestApproval, kept);
|
|
1130
|
+
}
|
|
1106
1131
|
function reduceConversation(view, input) {
|
|
1107
1132
|
switch (input.type) {
|
|
1108
1133
|
case "local_entry":
|
|
@@ -1653,6 +1678,36 @@ function taskStartedNotice(title, runner) {
|
|
|
1653
1678
|
return runner ? `Started "${title}" \xB7 ${runner}` : `Started "${title}"`;
|
|
1654
1679
|
}
|
|
1655
1680
|
|
|
1681
|
+
// src/conversation/markdown.ts
|
|
1682
|
+
var import_markdown_it = __toESM(require("markdown-it"));
|
|
1683
|
+
var md = new import_markdown_it.default({ html: false, linkify: true, breaks: true });
|
|
1684
|
+
md.linkify.set({ fuzzyLink: false, fuzzyEmail: false });
|
|
1685
|
+
md.validateLink = (url) => /^https?:/i.test(url);
|
|
1686
|
+
md.core.ruler.after("linkify", "image_as_text", (state) => {
|
|
1687
|
+
for (const block of state.tokens) {
|
|
1688
|
+
if (!block.children) continue;
|
|
1689
|
+
block.children = block.children.map((token) => {
|
|
1690
|
+
if (token.type !== "image") return token;
|
|
1691
|
+
const text2 = new state.Token("text", "", 0);
|
|
1692
|
+
text2.content = token.content || (token.attrGet("src") ?? "");
|
|
1693
|
+
return text2;
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
md.renderer.rules.link_open = (tokens, idx, options, _env, self) => {
|
|
1698
|
+
tokens[idx].attrSet("target", "_blank");
|
|
1699
|
+
tokens[idx].attrSet("rel", "noopener");
|
|
1700
|
+
return self.renderToken(tokens, idx, options);
|
|
1701
|
+
};
|
|
1702
|
+
md.renderer.rules.table_open = (tokens, idx, options, _env, self) => `<div class="md-table">${self.renderToken(tokens, idx, options)}`;
|
|
1703
|
+
md.renderer.rules.table_close = () => "</table></div>\n";
|
|
1704
|
+
function markdownTokens(text2) {
|
|
1705
|
+
return md.parse(text2, {});
|
|
1706
|
+
}
|
|
1707
|
+
function markdownHtml(text2) {
|
|
1708
|
+
return md.render(text2);
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1656
1711
|
// src/taskRow/actions.ts
|
|
1657
1712
|
var UNSTARTED_AI = (t) => t.type === "ai" && NOT_STARTED.has(t.status);
|
|
1658
1713
|
var QUEUED = (t) => t.status === "pending" || t.status === "approved";
|
|
@@ -1721,6 +1776,7 @@ function taskRowView(task, context = {}) {
|
|
|
1721
1776
|
awaiting: awaitingLabel(task),
|
|
1722
1777
|
resumes: resumeLabel(task, context.now),
|
|
1723
1778
|
approvals: approvalLabel(task.awaitingApproval),
|
|
1779
|
+
waitsForApproval: task.waitsForApproval && NOT_STARTED.has(task.status) ? WAITS_FOR_APPROVAL_LABEL : null,
|
|
1724
1780
|
autonomous: task.type === "ai" && context.modes?.find((m) => m.id === task.taskMode)?.autonomous === true,
|
|
1725
1781
|
repos: namedRepos(isolation?.repos),
|
|
1726
1782
|
conflict: isolation?.state === "conflict" ? { repo: namedRepo(isolation.conflictRepo), files: filesOf(isolation.conflictFiles) } : null,
|
|
@@ -1770,6 +1826,7 @@ var EMPTY_RUN = { tasks: [], runMerge: null, handoff: null, mergeResult: null };
|
|
|
1770
1826
|
NOT_STARTED,
|
|
1771
1827
|
NO_TURN,
|
|
1772
1828
|
SUPERVISOR_LEVEL_LABEL,
|
|
1829
|
+
WAITS_FOR_APPROVAL_LABEL,
|
|
1773
1830
|
addAttemptUsage,
|
|
1774
1831
|
addModelUsage,
|
|
1775
1832
|
addPlannerUsage,
|
|
@@ -1801,6 +1858,8 @@ var EMPTY_RUN = { tasks: [], runMerge: null, handoff: null, mergeResult: null };
|
|
|
1801
1858
|
loadedSkillTokens,
|
|
1802
1859
|
markAction,
|
|
1803
1860
|
markRequestFor,
|
|
1861
|
+
markdownHtml,
|
|
1862
|
+
markdownTokens,
|
|
1804
1863
|
namedRepos,
|
|
1805
1864
|
newTaskFields,
|
|
1806
1865
|
opsEditable,
|
|
@@ -1812,6 +1871,7 @@ var EMPTY_RUN = { tasks: [], runMerge: null, handoff: null, mergeResult: null };
|
|
|
1812
1871
|
pausedOnLimit,
|
|
1813
1872
|
planUsage,
|
|
1814
1873
|
plannerContextFill,
|
|
1874
|
+
reconcileApprovals,
|
|
1815
1875
|
reduceConversation,
|
|
1816
1876
|
reduceTaskLog,
|
|
1817
1877
|
replayTaskLog,
|