@hydra-acp/cli 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +16 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4076,10 +4076,8 @@ async function getPendingUpdate() {
|
|
|
4076
4076
|
const mod = await import("update-notifier");
|
|
4077
4077
|
const updateNotifier = mod.default ?? mod;
|
|
4078
4078
|
const notifier = updateNotifier({
|
|
4079
|
-
pkg: { name: PKG_NAME, version: HYDRA_VERSION }
|
|
4080
|
-
updateCheckInterval: 1e3 * 60 * 60 * 24
|
|
4079
|
+
pkg: { name: PKG_NAME, version: HYDRA_VERSION }
|
|
4081
4080
|
});
|
|
4082
|
-
notifier.check();
|
|
4083
4081
|
const u = notifier.update;
|
|
4084
4082
|
if (u && typeof u.latest === "string" && typeof u.current === "string" && u.latest !== u.current) {
|
|
4085
4083
|
try {
|
|
@@ -8271,11 +8269,12 @@ function toolIconStyle(status) {
|
|
|
8271
8269
|
}
|
|
8272
8270
|
}
|
|
8273
8271
|
function formatPlan(event) {
|
|
8272
|
+
const stopped = event.stopped === true;
|
|
8274
8273
|
if (event.entries.length === 0) {
|
|
8275
8274
|
return [
|
|
8276
8275
|
{
|
|
8277
8276
|
prefix: "\u25A3 ",
|
|
8278
|
-
prefixStyle: "plan",
|
|
8277
|
+
prefixStyle: stopped ? "tool-status-fail" : "plan",
|
|
8279
8278
|
body: "(empty plan)",
|
|
8280
8279
|
bodyStyle: "dim"
|
|
8281
8280
|
}
|
|
@@ -8284,7 +8283,7 @@ function formatPlan(event) {
|
|
|
8284
8283
|
const allComplete = event.entries.every(
|
|
8285
8284
|
(e) => (e.status ?? "pending") === "completed"
|
|
8286
8285
|
);
|
|
8287
|
-
const headerStyle = allComplete ? "plan-done" : "plan";
|
|
8286
|
+
const headerStyle = allComplete ? "plan-done" : stopped ? "tool-status-fail" : "plan";
|
|
8288
8287
|
const lines = [
|
|
8289
8288
|
{
|
|
8290
8289
|
prefix: "\u25A3 ",
|
|
@@ -8296,7 +8295,7 @@ function formatPlan(event) {
|
|
|
8296
8295
|
for (const entry of event.entries) {
|
|
8297
8296
|
const status = entry.status ?? "pending";
|
|
8298
8297
|
const marker = status === "completed" ? "[x]" : status === "in_progress" ? "[~]" : "[ ]";
|
|
8299
|
-
const style = status === "completed" ? "plan-done" : status === "in_progress" ? "plan" : "plan-pending";
|
|
8298
|
+
const style = status === "completed" ? "plan-done" : status === "in_progress" ? stopped ? "plan-pending" : "plan" : "plan-pending";
|
|
8300
8299
|
lines.push({
|
|
8301
8300
|
prefix: " ",
|
|
8302
8301
|
body: `${marker} ${entry.content}`,
|
|
@@ -9485,6 +9484,7 @@ async function runSession(term, config, opts, exitHint) {
|
|
|
9485
9484
|
let toolsBlockStartedAt = null;
|
|
9486
9485
|
let toolsBlockEndedAt = null;
|
|
9487
9486
|
let toolsBlockStopReason = null;
|
|
9487
|
+
let lastPlanEvent = null;
|
|
9488
9488
|
const TOOLS_COLLAPSED_LIMIT = 5;
|
|
9489
9489
|
let agentBuffer = "";
|
|
9490
9490
|
let agentKey = null;
|
|
@@ -9647,6 +9647,7 @@ async function runSession(term, config, opts, exitHint) {
|
|
|
9647
9647
|
}
|
|
9648
9648
|
screen.clearKey("tools");
|
|
9649
9649
|
screen.clearKey("plan");
|
|
9650
|
+
lastPlanEvent = null;
|
|
9650
9651
|
toolStates.clear();
|
|
9651
9652
|
toolCallOrder.length = 0;
|
|
9652
9653
|
toolsExpanded = false;
|
|
@@ -9672,6 +9673,7 @@ async function runSession(term, config, opts, exitHint) {
|
|
|
9672
9673
|
}
|
|
9673
9674
|
if (event.kind === "plan") {
|
|
9674
9675
|
closeAgentText();
|
|
9676
|
+
lastPlanEvent = event;
|
|
9675
9677
|
const lines = formatEvent(event);
|
|
9676
9678
|
if (lines.length > 0) {
|
|
9677
9679
|
screen.upsertLines("plan", lines);
|
|
@@ -9693,6 +9695,13 @@ async function runSession(term, config, opts, exitHint) {
|
|
|
9693
9695
|
}
|
|
9694
9696
|
if (event.kind === "turn-complete") {
|
|
9695
9697
|
closeAgentText();
|
|
9698
|
+
if (lastPlanEvent !== null && event.stopReason !== void 0 && event.stopReason !== "end_turn") {
|
|
9699
|
+
const lines = formatEvent({ ...lastPlanEvent, stopped: true });
|
|
9700
|
+
if (lines.length > 0) {
|
|
9701
|
+
screen.upsertLines("plan", lines);
|
|
9702
|
+
}
|
|
9703
|
+
}
|
|
9704
|
+
lastPlanEvent = null;
|
|
9696
9705
|
screen.clearKey("plan");
|
|
9697
9706
|
if (toolsBlockStartedAt !== null) {
|
|
9698
9707
|
toolsBlockEndedAt = Date.now();
|
|
@@ -9759,6 +9768,7 @@ async function runSession(term, config, opts, exitHint) {
|
|
|
9759
9768
|
toolsExpanded = false;
|
|
9760
9769
|
}
|
|
9761
9770
|
screen.clearKey("plan");
|
|
9771
|
+
lastPlanEvent = null;
|
|
9762
9772
|
if (pendingTurns > 0) {
|
|
9763
9773
|
adjustPendingTurns(-pendingTurns);
|
|
9764
9774
|
}
|