@buildautomaton/cli 0.1.65 → 0.1.66
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 +263 -141
- package/dist/cli.js.map +4 -4
- package/dist/index.js +263 -141
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -25791,7 +25791,7 @@ var {
|
|
|
25791
25791
|
} = import_index.default;
|
|
25792
25792
|
|
|
25793
25793
|
// src/cli-version.ts
|
|
25794
|
-
var CLI_VERSION = "0.1.
|
|
25794
|
+
var CLI_VERSION = "0.1.66".length > 0 ? "0.1.66" : "0.0.0-dev";
|
|
25795
25795
|
|
|
25796
25796
|
// src/cli/defaults.ts
|
|
25797
25797
|
var DEFAULT_API_URL = process.env.BUILDAUTOMATON_API_URL ?? "https://api.buildautomaton.com";
|
|
@@ -39402,6 +39402,208 @@ function createOnBridgeIdentified(opts) {
|
|
|
39402
39402
|
};
|
|
39403
39403
|
}
|
|
39404
39404
|
|
|
39405
|
+
// src/connection/create-bridge-identified-with-heartbeat.ts
|
|
39406
|
+
function createBridgeIdentifiedWithHeartbeat(params) {
|
|
39407
|
+
const { bridgeHeartbeat, log: log2, ...identifiedOpts } = params;
|
|
39408
|
+
const onBridgeIdentified = createOnBridgeIdentified({ ...identifiedOpts, logFn: log2 });
|
|
39409
|
+
return (msg) => {
|
|
39410
|
+
onBridgeIdentified(msg);
|
|
39411
|
+
bridgeHeartbeat.start();
|
|
39412
|
+
};
|
|
39413
|
+
}
|
|
39414
|
+
|
|
39415
|
+
// src/connection/heartbeat/build-heartbeat-message.ts
|
|
39416
|
+
function buildBridgeHeartbeatMessage(seq, meanRttMs2) {
|
|
39417
|
+
return meanRttMs2 !== void 0 && Number.isFinite(meanRttMs2) ? { t: "h", s: seq, m: Math.round(meanRttMs2) } : { t: "h", s: seq };
|
|
39418
|
+
}
|
|
39419
|
+
|
|
39420
|
+
// src/connection/heartbeat/heartbeat-seq.ts
|
|
39421
|
+
function createHeartbeatSeqCursor() {
|
|
39422
|
+
let seqCursor = -1;
|
|
39423
|
+
return {
|
|
39424
|
+
next() {
|
|
39425
|
+
seqCursor = seqCursor >= BRIDGE_HEARTBEAT_SEQ_MAX ? 0 : seqCursor + 1;
|
|
39426
|
+
return seqCursor;
|
|
39427
|
+
},
|
|
39428
|
+
reset() {
|
|
39429
|
+
seqCursor = -1;
|
|
39430
|
+
}
|
|
39431
|
+
};
|
|
39432
|
+
}
|
|
39433
|
+
|
|
39434
|
+
// src/connection/heartbeat/handle-pending-heartbeat-miss.ts
|
|
39435
|
+
function handlePendingHeartbeatMiss(params) {
|
|
39436
|
+
const { awaitingSeq, missed, log: log2, ws, onReconnect } = params;
|
|
39437
|
+
if (awaitingSeq === null) return { missed, stopTick: false };
|
|
39438
|
+
const nextMissed = missed + 1;
|
|
39439
|
+
if (nextMissed < BRIDGE_HEARTBEAT_MISSED_ACKS_BEFORE_RECONNECT) {
|
|
39440
|
+
return { missed: nextMissed, stopTick: false };
|
|
39441
|
+
}
|
|
39442
|
+
try {
|
|
39443
|
+
log2("[Bridge service] Heartbeat missed repeatedly; reconnecting\u2026");
|
|
39444
|
+
} catch {
|
|
39445
|
+
}
|
|
39446
|
+
onReconnect();
|
|
39447
|
+
safeCloseWebSocket(ws);
|
|
39448
|
+
return { missed: 0, stopTick: true };
|
|
39449
|
+
}
|
|
39450
|
+
|
|
39451
|
+
// src/connection/heartbeat/on-every-n-ticks.ts
|
|
39452
|
+
function createEveryNTicksRunner(onEveryNTicks) {
|
|
39453
|
+
let tickCount = 0;
|
|
39454
|
+
return {
|
|
39455
|
+
reset() {
|
|
39456
|
+
tickCount = 0;
|
|
39457
|
+
},
|
|
39458
|
+
onTick() {
|
|
39459
|
+
if (!onEveryNTicks || onEveryNTicks.n <= 0) return;
|
|
39460
|
+
tickCount++;
|
|
39461
|
+
if (tickCount % onEveryNTicks.n !== 0) return;
|
|
39462
|
+
try {
|
|
39463
|
+
onEveryNTicks.fn();
|
|
39464
|
+
} catch {
|
|
39465
|
+
}
|
|
39466
|
+
}
|
|
39467
|
+
};
|
|
39468
|
+
}
|
|
39469
|
+
|
|
39470
|
+
// src/connection/heartbeat/process-heartbeat-ack.ts
|
|
39471
|
+
function processHeartbeatAck(params) {
|
|
39472
|
+
const { seq, awaitingSeq, sentAtMs, recordRtt } = params;
|
|
39473
|
+
if (awaitingSeq === null) return { awaitingSeq, missed: 0 };
|
|
39474
|
+
if (!Number.isFinite(seq)) return { awaitingSeq, missed: 0 };
|
|
39475
|
+
const ack = Math.trunc(seq);
|
|
39476
|
+
const pending = awaitingSeq;
|
|
39477
|
+
if (ack < pending) return { awaitingSeq, missed: 0 };
|
|
39478
|
+
if (ack === pending) {
|
|
39479
|
+
recordRtt(Date.now() - sentAtMs);
|
|
39480
|
+
}
|
|
39481
|
+
return { awaitingSeq: null, missed: 0 };
|
|
39482
|
+
}
|
|
39483
|
+
|
|
39484
|
+
// src/connection/heartbeat/rtt-samples.ts
|
|
39485
|
+
function meanRttMs(samples) {
|
|
39486
|
+
if (samples.length === 0) return void 0;
|
|
39487
|
+
let sum = 0;
|
|
39488
|
+
for (const x of samples) sum += x;
|
|
39489
|
+
return sum / samples.length;
|
|
39490
|
+
}
|
|
39491
|
+
function createRttSampleBuffer(maxSamples = BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX) {
|
|
39492
|
+
const samples = [];
|
|
39493
|
+
return {
|
|
39494
|
+
push(rttMs) {
|
|
39495
|
+
if (!Number.isFinite(rttMs) || rttMs < 0 || rttMs >= 6e5) return;
|
|
39496
|
+
samples.push(rttMs);
|
|
39497
|
+
if (samples.length > maxSamples) {
|
|
39498
|
+
samples.splice(0, samples.length - maxSamples);
|
|
39499
|
+
}
|
|
39500
|
+
},
|
|
39501
|
+
clear() {
|
|
39502
|
+
samples.length = 0;
|
|
39503
|
+
},
|
|
39504
|
+
mean() {
|
|
39505
|
+
return meanRttMs(samples);
|
|
39506
|
+
}
|
|
39507
|
+
};
|
|
39508
|
+
}
|
|
39509
|
+
|
|
39510
|
+
// src/connection/heartbeat/controller.ts
|
|
39511
|
+
function createBridgeHeartbeatController(params) {
|
|
39512
|
+
const { getWs, log: log2, onEveryNTicks } = params;
|
|
39513
|
+
let interval = null;
|
|
39514
|
+
let awaitingSeq = null;
|
|
39515
|
+
let sentAtMs = 0;
|
|
39516
|
+
let missed = 0;
|
|
39517
|
+
const seqCursor = createHeartbeatSeqCursor();
|
|
39518
|
+
const rttSamples = createRttSampleBuffer();
|
|
39519
|
+
const everyNTicks = createEveryNTicksRunner(onEveryNTicks);
|
|
39520
|
+
function clearTimer() {
|
|
39521
|
+
if (interval != null) {
|
|
39522
|
+
clearInterval(interval);
|
|
39523
|
+
interval = null;
|
|
39524
|
+
}
|
|
39525
|
+
}
|
|
39526
|
+
function resetPendingState() {
|
|
39527
|
+
awaitingSeq = null;
|
|
39528
|
+
missed = 0;
|
|
39529
|
+
rttSamples.clear();
|
|
39530
|
+
}
|
|
39531
|
+
function tick() {
|
|
39532
|
+
const ws = getWs();
|
|
39533
|
+
if (!ws || ws.readyState !== wrapper_default.OPEN) return;
|
|
39534
|
+
const missResult = handlePendingHeartbeatMiss({
|
|
39535
|
+
awaitingSeq,
|
|
39536
|
+
missed,
|
|
39537
|
+
log: log2,
|
|
39538
|
+
ws,
|
|
39539
|
+
onReconnect: () => {
|
|
39540
|
+
clearTimer();
|
|
39541
|
+
resetPendingState();
|
|
39542
|
+
}
|
|
39543
|
+
});
|
|
39544
|
+
missed = missResult.missed;
|
|
39545
|
+
if (missResult.stopTick) return;
|
|
39546
|
+
const seq = seqCursor.next();
|
|
39547
|
+
sendWsMessage(ws, buildBridgeHeartbeatMessage(seq, rttSamples.mean()));
|
|
39548
|
+
awaitingSeq = seq;
|
|
39549
|
+
sentAtMs = Date.now();
|
|
39550
|
+
everyNTicks.onTick();
|
|
39551
|
+
}
|
|
39552
|
+
return {
|
|
39553
|
+
start() {
|
|
39554
|
+
clearTimer();
|
|
39555
|
+
everyNTicks.reset();
|
|
39556
|
+
resetPendingState();
|
|
39557
|
+
seqCursor.reset();
|
|
39558
|
+
interval = setInterval(tick, BRIDGE_APP_HEARTBEAT_INTERVAL_MS);
|
|
39559
|
+
},
|
|
39560
|
+
stop() {
|
|
39561
|
+
clearTimer();
|
|
39562
|
+
resetPendingState();
|
|
39563
|
+
},
|
|
39564
|
+
onAck(seq) {
|
|
39565
|
+
const result = processHeartbeatAck({
|
|
39566
|
+
seq,
|
|
39567
|
+
awaitingSeq,
|
|
39568
|
+
sentAtMs,
|
|
39569
|
+
recordRtt: rttSamples.push
|
|
39570
|
+
});
|
|
39571
|
+
awaitingSeq = result.awaitingSeq;
|
|
39572
|
+
missed = result.missed;
|
|
39573
|
+
}
|
|
39574
|
+
};
|
|
39575
|
+
}
|
|
39576
|
+
|
|
39577
|
+
// src/connection/send-bridge-identify.ts
|
|
39578
|
+
function sendBridgeIdentify(ws, params) {
|
|
39579
|
+
if (!ws) return;
|
|
39580
|
+
const { identifyReportedPaths, e2ee } = params;
|
|
39581
|
+
sendWsMessage(ws, {
|
|
39582
|
+
type: "identify",
|
|
39583
|
+
role: "cli",
|
|
39584
|
+
cliVersion: CLI_VERSION,
|
|
39585
|
+
bridgeRootPath: identifyReportedPaths.bridgeRootPath,
|
|
39586
|
+
worktreesRootPath: identifyReportedPaths.worktreesRootPath,
|
|
39587
|
+
localShortcutPort: identifyReportedPaths.localShortcutPort,
|
|
39588
|
+
localShortcutToken: identifyReportedPaths.localShortcutToken,
|
|
39589
|
+
...e2ee ? { e: e2ee.handshake } : {}
|
|
39590
|
+
});
|
|
39591
|
+
}
|
|
39592
|
+
var BRIDGE_IDENTIFY_REFRESH_EVERY_TICKS = 6;
|
|
39593
|
+
|
|
39594
|
+
// src/connection/create-bridge-identify-heartbeat.ts
|
|
39595
|
+
function createBridgeIdentifyHeartbeat(params) {
|
|
39596
|
+
const { getWs, log: log2, identifyReportedPaths, e2ee } = params;
|
|
39597
|
+
return createBridgeHeartbeatController({
|
|
39598
|
+
getWs,
|
|
39599
|
+
log: log2,
|
|
39600
|
+
onEveryNTicks: {
|
|
39601
|
+
n: BRIDGE_IDENTIFY_REFRESH_EVERY_TICKS,
|
|
39602
|
+
fn: () => sendBridgeIdentify(getWs(), { identifyReportedPaths, e2ee })
|
|
39603
|
+
}
|
|
39604
|
+
});
|
|
39605
|
+
}
|
|
39606
|
+
|
|
39405
39607
|
// src/connection/create-bridge-message-deps.ts
|
|
39406
39608
|
function createBridgeMessageDeps(params) {
|
|
39407
39609
|
const {
|
|
@@ -39568,98 +39770,11 @@ function createReportAutoDetectedAgents(getWs, logFn) {
|
|
|
39568
39770
|
};
|
|
39569
39771
|
}
|
|
39570
39772
|
|
|
39571
|
-
// src/connection/
|
|
39572
|
-
function
|
|
39573
|
-
if (samples.length === 0) return void 0;
|
|
39574
|
-
let sum = 0;
|
|
39575
|
-
for (const x of samples) sum += x;
|
|
39576
|
-
return sum / samples.length;
|
|
39577
|
-
}
|
|
39578
|
-
function createBridgeHeartbeatController(params) {
|
|
39579
|
-
const { getWs, log: log2 } = params;
|
|
39580
|
-
let interval = null;
|
|
39581
|
-
let seqCursor = -1;
|
|
39582
|
-
let awaitingSeq = null;
|
|
39583
|
-
let sentAtMs = 0;
|
|
39584
|
-
let missed = 0;
|
|
39585
|
-
const rttSamples = [];
|
|
39586
|
-
function clearTimer() {
|
|
39587
|
-
if (interval != null) {
|
|
39588
|
-
clearInterval(interval);
|
|
39589
|
-
interval = null;
|
|
39590
|
-
}
|
|
39591
|
-
}
|
|
39592
|
-
function nextSeq() {
|
|
39593
|
-
seqCursor = seqCursor >= BRIDGE_HEARTBEAT_SEQ_MAX ? 0 : seqCursor + 1;
|
|
39594
|
-
return seqCursor;
|
|
39595
|
-
}
|
|
39596
|
-
function tick() {
|
|
39597
|
-
const ws = getWs();
|
|
39598
|
-
if (!ws || ws.readyState !== wrapper_default.OPEN) return;
|
|
39599
|
-
if (awaitingSeq !== null) {
|
|
39600
|
-
missed++;
|
|
39601
|
-
if (missed >= BRIDGE_HEARTBEAT_MISSED_ACKS_BEFORE_RECONNECT) {
|
|
39602
|
-
try {
|
|
39603
|
-
log2("[Bridge service] Heartbeat missed repeatedly; reconnecting\u2026");
|
|
39604
|
-
} catch {
|
|
39605
|
-
}
|
|
39606
|
-
clearTimer();
|
|
39607
|
-
awaitingSeq = null;
|
|
39608
|
-
missed = 0;
|
|
39609
|
-
rttSamples.length = 0;
|
|
39610
|
-
safeCloseWebSocket(ws);
|
|
39611
|
-
return;
|
|
39612
|
-
}
|
|
39613
|
-
}
|
|
39614
|
-
const seq = nextSeq();
|
|
39615
|
-
const mean = meanRttMs(rttSamples);
|
|
39616
|
-
const payload = mean !== void 0 && Number.isFinite(mean) ? { t: "h", s: seq, m: Math.round(mean) } : { t: "h", s: seq };
|
|
39617
|
-
sendWsMessage(ws, payload);
|
|
39618
|
-
awaitingSeq = seq;
|
|
39619
|
-
sentAtMs = Date.now();
|
|
39620
|
-
}
|
|
39621
|
-
return {
|
|
39622
|
-
start() {
|
|
39623
|
-
clearTimer();
|
|
39624
|
-
awaitingSeq = null;
|
|
39625
|
-
missed = 0;
|
|
39626
|
-
seqCursor = -1;
|
|
39627
|
-
rttSamples.length = 0;
|
|
39628
|
-
interval = setInterval(tick, BRIDGE_APP_HEARTBEAT_INTERVAL_MS);
|
|
39629
|
-
},
|
|
39630
|
-
stop() {
|
|
39631
|
-
clearTimer();
|
|
39632
|
-
awaitingSeq = null;
|
|
39633
|
-
missed = 0;
|
|
39634
|
-
rttSamples.length = 0;
|
|
39635
|
-
},
|
|
39636
|
-
onAck(seq) {
|
|
39637
|
-
if (awaitingSeq === null) return;
|
|
39638
|
-
if (!Number.isFinite(seq)) return;
|
|
39639
|
-
const ack = Math.trunc(seq);
|
|
39640
|
-
const pending = awaitingSeq;
|
|
39641
|
-
if (ack < pending) return;
|
|
39642
|
-
if (ack === pending) {
|
|
39643
|
-
const rtt = Date.now() - sentAtMs;
|
|
39644
|
-
if (Number.isFinite(rtt) && rtt >= 0 && rtt < 6e5) {
|
|
39645
|
-
rttSamples.push(rtt);
|
|
39646
|
-
if (rttSamples.length > BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX) {
|
|
39647
|
-
rttSamples.splice(0, rttSamples.length - BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX);
|
|
39648
|
-
}
|
|
39649
|
-
}
|
|
39650
|
-
}
|
|
39651
|
-
awaitingSeq = null;
|
|
39652
|
-
missed = 0;
|
|
39653
|
-
}
|
|
39654
|
-
};
|
|
39655
|
-
}
|
|
39656
|
-
|
|
39657
|
-
// src/connection/create-bridge-runtime-message-setup.ts
|
|
39658
|
-
function createBridgeRuntimeMessageSetup(options) {
|
|
39773
|
+
// src/connection/create-bridge-runtime-message-deps.ts
|
|
39774
|
+
function createBridgeRuntimeMessageDeps(params) {
|
|
39659
39775
|
const {
|
|
39660
39776
|
apiUrl,
|
|
39661
39777
|
workspaceId,
|
|
39662
|
-
firehoseServerUrl,
|
|
39663
39778
|
state,
|
|
39664
39779
|
getWs,
|
|
39665
39780
|
log: log2,
|
|
@@ -39668,23 +39783,11 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
39668
39783
|
sessionWorktreeManager,
|
|
39669
39784
|
previewWorktreeManager,
|
|
39670
39785
|
previewEnvironmentManager,
|
|
39671
|
-
e2ee
|
|
39672
|
-
|
|
39673
|
-
|
|
39674
|
-
|
|
39675
|
-
|
|
39676
|
-
firehoseServerUrl,
|
|
39677
|
-
workspaceId,
|
|
39678
|
-
state,
|
|
39679
|
-
logFn: log2
|
|
39680
|
-
});
|
|
39681
|
-
const onBridgeIdentified = (msg) => {
|
|
39682
|
-
baseOnBridgeIdentified(msg);
|
|
39683
|
-
bridgeHeartbeat.start();
|
|
39684
|
-
};
|
|
39685
|
-
const sendLocalSkillsReport = createSendLocalSkillsReport(getWs, log2);
|
|
39686
|
-
const reportAutoDetectedAgents = createReportAutoDetectedAgents(getWs, log2);
|
|
39687
|
-
const messageDeps = createBridgeMessageDeps({
|
|
39786
|
+
e2ee,
|
|
39787
|
+
onBridgeIdentified,
|
|
39788
|
+
bridgeHeartbeat
|
|
39789
|
+
} = params;
|
|
39790
|
+
return createBridgeMessageDeps({
|
|
39688
39791
|
getWs,
|
|
39689
39792
|
log: log2,
|
|
39690
39793
|
acpManager,
|
|
@@ -39692,8 +39795,8 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
39692
39795
|
previewWorktreeManager,
|
|
39693
39796
|
onBridgeIdentified,
|
|
39694
39797
|
bridgeHeartbeat,
|
|
39695
|
-
sendLocalSkillsReport,
|
|
39696
|
-
reportAutoDetectedAgents,
|
|
39798
|
+
sendLocalSkillsReport: createSendLocalSkillsReport(getWs, log2),
|
|
39799
|
+
reportAutoDetectedAgents: createReportAutoDetectedAgents(getWs, log2),
|
|
39697
39800
|
warmupAgentCapabilitiesOnConnect: createWarmupAgentCapabilitiesOnConnect({
|
|
39698
39801
|
workspaceId,
|
|
39699
39802
|
log: log2,
|
|
@@ -39709,6 +39812,54 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
39709
39812
|
cloudApiBaseUrl: apiUrl,
|
|
39710
39813
|
getCloudAccessToken: () => tokens.accessToken
|
|
39711
39814
|
});
|
|
39815
|
+
}
|
|
39816
|
+
|
|
39817
|
+
// src/connection/create-bridge-runtime-message-setup.ts
|
|
39818
|
+
function createBridgeRuntimeMessageSetup(options) {
|
|
39819
|
+
const {
|
|
39820
|
+
apiUrl,
|
|
39821
|
+
workspaceId,
|
|
39822
|
+
firehoseServerUrl,
|
|
39823
|
+
state,
|
|
39824
|
+
getWs,
|
|
39825
|
+
log: log2,
|
|
39826
|
+
tokens,
|
|
39827
|
+
acpManager,
|
|
39828
|
+
sessionWorktreeManager,
|
|
39829
|
+
previewWorktreeManager,
|
|
39830
|
+
previewEnvironmentManager,
|
|
39831
|
+
e2ee,
|
|
39832
|
+
identifyReportedPaths
|
|
39833
|
+
} = options;
|
|
39834
|
+
const bridgeHeartbeat = createBridgeIdentifyHeartbeat({
|
|
39835
|
+
getWs,
|
|
39836
|
+
log: log2,
|
|
39837
|
+
identifyReportedPaths,
|
|
39838
|
+
e2ee
|
|
39839
|
+
});
|
|
39840
|
+
const onBridgeIdentified = createBridgeIdentifiedWithHeartbeat({
|
|
39841
|
+
previewEnvironmentManager,
|
|
39842
|
+
firehoseServerUrl,
|
|
39843
|
+
workspaceId,
|
|
39844
|
+
state,
|
|
39845
|
+
log: log2,
|
|
39846
|
+
bridgeHeartbeat
|
|
39847
|
+
});
|
|
39848
|
+
const messageDeps = createBridgeRuntimeMessageDeps({
|
|
39849
|
+
apiUrl,
|
|
39850
|
+
workspaceId,
|
|
39851
|
+
state,
|
|
39852
|
+
getWs,
|
|
39853
|
+
log: log2,
|
|
39854
|
+
tokens,
|
|
39855
|
+
acpManager,
|
|
39856
|
+
sessionWorktreeManager,
|
|
39857
|
+
previewWorktreeManager,
|
|
39858
|
+
previewEnvironmentManager,
|
|
39859
|
+
e2ee,
|
|
39860
|
+
onBridgeIdentified,
|
|
39861
|
+
bridgeHeartbeat
|
|
39862
|
+
});
|
|
39712
39863
|
return { bridgeHeartbeat, messageDeps };
|
|
39713
39864
|
}
|
|
39714
39865
|
|
|
@@ -48514,7 +48665,8 @@ async function createBridgeConnectionRuntime(options, params) {
|
|
|
48514
48665
|
sessionWorktreeManager,
|
|
48515
48666
|
previewWorktreeManager,
|
|
48516
48667
|
previewEnvironmentManager,
|
|
48517
|
-
e2ee
|
|
48668
|
+
e2ee,
|
|
48669
|
+
identifyReportedPaths
|
|
48518
48670
|
});
|
|
48519
48671
|
return {
|
|
48520
48672
|
state,
|
|
@@ -50716,27 +50868,6 @@ function createMainBridgeCloseHandler(params, connect) {
|
|
|
50716
50868
|
};
|
|
50717
50869
|
}
|
|
50718
50870
|
|
|
50719
|
-
// src/connection/report-git-repos.ts
|
|
50720
|
-
function reportGitRepos(getWs, log2) {
|
|
50721
|
-
setImmediate(() => {
|
|
50722
|
-
discoverGitRepos().then((repos) => {
|
|
50723
|
-
if (repos.length > 0) {
|
|
50724
|
-
const socket = getWs();
|
|
50725
|
-
if (socket) {
|
|
50726
|
-
sendWsMessage(socket, {
|
|
50727
|
-
type: "git_repos",
|
|
50728
|
-
repos: repos.map((r) => ({ absolutePath: r.absolutePath, remoteUrl: r.remoteUrl }))
|
|
50729
|
-
});
|
|
50730
|
-
}
|
|
50731
|
-
}
|
|
50732
|
-
}).catch((err) => {
|
|
50733
|
-
log2(
|
|
50734
|
-
`[Bridge service] Git repository discovery failed: ${err instanceof Error ? err.message : String(err)}`
|
|
50735
|
-
);
|
|
50736
|
-
});
|
|
50737
|
-
});
|
|
50738
|
-
}
|
|
50739
|
-
|
|
50740
50871
|
// src/connection/main-bridge-ws-open-handler.ts
|
|
50741
50872
|
function createMainBridgeOpenHandler(params) {
|
|
50742
50873
|
const {
|
|
@@ -50761,16 +50892,7 @@ function createMainBridgeOpenHandler(params) {
|
|
|
50761
50892
|
}
|
|
50762
50893
|
const socket = getWs();
|
|
50763
50894
|
if (socket) {
|
|
50764
|
-
|
|
50765
|
-
type: "identify",
|
|
50766
|
-
role: "cli",
|
|
50767
|
-
cliVersion: CLI_VERSION,
|
|
50768
|
-
bridgeRootPath: identifyReportedPaths.bridgeRootPath,
|
|
50769
|
-
worktreesRootPath: identifyReportedPaths.worktreesRootPath,
|
|
50770
|
-
localShortcutPort: identifyReportedPaths.localShortcutPort,
|
|
50771
|
-
localShortcutToken: identifyReportedPaths.localShortcutToken,
|
|
50772
|
-
...e2ee ? { e: e2ee.handshake } : {}
|
|
50773
|
-
});
|
|
50895
|
+
sendBridgeIdentify(socket, { identifyReportedPaths, e2ee });
|
|
50774
50896
|
reportGitRepos(getWs, logFn);
|
|
50775
50897
|
try {
|
|
50776
50898
|
onBridgeSocketOpen?.();
|