lark-coding-assistant 0.2.4 → 0.2.5
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/daemon-entry.js +16 -4
- package/dist/daemon-entry.js.map +1 -1
- package/package.json +1 -1
package/dist/daemon-entry.js
CHANGED
|
@@ -4336,13 +4336,25 @@ ${escapeFence2(output).slice(-6500)}
|
|
|
4336
4336
|
if (focusedIndex === targetIndex) return { ok: true };
|
|
4337
4337
|
const direction = targetIndex > focusedIndex ? "Down" : "Up";
|
|
4338
4338
|
await this.tmux.sendKey(paneId, direction);
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
const nextFocused = this.screen?.actions.findIndex(({ focused }) => focused) ?? -1;
|
|
4342
|
-
if (nextFocused === focusedIndex) return { ok: false, error: "terminal focus did not move as expected" };
|
|
4339
|
+
const moved = await this.waitForFocusMove(interactionId, focusedIndex);
|
|
4340
|
+
if (!moved.ok) return moved;
|
|
4343
4341
|
}
|
|
4344
4342
|
return { ok: false, error: "terminal focus navigation exceeded its safe step limit" };
|
|
4345
4343
|
}
|
|
4344
|
+
async waitForFocusMove(interactionId, previousIndex) {
|
|
4345
|
+
const deadline = Date.now() + 1200;
|
|
4346
|
+
while (Date.now() < deadline) {
|
|
4347
|
+
await new Promise((resolve2) => setTimeout(resolve2, 60));
|
|
4348
|
+
await this.poll();
|
|
4349
|
+
const interaction = this.screen?.interaction;
|
|
4350
|
+
if (!interaction || interaction.interactionId !== interactionId) {
|
|
4351
|
+
return { ok: false, error: "interaction changed while navigating; refusing action" };
|
|
4352
|
+
}
|
|
4353
|
+
const focusedIndex = this.screen?.actions.findIndex(({ focused }) => focused) ?? -1;
|
|
4354
|
+
if (focusedIndex !== -1 && focusedIndex !== previousIndex) return { ok: true };
|
|
4355
|
+
}
|
|
4356
|
+
return { ok: false, error: "terminal focus did not move before the navigation timeout" };
|
|
4357
|
+
}
|
|
4346
4358
|
async waitForInteractionChange(interactionId) {
|
|
4347
4359
|
const deadline = Date.now() + 1500;
|
|
4348
4360
|
while (Date.now() < deadline) {
|