@fnndsc/chell 5.6.2 → 5.7.1
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/core/daemonConsole.d.ts +12 -0
- package/dist/core/daemonConsole.js +30 -0
- package/dist/core/daemonConsole.js.map +1 -0
- package/dist/core/promptGuard.d.ts +44 -0
- package/dist/core/promptGuard.js +71 -0
- package/dist/core/promptGuard.js.map +1 -0
- package/dist/core/repl.d.ts +6 -0
- package/dist/core/repl.js +25 -2
- package/dist/core/repl.js.map +1 -1
- package/dist/core/startupWarmup.d.ts +11 -4
- package/dist/core/startupWarmup.js +99 -77
- package/dist/core/startupWarmup.js.map +1 -1
- package/dist/lib/bootsequence.d.ts +26 -1
- package/dist/lib/bootsequence.js +84 -5
- package/dist/lib/bootsequence.js.map +1 -1
- package/dist/lib/logo.d.ts +4 -5
- package/dist/lib/logo.js +21 -57
- package/dist/lib/logo.js.map +1 -1
- package/dist/lib/terminalRows.d.ts +88 -0
- package/dist/lib/terminalRows.js +151 -0
- package/dist/lib/terminalRows.js.map +1 -0
- package/dist/remote/client.js +20 -17
- package/dist/remote/client.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DaemonConsoleTarget } from '@fnndsc/calypso';
|
|
2
|
+
export type { DaemonConsoleTarget };
|
|
3
|
+
/** This chell build's own entry, spawned as the console surface. */
|
|
4
|
+
export declare const CHELL_ENTRY: string;
|
|
5
|
+
/**
|
|
6
|
+
* Runs the daemon console on chell's own terminal, spawning this chell as
|
|
7
|
+
* the surface.
|
|
8
|
+
*
|
|
9
|
+
* @param target - The daemon to attach to.
|
|
10
|
+
* @returns Resolves when the operator will not attach again.
|
|
11
|
+
*/
|
|
12
|
+
export declare function daemonConsole_run(target: DaemonConsoleTarget): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file chell's daemon-console entry, over the console the daemon package
|
|
3
|
+
* owns.
|
|
4
|
+
*
|
|
5
|
+
* The console loop, the cage and the reattach grammar live in calypso, since
|
|
6
|
+
* both the standalone `calypso` binary and `chell --daemon` end their boot
|
|
7
|
+
* this way. chell's one difference is the surface it launches: it spawns
|
|
8
|
+
* itself — this build, at this path — rather than whatever `chell` the path
|
|
9
|
+
* happens to resolve, so the console is never a different chell than the
|
|
10
|
+
* daemon it sits on.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { daemonConsole_run as consoleSession_run, consoleDeps_live, } from '@fnndsc/calypso';
|
|
16
|
+
/** This chell build's own entry, spawned as the console surface. */
|
|
17
|
+
export const CHELL_ENTRY = fileURLToPath(new URL('../index.js', import.meta.url));
|
|
18
|
+
/** Launch the surface as this very chell, not one resolved from the path. */
|
|
19
|
+
const CHELL_LAUNCH = { exec: process.execPath, prefixArgs: [CHELL_ENTRY] };
|
|
20
|
+
/**
|
|
21
|
+
* Runs the daemon console on chell's own terminal, spawning this chell as
|
|
22
|
+
* the surface.
|
|
23
|
+
*
|
|
24
|
+
* @param target - The daemon to attach to.
|
|
25
|
+
* @returns Resolves when the operator will not attach again.
|
|
26
|
+
*/
|
|
27
|
+
export async function daemonConsole_run(target) {
|
|
28
|
+
return consoleSession_run(target, consoleDeps_live(CHELL_LAUNCH));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=daemonConsole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemonConsole.js","sourceRoot":"","sources":["../../src/core/daemonConsole.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,iBAAiB,IAAI,kBAAkB,EACvC,gBAAgB,GAGjB,MAAM,iBAAiB,CAAC;AAIzB,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1F,6EAA6E;AAC7E,MAAM,YAAY,GAAkB,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAA2B;IACjE,OAAO,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Keeps a stray write from landing across an idle prompt.
|
|
3
|
+
*
|
|
4
|
+
* A REPL waiting at its prompt shares the terminal with everything else
|
|
5
|
+
* the process writes: another surface's output pushed by the daemon, a
|
|
6
|
+
* warm-up settling late, a roster row. Written raw, such a line lands on
|
|
7
|
+
* the prompt line and the prompt is gone until the next keystroke. While
|
|
8
|
+
* the guard is engaged, a stray write clears the prompt line, lands on a
|
|
9
|
+
* line of its own, and the prompt is redrawn beneath it with whatever was
|
|
10
|
+
* typed still in place.
|
|
11
|
+
*
|
|
12
|
+
* readline draws through an output whose write bypasses the guard, so the
|
|
13
|
+
* prompt's own paint is never mistaken for a stray line.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
/** A write's completion callback, as the stream API passes it. */
|
|
18
|
+
type WriteCallback = (error?: Error | null) => void;
|
|
19
|
+
/** What the guard needs of the terminal: a write it can wrap and a TTY flag. */
|
|
20
|
+
export interface GuardedStream {
|
|
21
|
+
write(chunk: string | Uint8Array, callback?: WriteCallback): boolean;
|
|
22
|
+
write(chunk: string | Uint8Array, encoding?: BufferEncoding, callback?: WriteCallback): boolean;
|
|
23
|
+
isTTY?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** A prompt guard around one output stream. */
|
|
26
|
+
export interface PromptGuard<S extends GuardedStream = GuardedStream> {
|
|
27
|
+
/** The stream readline should draw on: its write is never guarded. */
|
|
28
|
+
readonly output: S;
|
|
29
|
+
/** Route stray writes above the prompt; call once the prompt is drawn. */
|
|
30
|
+
engage(): void;
|
|
31
|
+
/** Let writes flow raw; call before a command's output starts. */
|
|
32
|
+
release(): void;
|
|
33
|
+
/** Write as the terminal's own, whether or not the guard is engaged. */
|
|
34
|
+
write(text: string): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a prompt guard around a stream.
|
|
38
|
+
*
|
|
39
|
+
* @param stream - The terminal stream; `process.stdout` in a running shell.
|
|
40
|
+
* @param redraw - Repaints the prompt and the line typed so far.
|
|
41
|
+
* @returns The guard.
|
|
42
|
+
*/
|
|
43
|
+
export declare function promptGuard_create<S extends GuardedStream>(stream: S, redraw: () => void): PromptGuard<S>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Keeps a stray write from landing across an idle prompt.
|
|
3
|
+
*
|
|
4
|
+
* A REPL waiting at its prompt shares the terminal with everything else
|
|
5
|
+
* the process writes: another surface's output pushed by the daemon, a
|
|
6
|
+
* warm-up settling late, a roster row. Written raw, such a line lands on
|
|
7
|
+
* the prompt line and the prompt is gone until the next keystroke. While
|
|
8
|
+
* the guard is engaged, a stray write clears the prompt line, lands on a
|
|
9
|
+
* line of its own, and the prompt is redrawn beneath it with whatever was
|
|
10
|
+
* typed still in place.
|
|
11
|
+
*
|
|
12
|
+
* readline draws through an output whose write bypasses the guard, so the
|
|
13
|
+
* prompt's own paint is never mistaken for a stray line.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Creates a prompt guard around a stream.
|
|
19
|
+
*
|
|
20
|
+
* @param stream - The terminal stream; `process.stdout` in a running shell.
|
|
21
|
+
* @param redraw - Repaints the prompt and the line typed so far.
|
|
22
|
+
* @returns The guard.
|
|
23
|
+
*/
|
|
24
|
+
export function promptGuard_create(stream, redraw) {
|
|
25
|
+
const original = stream.write;
|
|
26
|
+
const realWrite = (chunk, encodingOrCallback, callback) => {
|
|
27
|
+
// Normalised to the three-argument form: the stream takes an undefined
|
|
28
|
+
// encoding as its default, and the callback lands where it belongs.
|
|
29
|
+
const encoding = typeof encodingOrCallback === 'string' ? encodingOrCallback : undefined;
|
|
30
|
+
const done = typeof encodingOrCallback === 'function' ? encodingOrCallback : callback;
|
|
31
|
+
return original.call(stream, chunk, encoding, done);
|
|
32
|
+
};
|
|
33
|
+
let engaged = false;
|
|
34
|
+
const strayWrite = (chunk, encodingOrCallback, callback) => {
|
|
35
|
+
const text = typeof chunk === 'string' ? chunk : Buffer.from(chunk).toString('utf8');
|
|
36
|
+
const done = typeof encodingOrCallback === 'function' ? encodingOrCallback : callback;
|
|
37
|
+
if (stream.isTTY === true)
|
|
38
|
+
realWrite('\r\x1b[2K');
|
|
39
|
+
realWrite(text.endsWith('\n') ? text : `${text}\n`);
|
|
40
|
+
redraw();
|
|
41
|
+
done?.();
|
|
42
|
+
return true;
|
|
43
|
+
};
|
|
44
|
+
const output = new Proxy(stream, {
|
|
45
|
+
get(target, property, receiver) {
|
|
46
|
+
if (property === 'write')
|
|
47
|
+
return realWrite;
|
|
48
|
+
const value = Reflect.get(target, property, receiver);
|
|
49
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
output,
|
|
54
|
+
engage() {
|
|
55
|
+
if (engaged)
|
|
56
|
+
return;
|
|
57
|
+
engaged = true;
|
|
58
|
+
stream.write = strayWrite;
|
|
59
|
+
},
|
|
60
|
+
release() {
|
|
61
|
+
if (!engaged)
|
|
62
|
+
return;
|
|
63
|
+
engaged = false;
|
|
64
|
+
stream.write = original;
|
|
65
|
+
},
|
|
66
|
+
write(text) {
|
|
67
|
+
realWrite(text);
|
|
68
|
+
},
|
|
69
|
+
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AI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QACpD,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,MAAM,GAAM,IAAI,KAAK,CAAC,MAAM,EAAE;QAClC,GAAG,CAAC,MAAS,EAAE,QAAyB,EAAE,QAAiB;YACzD,IAAI,QAAQ,KAAK,OAAO;gBAAE,OAAO,SAAS,CAAC;YAC3C,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC/D,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAyC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACvG,CAAC;KACF,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,MAAM;YACJ,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC;QAC5B,CAAC;QACD,OAAO;YACL,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC;QAC1B,CAAC;QACD,KAAK,CAAC,IAAY;YAChB,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/core/repl.d.ts
CHANGED
|
@@ -33,6 +33,12 @@ export declare class REPL {
|
|
|
33
33
|
private lastExitCode;
|
|
34
34
|
private promptText;
|
|
35
35
|
private readonly bytesFetch;
|
|
36
|
+
/**
|
|
37
|
+
* Keeps a stray write — another surface's output pushed by the daemon, a
|
|
38
|
+
* warm-up settling late — from landing across the idle prompt. Engaged
|
|
39
|
+
* once the prompt is drawn, released before a command's output starts.
|
|
40
|
+
*/
|
|
41
|
+
private readonly guard;
|
|
36
42
|
/**
|
|
37
43
|
* Initializes the REPL interface around an engine.
|
|
38
44
|
*
|
package/dist/core/repl.js
CHANGED
|
@@ -17,6 +17,7 @@ import { cliSurface_create } from './cliSurface.js';
|
|
|
17
17
|
import { sink_set, StdoutSink } from '@fnndsc/brasa';
|
|
18
18
|
import { TerminalProgressRenderer } from './progressRenderer.js';
|
|
19
19
|
import { surfaceLine_executeSafely } from './surfaceDispatch.js';
|
|
20
|
+
import { promptGuard_create } from './promptGuard.js';
|
|
20
21
|
/**
|
|
21
22
|
* Handles the Read-Eval-Print Loop (REPL) interaction.
|
|
22
23
|
*/
|
|
@@ -28,6 +29,12 @@ export class REPL {
|
|
|
28
29
|
lastExitCode = 0;
|
|
29
30
|
promptText;
|
|
30
31
|
bytesFetch;
|
|
32
|
+
/**
|
|
33
|
+
* Keeps a stray write — another surface's output pushed by the daemon, a
|
|
34
|
+
* warm-up settling late — from landing across the idle prompt. Engaged
|
|
35
|
+
* once the prompt is drawn, released before a command's output starts.
|
|
36
|
+
*/
|
|
37
|
+
guard;
|
|
31
38
|
/**
|
|
32
39
|
* Initializes the REPL interface around an engine.
|
|
33
40
|
*
|
|
@@ -38,9 +45,20 @@ export class REPL {
|
|
|
38
45
|
this.engine = engine;
|
|
39
46
|
this.promptText = options?.promptText;
|
|
40
47
|
this.bytesFetch = options?.bytesFetch;
|
|
48
|
+
this.guard = promptGuard_create(process.stdout, () => {
|
|
49
|
+
try {
|
|
50
|
+
this.rl.prompt(true);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Interface might be closed.
|
|
54
|
+
}
|
|
55
|
+
});
|
|
41
56
|
this.rl = readline.createInterface({
|
|
42
57
|
input: process.stdin,
|
|
43
|
-
output
|
|
58
|
+
// readline draws through the guard's own output, so the prompt's paint
|
|
59
|
+
// is never taken for a stray line.
|
|
60
|
+
output: this.guard.output,
|
|
61
|
+
terminal: process.stdout.isTTY === true,
|
|
44
62
|
prompt: '> ',
|
|
45
63
|
completer: (line, callback) => {
|
|
46
64
|
this.engine.line_complete(line)
|
|
@@ -66,6 +84,8 @@ export class REPL {
|
|
|
66
84
|
await this.history_load();
|
|
67
85
|
await this.prompt_update();
|
|
68
86
|
this.rl.on('line', async (line) => {
|
|
87
|
+
// The line is the command's now; its output flows raw.
|
|
88
|
+
this.guard.release();
|
|
69
89
|
await this.history_append(line);
|
|
70
90
|
// `exit` quits this shell, never the engine. Closing readline runs the
|
|
71
91
|
// 'close' handler (goodbye, then process exit). Crucially, for a remote
|
|
@@ -93,7 +113,7 @@ export class REPL {
|
|
|
93
113
|
// A cancellable foreground command (currently recursive scans) gets the
|
|
94
114
|
// interrupt first. Otherwise Ctrl+C retains readline's usual behavior:
|
|
95
115
|
// clear an unfinished input line and redraw the prompt.
|
|
96
|
-
|
|
116
|
+
this.guard.write('\n');
|
|
97
117
|
if (this.engine.line_cancel?.()) {
|
|
98
118
|
return;
|
|
99
119
|
}
|
|
@@ -102,6 +122,7 @@ export class REPL {
|
|
|
102
122
|
});
|
|
103
123
|
this.rl.on('close', () => {
|
|
104
124
|
this.isOpen = false;
|
|
125
|
+
this.guard.release();
|
|
105
126
|
console.log(chalk.cyan('Exiting ChELL. Goodbye!'));
|
|
106
127
|
process.exit(0);
|
|
107
128
|
});
|
|
@@ -124,6 +145,7 @@ export class REPL {
|
|
|
124
145
|
catch (e) {
|
|
125
146
|
// Interface might be closed
|
|
126
147
|
}
|
|
148
|
+
this.guard.engage();
|
|
127
149
|
return;
|
|
128
150
|
}
|
|
129
151
|
const rendered = await sessionPrompt_render({
|
|
@@ -137,6 +159,7 @@ export class REPL {
|
|
|
137
159
|
catch (e) {
|
|
138
160
|
// Interface might be closed
|
|
139
161
|
}
|
|
162
|
+
this.guard.engage();
|
|
140
163
|
}
|
|
141
164
|
/**
|
|
142
165
|
* Loads command history from file.
|
package/dist/core/repl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.js","sourceRoot":"","sources":["../../src/core/repl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"repl.js","sourceRoot":"","sources":["../../src/core/repl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAoB,MA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,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;gBAClD,uEAAuE;gBACvE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YACzD,CAAC;YAAC,OAAO,CAAU,EAAE,CAAC;gBACpB,4CAA4C;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,cAAc,CAAC,IAAY;QACvC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,OAAO;QACzB,MAAM,IAAI,GAAW,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,2CAA2C;QAC7C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type BrasaEngine, type PrefetchResult } from '@fnndsc/brasa';
|
|
12
12
|
import { type HostControlInputs } from '@fnndsc/calypso';
|
|
13
|
+
import { type DaemonConsoleTarget } from './daemonConsole.js';
|
|
13
14
|
import { type BootStatus } from '../lib/bootsequence.js';
|
|
14
15
|
/** Startup cache selections shared by interactive and daemon modes. */
|
|
15
16
|
export interface StartupWarmupFlags {
|
|
@@ -77,11 +78,13 @@ export declare function queryCheckpoint_flush(): Promise<void>;
|
|
|
77
78
|
* @param user - Authenticated username used to construct the feed path.
|
|
78
79
|
* @param interactive - Whether progress may use an interactive spinner.
|
|
79
80
|
* @param reporter - Host status logger, or null for silent status reporting.
|
|
80
|
-
* @param
|
|
81
|
-
*
|
|
81
|
+
* @param reportSettlement - Whether to report outcomes that arrive after
|
|
82
|
+
* boot (the topology walk, the steps warming behind the prompt); daemon
|
|
83
|
+
* hosts enable this because the face keeps the readout, while interactive
|
|
84
|
+
* hosts use prompt progress.
|
|
82
85
|
* @returns Cache counts and the labels of any failed warm-up operations.
|
|
83
86
|
*/
|
|
84
|
-
export declare function startupWarmup_run(flags: StartupWarmupFlags, user: string | undefined, interactive: boolean, reporter: StartupWarmupReporter | null,
|
|
87
|
+
export declare function startupWarmup_run(flags: StartupWarmupFlags, user: string | undefined, interactive: boolean, reporter: StartupWarmupReporter | null, reportSettlement?: boolean): Promise<StartupWarmupCache>;
|
|
85
88
|
/**
|
|
86
89
|
* Warms a connected engine, reports readiness, then publishes its daemon.
|
|
87
90
|
*
|
|
@@ -90,5 +93,9 @@ export declare function startupWarmup_run(flags: StartupWarmupFlags, user: strin
|
|
|
90
93
|
* @param flags - Resource caches selected by daemon boot flags.
|
|
91
94
|
* @param interactive - Whether progress may use an interactive spinner.
|
|
92
95
|
* @param reporter - Daemon boot status logger.
|
|
96
|
+
* @param recovery - Asks the operator what to do after an exhausted warm-up.
|
|
97
|
+
* @param hostControlInputs - The host-control policy inputs.
|
|
98
|
+
* @param console - Puts a surface on this terminal once the daemon is up;
|
|
99
|
+
* the daemon console by default, replaceable under test.
|
|
93
100
|
*/
|
|
94
|
-
export declare function daemonSession_run(engine: BrasaEngine, user: string | undefined, flags: StartupWarmupFlags, interactive: boolean, reporter: StartupWarmupReporter, recovery?: DaemonWarmupRecovery, hostControlInputs?: HostControlInputs): Promise<void>;
|
|
101
|
+
export declare function daemonSession_run(engine: BrasaEngine, user: string | undefined, flags: StartupWarmupFlags, interactive: boolean, reporter: StartupWarmupReporter, recovery?: DaemonWarmupRecovery, hostControlInputs?: HostControlInputs, console?: (target: DaemonConsoleTarget) => Promise<void>): Promise<void>;
|