@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/index.js
CHANGED
|
@@ -25326,7 +25326,7 @@ function installBridgeProcessResilience() {
|
|
|
25326
25326
|
}
|
|
25327
25327
|
|
|
25328
25328
|
// src/cli-version.ts
|
|
25329
|
-
var CLI_VERSION = "0.1.
|
|
25329
|
+
var CLI_VERSION = "0.1.66".length > 0 ? "0.1.66" : "0.0.0-dev";
|
|
25330
25330
|
|
|
25331
25331
|
// src/connection/heartbeat/constants.ts
|
|
25332
25332
|
var BRIDGE_APP_HEARTBEAT_INTERVAL_MS = 1e4;
|
|
@@ -36351,6 +36351,208 @@ function createOnBridgeIdentified(opts) {
|
|
|
36351
36351
|
};
|
|
36352
36352
|
}
|
|
36353
36353
|
|
|
36354
|
+
// src/connection/create-bridge-identified-with-heartbeat.ts
|
|
36355
|
+
function createBridgeIdentifiedWithHeartbeat(params) {
|
|
36356
|
+
const { bridgeHeartbeat, log: log2, ...identifiedOpts } = params;
|
|
36357
|
+
const onBridgeIdentified = createOnBridgeIdentified({ ...identifiedOpts, logFn: log2 });
|
|
36358
|
+
return (msg) => {
|
|
36359
|
+
onBridgeIdentified(msg);
|
|
36360
|
+
bridgeHeartbeat.start();
|
|
36361
|
+
};
|
|
36362
|
+
}
|
|
36363
|
+
|
|
36364
|
+
// src/connection/heartbeat/build-heartbeat-message.ts
|
|
36365
|
+
function buildBridgeHeartbeatMessage(seq, meanRttMs2) {
|
|
36366
|
+
return meanRttMs2 !== void 0 && Number.isFinite(meanRttMs2) ? { t: "h", s: seq, m: Math.round(meanRttMs2) } : { t: "h", s: seq };
|
|
36367
|
+
}
|
|
36368
|
+
|
|
36369
|
+
// src/connection/heartbeat/heartbeat-seq.ts
|
|
36370
|
+
function createHeartbeatSeqCursor() {
|
|
36371
|
+
let seqCursor = -1;
|
|
36372
|
+
return {
|
|
36373
|
+
next() {
|
|
36374
|
+
seqCursor = seqCursor >= BRIDGE_HEARTBEAT_SEQ_MAX ? 0 : seqCursor + 1;
|
|
36375
|
+
return seqCursor;
|
|
36376
|
+
},
|
|
36377
|
+
reset() {
|
|
36378
|
+
seqCursor = -1;
|
|
36379
|
+
}
|
|
36380
|
+
};
|
|
36381
|
+
}
|
|
36382
|
+
|
|
36383
|
+
// src/connection/heartbeat/handle-pending-heartbeat-miss.ts
|
|
36384
|
+
function handlePendingHeartbeatMiss(params) {
|
|
36385
|
+
const { awaitingSeq, missed, log: log2, ws, onReconnect } = params;
|
|
36386
|
+
if (awaitingSeq === null) return { missed, stopTick: false };
|
|
36387
|
+
const nextMissed = missed + 1;
|
|
36388
|
+
if (nextMissed < BRIDGE_HEARTBEAT_MISSED_ACKS_BEFORE_RECONNECT) {
|
|
36389
|
+
return { missed: nextMissed, stopTick: false };
|
|
36390
|
+
}
|
|
36391
|
+
try {
|
|
36392
|
+
log2("[Bridge service] Heartbeat missed repeatedly; reconnecting\u2026");
|
|
36393
|
+
} catch {
|
|
36394
|
+
}
|
|
36395
|
+
onReconnect();
|
|
36396
|
+
safeCloseWebSocket(ws);
|
|
36397
|
+
return { missed: 0, stopTick: true };
|
|
36398
|
+
}
|
|
36399
|
+
|
|
36400
|
+
// src/connection/heartbeat/on-every-n-ticks.ts
|
|
36401
|
+
function createEveryNTicksRunner(onEveryNTicks) {
|
|
36402
|
+
let tickCount = 0;
|
|
36403
|
+
return {
|
|
36404
|
+
reset() {
|
|
36405
|
+
tickCount = 0;
|
|
36406
|
+
},
|
|
36407
|
+
onTick() {
|
|
36408
|
+
if (!onEveryNTicks || onEveryNTicks.n <= 0) return;
|
|
36409
|
+
tickCount++;
|
|
36410
|
+
if (tickCount % onEveryNTicks.n !== 0) return;
|
|
36411
|
+
try {
|
|
36412
|
+
onEveryNTicks.fn();
|
|
36413
|
+
} catch {
|
|
36414
|
+
}
|
|
36415
|
+
}
|
|
36416
|
+
};
|
|
36417
|
+
}
|
|
36418
|
+
|
|
36419
|
+
// src/connection/heartbeat/process-heartbeat-ack.ts
|
|
36420
|
+
function processHeartbeatAck(params) {
|
|
36421
|
+
const { seq, awaitingSeq, sentAtMs, recordRtt } = params;
|
|
36422
|
+
if (awaitingSeq === null) return { awaitingSeq, missed: 0 };
|
|
36423
|
+
if (!Number.isFinite(seq)) return { awaitingSeq, missed: 0 };
|
|
36424
|
+
const ack = Math.trunc(seq);
|
|
36425
|
+
const pending = awaitingSeq;
|
|
36426
|
+
if (ack < pending) return { awaitingSeq, missed: 0 };
|
|
36427
|
+
if (ack === pending) {
|
|
36428
|
+
recordRtt(Date.now() - sentAtMs);
|
|
36429
|
+
}
|
|
36430
|
+
return { awaitingSeq: null, missed: 0 };
|
|
36431
|
+
}
|
|
36432
|
+
|
|
36433
|
+
// src/connection/heartbeat/rtt-samples.ts
|
|
36434
|
+
function meanRttMs(samples) {
|
|
36435
|
+
if (samples.length === 0) return void 0;
|
|
36436
|
+
let sum = 0;
|
|
36437
|
+
for (const x of samples) sum += x;
|
|
36438
|
+
return sum / samples.length;
|
|
36439
|
+
}
|
|
36440
|
+
function createRttSampleBuffer(maxSamples = BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX) {
|
|
36441
|
+
const samples = [];
|
|
36442
|
+
return {
|
|
36443
|
+
push(rttMs) {
|
|
36444
|
+
if (!Number.isFinite(rttMs) || rttMs < 0 || rttMs >= 6e5) return;
|
|
36445
|
+
samples.push(rttMs);
|
|
36446
|
+
if (samples.length > maxSamples) {
|
|
36447
|
+
samples.splice(0, samples.length - maxSamples);
|
|
36448
|
+
}
|
|
36449
|
+
},
|
|
36450
|
+
clear() {
|
|
36451
|
+
samples.length = 0;
|
|
36452
|
+
},
|
|
36453
|
+
mean() {
|
|
36454
|
+
return meanRttMs(samples);
|
|
36455
|
+
}
|
|
36456
|
+
};
|
|
36457
|
+
}
|
|
36458
|
+
|
|
36459
|
+
// src/connection/heartbeat/controller.ts
|
|
36460
|
+
function createBridgeHeartbeatController(params) {
|
|
36461
|
+
const { getWs, log: log2, onEveryNTicks } = params;
|
|
36462
|
+
let interval = null;
|
|
36463
|
+
let awaitingSeq = null;
|
|
36464
|
+
let sentAtMs = 0;
|
|
36465
|
+
let missed = 0;
|
|
36466
|
+
const seqCursor = createHeartbeatSeqCursor();
|
|
36467
|
+
const rttSamples = createRttSampleBuffer();
|
|
36468
|
+
const everyNTicks = createEveryNTicksRunner(onEveryNTicks);
|
|
36469
|
+
function clearTimer() {
|
|
36470
|
+
if (interval != null) {
|
|
36471
|
+
clearInterval(interval);
|
|
36472
|
+
interval = null;
|
|
36473
|
+
}
|
|
36474
|
+
}
|
|
36475
|
+
function resetPendingState() {
|
|
36476
|
+
awaitingSeq = null;
|
|
36477
|
+
missed = 0;
|
|
36478
|
+
rttSamples.clear();
|
|
36479
|
+
}
|
|
36480
|
+
function tick() {
|
|
36481
|
+
const ws = getWs();
|
|
36482
|
+
if (!ws || ws.readyState !== wrapper_default.OPEN) return;
|
|
36483
|
+
const missResult = handlePendingHeartbeatMiss({
|
|
36484
|
+
awaitingSeq,
|
|
36485
|
+
missed,
|
|
36486
|
+
log: log2,
|
|
36487
|
+
ws,
|
|
36488
|
+
onReconnect: () => {
|
|
36489
|
+
clearTimer();
|
|
36490
|
+
resetPendingState();
|
|
36491
|
+
}
|
|
36492
|
+
});
|
|
36493
|
+
missed = missResult.missed;
|
|
36494
|
+
if (missResult.stopTick) return;
|
|
36495
|
+
const seq = seqCursor.next();
|
|
36496
|
+
sendWsMessage(ws, buildBridgeHeartbeatMessage(seq, rttSamples.mean()));
|
|
36497
|
+
awaitingSeq = seq;
|
|
36498
|
+
sentAtMs = Date.now();
|
|
36499
|
+
everyNTicks.onTick();
|
|
36500
|
+
}
|
|
36501
|
+
return {
|
|
36502
|
+
start() {
|
|
36503
|
+
clearTimer();
|
|
36504
|
+
everyNTicks.reset();
|
|
36505
|
+
resetPendingState();
|
|
36506
|
+
seqCursor.reset();
|
|
36507
|
+
interval = setInterval(tick, BRIDGE_APP_HEARTBEAT_INTERVAL_MS);
|
|
36508
|
+
},
|
|
36509
|
+
stop() {
|
|
36510
|
+
clearTimer();
|
|
36511
|
+
resetPendingState();
|
|
36512
|
+
},
|
|
36513
|
+
onAck(seq) {
|
|
36514
|
+
const result = processHeartbeatAck({
|
|
36515
|
+
seq,
|
|
36516
|
+
awaitingSeq,
|
|
36517
|
+
sentAtMs,
|
|
36518
|
+
recordRtt: rttSamples.push
|
|
36519
|
+
});
|
|
36520
|
+
awaitingSeq = result.awaitingSeq;
|
|
36521
|
+
missed = result.missed;
|
|
36522
|
+
}
|
|
36523
|
+
};
|
|
36524
|
+
}
|
|
36525
|
+
|
|
36526
|
+
// src/connection/send-bridge-identify.ts
|
|
36527
|
+
function sendBridgeIdentify(ws, params) {
|
|
36528
|
+
if (!ws) return;
|
|
36529
|
+
const { identifyReportedPaths, e2ee } = params;
|
|
36530
|
+
sendWsMessage(ws, {
|
|
36531
|
+
type: "identify",
|
|
36532
|
+
role: "cli",
|
|
36533
|
+
cliVersion: CLI_VERSION,
|
|
36534
|
+
bridgeRootPath: identifyReportedPaths.bridgeRootPath,
|
|
36535
|
+
worktreesRootPath: identifyReportedPaths.worktreesRootPath,
|
|
36536
|
+
localShortcutPort: identifyReportedPaths.localShortcutPort,
|
|
36537
|
+
localShortcutToken: identifyReportedPaths.localShortcutToken,
|
|
36538
|
+
...e2ee ? { e: e2ee.handshake } : {}
|
|
36539
|
+
});
|
|
36540
|
+
}
|
|
36541
|
+
var BRIDGE_IDENTIFY_REFRESH_EVERY_TICKS = 6;
|
|
36542
|
+
|
|
36543
|
+
// src/connection/create-bridge-identify-heartbeat.ts
|
|
36544
|
+
function createBridgeIdentifyHeartbeat(params) {
|
|
36545
|
+
const { getWs, log: log2, identifyReportedPaths, e2ee } = params;
|
|
36546
|
+
return createBridgeHeartbeatController({
|
|
36547
|
+
getWs,
|
|
36548
|
+
log: log2,
|
|
36549
|
+
onEveryNTicks: {
|
|
36550
|
+
n: BRIDGE_IDENTIFY_REFRESH_EVERY_TICKS,
|
|
36551
|
+
fn: () => sendBridgeIdentify(getWs(), { identifyReportedPaths, e2ee })
|
|
36552
|
+
}
|
|
36553
|
+
});
|
|
36554
|
+
}
|
|
36555
|
+
|
|
36354
36556
|
// src/connection/create-bridge-message-deps.ts
|
|
36355
36557
|
function createBridgeMessageDeps(params) {
|
|
36356
36558
|
const {
|
|
@@ -36517,98 +36719,11 @@ function createReportAutoDetectedAgents(getWs, logFn) {
|
|
|
36517
36719
|
};
|
|
36518
36720
|
}
|
|
36519
36721
|
|
|
36520
|
-
// src/connection/
|
|
36521
|
-
function
|
|
36522
|
-
if (samples.length === 0) return void 0;
|
|
36523
|
-
let sum = 0;
|
|
36524
|
-
for (const x of samples) sum += x;
|
|
36525
|
-
return sum / samples.length;
|
|
36526
|
-
}
|
|
36527
|
-
function createBridgeHeartbeatController(params) {
|
|
36528
|
-
const { getWs, log: log2 } = params;
|
|
36529
|
-
let interval = null;
|
|
36530
|
-
let seqCursor = -1;
|
|
36531
|
-
let awaitingSeq = null;
|
|
36532
|
-
let sentAtMs = 0;
|
|
36533
|
-
let missed = 0;
|
|
36534
|
-
const rttSamples = [];
|
|
36535
|
-
function clearTimer() {
|
|
36536
|
-
if (interval != null) {
|
|
36537
|
-
clearInterval(interval);
|
|
36538
|
-
interval = null;
|
|
36539
|
-
}
|
|
36540
|
-
}
|
|
36541
|
-
function nextSeq() {
|
|
36542
|
-
seqCursor = seqCursor >= BRIDGE_HEARTBEAT_SEQ_MAX ? 0 : seqCursor + 1;
|
|
36543
|
-
return seqCursor;
|
|
36544
|
-
}
|
|
36545
|
-
function tick() {
|
|
36546
|
-
const ws = getWs();
|
|
36547
|
-
if (!ws || ws.readyState !== wrapper_default.OPEN) return;
|
|
36548
|
-
if (awaitingSeq !== null) {
|
|
36549
|
-
missed++;
|
|
36550
|
-
if (missed >= BRIDGE_HEARTBEAT_MISSED_ACKS_BEFORE_RECONNECT) {
|
|
36551
|
-
try {
|
|
36552
|
-
log2("[Bridge service] Heartbeat missed repeatedly; reconnecting\u2026");
|
|
36553
|
-
} catch {
|
|
36554
|
-
}
|
|
36555
|
-
clearTimer();
|
|
36556
|
-
awaitingSeq = null;
|
|
36557
|
-
missed = 0;
|
|
36558
|
-
rttSamples.length = 0;
|
|
36559
|
-
safeCloseWebSocket(ws);
|
|
36560
|
-
return;
|
|
36561
|
-
}
|
|
36562
|
-
}
|
|
36563
|
-
const seq = nextSeq();
|
|
36564
|
-
const mean = meanRttMs(rttSamples);
|
|
36565
|
-
const payload = mean !== void 0 && Number.isFinite(mean) ? { t: "h", s: seq, m: Math.round(mean) } : { t: "h", s: seq };
|
|
36566
|
-
sendWsMessage(ws, payload);
|
|
36567
|
-
awaitingSeq = seq;
|
|
36568
|
-
sentAtMs = Date.now();
|
|
36569
|
-
}
|
|
36570
|
-
return {
|
|
36571
|
-
start() {
|
|
36572
|
-
clearTimer();
|
|
36573
|
-
awaitingSeq = null;
|
|
36574
|
-
missed = 0;
|
|
36575
|
-
seqCursor = -1;
|
|
36576
|
-
rttSamples.length = 0;
|
|
36577
|
-
interval = setInterval(tick, BRIDGE_APP_HEARTBEAT_INTERVAL_MS);
|
|
36578
|
-
},
|
|
36579
|
-
stop() {
|
|
36580
|
-
clearTimer();
|
|
36581
|
-
awaitingSeq = null;
|
|
36582
|
-
missed = 0;
|
|
36583
|
-
rttSamples.length = 0;
|
|
36584
|
-
},
|
|
36585
|
-
onAck(seq) {
|
|
36586
|
-
if (awaitingSeq === null) return;
|
|
36587
|
-
if (!Number.isFinite(seq)) return;
|
|
36588
|
-
const ack = Math.trunc(seq);
|
|
36589
|
-
const pending = awaitingSeq;
|
|
36590
|
-
if (ack < pending) return;
|
|
36591
|
-
if (ack === pending) {
|
|
36592
|
-
const rtt = Date.now() - sentAtMs;
|
|
36593
|
-
if (Number.isFinite(rtt) && rtt >= 0 && rtt < 6e5) {
|
|
36594
|
-
rttSamples.push(rtt);
|
|
36595
|
-
if (rttSamples.length > BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX) {
|
|
36596
|
-
rttSamples.splice(0, rttSamples.length - BRIDGE_HEARTBEAT_RTT_SAMPLE_MAX);
|
|
36597
|
-
}
|
|
36598
|
-
}
|
|
36599
|
-
}
|
|
36600
|
-
awaitingSeq = null;
|
|
36601
|
-
missed = 0;
|
|
36602
|
-
}
|
|
36603
|
-
};
|
|
36604
|
-
}
|
|
36605
|
-
|
|
36606
|
-
// src/connection/create-bridge-runtime-message-setup.ts
|
|
36607
|
-
function createBridgeRuntimeMessageSetup(options) {
|
|
36722
|
+
// src/connection/create-bridge-runtime-message-deps.ts
|
|
36723
|
+
function createBridgeRuntimeMessageDeps(params) {
|
|
36608
36724
|
const {
|
|
36609
36725
|
apiUrl,
|
|
36610
36726
|
workspaceId,
|
|
36611
|
-
firehoseServerUrl,
|
|
36612
36727
|
state,
|
|
36613
36728
|
getWs,
|
|
36614
36729
|
log: log2,
|
|
@@ -36617,23 +36732,11 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
36617
36732
|
sessionWorktreeManager,
|
|
36618
36733
|
previewWorktreeManager,
|
|
36619
36734
|
previewEnvironmentManager,
|
|
36620
|
-
e2ee
|
|
36621
|
-
|
|
36622
|
-
|
|
36623
|
-
|
|
36624
|
-
|
|
36625
|
-
firehoseServerUrl,
|
|
36626
|
-
workspaceId,
|
|
36627
|
-
state,
|
|
36628
|
-
logFn: log2
|
|
36629
|
-
});
|
|
36630
|
-
const onBridgeIdentified = (msg) => {
|
|
36631
|
-
baseOnBridgeIdentified(msg);
|
|
36632
|
-
bridgeHeartbeat.start();
|
|
36633
|
-
};
|
|
36634
|
-
const sendLocalSkillsReport = createSendLocalSkillsReport(getWs, log2);
|
|
36635
|
-
const reportAutoDetectedAgents = createReportAutoDetectedAgents(getWs, log2);
|
|
36636
|
-
const messageDeps = createBridgeMessageDeps({
|
|
36735
|
+
e2ee,
|
|
36736
|
+
onBridgeIdentified,
|
|
36737
|
+
bridgeHeartbeat
|
|
36738
|
+
} = params;
|
|
36739
|
+
return createBridgeMessageDeps({
|
|
36637
36740
|
getWs,
|
|
36638
36741
|
log: log2,
|
|
36639
36742
|
acpManager,
|
|
@@ -36641,8 +36744,8 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
36641
36744
|
previewWorktreeManager,
|
|
36642
36745
|
onBridgeIdentified,
|
|
36643
36746
|
bridgeHeartbeat,
|
|
36644
|
-
sendLocalSkillsReport,
|
|
36645
|
-
reportAutoDetectedAgents,
|
|
36747
|
+
sendLocalSkillsReport: createSendLocalSkillsReport(getWs, log2),
|
|
36748
|
+
reportAutoDetectedAgents: createReportAutoDetectedAgents(getWs, log2),
|
|
36646
36749
|
warmupAgentCapabilitiesOnConnect: createWarmupAgentCapabilitiesOnConnect({
|
|
36647
36750
|
workspaceId,
|
|
36648
36751
|
log: log2,
|
|
@@ -36658,6 +36761,54 @@ function createBridgeRuntimeMessageSetup(options) {
|
|
|
36658
36761
|
cloudApiBaseUrl: apiUrl,
|
|
36659
36762
|
getCloudAccessToken: () => tokens.accessToken
|
|
36660
36763
|
});
|
|
36764
|
+
}
|
|
36765
|
+
|
|
36766
|
+
// src/connection/create-bridge-runtime-message-setup.ts
|
|
36767
|
+
function createBridgeRuntimeMessageSetup(options) {
|
|
36768
|
+
const {
|
|
36769
|
+
apiUrl,
|
|
36770
|
+
workspaceId,
|
|
36771
|
+
firehoseServerUrl,
|
|
36772
|
+
state,
|
|
36773
|
+
getWs,
|
|
36774
|
+
log: log2,
|
|
36775
|
+
tokens,
|
|
36776
|
+
acpManager,
|
|
36777
|
+
sessionWorktreeManager,
|
|
36778
|
+
previewWorktreeManager,
|
|
36779
|
+
previewEnvironmentManager,
|
|
36780
|
+
e2ee,
|
|
36781
|
+
identifyReportedPaths
|
|
36782
|
+
} = options;
|
|
36783
|
+
const bridgeHeartbeat = createBridgeIdentifyHeartbeat({
|
|
36784
|
+
getWs,
|
|
36785
|
+
log: log2,
|
|
36786
|
+
identifyReportedPaths,
|
|
36787
|
+
e2ee
|
|
36788
|
+
});
|
|
36789
|
+
const onBridgeIdentified = createBridgeIdentifiedWithHeartbeat({
|
|
36790
|
+
previewEnvironmentManager,
|
|
36791
|
+
firehoseServerUrl,
|
|
36792
|
+
workspaceId,
|
|
36793
|
+
state,
|
|
36794
|
+
log: log2,
|
|
36795
|
+
bridgeHeartbeat
|
|
36796
|
+
});
|
|
36797
|
+
const messageDeps = createBridgeRuntimeMessageDeps({
|
|
36798
|
+
apiUrl,
|
|
36799
|
+
workspaceId,
|
|
36800
|
+
state,
|
|
36801
|
+
getWs,
|
|
36802
|
+
log: log2,
|
|
36803
|
+
tokens,
|
|
36804
|
+
acpManager,
|
|
36805
|
+
sessionWorktreeManager,
|
|
36806
|
+
previewWorktreeManager,
|
|
36807
|
+
previewEnvironmentManager,
|
|
36808
|
+
e2ee,
|
|
36809
|
+
onBridgeIdentified,
|
|
36810
|
+
bridgeHeartbeat
|
|
36811
|
+
});
|
|
36661
36812
|
return { bridgeHeartbeat, messageDeps };
|
|
36662
36813
|
}
|
|
36663
36814
|
|
|
@@ -45463,7 +45614,8 @@ async function createBridgeConnectionRuntime(options, params) {
|
|
|
45463
45614
|
sessionWorktreeManager,
|
|
45464
45615
|
previewWorktreeManager,
|
|
45465
45616
|
previewEnvironmentManager,
|
|
45466
|
-
e2ee
|
|
45617
|
+
e2ee,
|
|
45618
|
+
identifyReportedPaths
|
|
45467
45619
|
});
|
|
45468
45620
|
return {
|
|
45469
45621
|
state,
|
|
@@ -47490,27 +47642,6 @@ function createMainBridgeCloseHandler(params, connect) {
|
|
|
47490
47642
|
};
|
|
47491
47643
|
}
|
|
47492
47644
|
|
|
47493
|
-
// src/connection/report-git-repos.ts
|
|
47494
|
-
function reportGitRepos(getWs, log2) {
|
|
47495
|
-
setImmediate(() => {
|
|
47496
|
-
discoverGitRepos().then((repos) => {
|
|
47497
|
-
if (repos.length > 0) {
|
|
47498
|
-
const socket = getWs();
|
|
47499
|
-
if (socket) {
|
|
47500
|
-
sendWsMessage(socket, {
|
|
47501
|
-
type: "git_repos",
|
|
47502
|
-
repos: repos.map((r) => ({ absolutePath: r.absolutePath, remoteUrl: r.remoteUrl }))
|
|
47503
|
-
});
|
|
47504
|
-
}
|
|
47505
|
-
}
|
|
47506
|
-
}).catch((err) => {
|
|
47507
|
-
log2(
|
|
47508
|
-
`[Bridge service] Git repository discovery failed: ${err instanceof Error ? err.message : String(err)}`
|
|
47509
|
-
);
|
|
47510
|
-
});
|
|
47511
|
-
});
|
|
47512
|
-
}
|
|
47513
|
-
|
|
47514
47645
|
// src/connection/main-bridge-ws-open-handler.ts
|
|
47515
47646
|
function createMainBridgeOpenHandler(params) {
|
|
47516
47647
|
const {
|
|
@@ -47535,16 +47666,7 @@ function createMainBridgeOpenHandler(params) {
|
|
|
47535
47666
|
}
|
|
47536
47667
|
const socket = getWs();
|
|
47537
47668
|
if (socket) {
|
|
47538
|
-
|
|
47539
|
-
type: "identify",
|
|
47540
|
-
role: "cli",
|
|
47541
|
-
cliVersion: CLI_VERSION,
|
|
47542
|
-
bridgeRootPath: identifyReportedPaths.bridgeRootPath,
|
|
47543
|
-
worktreesRootPath: identifyReportedPaths.worktreesRootPath,
|
|
47544
|
-
localShortcutPort: identifyReportedPaths.localShortcutPort,
|
|
47545
|
-
localShortcutToken: identifyReportedPaths.localShortcutToken,
|
|
47546
|
-
...e2ee ? { e: e2ee.handshake } : {}
|
|
47547
|
-
});
|
|
47669
|
+
sendBridgeIdentify(socket, { identifyReportedPaths, e2ee });
|
|
47548
47670
|
reportGitRepos(getWs, logFn);
|
|
47549
47671
|
try {
|
|
47550
47672
|
onBridgeSocketOpen?.();
|