@linzumi/cli 0.0.45-beta → 0.0.46-beta
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/README.md +1 -1
- package/dist/index.js +11 -33
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1488,7 +1488,6 @@ var defaultIntervalMs = 2000;
|
|
|
1488
1488
|
var defaultDebounceMs = 750;
|
|
1489
1489
|
function startPortForwardWatcher(options) {
|
|
1490
1490
|
const rootPid = options.rootPid ?? process.pid;
|
|
1491
|
-
const rootCwd = normalizeCwd(options.rootCwd);
|
|
1492
1491
|
const intervalMs = options.intervalMs ?? defaultIntervalMs;
|
|
1493
1492
|
const debounceMs = options.debounceMs ?? defaultDebounceMs;
|
|
1494
1493
|
const lostDebounceMs = options.lostDebounceMs ?? intervalMs * 2 + debounceMs;
|
|
@@ -1508,8 +1507,8 @@ function startPortForwardWatcher(options) {
|
|
|
1508
1507
|
Promise.resolve().then(async () => {
|
|
1509
1508
|
const descendants = descendantPidSet(scanProcesses(), rootPid);
|
|
1510
1509
|
const sockets = scanListenSockets();
|
|
1511
|
-
const candidatePids =
|
|
1512
|
-
const candidates = detectedForwardCandidates(sockets, descendants, scanProcessCwds(candidatePids)
|
|
1510
|
+
const candidatePids = sockets.filter((socket) => descendants.has(socket.pid)).map((socket) => socket.pid);
|
|
1511
|
+
const candidates = detectedForwardCandidates(sockets, descendants, scanProcessCwds(candidatePids));
|
|
1513
1512
|
const scanTimeMs = nowMs();
|
|
1514
1513
|
const stable = stableForwardCandidates(candidateStabilityByPort, candidates, scanTimeMs, debounceMs);
|
|
1515
1514
|
const changes = debouncedForwardCandidateChanges(emittedByPort, missingByPort, stable.stableCandidates, scanTimeMs, lostDebounceMs);
|
|
@@ -1613,17 +1612,8 @@ function descendantPidSet(rows, rootPid) {
|
|
|
1613
1612
|
}
|
|
1614
1613
|
return descendants;
|
|
1615
1614
|
}
|
|
1616
|
-
function detectedForwardCandidates(sockets, descendantPids, processCwds = new Map
|
|
1617
|
-
|
|
1618
|
-
return sockets.filter((socket) => {
|
|
1619
|
-
if (descendantPids.has(socket.pid)) {
|
|
1620
|
-
return true;
|
|
1621
|
-
}
|
|
1622
|
-
if (rootCwd === undefined) {
|
|
1623
|
-
return false;
|
|
1624
|
-
}
|
|
1625
|
-
return cwdMatchesRoot(processCwds.get(socket.pid), rootCwd);
|
|
1626
|
-
}).filter((socket) => socket.port > 0 && socket.port < 65536).sort((left, right) => left.port - right.port).map((socket) => {
|
|
1615
|
+
function detectedForwardCandidates(sockets, descendantPids, processCwds = new Map) {
|
|
1616
|
+
return sockets.filter((socket) => descendantPids.has(socket.pid)).filter((socket) => socket.port > 0 && socket.port < 65536).sort((left, right) => left.port - right.port).map((socket) => {
|
|
1627
1617
|
const cwd = processCwds.get(socket.pid);
|
|
1628
1618
|
return {
|
|
1629
1619
|
port: socket.port,
|
|
@@ -1633,20 +1623,6 @@ function detectedForwardCandidates(sockets, descendantPids, processCwds = new Ma
|
|
|
1633
1623
|
};
|
|
1634
1624
|
});
|
|
1635
1625
|
}
|
|
1636
|
-
function normalizeCwd(cwd) {
|
|
1637
|
-
if (cwd === undefined) {
|
|
1638
|
-
return;
|
|
1639
|
-
}
|
|
1640
|
-
const normalized = cwd.trim().replace(/\/+$/, "");
|
|
1641
|
-
return normalized === "" ? undefined : normalized;
|
|
1642
|
-
}
|
|
1643
|
-
function cwdMatchesRoot(candidateCwd, rootCwd) {
|
|
1644
|
-
const normalizedCandidate = normalizeCwd(candidateCwd);
|
|
1645
|
-
if (normalizedCandidate === undefined) {
|
|
1646
|
-
return false;
|
|
1647
|
-
}
|
|
1648
|
-
return normalizedCandidate === rootCwd || normalizedCandidate.startsWith(`${rootCwd}/`);
|
|
1649
|
-
}
|
|
1650
1626
|
function parseProcessRows(output) {
|
|
1651
1627
|
return output.split(`
|
|
1652
1628
|
`).map((line) => line.trim()).filter((line) => line !== "").map((line) => {
|
|
@@ -2716,7 +2692,6 @@ function startPortForwardWatchIfEnabled(args, state, payloadContext) {
|
|
|
2716
2692
|
state.approvedForwardPorts.add(port);
|
|
2717
2693
|
}
|
|
2718
2694
|
state.portForwardWatcher = start({
|
|
2719
|
-
rootCwd: watchOptions.rootCwd ?? args.options.cwd,
|
|
2720
2695
|
...watchOptions,
|
|
2721
2696
|
onCandidate: (candidate) => publishPortForwardPrompt(args, state, payloadContext, candidate),
|
|
2722
2697
|
onCandidateLost: (candidate) => handleLostPortForwardCandidate(args, state, payloadContext, candidate),
|
|
@@ -6890,7 +6865,7 @@ function installDirectory(sourceDir, destinationDir) {
|
|
|
6890
6865
|
mkdirSync3(dirname2(destinationDir), { recursive: true });
|
|
6891
6866
|
cpSync(sourceDir, destinationDir, { recursive: true });
|
|
6892
6867
|
}
|
|
6893
|
-
function codeServerEnv(env, cwd,
|
|
6868
|
+
function codeServerEnv(env, cwd, userDataDir, collaboration) {
|
|
6894
6869
|
const { PORT: _port, ...hostEnv } = env;
|
|
6895
6870
|
const base = {
|
|
6896
6871
|
...hostEnv,
|
|
@@ -6904,7 +6879,8 @@ function codeServerEnv(env, cwd, _userDataDir, collaboration) {
|
|
|
6904
6879
|
KANDAN_EDITOR_COLLABORATION_DEPLOYMENT_SHAPE: "local_runner_sidecar",
|
|
6905
6880
|
KANDAN_EDITOR_COLLABORATION_ENTRY_MODE: "kandan_auto_host_or_join",
|
|
6906
6881
|
KANDAN_EDITOR_COLLABORATION_ROOM_ID: collaboration.roomId,
|
|
6907
|
-
KANDAN_EDITOR_COLLABORATION_SERVER_URL: collaboration.bootstrapServerUrl
|
|
6882
|
+
KANDAN_EDITOR_COLLABORATION_SERVER_URL: collaboration.bootstrapServerUrl,
|
|
6883
|
+
KANDAN_EDITOR_COLLABORATION_AUTO_HOST_CLAIM_PATH: join4(userDataDir, "kandan-oct-auto-host.lock")
|
|
6908
6884
|
};
|
|
6909
6885
|
}
|
|
6910
6886
|
function collaborationEvent(collaboration) {
|
|
@@ -8484,7 +8460,7 @@ function realpathOrResolved(pathValue) {
|
|
|
8484
8460
|
}
|
|
8485
8461
|
|
|
8486
8462
|
// src/version.ts
|
|
8487
|
-
var linzumiCliVersion = "0.0.
|
|
8463
|
+
var linzumiCliVersion = "0.0.46-beta";
|
|
8488
8464
|
var linzumiCliVersionText = `linzumi ${linzumiCliVersion}`;
|
|
8489
8465
|
|
|
8490
8466
|
// src/runnerLock.ts
|
|
@@ -8975,11 +8951,14 @@ async function openLocalCodexRunner(options, log, cleanup, close) {
|
|
|
8975
8951
|
cleanup.actions.push(() => kandan.close());
|
|
8976
8952
|
const topic = `local_runner:${options.runnerId}`;
|
|
8977
8953
|
const clientId = options.machineId ?? options.runnerId;
|
|
8954
|
+
const runnerHost = hostname2();
|
|
8978
8955
|
const joinPayload = () => ({
|
|
8979
8956
|
clientName: "kandan-local-codex-runner",
|
|
8980
8957
|
clientId,
|
|
8981
8958
|
runnerPid: process.pid,
|
|
8982
8959
|
version: linzumiCliVersion,
|
|
8960
|
+
hostname: runnerHost,
|
|
8961
|
+
cwd: options.cwd,
|
|
8983
8962
|
workspace: runnerWorkspaceSlug(options) ?? null,
|
|
8984
8963
|
channel: options.channelSession?.channelSlug ?? null,
|
|
8985
8964
|
capabilities: capabilitiesPayload()
|
|
@@ -9248,7 +9227,6 @@ async function openLocalCodexRunner(options, log, cleanup, close) {
|
|
|
9248
9227
|
const seq = { value: 0 };
|
|
9249
9228
|
const codexThreads = options.channelSession === undefined ? await discoverCodexThreads(codex, options.cwd) : [];
|
|
9250
9229
|
const discoveredCodexThreads = { value: codexThreads };
|
|
9251
|
-
const runnerHost = hostname2();
|
|
9252
9230
|
const runtimeDefaults = runnerRuntimeDefaults(options);
|
|
9253
9231
|
const instancePayload = {
|
|
9254
9232
|
instanceId,
|
package/package.json
CHANGED