@ordewell/core 0.4.15 → 0.4.17
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/{ITerminalRunner-DqAs12sy.d.ts → ITerminalRunner-CbLHKXT5.d.ts} +1 -1
- package/dist/{ITerminalRunner-D_RBDoHa.d.mts → ITerminalRunner-E3-6QNUS.d.mts} +1 -1
- package/dist/{ModeResolver-CzZd-i6T.d.ts → ModeResolver-Ob-ihQbI.d.ts} +1 -1
- package/dist/{ModeResolver-CCKYqdZC.d.mts → ModeResolver-mtIWrLXn.d.mts} +1 -1
- package/dist/{Task-cGrfYRXK.d.mts → Task-4rDGr8Su.d.mts} +1 -1
- package/dist/{Task-cGrfYRXK.d.ts → Task-4rDGr8Su.d.ts} +1 -1
- package/dist/{chunk-YTJ7EOV6.mjs → chunk-DV3YIKRA.mjs} +2 -2
- package/dist/{chunk-YTJ7EOV6.mjs.map → chunk-DV3YIKRA.mjs.map} +1 -1
- package/dist/{chunk-UEJ3SZQ7.mjs → chunk-QJ63PD5K.mjs} +2 -2
- package/dist/{chunk-N6HTBUKG.mjs → chunk-T4KGVP4N.mjs} +1 -1
- package/dist/chunk-T4KGVP4N.mjs.map +1 -0
- package/dist/index.d.mts +38 -20
- package/dist/index.d.ts +38 -20
- package/dist/index.js +44 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -24
- package/dist/index.mjs.map +1 -1
- package/dist/order-labels.d.mts +1 -1
- package/dist/order-labels.d.ts +1 -1
- package/dist/{parsing-D87zKtTe.d.ts → parsing-BJoHbA-t.d.ts} +2 -2
- package/dist/{parsing-BT-dvFcu.d.mts → parsing-BWfpLch9.d.mts} +2 -2
- package/dist/parsing.d.mts +3 -3
- package/dist/parsing.d.ts +3 -3
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +2 -2
- package/dist/{plan-utils-BbC9KdK4.d.ts → plan-utils-DJm2a7Zp.d.ts} +4 -2
- package/dist/{plan-utils-DHBIvkiT.d.mts → plan-utils-s6VL8NDF.d.mts} +4 -2
- package/dist/plan-utils.d.mts +3 -3
- package/dist/plan-utils.d.ts +3 -3
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +2 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/package.json +1 -1
- package/skills/improve-codebase-architecture/SKILL.md +59 -0
- package/dist/chunk-N6HTBUKG.mjs.map +0 -1
- /package/dist/{chunk-UEJ3SZQ7.mjs.map → chunk-QJ63PD5K.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveTaskMode,
|
|
14
14
|
runnerModesFrom,
|
|
15
15
|
validatePlanModification
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QJ63PD5K.mjs";
|
|
17
17
|
import {
|
|
18
18
|
CHECKPOINT_TRUNCATE_LENGTH,
|
|
19
19
|
UPDATABLE_FIELDS,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
textHasTaskOps,
|
|
38
38
|
truncateCheckpointSummary,
|
|
39
39
|
validateTaskEdit
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-DV3YIKRA.mjs";
|
|
41
41
|
import {
|
|
42
42
|
PLAN_ENVELOPE_KEY,
|
|
43
43
|
PlanParseError,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
updateTaskInPlan,
|
|
64
64
|
validateModifiedPlan,
|
|
65
65
|
warningsText
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-T4KGVP4N.mjs";
|
|
67
67
|
import {
|
|
68
68
|
resolveOrderLabel,
|
|
69
69
|
taskOrderLabel
|
|
@@ -9040,6 +9040,8 @@ var StdioAgentAdapter = class {
|
|
|
9040
9040
|
exited = null;
|
|
9041
9041
|
/** Set for the duration of a turn. Outside one, events are buffered rather than dropped. */
|
|
9042
9042
|
turnEmit = null;
|
|
9043
|
+
/** Set for the duration of a turn. Pinged on every raw line, whether or not `handleLine` turns it into an event. */
|
|
9044
|
+
turnActivity = null;
|
|
9043
9045
|
/**
|
|
9044
9046
|
* Events the agent produced before its first turn — in practice the startup
|
|
9045
9047
|
* warnings that arrive during the handshake. Dropping them hid the one
|
|
@@ -9086,12 +9088,15 @@ var StdioAgentAdapter = class {
|
|
|
9086
9088
|
windowsVerbatimArguments: launch.verbatim
|
|
9087
9089
|
});
|
|
9088
9090
|
this.process.stdout?.on("data", (chunk) => {
|
|
9089
|
-
this.stdout.push(chunk.toString(), (line) =>
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
this.
|
|
9093
|
-
|
|
9094
|
-
|
|
9091
|
+
this.stdout.push(chunk.toString(), (line) => {
|
|
9092
|
+
this.turnActivity?.();
|
|
9093
|
+
this.handleLine(line, (event) => {
|
|
9094
|
+
if (this.turnEmit) this.turnEmit(event);
|
|
9095
|
+
else if (!this.hadTurn && !TURN_SCOPED_EVENTS.has(event.type) && this.betweenTurns.length < BETWEEN_TURN_EVENT_CAP) {
|
|
9096
|
+
this.betweenTurns.push(event);
|
|
9097
|
+
}
|
|
9098
|
+
});
|
|
9099
|
+
});
|
|
9095
9100
|
});
|
|
9096
9101
|
this.process.stderr?.on("data", (chunk) => {
|
|
9097
9102
|
this.stderrTail = (this.stderrTail + chunk.toString()).slice(-STDERR_TAIL_CHARS);
|
|
@@ -9108,7 +9113,7 @@ ${err.message}`).slice(-STDERR_TAIL_CHARS);
|
|
|
9108
9113
|
});
|
|
9109
9114
|
await this.handshake(opts);
|
|
9110
9115
|
}
|
|
9111
|
-
async send(message, onEvent, signal) {
|
|
9116
|
+
async send(message, onEvent, signal, onActivity) {
|
|
9112
9117
|
if (!this.process) throw new Error(`${this.agentId} planner session is not started`);
|
|
9113
9118
|
if (this.exited) {
|
|
9114
9119
|
onEvent({ type: "error", message: this.exitMessage() });
|
|
@@ -9120,6 +9125,7 @@ ${err.message}`).slice(-STDERR_TAIL_CHARS);
|
|
|
9120
9125
|
if (settled) return;
|
|
9121
9126
|
settled = true;
|
|
9122
9127
|
this.turnEmit = null;
|
|
9128
|
+
this.turnActivity = null;
|
|
9123
9129
|
this.hadTurn = true;
|
|
9124
9130
|
signal?.removeEventListener("abort", onAbort);
|
|
9125
9131
|
this.process?.removeListener("exit", onExit);
|
|
@@ -9141,6 +9147,7 @@ ${err.message}`).slice(-STDERR_TAIL_CHARS);
|
|
|
9141
9147
|
finish();
|
|
9142
9148
|
};
|
|
9143
9149
|
this.turnEmit = emit;
|
|
9150
|
+
this.turnActivity = onActivity ?? null;
|
|
9144
9151
|
this.process.once("exit", onExit);
|
|
9145
9152
|
this.process.once("error", onExit);
|
|
9146
9153
|
if (signal?.aborted) {
|
|
@@ -9775,7 +9782,7 @@ ${this.stderrTail.trim()}` : ""}`);
|
|
|
9775
9782
|
if (!created?.id) throw new Error("The OpenCode planner server did not return a session id.");
|
|
9776
9783
|
this.sessionId = created.id;
|
|
9777
9784
|
}
|
|
9778
|
-
async send(message, onEvent, signal) {
|
|
9785
|
+
async send(message, onEvent, signal, onActivity) {
|
|
9779
9786
|
if (!this.baseUrl || !this.sessionId) throw new Error("OpenCode planner session is not started");
|
|
9780
9787
|
if (this.exited) {
|
|
9781
9788
|
onEvent({ type: "error", message: this.exitMessage() });
|
|
@@ -9795,7 +9802,8 @@ ${this.stderrTail.trim()}` : ""}`);
|
|
|
9795
9802
|
if (part.type === "tool") this.emitPart(part, seen, onEvent);
|
|
9796
9803
|
},
|
|
9797
9804
|
(ask) => this.denyPermission(ask, seen, onEvent),
|
|
9798
|
-
connected
|
|
9805
|
+
connected,
|
|
9806
|
+
onActivity
|
|
9799
9807
|
);
|
|
9800
9808
|
await Promise.race([streamReady, new Promise((r) => {
|
|
9801
9809
|
const t = setTimeout(r, STREAM_CONNECT_TIMEOUT_MS);
|
|
@@ -9910,7 +9918,7 @@ ${part.text}` : part.text });
|
|
|
9910
9918
|
* the settled POST repeats it — but permission requests arrive nowhere else,
|
|
9911
9919
|
* so the stream is load-bearing for {@link denyPermission}.
|
|
9912
9920
|
*/
|
|
9913
|
-
async streamEvents(signal, onPart, onPermission, onConnected) {
|
|
9921
|
+
async streamEvents(signal, onPart, onPermission, onConnected, onActivity) {
|
|
9914
9922
|
const response = await this.deps.fetch(`${this.baseUrl}/event`, { signal }).catch(() => null);
|
|
9915
9923
|
const body = response?.body;
|
|
9916
9924
|
if (!body) {
|
|
@@ -9924,6 +9932,7 @@ ${part.text}` : part.text });
|
|
|
9924
9932
|
for (; ; ) {
|
|
9925
9933
|
const { done, value } = await reader.read().catch(() => ({ done: true, value: void 0 }));
|
|
9926
9934
|
if (done) return;
|
|
9935
|
+
onActivity?.();
|
|
9927
9936
|
buffer += decoder.decode(value, { stream: true });
|
|
9928
9937
|
let newline;
|
|
9929
9938
|
while ((newline = buffer.indexOf("\n")) >= 0) {
|
|
@@ -10318,7 +10327,7 @@ var CliAgentAiService = class {
|
|
|
10318
10327
|
case "turn_end":
|
|
10319
10328
|
return;
|
|
10320
10329
|
}
|
|
10321
|
-
}, signal);
|
|
10330
|
+
}, signal, () => onProgress({ type: "liveness" }));
|
|
10322
10331
|
for (const id of [...pendingCalls.keys()]) {
|
|
10323
10332
|
settle(id, "The agent ended the turn without reporting this call's result.", false, "not_executed");
|
|
10324
10333
|
}
|
|
@@ -10743,7 +10752,7 @@ function builtinSkillsDir() {
|
|
|
10743
10752
|
}
|
|
10744
10753
|
|
|
10745
10754
|
// src/services/SkillsService.ts
|
|
10746
|
-
var BUILTIN_SKILL_NAMES = ["grilling", "to-spec"];
|
|
10755
|
+
var BUILTIN_SKILL_NAMES = ["grilling", "to-spec", "improve-codebase-architecture"];
|
|
10747
10756
|
var RETIRED_BUILTIN_SKILL_NAMES = ["grill-me"];
|
|
10748
10757
|
function parseSkillFile(filePath, name, source) {
|
|
10749
10758
|
const raw = fs4.readFileSync(filePath, "utf8");
|
|
@@ -11097,16 +11106,27 @@ var PlanEditError = class extends Error {
|
|
|
11097
11106
|
function sessionRuntimeSettings(settings) {
|
|
11098
11107
|
return { ...plannerRuntimeToggles(settings), modelAllowlist: settings.modelAllowlist };
|
|
11099
11108
|
}
|
|
11109
|
+
var SKILL_TOKEN = /(^|\s)\/([a-z][a-z0-9_-]*)([,.!?;:]*)(?=\s|$)/gi;
|
|
11100
11110
|
function resolveSkillInvocation(text, skillsService) {
|
|
11101
|
-
const
|
|
11102
|
-
if (
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11111
|
+
const bareMatch = text.trim().match(/^\/([a-z][a-z0-9_-]*)$/im);
|
|
11112
|
+
if (bareMatch) {
|
|
11113
|
+
const skillName = bareMatch[1].toLowerCase();
|
|
11114
|
+
const skill = skillsService.findSkill(skillName);
|
|
11115
|
+
if (!skill) {
|
|
11116
|
+
const available = typeof skillsService.listSkills === "function" ? skillsService.listSkills().map((s) => s.name).join(", ") : "";
|
|
11117
|
+
return `Unknown skill: ${skillName}. Available skills: ${available}`;
|
|
11118
|
+
}
|
|
11119
|
+
return skill.content;
|
|
11120
|
+
}
|
|
11121
|
+
const expanded = /* @__PURE__ */ new Set();
|
|
11122
|
+
return text.replace(SKILL_TOKEN, (full, lead, name, punct) => {
|
|
11123
|
+
const skillName = name.toLowerCase();
|
|
11124
|
+
if (expanded.has(skillName)) return full;
|
|
11125
|
+
const skill = skillsService.findSkill(skillName);
|
|
11126
|
+
if (!skill) return full;
|
|
11127
|
+
expanded.add(skillName);
|
|
11128
|
+
return `${lead}${skill.content}${punct}`;
|
|
11129
|
+
});
|
|
11110
11130
|
}
|
|
11111
11131
|
var Session = class {
|
|
11112
11132
|
/** Injected by a test; when present it is the service, forever. */
|
|
@@ -11278,6 +11298,9 @@ var Session = class {
|
|
|
11278
11298
|
};
|
|
11279
11299
|
}
|
|
11280
11300
|
translateProgress(progress) {
|
|
11301
|
+
if (progress.type === "liveness") {
|
|
11302
|
+
this.broadcast({ type: "planner_liveness" });
|
|
11303
|
+
}
|
|
11281
11304
|
if (progress.type === "thinking" && progress.text) {
|
|
11282
11305
|
this.broadcast({ type: "plan_thinking", text: progress.text });
|
|
11283
11306
|
}
|