@ours.network/fleet 0.9.2 → 0.9.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/monitor.d.ts +9 -0
- package/dist/monitor.js +18 -0
- package/package.json +1 -1
package/dist/monitor.d.ts
CHANGED
|
@@ -145,6 +145,15 @@ export declare class Monitor {
|
|
|
145
145
|
private observeTurnOutcome;
|
|
146
146
|
/** Update the consecutive-API-error streak and derive `.monitor-status` from it. */
|
|
147
147
|
private recordTurn;
|
|
148
|
+
/**
|
|
149
|
+
* Reset the composer to empty before typing a wake. Without this, any
|
|
150
|
+
* unsubmitted text a human left in the input concatenates with the injected
|
|
151
|
+
* line (`stray[fleet-monitor] …`) or, when it has opened a slash-command menu,
|
|
152
|
+
* swallows the submit Enter entirely — wedging every subsequent injection until
|
|
153
|
+
* the composer is cleared by hand. Best-effort: a dead pane just makes the keys
|
|
154
|
+
* no-ops (delivery is still verified downstream).
|
|
155
|
+
*/
|
|
156
|
+
private clearComposer;
|
|
148
157
|
/** Block until the console can accept input; classify offline/stopped/ready. */
|
|
149
158
|
private awaitInjectable;
|
|
150
159
|
private doFetch;
|
package/dist/monitor.js
CHANGED
|
@@ -9,6 +9,11 @@ const BOOT_GRACE_MS = 15_000; // hold injection until the TUI is up
|
|
|
9
9
|
const POST_VERIFY_MS = 1_000;
|
|
10
10
|
const MAX_ENTER_RETRIES = 2;
|
|
11
11
|
const MODAL_RETRY_MS = 5_000;
|
|
12
|
+
// Keys that reset the composer to empty before we type a wake, so a human's
|
|
13
|
+
// unsubmitted keystrokes can't concatenate with — or wedge (e.g. via an open
|
|
14
|
+
// slash-command menu that captures Enter) — the injected line. C-e moves to end
|
|
15
|
+
// of line, C-u kills to start ⇒ whole single line cleared regardless of cursor.
|
|
16
|
+
const COMPOSER_CLEAR_KEYS = ['C-e', 'C-u'];
|
|
12
17
|
const BACKOFF_STEP_MS = 1_000;
|
|
13
18
|
const BACKOFF_MAX_MS = 5_000;
|
|
14
19
|
const PREFIX = '[fleet-monitor]';
|
|
@@ -296,6 +301,7 @@ export class Monitor {
|
|
|
296
301
|
return; // events remain covered by unread.json / SessionStart backlog
|
|
297
302
|
}
|
|
298
303
|
const line = formatNotificationLine(batch);
|
|
304
|
+
await this.clearComposer(); // start from an empty composer
|
|
299
305
|
await this.deps.tmux.sendText(this.name, line); // send-keys -l + Enter
|
|
300
306
|
let delivered = false;
|
|
301
307
|
// Verify submission for THIS line even if stop() arrives mid-flight: the text
|
|
@@ -356,6 +362,18 @@ export class Monitor {
|
|
|
356
362
|
? 'degraded: turns failing (api error)'
|
|
357
363
|
: 'armed');
|
|
358
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Reset the composer to empty before typing a wake. Without this, any
|
|
367
|
+
* unsubmitted text a human left in the input concatenates with the injected
|
|
368
|
+
* line (`stray[fleet-monitor] …`) or, when it has opened a slash-command menu,
|
|
369
|
+
* swallows the submit Enter entirely — wedging every subsequent injection until
|
|
370
|
+
* the composer is cleared by hand. Best-effort: a dead pane just makes the keys
|
|
371
|
+
* no-ops (delivery is still verified downstream).
|
|
372
|
+
*/
|
|
373
|
+
async clearComposer() {
|
|
374
|
+
for (const key of COMPOSER_CLEAR_KEYS)
|
|
375
|
+
await this.deps.tmux.sendKey(this.name, key);
|
|
376
|
+
}
|
|
359
377
|
/** Block until the console can accept input; classify offline/stopped/ready. */
|
|
360
378
|
async awaitInjectable(pid) {
|
|
361
379
|
for (;;) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/fleet",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, tmux consoles, systemd/launchd supervision, ours.network messaging.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "FSL-1.1-Apache-2.0",
|