@4pm/cli 0.4.2 → 0.4.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/index.js +24 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25939,6 +25939,7 @@ var WsClient = class {
|
|
|
25939
25939
|
if ("type" in message) {
|
|
25940
25940
|
if (message.type === "hello_ack" && this.ecdh) {
|
|
25941
25941
|
this.sessionKey = deriveSessionKey(this.ecdh, message.pubkey);
|
|
25942
|
+
if (message.workerName) this.bus.setWorker(message.workerName);
|
|
25942
25943
|
logger.info("ws.connected", { version: CLI_VERSION });
|
|
25943
25944
|
this.bus.setStatus("connected");
|
|
25944
25945
|
this.bus.log("\u2714 Connected to the server (session encryption ready).");
|
|
@@ -26321,6 +26322,8 @@ var SessionBus = class {
|
|
|
26321
26322
|
currentActiveProfile = null;
|
|
26322
26323
|
/** Link scope learned from the server at connect time (heals the header/.cre). */
|
|
26323
26324
|
currentScope = null;
|
|
26325
|
+
/** Worker (physical machine) name learned from the server at connect time. */
|
|
26326
|
+
currentWorker = null;
|
|
26324
26327
|
constructor() {
|
|
26325
26328
|
this.emitter.setMaxListeners(50);
|
|
26326
26329
|
}
|
|
@@ -26402,6 +26405,20 @@ var SessionBus = class {
|
|
|
26402
26405
|
this.emitter.on("scope", fn);
|
|
26403
26406
|
return () => this.emitter.off("scope", fn);
|
|
26404
26407
|
}
|
|
26408
|
+
/** The worker (physical machine) name learned from the server at connect, or null. */
|
|
26409
|
+
get worker() {
|
|
26410
|
+
return this.currentWorker;
|
|
26411
|
+
}
|
|
26412
|
+
/** Set the worker name (learned from the hello_ack — heals the header). */
|
|
26413
|
+
setWorker(worker) {
|
|
26414
|
+
this.currentWorker = worker;
|
|
26415
|
+
this.emitter.emit("worker", worker);
|
|
26416
|
+
}
|
|
26417
|
+
/** Subscribe to worker-name changes. */
|
|
26418
|
+
onWorker(fn) {
|
|
26419
|
+
this.emitter.on("worker", fn);
|
|
26420
|
+
return () => this.emitter.off("worker", fn);
|
|
26421
|
+
}
|
|
26405
26422
|
/**
|
|
26406
26423
|
* Subscribe to transcript entries. Any entries emitted before this subscription
|
|
26407
26424
|
* are replayed first (so a consumer that mounts a tick late — e.g. React effects —
|
|
@@ -32102,6 +32119,7 @@ function scopeLabel(scope) {
|
|
|
32102
32119
|
function Banner({
|
|
32103
32120
|
info,
|
|
32104
32121
|
scope,
|
|
32122
|
+
worker,
|
|
32105
32123
|
status,
|
|
32106
32124
|
activeProfile
|
|
32107
32125
|
}) {
|
|
@@ -32123,7 +32141,8 @@ function Banner({
|
|
|
32123
32141
|
"scope: ",
|
|
32124
32142
|
scopeLabel(scope),
|
|
32125
32143
|
" \xB7 profile: ",
|
|
32126
|
-
info.profile
|
|
32144
|
+
info.profile,
|
|
32145
|
+
worker ? ` \xB7 worker: ${worker}` : ""
|
|
32127
32146
|
] }),
|
|
32128
32147
|
scope === "orchestrator" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
|
|
32129
32148
|
"server: ",
|
|
@@ -32526,6 +32545,7 @@ function App2({
|
|
|
32526
32545
|
const [busy, setBusy] = (0, import_react26.useState)(bus.busy);
|
|
32527
32546
|
const [activeProfile, setActiveProfile] = (0, import_react26.useState)(bus.activeProfile);
|
|
32528
32547
|
const [scope, setScope] = (0, import_react26.useState)(bus.scope ?? info.scope);
|
|
32548
|
+
const [worker, setWorker] = (0, import_react26.useState)(bus.worker);
|
|
32529
32549
|
const [scrollBack, setScrollBack] = (0, import_react26.useState)(0);
|
|
32530
32550
|
const [history, setHistory] = (0, import_react26.useState)(() => loadInputHistory(info.profileDir));
|
|
32531
32551
|
(0, import_react26.useEffect)(() => {
|
|
@@ -32538,12 +32558,14 @@ function App2({
|
|
|
32538
32558
|
const offBusy = bus.onBusy(setBusy);
|
|
32539
32559
|
const offProfile = bus.onActiveProfile(setActiveProfile);
|
|
32540
32560
|
const offScope = bus.onScope(setScope);
|
|
32561
|
+
const offWorker = bus.onWorker(setWorker);
|
|
32541
32562
|
return () => {
|
|
32542
32563
|
offTranscript();
|
|
32543
32564
|
offStatus();
|
|
32544
32565
|
offBusy();
|
|
32545
32566
|
offProfile();
|
|
32546
32567
|
offScope();
|
|
32568
|
+
offWorker();
|
|
32547
32569
|
};
|
|
32548
32570
|
}, [bus]);
|
|
32549
32571
|
const handleSubmit = (input) => {
|
|
@@ -32580,7 +32602,7 @@ function App2({
|
|
|
32580
32602
|
else if (key.pageDown) setScrollBack((b) => Math.max(0, b - bodyHeight));
|
|
32581
32603
|
});
|
|
32582
32604
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", height: rows, children: [
|
|
32583
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Banner, { info, scope, status, activeProfile }),
|
|
32605
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Banner, { info, scope, worker, status, activeProfile }),
|
|
32584
32606
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Rule, { width }),
|
|
32585
32607
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", height: bodyHeight, overflow: "hidden", children: [
|
|
32586
32608
|
visible.map((line) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TranscriptLine, { line }, line.key)),
|