tmux-ide 2.9.17 → 2.9.18
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/bin/cli.js +629 -320
- package/package.json +1 -1
- package/packages/daemon/dist/doctor.js +101 -2
- package/packages/daemon/dist/lib/daemon-embed.js +4 -1
- package/packages/daemon/dist/lib/native-split-capability.js +20 -0
- package/packages/daemon/dist/lib/tmux-server-owner.js +2 -1
- package/packages/daemon/dist/native/TmuxIdeNotifier.app/Contents/Info.plist +2 -2
- package/packages/daemon/dist/native/TmuxIdeNotifier.app/Contents/MacOS/tmux-ide-notifier +0 -0
- package/packages/daemon/dist/native/TmuxIdeNotifier.app/Contents/Resources/Assets.car +0 -0
- package/packages/daemon/dist/native/TmuxIdeNotifier.app/Contents/_CodeSignature/CodeResources +2 -2
- package/packages/daemon/dist/terminal/mirror/control-channel.js +3 -2
- package/packages/daemon/dist/terminal/mirror/mirror-service.js +47 -11
- package/packages/daemon/dist/terminal/mirror/session-channel.js +19 -4
- package/packages/daemon/dist/terminal/mirror/window-split-authority.js +9 -2
- package/packages/daemon/dist/terminal/protocol/native-split-resize.js +16 -16
- package/packages/daemon/dist/terminal/protocol/stock-split-resize.js +194 -0
- package/packages/daemon/src/doctor.ts +104 -2
- package/packages/daemon/src/lib/daemon-embed.ts +4 -0
- package/packages/daemon/src/lib/native-split-capability.ts +21 -0
- package/packages/daemon/src/lib/tmux-server-owner.ts +2 -0
- package/packages/daemon/src/terminal/mirror/control-channel.ts +3 -2
- package/packages/daemon/src/terminal/mirror/mirror-service.ts +51 -12
- package/packages/daemon/src/terminal/mirror/session-channel.ts +23 -4
- package/packages/daemon/src/terminal/mirror/window-split-authority.ts +15 -4
- package/packages/daemon/src/terminal/protocol/native-split-resize.ts +16 -16
- package/packages/daemon/src/terminal/protocol/stock-split-resize.ts +268 -0
package/bin/cli.js
CHANGED
|
@@ -1294,9 +1294,9 @@ function parseMacOSVersion(value) {
|
|
|
1294
1294
|
throw new Error("Invalid bundled tmux macOS version metadata");
|
|
1295
1295
|
return value.split(".").map(Number);
|
|
1296
1296
|
}
|
|
1297
|
-
function isMacOSVersionCompatible(current,
|
|
1297
|
+
function isMacOSVersionCompatible(current, minimum2) {
|
|
1298
1298
|
const actual = parseMacOSVersion(current);
|
|
1299
|
-
const required = parseMacOSVersion(
|
|
1299
|
+
const required = parseMacOSVersion(minimum2);
|
|
1300
1300
|
for (let index = 0; index < 3; index += 1) {
|
|
1301
1301
|
const difference = (actual[index] ?? 0) - (required[index] ?? 0);
|
|
1302
1302
|
if (difference !== 0) return difference > 0;
|
|
@@ -4775,16 +4775,16 @@ function projectAgentGraphOverlay(input) {
|
|
|
4775
4775
|
}
|
|
4776
4776
|
const edges = [];
|
|
4777
4777
|
const seenEdges = /* @__PURE__ */ new Set();
|
|
4778
|
-
for (const
|
|
4779
|
-
if (
|
|
4778
|
+
for (const edge of input.edges) {
|
|
4779
|
+
if (edge.from === edge.to) {
|
|
4780
4780
|
truncated = true;
|
|
4781
4781
|
continue;
|
|
4782
4782
|
}
|
|
4783
|
-
if (!nodeIds.has(
|
|
4783
|
+
if (!nodeIds.has(edge.from) || !nodeIds.has(edge.to)) {
|
|
4784
4784
|
truncated = true;
|
|
4785
4785
|
continue;
|
|
4786
4786
|
}
|
|
4787
|
-
const key2 = `${
|
|
4787
|
+
const key2 = `${edge.kind}\0${edge.from}\0${edge.to}`;
|
|
4788
4788
|
if (seenEdges.has(key2)) {
|
|
4789
4789
|
truncated = true;
|
|
4790
4790
|
continue;
|
|
@@ -4794,7 +4794,7 @@ function projectAgentGraphOverlay(input) {
|
|
|
4794
4794
|
continue;
|
|
4795
4795
|
}
|
|
4796
4796
|
seenEdges.add(key2);
|
|
4797
|
-
edges.push({ from:
|
|
4797
|
+
edges.push({ from: edge.from, to: edge.to, kind: edge.kind });
|
|
4798
4798
|
}
|
|
4799
4799
|
const groups = [];
|
|
4800
4800
|
const seenGroupIds = /* @__PURE__ */ new Set();
|
|
@@ -4897,22 +4897,22 @@ var init_agent_graph_overlay = __esm({
|
|
|
4897
4897
|
}
|
|
4898
4898
|
}
|
|
4899
4899
|
const nodeIds = new Set(nodeEntries.map(([key2]) => key2));
|
|
4900
|
-
for (const [index,
|
|
4901
|
-
if (
|
|
4900
|
+
for (const [index, edge] of overlay.edges.entries()) {
|
|
4901
|
+
if (edge.from === edge.to) {
|
|
4902
4902
|
ctx.addIssue({
|
|
4903
4903
|
code: z27.ZodIssueCode.custom,
|
|
4904
4904
|
message: "edge must not be a self-edge",
|
|
4905
4905
|
path: ["edges", index]
|
|
4906
4906
|
});
|
|
4907
4907
|
}
|
|
4908
|
-
if (!nodeIds.has(
|
|
4908
|
+
if (!nodeIds.has(edge.from)) {
|
|
4909
4909
|
ctx.addIssue({
|
|
4910
4910
|
code: z27.ZodIssueCode.custom,
|
|
4911
4911
|
message: "edge references an unknown node",
|
|
4912
4912
|
path: ["edges", index, "from"]
|
|
4913
4913
|
});
|
|
4914
4914
|
}
|
|
4915
|
-
if (!nodeIds.has(
|
|
4915
|
+
if (!nodeIds.has(edge.to)) {
|
|
4916
4916
|
ctx.addIssue({
|
|
4917
4917
|
code: z27.ZodIssueCode.custom,
|
|
4918
4918
|
message: "edge references an unknown node",
|
|
@@ -13145,7 +13145,7 @@ var require_package = __commonJS({
|
|
|
13145
13145
|
"package.json"(exports, module) {
|
|
13146
13146
|
module.exports = {
|
|
13147
13147
|
name: "tmux-ide",
|
|
13148
|
-
version: "2.9.
|
|
13148
|
+
version: "2.9.18",
|
|
13149
13149
|
description: "The open-source workspace for coding agents: run Claude Code, Codex and other agents in tmux with live status",
|
|
13150
13150
|
type: "module",
|
|
13151
13151
|
bin: {
|
|
@@ -17476,19 +17476,19 @@ function pickBool2(value, fallback) {
|
|
|
17476
17476
|
}
|
|
17477
17477
|
function inQuietHours(now, quiet) {
|
|
17478
17478
|
if (!quiet) return false;
|
|
17479
|
-
const
|
|
17479
|
+
const start3 = parseHHMM(quiet.start);
|
|
17480
17480
|
const end = parseHHMM(quiet.end);
|
|
17481
|
-
if (
|
|
17481
|
+
if (start3 === null || end === null || start3 === end) return false;
|
|
17482
17482
|
const nowMin = now.getHours() * 60 + now.getMinutes();
|
|
17483
|
-
return
|
|
17483
|
+
return start3 < end ? nowMin >= start3 && nowMin < end : nowMin >= start3 || nowMin < end;
|
|
17484
17484
|
}
|
|
17485
17485
|
function parseQuietHours(value) {
|
|
17486
17486
|
const o = asObject2(value);
|
|
17487
|
-
const
|
|
17487
|
+
const start3 = typeof o.start === "string" ? o.start : null;
|
|
17488
17488
|
const end = typeof o.end === "string" ? o.end : null;
|
|
17489
|
-
if (
|
|
17490
|
-
if (parseHHMM(
|
|
17491
|
-
return { start:
|
|
17489
|
+
if (start3 === null || end === null) return null;
|
|
17490
|
+
if (parseHHMM(start3) === null || parseHHMM(end) === null) return null;
|
|
17491
|
+
return { start: start3, end };
|
|
17492
17492
|
}
|
|
17493
17493
|
function parseNotificationPrefs(rawConfig) {
|
|
17494
17494
|
const base2 = parseAppConfig(rawConfig).notifications;
|
|
@@ -17995,7 +17995,7 @@ function writeChips(deps2, adopted, panes, theme) {
|
|
|
17995
17995
|
writeChip(pane.paneId, chip);
|
|
17996
17996
|
}
|
|
17997
17997
|
}
|
|
17998
|
-
function diffPaneTransitions(prev, panes,
|
|
17998
|
+
function diffPaneTransitions(prev, panes, locate) {
|
|
17999
17999
|
const events = [];
|
|
18000
18000
|
const next = /* @__PURE__ */ new Map();
|
|
18001
18001
|
for (const pane of panes) {
|
|
@@ -18010,7 +18010,7 @@ function diffPaneTransitions(prev, panes, locate2) {
|
|
|
18010
18010
|
paneId: pane.paneId,
|
|
18011
18011
|
windowIndex: pane.windowIndex,
|
|
18012
18012
|
agent: pane.agent,
|
|
18013
|
-
location: notifiable &&
|
|
18013
|
+
location: notifiable && locate ? locate(pane.paneId) : pane.sessionName
|
|
18014
18014
|
});
|
|
18015
18015
|
}
|
|
18016
18016
|
prev.clear();
|
|
@@ -20762,12 +20762,12 @@ function decodeUtf8Strict(value, path2) {
|
|
|
20762
20762
|
function isPromiseLike(value) {
|
|
20763
20763
|
return (typeof value === "object" || typeof value === "function") && value !== null && "then" in value && typeof value.then === "function";
|
|
20764
20764
|
}
|
|
20765
|
-
function normalizeLockDuration(value, fallback,
|
|
20765
|
+
function normalizeLockDuration(value, fallback, minimum2, maximum, field) {
|
|
20766
20766
|
const resolved2 = value ?? fallback;
|
|
20767
|
-
if (!Number.isSafeInteger(resolved2) || resolved2 <
|
|
20767
|
+
if (!Number.isSafeInteger(resolved2) || resolved2 < minimum2 || resolved2 > maximum) {
|
|
20768
20768
|
throw new InvalidJsonValueError(
|
|
20769
20769
|
`$.${field}`,
|
|
20770
|
-
`${field} must be an integer between ${
|
|
20770
|
+
`${field} must be an integer between ${minimum2} and ${maximum}`
|
|
20771
20771
|
);
|
|
20772
20772
|
}
|
|
20773
20773
|
return resolved2;
|
|
@@ -22761,8 +22761,8 @@ async function resolveHarness(workspace, canonicalRoot, harnessProfileId) {
|
|
|
22761
22761
|
harnessProfileId
|
|
22762
22762
|
});
|
|
22763
22763
|
}
|
|
22764
|
-
const
|
|
22765
|
-
if (
|
|
22764
|
+
const capability = matches[0];
|
|
22765
|
+
if (capability.kind === "shell" || capability.installation !== "available" || capability.commandReadiness !== "ready") {
|
|
22766
22766
|
throw new WorkspacePaneCreationError("harness_unavailable", {
|
|
22767
22767
|
workspaceName: workspace.name,
|
|
22768
22768
|
harnessProfileId
|
|
@@ -22770,9 +22770,9 @@ async function resolveHarness(workspace, canonicalRoot, harnessProfileId) {
|
|
|
22770
22770
|
}
|
|
22771
22771
|
const configured = configuredProfiles[harnessProfileId];
|
|
22772
22772
|
const resolved2 = {
|
|
22773
|
-
id:
|
|
22774
|
-
label:
|
|
22775
|
-
command: [...
|
|
22773
|
+
id: capability.id,
|
|
22774
|
+
label: capability.label,
|
|
22775
|
+
command: [...capability.command],
|
|
22776
22776
|
environment: Object.freeze({ ...configured?.env ?? {} })
|
|
22777
22777
|
};
|
|
22778
22778
|
assertBoundedLaunch(resolved2);
|
|
@@ -25088,8 +25088,8 @@ async function clearAgentAuthority(paneId) {
|
|
|
25088
25088
|
}
|
|
25089
25089
|
function paneStartAndPath(paneId) {
|
|
25090
25090
|
return tmuxRun(["display", "-p", "-t", paneId, "#{pane_start_command} #{pane_current_path}"]).then((out) => {
|
|
25091
|
-
const [
|
|
25092
|
-
return { start:
|
|
25091
|
+
const [start3 = "", path2 = ""] = out.split(" ");
|
|
25092
|
+
return { start: start3, path: path2 };
|
|
25093
25093
|
}).catch(() => null);
|
|
25094
25094
|
}
|
|
25095
25095
|
async function stopAgent(paneId) {
|
|
@@ -26827,7 +26827,7 @@ function json(text2, limit) {
|
|
|
26827
26827
|
throw new Error("Bounded native response required");
|
|
26828
26828
|
return JSON.parse(text2);
|
|
26829
26829
|
}
|
|
26830
|
-
function
|
|
26830
|
+
function nativeSplitCapability(text2) {
|
|
26831
26831
|
const value = json(text2, 1024);
|
|
26832
26832
|
return object(value, [
|
|
26833
26833
|
"schemaVersion",
|
|
@@ -26840,12 +26840,12 @@ function capability(text2) {
|
|
|
26840
26840
|
}
|
|
26841
26841
|
async function supportsNativeSplitResize(runTmux2) {
|
|
26842
26842
|
try {
|
|
26843
|
-
return
|
|
26843
|
+
return nativeSplitCapability(await runTmux2(["tmux-ide-resize-split", "-V"]));
|
|
26844
26844
|
} catch {
|
|
26845
26845
|
return false;
|
|
26846
26846
|
}
|
|
26847
26847
|
}
|
|
26848
|
-
function
|
|
26848
|
+
function validSplitTree(tree) {
|
|
26849
26849
|
let budget2 = 5;
|
|
26850
26850
|
const visit = (node) => {
|
|
26851
26851
|
if (node.left + node.width > 4096 || node.top + node.height > 4096) return false;
|
|
@@ -26859,7 +26859,7 @@ function validTree(tree) {
|
|
|
26859
26859
|
};
|
|
26860
26860
|
return visit(tree);
|
|
26861
26861
|
}
|
|
26862
|
-
function
|
|
26862
|
+
function locateSplit(tree, path2) {
|
|
26863
26863
|
let node = tree;
|
|
26864
26864
|
let parent;
|
|
26865
26865
|
for (const index of path2) {
|
|
@@ -26869,13 +26869,13 @@ function locate(tree, path2) {
|
|
|
26869
26869
|
}
|
|
26870
26870
|
return parent && path2.at(-1) < parent.children.length - 1 ? { parent, node } : null;
|
|
26871
26871
|
}
|
|
26872
|
-
function
|
|
26872
|
+
function splitEdge(node, axis) {
|
|
26873
26873
|
return axis === "cols" ? node.left + node.width : node.top + node.height;
|
|
26874
26874
|
}
|
|
26875
26875
|
function sameRect(a, b) {
|
|
26876
26876
|
return a.left === b.left && a.top === b.top && a.width === b.width && a.height === b.height;
|
|
26877
26877
|
}
|
|
26878
|
-
function
|
|
26878
|
+
function preservesSplitTree(before, after, affected, axis, inside = false) {
|
|
26879
26879
|
const begins = before === affected;
|
|
26880
26880
|
if (before.kind !== after.kind || (!inside || begins) && !sameRect(before, after)) return false;
|
|
26881
26881
|
inside ||= begins;
|
|
@@ -26883,7 +26883,7 @@ function preservesTree(before, after, affected, axis, inside = false) {
|
|
|
26883
26883
|
return false;
|
|
26884
26884
|
if (before.kind === "leaf") return after.kind === "leaf" && before.id === after.id;
|
|
26885
26885
|
return after.kind === "split" && before.axis === after.axis && before.children.length === after.children.length && before.children.every(
|
|
26886
|
-
(child, index) =>
|
|
26886
|
+
(child, index) => preservesSplitTree(child, after.children[index], affected, axis, inside)
|
|
26887
26887
|
);
|
|
26888
26888
|
}
|
|
26889
26889
|
async function resizeNativeSplit(request3, runTmux2) {
|
|
@@ -26892,8 +26892,8 @@ async function resizeNativeSplit(request3, runTmux2) {
|
|
|
26892
26892
|
if (!object(request3, ["sessionId", "windowId", "expectedLayout", "path", "axis", "boundary"]) || typeof request3.sessionId !== "string" || !/^\$(0|[1-9][0-9]{0,9})$/.test(request3.sessionId) || Number(request3.sessionId.slice(1)) > 4294967295 || typeof request3.windowId !== "string" || !/^@(0|[1-9][0-9]{0,9})$/.test(request3.windowId) || Number(request3.windowId.slice(1)) > 4294967295 || typeof request3.expectedLayout !== "string" || !Array.isArray(request3.path) || request3.path.length < 1 || request3.path.length >= 64 || request3.path.some((index) => !Number.isInteger(index) || index < 0 || index > 511) || request3.path.join(".").length > 256 || request3.axis !== "cols" && request3.axis !== "rows" || !Number.isInteger(request3.boundary) || request3.boundary < 0 || request3.boundary > 4096)
|
|
26893
26893
|
return { status: "refused", reason: "invalid-request" };
|
|
26894
26894
|
const tree = parseLayoutTree(request3.expectedLayout);
|
|
26895
|
-
if (!tree || !
|
|
26896
|
-
const selected =
|
|
26895
|
+
if (!tree || !validSplitTree(tree)) return { status: "refused", reason: "invalid-request" };
|
|
26896
|
+
const selected = locateSplit(tree, request3.path);
|
|
26897
26897
|
if (!selected || selected.parent.axis !== request3.axis)
|
|
26898
26898
|
return { status: "refused", reason: "invalid-request" };
|
|
26899
26899
|
before = tree;
|
|
@@ -26902,7 +26902,7 @@ async function resizeNativeSplit(request3, runTmux2) {
|
|
|
26902
26902
|
return { status: "refused", reason: "invalid-request" };
|
|
26903
26903
|
}
|
|
26904
26904
|
try {
|
|
26905
|
-
if (!
|
|
26905
|
+
if (!nativeSplitCapability(await runTmux2(["tmux-ide-resize-split", "-V"])))
|
|
26906
26906
|
return { status: "refused", reason: "unsupported" };
|
|
26907
26907
|
} catch {
|
|
26908
26908
|
return { status: "refused", reason: "unsupported" };
|
|
@@ -26932,10 +26932,10 @@ async function resizeNativeSplit(request3, runTmux2) {
|
|
|
26932
26932
|
if (!object(receipt, ["schemaVersion", "boundary", "layout"]) || receipt.schemaVersion !== 1 || typeof receipt.layout !== "string" || typeof receipt.boundary !== "number" || !Number.isInteger(receipt.boundary) || receipt.boundary < 0 || receipt.boundary > 4096)
|
|
26933
26933
|
return { status: "uncertain", reason: "invalid-receipt" };
|
|
26934
26934
|
const after = parseLayoutTree(receipt.layout);
|
|
26935
|
-
const original =
|
|
26936
|
-
const actual = after &&
|
|
26937
|
-
const previous =
|
|
26938
|
-
if (!after || !
|
|
26935
|
+
const original = locateSplit(before, captured.path);
|
|
26936
|
+
const actual = after && locateSplit(after, captured.path);
|
|
26937
|
+
const previous = splitEdge(original.node, captured.axis);
|
|
26938
|
+
if (!after || !validSplitTree(after) || !actual || !preservesSplitTree(before, after, original.parent, captured.axis) || receipt.boundary !== splitEdge(actual.node, captured.axis) || receipt.boundary < Math.min(previous, captured.boundary) || receipt.boundary > Math.max(previous, captured.boundary))
|
|
26939
26939
|
return { status: "uncertain", reason: "invalid-receipt" };
|
|
26940
26940
|
return {
|
|
26941
26941
|
status: "applied",
|
|
@@ -27005,11 +27005,28 @@ function createNativeSplitReadiness(options) {
|
|
|
27005
27005
|
pending = null;
|
|
27006
27006
|
});
|
|
27007
27007
|
}
|
|
27008
|
+
function createStockSplitProbe(options) {
|
|
27009
|
+
return async () => {
|
|
27010
|
+
for (const command3 of NATIVE_COMMANDS) {
|
|
27011
|
+
try {
|
|
27012
|
+
await options.runPinnedTmux([command3, "-V"]);
|
|
27013
|
+
return false;
|
|
27014
|
+
} catch (error) {
|
|
27015
|
+
const failure4 = error;
|
|
27016
|
+
const text2 = String(failure4?.cause?.stderr ?? failure4?.stderr ?? "");
|
|
27017
|
+
if (!new RegExp(`^unknown command: ${command3}$`, "mu").test(text2)) return false;
|
|
27018
|
+
}
|
|
27019
|
+
}
|
|
27020
|
+
return true;
|
|
27021
|
+
};
|
|
27022
|
+
}
|
|
27023
|
+
var NATIVE_COMMANDS;
|
|
27008
27024
|
var init_native_split_capability = __esm({
|
|
27009
27025
|
"packages/daemon/src/lib/native-split-capability.ts"() {
|
|
27010
27026
|
"use strict";
|
|
27011
27027
|
init_src2();
|
|
27012
27028
|
init_native_split_resize();
|
|
27029
|
+
NATIVE_COMMANDS = ["tmux-ide-resize-split", "tmux-ide-events"];
|
|
27013
27030
|
}
|
|
27014
27031
|
});
|
|
27015
27032
|
|
|
@@ -28706,11 +28723,11 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28706
28723
|
return null;
|
|
28707
28724
|
}
|
|
28708
28725
|
};
|
|
28709
|
-
const record2 = (operation,
|
|
28726
|
+
const record2 = (operation, start3) => {
|
|
28710
28727
|
const end = now();
|
|
28711
|
-
if (
|
|
28728
|
+
if (start3 !== null && end !== null) {
|
|
28712
28729
|
try {
|
|
28713
|
-
timing?.record(operation,
|
|
28730
|
+
timing?.record(operation, start3, end);
|
|
28714
28731
|
} catch {
|
|
28715
28732
|
}
|
|
28716
28733
|
}
|
|
@@ -28841,9 +28858,9 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28841
28858
|
reason: "pane_identity_changed_during_read"
|
|
28842
28859
|
});
|
|
28843
28860
|
}
|
|
28844
|
-
let
|
|
28845
|
-
while (
|
|
28846
|
-
const text2 = bytes.subarray(
|
|
28861
|
+
let start3 = Math.max(0, bytes.byteLength - SESSION_RUNTIME_PANE_READ_MAX_BYTES);
|
|
28862
|
+
while (start3 < bytes.byteLength && (bytes[start3] & 192) === 128) start3++;
|
|
28863
|
+
const text2 = bytes.subarray(start3).toString("utf8");
|
|
28847
28864
|
return SessionRuntimePaneReadResultSchemaZ.parse({
|
|
28848
28865
|
verb: "workspace.pane.read",
|
|
28849
28866
|
operationId,
|
|
@@ -28853,9 +28870,9 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28853
28870
|
format: "ansi",
|
|
28854
28871
|
availability: "available",
|
|
28855
28872
|
text: text2,
|
|
28856
|
-
byteCount: bytes.byteLength -
|
|
28873
|
+
byteCount: bytes.byteLength - start3,
|
|
28857
28874
|
capturedByteCount: bytes.byteLength,
|
|
28858
|
-
truncated:
|
|
28875
|
+
truncated: start3 > 0
|
|
28859
28876
|
});
|
|
28860
28877
|
}
|
|
28861
28878
|
dispose() {
|
|
@@ -29506,7 +29523,7 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
29506
29523
|
/** Optional metadata path; null alone permits pre-dispatch stock fallback. */
|
|
29507
29524
|
#runAuthored(operationId, execution, pane, expectedKinds, commands2, dispatch, options) {
|
|
29508
29525
|
if (execution && pane.nativePaneBirthId && this.#io.runAuthoredNative) {
|
|
29509
|
-
const
|
|
29526
|
+
const nativeCommands2 = commands2.filter(
|
|
29510
29527
|
(command3) => !(command3[0] === "set-option" && command3[1] === "-p" && command3[2] === "-t" && command3[3] === pane.paneId && (command3[4] === INTERNAL_SEND_OPERATION_OPTION || command3[4] === INTERNAL_READ_OPERATION_OPTION))
|
|
29511
29528
|
);
|
|
29512
29529
|
dispatch.native = true;
|
|
@@ -29516,7 +29533,7 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
29516
29533
|
context: execution,
|
|
29517
29534
|
targetPaneId: pane.paneId,
|
|
29518
29535
|
targetBirthId: pane.nativePaneBirthId,
|
|
29519
|
-
commands:
|
|
29536
|
+
commands: nativeCommands2,
|
|
29520
29537
|
expectedKinds
|
|
29521
29538
|
},
|
|
29522
29539
|
options
|
|
@@ -29969,6 +29986,158 @@ var init_guarded_native_split_resize = __esm({
|
|
|
29969
29986
|
}
|
|
29970
29987
|
});
|
|
29971
29988
|
|
|
29989
|
+
// packages/daemon/src/terminal/protocol/stock-split-resize.ts
|
|
29990
|
+
import { randomUUID as randomUUID14 } from "node:crypto";
|
|
29991
|
+
function minimum(node, axis, sizes, root) {
|
|
29992
|
+
if (node.kind === "leaf") {
|
|
29993
|
+
if (axis === "cols") return 1 + sizes.scrollbar;
|
|
29994
|
+
const onEdge = sizes.borderStatus === "top" && node.top === root.top || sizes.borderStatus === "bottom" && node.top + node.height === root.top + root.height;
|
|
29995
|
+
return onEdge ? 2 : 1;
|
|
29996
|
+
}
|
|
29997
|
+
const mins = node.children.map((child) => minimum(child, axis, sizes, root));
|
|
29998
|
+
return node.axis === axis ? mins.reduce((sum, size) => sum + size, node.children.length - 1) : Math.max(...mins);
|
|
29999
|
+
}
|
|
30000
|
+
function reachingLeaf(node, axis) {
|
|
30001
|
+
if (node.kind === "leaf") return node.id;
|
|
30002
|
+
if (node.axis === axis) return null;
|
|
30003
|
+
for (const child of node.children) {
|
|
30004
|
+
const leaf = reachingLeaf(child, axis);
|
|
30005
|
+
if (leaf) return leaf;
|
|
30006
|
+
}
|
|
30007
|
+
return null;
|
|
30008
|
+
}
|
|
30009
|
+
function stockSplitTarget(tree, path2, axis) {
|
|
30010
|
+
const located = locateSplit(tree, path2);
|
|
30011
|
+
if (!located || located.parent.axis !== axis) return null;
|
|
30012
|
+
const leading = reachingLeaf(located.node, axis);
|
|
30013
|
+
if (leading) return leading;
|
|
30014
|
+
const index = path2.at(-1);
|
|
30015
|
+
if (index + 1 !== located.parent.children.length - 1) return null;
|
|
30016
|
+
return reachingLeaf(located.parent.children[index + 1], axis);
|
|
30017
|
+
}
|
|
30018
|
+
function stockSplitRange(tree, path2, axis, sizes) {
|
|
30019
|
+
const located = locateSplit(tree, path2);
|
|
30020
|
+
if (!located) return null;
|
|
30021
|
+
const after = located.parent.children[path2.at(-1) + 1];
|
|
30022
|
+
const low = start(located.node, axis) + minimum(located.node, axis, sizes, tree);
|
|
30023
|
+
const high = start(after, axis) + span(after, axis) - minimum(after, axis, sizes, tree) - 1;
|
|
30024
|
+
return { low, high };
|
|
30025
|
+
}
|
|
30026
|
+
function stockSplitMovable(tree, path2, axis, sizes) {
|
|
30027
|
+
const range = stockSplitRange(tree, path2, axis, sizes);
|
|
30028
|
+
return stockSplitTarget(tree, path2, axis) !== null && range !== null && range.high > range.low;
|
|
30029
|
+
}
|
|
30030
|
+
function planStockSplitResize(tree, path2, axis, boundary2, sizes) {
|
|
30031
|
+
const paneId = stockSplitTarget(tree, path2, axis);
|
|
30032
|
+
const range = stockSplitRange(tree, path2, axis, sizes);
|
|
30033
|
+
const located = locateSplit(tree, path2);
|
|
30034
|
+
if (!paneId || !range || !located || range.high < range.low) return null;
|
|
30035
|
+
const clamped = Math.min(range.high, Math.max(range.low, boundary2));
|
|
30036
|
+
return { paneId, boundary: clamped, delta: clamped - splitEdge(located.node, axis) };
|
|
30037
|
+
}
|
|
30038
|
+
function formatLiteral(layout) {
|
|
30039
|
+
return layout.replaceAll(",", "#,").replaceAll("}", "#}");
|
|
30040
|
+
}
|
|
30041
|
+
function leafCount(node) {
|
|
30042
|
+
return node.kind === "leaf" ? 1 : node.children.reduce((sum, child) => sum + leafCount(child), 0);
|
|
30043
|
+
}
|
|
30044
|
+
function stockSplitCommand(request3, sessionCreated, plan, panes, options, marker) {
|
|
30045
|
+
const equal = (name, value) => `#{==:#{${name}},${value}}`;
|
|
30046
|
+
const condition = [
|
|
30047
|
+
equal("window_id", request3.windowId),
|
|
30048
|
+
equal("session_id", request3.sessionId),
|
|
30049
|
+
equal("session_created", sessionCreated),
|
|
30050
|
+
equal("window_zoomed_flag", 0),
|
|
30051
|
+
// Control clients' layouts leave out floating panes; this count includes them.
|
|
30052
|
+
equal("window_panes", panes),
|
|
30053
|
+
equal("pane-border-status", options.borderStatus),
|
|
30054
|
+
equal("pane-scrollbars", options.scrollbars),
|
|
30055
|
+
equal("window_layout", formatLiteral(request3.expectedLayout))
|
|
30056
|
+
].reduceRight((rest, next) => `#{&&:${next},${rest}}`);
|
|
30057
|
+
const flag = request3.axis === "cols" ? plan.delta > 0 ? "-R" : "-L" : plan.delta > 0 ? "-D" : "-U";
|
|
30058
|
+
const move = plan.delta === 0 ? `display-message -p ""` : `resize-pane -t ${plan.paneId} ${flag} ${Math.abs(plan.delta)}`;
|
|
30059
|
+
const readback = `display-message -p -t ${request3.windowId} "${marker} #{window_layout}"`;
|
|
30060
|
+
return `if-shell -F -t '${request3.sessionId}:${request3.windowId}' '${condition}' '${move} ; ${readback}' 'display-message -p ${marker} ; display-message -p ${marker}'`;
|
|
30061
|
+
}
|
|
30062
|
+
function parseStockSplitOptions(line) {
|
|
30063
|
+
const [borderStatus, scrollbars, style] = (line ?? "").split(" ");
|
|
30064
|
+
if (!/^(off|top|bottom)$/u.test(borderStatus ?? "") || !/^[a-z]+$/u.test(scrollbars ?? ""))
|
|
30065
|
+
return null;
|
|
30066
|
+
const field = (name) => Number(new RegExp(`\\b${name}=(\\d+)`, "u").exec(style ?? "")?.[1] ?? 0);
|
|
30067
|
+
return {
|
|
30068
|
+
borderStatus,
|
|
30069
|
+
scrollbars,
|
|
30070
|
+
scrollbar: scrollbars === "off" ? 0 : Math.max(field("width"), 1) + field("pad")
|
|
30071
|
+
};
|
|
30072
|
+
}
|
|
30073
|
+
async function resizeStockSplit(request3, sessionCreated, authorizeBeforeEffect, io) {
|
|
30074
|
+
const before = parseLayoutTree(request3.expectedLayout);
|
|
30075
|
+
if (!before || !validSplitTree(before) || !/^\$\d+$/u.test(request3.sessionId) || !/^@\d+$/u.test(request3.windowId) || !/^[1-9]\d*$/u.test(sessionCreated))
|
|
30076
|
+
return { status: "refused", reason: "invalid-request" };
|
|
30077
|
+
let options;
|
|
30078
|
+
try {
|
|
30079
|
+
options = parseStockSplitOptions((await io.readOptions(request3.windowId))[0]);
|
|
30080
|
+
} catch {
|
|
30081
|
+
return { status: "refused", reason: "unsupported" };
|
|
30082
|
+
}
|
|
30083
|
+
if (!options) return { status: "refused", reason: "unsupported" };
|
|
30084
|
+
const plan = planStockSplitResize(before, request3.path, request3.axis, request3.boundary, options);
|
|
30085
|
+
if (!plan) return { status: "refused", reason: "invalid-request" };
|
|
30086
|
+
const marker = `tmux-ide-split-${randomUUID14()}`;
|
|
30087
|
+
const command3 = stockSplitCommand(
|
|
30088
|
+
request3,
|
|
30089
|
+
sessionCreated,
|
|
30090
|
+
plan,
|
|
30091
|
+
leafCount(before),
|
|
30092
|
+
options,
|
|
30093
|
+
marker
|
|
30094
|
+
);
|
|
30095
|
+
authorizeBeforeEffect();
|
|
30096
|
+
let reply;
|
|
30097
|
+
try {
|
|
30098
|
+
reply = await io.send(command3);
|
|
30099
|
+
} catch {
|
|
30100
|
+
return { status: "uncertain", reason: "command-failed" };
|
|
30101
|
+
}
|
|
30102
|
+
const answer = reply.join("\n");
|
|
30103
|
+
if (answer === marker) return { status: "refused", reason: "stale-layout" };
|
|
30104
|
+
if (reply.length !== 1 || !answer.startsWith(`${marker} `))
|
|
30105
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30106
|
+
const layout = answer.slice(marker.length + 1);
|
|
30107
|
+
const after = parseLayoutTree(layout);
|
|
30108
|
+
const original = locateSplit(before, request3.path);
|
|
30109
|
+
const actual = after && locateSplit(after, request3.path);
|
|
30110
|
+
if (!after || !validSplitTree(after) || !actual || !preservesSplitTree(before, after, original.parent, request3.axis))
|
|
30111
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30112
|
+
const edges = (parent) => parent.children.map((child) => splitEdge(child, request3.axis));
|
|
30113
|
+
const moved = request3.path.at(-1);
|
|
30114
|
+
const others = edges(actual.parent);
|
|
30115
|
+
if (edges(original.parent).some((edge, index) => index !== moved && edge !== others[index]))
|
|
30116
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30117
|
+
const boundary2 = splitEdge(actual.node, request3.axis);
|
|
30118
|
+
const previous = splitEdge(original.node, request3.axis);
|
|
30119
|
+
if (boundary2 < Math.min(previous, plan.boundary) || boundary2 > Math.max(previous, plan.boundary))
|
|
30120
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30121
|
+
return {
|
|
30122
|
+
status: "applied",
|
|
30123
|
+
boundary: boundary2,
|
|
30124
|
+
layout,
|
|
30125
|
+
tree: after,
|
|
30126
|
+
changed: layout !== request3.expectedLayout
|
|
30127
|
+
};
|
|
30128
|
+
}
|
|
30129
|
+
var span, start, STOCK_SPLIT_OPTIONS_FORMAT;
|
|
30130
|
+
var init_stock_split_resize = __esm({
|
|
30131
|
+
"packages/daemon/src/terminal/protocol/stock-split-resize.ts"() {
|
|
30132
|
+
"use strict";
|
|
30133
|
+
init_layout_parse();
|
|
30134
|
+
init_native_split_resize();
|
|
30135
|
+
span = (node, axis) => axis === "cols" ? node.width : node.height;
|
|
30136
|
+
start = (node, axis) => axis === "cols" ? node.left : node.top;
|
|
30137
|
+
STOCK_SPLIT_OPTIONS_FORMAT = "#{pane-border-status} #{pane-scrollbars} #{pane-scrollbars-style}";
|
|
30138
|
+
}
|
|
30139
|
+
});
|
|
30140
|
+
|
|
29972
30141
|
// packages/daemon/src/terminal/mirror/layout-content-rows.ts
|
|
29973
30142
|
function layoutContentRows(paneTop, paneHeight, windowRows, border) {
|
|
29974
30143
|
if (border === "off") return paneHeight;
|
|
@@ -31257,6 +31426,7 @@ var TMUX_SERVER_HOSTNAME, STRUCTURAL_NOTIFICATIONS, NATIVE_CLIENT_NOTIFICATIONS,
|
|
|
31257
31426
|
var init_session_channel = __esm({
|
|
31258
31427
|
"packages/daemon/src/terminal/mirror/session-channel.ts"() {
|
|
31259
31428
|
"use strict";
|
|
31429
|
+
init_stock_split_resize();
|
|
31260
31430
|
init_layout_content_rows();
|
|
31261
31431
|
init_native_atomic_snapshot();
|
|
31262
31432
|
init_tmux_interaction_retention();
|
|
@@ -31701,7 +31871,7 @@ var init_session_channel = __esm({
|
|
|
31701
31871
|
};
|
|
31702
31872
|
}
|
|
31703
31873
|
/** Exact native ancestry, never reconstructed from published pane rectangles. */
|
|
31704
|
-
describeSplitLayout(target) {
|
|
31874
|
+
describeSplitLayout(target, stock = false) {
|
|
31705
31875
|
const authority2 = this.windowLinkAuthority;
|
|
31706
31876
|
const identity4 = this.attachedIdentity;
|
|
31707
31877
|
const generation = this.attachedServerGeneration;
|
|
@@ -31723,14 +31893,14 @@ var init_session_channel = __esm({
|
|
|
31723
31893
|
const panes = native2.leaves.map((leaf) => {
|
|
31724
31894
|
const pane = this.panesByRuntime.get(leaf.id);
|
|
31725
31895
|
const birth = pane?.descriptor?.nativePaneBirthId;
|
|
31726
|
-
if (!pane || pane.windowRuntimeId !== resolved2.runtimeWindowId || pane.descriptor?.runtimeSessionId !== identity4.runtimeSessionId || pane.descriptor?.windowId !== resolved2.runtimeWindowId || this.panesBySemantic.get(pane.semanticId) !== pane || !birth || !/^[1-9]\d*$/u.test(birth) || !layout.leaves.some(
|
|
31896
|
+
if (!pane || pane.windowRuntimeId !== resolved2.runtimeWindowId || pane.descriptor?.runtimeSessionId !== identity4.runtimeSessionId || pane.descriptor?.windowId !== resolved2.runtimeWindowId || this.panesBySemantic.get(pane.semanticId) !== pane || !stock && (!birth || !/^[1-9]\d*$/u.test(birth)) || !layout.leaves.some(
|
|
31727
31897
|
(visible) => visible.id === leaf.id && visible.left === leaf.left && visible.top === leaf.top && visible.width === leaf.width && visible.height === leaf.height
|
|
31728
31898
|
))
|
|
31729
31899
|
throw new Error("Split layout pane identity incomplete");
|
|
31730
31900
|
return Object.freeze({
|
|
31731
31901
|
runtimePaneId: pane.runtimeId,
|
|
31732
31902
|
semanticPaneId: pane.semanticId,
|
|
31733
|
-
nativePaneBirthId: birth
|
|
31903
|
+
nativePaneBirthId: stock ? "" : birth
|
|
31734
31904
|
});
|
|
31735
31905
|
});
|
|
31736
31906
|
return Object.freeze({
|
|
@@ -31740,9 +31910,23 @@ var init_session_channel = __esm({
|
|
|
31740
31910
|
runtimeWindowId: resolved2.runtimeWindowId,
|
|
31741
31911
|
semanticWindowId: window2.semanticId,
|
|
31742
31912
|
rawLayout: layout.rawLayout,
|
|
31913
|
+
...stock ? { paneBorderStatus: window2.paneBorderStatus } : {},
|
|
31743
31914
|
panes: Object.freeze(panes)
|
|
31744
31915
|
});
|
|
31745
31916
|
}
|
|
31917
|
+
stockSplitOptions(windowId) {
|
|
31918
|
+
return this.io.request(`display-message -p -t ${windowId} "${STOCK_SPLIT_OPTIONS_FORMAT}"`);
|
|
31919
|
+
}
|
|
31920
|
+
/** One guarded resize on this control connection, for a stock tmux server. */
|
|
31921
|
+
stockSplitCommand(command3) {
|
|
31922
|
+
return new Promise((resolve45, reject) => {
|
|
31923
|
+
const onReply = (reply) => reply.ok ? resolve45(reply.lines) : reject(new Error("Stock split command failed"));
|
|
31924
|
+
const limits = { maxBytes: 16 * 1024, maxLines: 4 };
|
|
31925
|
+
if (this.io.commandListBoundedInline)
|
|
31926
|
+
this.io.commandListBoundedInline(command3, 3, 2, limits, onReply);
|
|
31927
|
+
else this.io.commandListInline(command3, 3, 2, onReply);
|
|
31928
|
+
});
|
|
31929
|
+
}
|
|
31746
31930
|
async executeWindowLinkAction(request3) {
|
|
31747
31931
|
const authority2 = this.windowLinkAuthority;
|
|
31748
31932
|
if (!authority2 || this.disposed) throw new WindowLinkResolutionError("window_link_stale");
|
|
@@ -34273,7 +34457,7 @@ var init_session_channel = __esm({
|
|
|
34273
34457
|
});
|
|
34274
34458
|
|
|
34275
34459
|
// packages/daemon/src/terminal/mirror/window-split-authority.ts
|
|
34276
|
-
import { randomUUID as
|
|
34460
|
+
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
34277
34461
|
import { z as z99 } from "zod";
|
|
34278
34462
|
var MAX_RETAINED_WINDOWS, WindowSplitLayoutUnavailable, WindowSplitAuthority;
|
|
34279
34463
|
var init_window_split_authority = __esm({
|
|
@@ -34282,6 +34466,7 @@ var init_window_split_authority = __esm({
|
|
|
34282
34466
|
init_src2();
|
|
34283
34467
|
init_native_operation_command();
|
|
34284
34468
|
init_layout_parse();
|
|
34469
|
+
init_stock_split_resize();
|
|
34285
34470
|
init_session_channel();
|
|
34286
34471
|
MAX_RETAINED_WINDOWS = 32;
|
|
34287
34472
|
WindowSplitLayoutUnavailable = class extends Error {
|
|
@@ -34311,7 +34496,7 @@ var init_window_split_authority = __esm({
|
|
|
34311
34496
|
if (!tree || tree.width > 4096 || tree.height > 4096 || snapshot3.panes.length > 256)
|
|
34312
34497
|
throw new WindowSplitLayoutUnavailable();
|
|
34313
34498
|
snapshot3.panes.forEach((pane) => {
|
|
34314
|
-
if (!/^%(0|[1-9][0-9]{0,9})$/u.test(pane.runtimePaneId) || Number(pane.runtimePaneId.slice(1)) > 4294967295 || !NativeJournalUint64SchemaZ.refine((birth) => birth !== "0").safeParse(
|
|
34499
|
+
if (!/^%(0|[1-9][0-9]{0,9})$/u.test(pane.runtimePaneId) || Number(pane.runtimePaneId.slice(1)) > 4294967295 || !this.options.stock && !NativeJournalUint64SchemaZ.refine((birth) => birth !== "0").safeParse(
|
|
34315
34500
|
pane.nativePaneBirthId
|
|
34316
34501
|
).success)
|
|
34317
34502
|
throw new WindowSplitLayoutUnavailable();
|
|
@@ -34339,8 +34524,11 @@ var init_window_split_authority = __esm({
|
|
|
34339
34524
|
}
|
|
34340
34525
|
node.children.forEach((child, index) => {
|
|
34341
34526
|
const childPath = [...path2, index];
|
|
34342
|
-
if (index < node.children.length - 1
|
|
34343
|
-
|
|
34527
|
+
if (index < node.children.length - 1 && (!this.options.stock || stockSplitMovable(tree, childPath, node.axis, {
|
|
34528
|
+
borderStatus: snapshot3.paneBorderStatus ?? "off",
|
|
34529
|
+
scrollbar: 0
|
|
34530
|
+
}))) {
|
|
34531
|
+
const splitId = randomUUID15();
|
|
34344
34532
|
paths.set(splitId, childPath);
|
|
34345
34533
|
splits.push({
|
|
34346
34534
|
splitId,
|
|
@@ -34359,7 +34547,7 @@ var init_window_split_authority = __esm({
|
|
|
34359
34547
|
const resource3 = WindowSplitLayoutResourceSchemaZ.parse({
|
|
34360
34548
|
version: 1,
|
|
34361
34549
|
window: window2,
|
|
34362
|
-
layoutId:
|
|
34550
|
+
layoutId: randomUUID15(),
|
|
34363
34551
|
cols: tree.width,
|
|
34364
34552
|
rows: tree.height,
|
|
34365
34553
|
panes,
|
|
@@ -34486,7 +34674,7 @@ var init_tmux_version = __esm({
|
|
|
34486
34674
|
});
|
|
34487
34675
|
|
|
34488
34676
|
// packages/daemon/src/terminal/graphics/local-image-store.ts
|
|
34489
|
-
import { randomUUID as
|
|
34677
|
+
import { randomUUID as randomUUID16, webcrypto } from "node:crypto";
|
|
34490
34678
|
import { constants as constants11 } from "node:fs";
|
|
34491
34679
|
import { chmod, link, lstat as lstat2, mkdtemp, open, realpath, rmdir, unlink } from "node:fs/promises";
|
|
34492
34680
|
import { join as join31 } from "node:path";
|
|
@@ -34594,7 +34782,7 @@ var init_local_image_store = __esm({
|
|
|
34594
34782
|
this.#bytes += entry.bytes;
|
|
34595
34783
|
}
|
|
34596
34784
|
const lease = Object.freeze({
|
|
34597
|
-
id:
|
|
34785
|
+
id: randomUUID16(),
|
|
34598
34786
|
generation: this.generation,
|
|
34599
34787
|
client,
|
|
34600
34788
|
digest: digest3,
|
|
@@ -34611,7 +34799,7 @@ var init_local_image_store = __esm({
|
|
|
34611
34799
|
}
|
|
34612
34800
|
async #write(digest3, data) {
|
|
34613
34801
|
const path2 = join31(this.directory, digest3);
|
|
34614
|
-
const temporary = join31(this.directory, `.pending-${
|
|
34802
|
+
const temporary = join31(this.directory, `.pending-${randomUUID16()}`);
|
|
34615
34803
|
const file = await open(
|
|
34616
34804
|
temporary,
|
|
34617
34805
|
constants11.O_CREAT | constants11.O_EXCL | constants11.O_WRONLY | constants11.O_NOFOLLOW,
|
|
@@ -34711,7 +34899,7 @@ var init_local_image_store = __esm({
|
|
|
34711
34899
|
});
|
|
34712
34900
|
|
|
34713
34901
|
// packages/daemon/src/terminal/graphics/local-image-owner.ts
|
|
34714
|
-
import { randomUUID as
|
|
34902
|
+
import { randomUUID as randomUUID17 } from "node:crypto";
|
|
34715
34903
|
import { constants as constants12 } from "node:fs";
|
|
34716
34904
|
import {
|
|
34717
34905
|
link as link2,
|
|
@@ -34942,7 +35130,7 @@ var init_local_image_owner = __esm({
|
|
|
34942
35130
|
throw new Error("Local image manifest replaced");
|
|
34943
35131
|
if (JSON.stringify(current.manifest) === encoded) return;
|
|
34944
35132
|
}
|
|
34945
|
-
const temporary = join32(this.path, `.owner-${
|
|
35133
|
+
const temporary = join32(this.path, `.owner-${randomUUID17()}`);
|
|
34946
35134
|
const file = await open2(
|
|
34947
35135
|
temporary,
|
|
34948
35136
|
constants12.O_CREAT | constants12.O_EXCL | constants12.O_WRONLY | constants12.O_NOFOLLOW,
|
|
@@ -35224,7 +35412,7 @@ var init_pane_source_discovery = __esm({
|
|
|
35224
35412
|
});
|
|
35225
35413
|
|
|
35226
35414
|
// packages/daemon/src/lib/background-native-capture.ts
|
|
35227
|
-
import { randomUUID as
|
|
35415
|
+
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
35228
35416
|
function createBackgroundNativeCapture(options) {
|
|
35229
35417
|
return async (request3, signal) => {
|
|
35230
35418
|
signal?.throwIfAborted();
|
|
@@ -35235,7 +35423,7 @@ function createBackgroundNativeCapture(options) {
|
|
|
35235
35423
|
return null;
|
|
35236
35424
|
if (request3.mode !== "agent-status" && request3.mode !== "fleet-preview")
|
|
35237
35425
|
throw new TypeError("Invalid background capture mode");
|
|
35238
|
-
const operationId =
|
|
35426
|
+
const operationId = randomUUID18();
|
|
35239
35427
|
const command3 = [
|
|
35240
35428
|
"capture-pane",
|
|
35241
35429
|
"-p",
|
|
@@ -35358,7 +35546,7 @@ var init_background_native_capture = __esm({
|
|
|
35358
35546
|
});
|
|
35359
35547
|
|
|
35360
35548
|
// packages/daemon/src/terminal/mirror/owned-viewer-adapter.ts
|
|
35361
|
-
import { randomUUID as
|
|
35549
|
+
import { randomUUID as randomUUID19 } from "node:crypto";
|
|
35362
35550
|
var commands, OwnedViewerAdapter;
|
|
35363
35551
|
var init_owned_viewer_adapter = __esm({
|
|
35364
35552
|
"packages/daemon/src/terminal/mirror/owned-viewer-adapter.ts"() {
|
|
@@ -35383,18 +35571,18 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35383
35571
|
});
|
|
35384
35572
|
}
|
|
35385
35573
|
controlOptions() {
|
|
35386
|
-
let
|
|
35574
|
+
let capability;
|
|
35387
35575
|
try {
|
|
35388
|
-
|
|
35576
|
+
capability = this.authority.capability();
|
|
35389
35577
|
} catch {
|
|
35390
35578
|
this.#uncertain();
|
|
35391
35579
|
return void 0;
|
|
35392
35580
|
}
|
|
35393
|
-
if (this.#disposed || !
|
|
35581
|
+
if (this.#disposed || !capability) return void 0;
|
|
35394
35582
|
return {
|
|
35395
|
-
serverEpoch:
|
|
35583
|
+
serverEpoch: capability.serverEpoch,
|
|
35396
35584
|
onIdentity: (identity4) => {
|
|
35397
|
-
if (this.#disposed || !this.#io || this.#connection || identity4.serverEpoch !==
|
|
35585
|
+
if (this.#disposed || !this.#io || this.#connection || identity4.serverEpoch !== capability.serverEpoch || this.authority.capability()?.serverEpoch !== identity4.serverEpoch)
|
|
35398
35586
|
return false;
|
|
35399
35587
|
const connection = this.authority.register(identity4);
|
|
35400
35588
|
if (!connection) return false;
|
|
@@ -35412,9 +35600,9 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35412
35600
|
/** Available only on the actual attached issuer, never the journal reader. */
|
|
35413
35601
|
atomicSnapshotEpoch(io, representation = "native") {
|
|
35414
35602
|
try {
|
|
35415
|
-
const
|
|
35603
|
+
const capability = this.authority.capability();
|
|
35416
35604
|
const actual = io.nativeViewerIdentity;
|
|
35417
|
-
return !this.#disposed && io === this.#io && this.#connection && this.#identity && (representation === "dual" ?
|
|
35605
|
+
return !this.#disposed && io === this.#io && this.#connection && this.#identity && (representation === "dual" ? capability?.atomicPaneSnapshotDual : capability?.atomicPaneSnapshot) === true && actual && actual.connectionId === this.#identity.connectionId && actual.serverEpoch === this.#identity.serverEpoch && capability?.serverEpoch === actual.serverEpoch ? actual.serverEpoch : null;
|
|
35418
35606
|
} catch {
|
|
35419
35607
|
this.#uncertain();
|
|
35420
35608
|
return null;
|
|
@@ -35423,20 +35611,20 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35423
35611
|
tryDispatch(io, request3, onReply) {
|
|
35424
35612
|
const identity4 = this.#identity, connection = this.#connection;
|
|
35425
35613
|
let actual;
|
|
35426
|
-
let
|
|
35614
|
+
let capability;
|
|
35427
35615
|
try {
|
|
35428
35616
|
actual = io.nativeViewerIdentity;
|
|
35429
|
-
|
|
35617
|
+
capability = this.authority.capability();
|
|
35430
35618
|
} catch {
|
|
35431
35619
|
this.#uncertain();
|
|
35432
35620
|
return false;
|
|
35433
35621
|
}
|
|
35434
|
-
if (this.#disposed || io !== this.#io || !identity4 || !connection || !actual || actual.serverEpoch !== identity4.serverEpoch || request3.expectedServerEpoch !== void 0 && request3.expectedServerEpoch !== identity4.serverEpoch || actual.connectionId !== identity4.connectionId ||
|
|
35622
|
+
if (this.#disposed || io !== this.#io || !identity4 || !connection || !actual || actual.serverEpoch !== identity4.serverEpoch || request3.expectedServerEpoch !== void 0 && request3.expectedServerEpoch !== identity4.serverEpoch || actual.connectionId !== identity4.connectionId || capability?.serverEpoch !== identity4.serverEpoch || !io.commandNativeViewerInline || !/^%(0|[1-9][0-9]*)$/.test(request3.paneId) || !/^[1-9][0-9]*$/.test(request3.paneBirthId) || request3.commands.length === 0 || request3.commands.length > 64 || request3.commands.some((argv) => !commands.has(argv[0] ?? "")))
|
|
35435
35623
|
return false;
|
|
35436
35624
|
let permit;
|
|
35437
35625
|
try {
|
|
35438
35626
|
permit = this.authority.admit({
|
|
35439
|
-
operationId:
|
|
35627
|
+
operationId: randomUUID19(),
|
|
35440
35628
|
role: "viewer",
|
|
35441
35629
|
source: null,
|
|
35442
35630
|
connection,
|
|
@@ -36180,7 +36368,7 @@ var init_authored_native_receipt_staging = __esm({
|
|
|
36180
36368
|
|
|
36181
36369
|
// packages/daemon/src/lib/owned-native-interaction-bindings.ts
|
|
36182
36370
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
36183
|
-
import { randomUUID as
|
|
36371
|
+
import { randomUUID as randomUUID20 } from "node:crypto";
|
|
36184
36372
|
function isOwnedNativePlanCompletion(value) {
|
|
36185
36373
|
return value !== null && typeof value === "object" && ownedCompletions.has(value);
|
|
36186
36374
|
}
|
|
@@ -36266,7 +36454,7 @@ var init_owned_native_interaction_bindings = __esm({
|
|
|
36266
36454
|
return null;
|
|
36267
36455
|
if ([...this.#connections.values()].some((c) => c.identity.connectionId === identity4.connectionId))
|
|
36268
36456
|
return null;
|
|
36269
|
-
const token2 = Object.freeze({ bindingId:
|
|
36457
|
+
const token2 = Object.freeze({ bindingId: randomUUID20() });
|
|
36270
36458
|
this.#connections.set(token2, {
|
|
36271
36459
|
token: token2,
|
|
36272
36460
|
identity: freeze(identity4),
|
|
@@ -36608,7 +36796,7 @@ var init_owned_native_interaction_bindings = __esm({
|
|
|
36608
36796
|
});
|
|
36609
36797
|
|
|
36610
36798
|
// packages/daemon/src/lib/tmux-server-generation-runner.ts
|
|
36611
|
-
import { randomUUID as
|
|
36799
|
+
import { randomUUID as randomUUID21 } from "node:crypto";
|
|
36612
36800
|
function fenceNativeTmuxCommand(args, expected) {
|
|
36613
36801
|
const { pid, startTime } = expected;
|
|
36614
36802
|
if (!/^[1-9][0-9]*$/u.test(pid) || !/^[1-9][0-9]*$/u.test(startTime))
|
|
@@ -36627,7 +36815,7 @@ function fenceNativeTmuxCommand(args, expected) {
|
|
|
36627
36815
|
if (firstCommand === args.length) throw new Error("Missing tmux command");
|
|
36628
36816
|
const condition = `#{&&:#{==:#{pid},${pid}},#{==:#{start_time},${startTime}}}`;
|
|
36629
36817
|
const command3 = args.slice(firstCommand).map((arg) => arg === ";" ? ";" : shellEscape(arg)).join(" ");
|
|
36630
|
-
const refusal = `tmux-server-stale.${
|
|
36818
|
+
const refusal = `tmux-server-stale.${randomUUID21()}`;
|
|
36631
36819
|
return {
|
|
36632
36820
|
argv: [...globalFlags, "if-shell", "-F", condition, command3, `display-message -p '${refusal}'`],
|
|
36633
36821
|
verify(output) {
|
|
@@ -36737,9 +36925,9 @@ var init_native_journal_control_connection = __esm({
|
|
|
36737
36925
|
try {
|
|
36738
36926
|
if (this.#failure) throw this.#failure;
|
|
36739
36927
|
if (lines.length !== 2) throw new Error("Invalid native journal greeting");
|
|
36740
|
-
const
|
|
36928
|
+
const capability = NativeJournalCapabilitySchemaZ.parse(JSON.parse(lines[0]));
|
|
36741
36929
|
const identity4 = NativeJournalIdentitySchemaZ.parse(JSON.parse(lines[1]));
|
|
36742
|
-
if (
|
|
36930
|
+
if (capability.readerTransport !== "sessionless-control-v1" || !capability.enabled || capability.serverEpoch !== this.#serverEpoch || identity4.serverEpoch !== this.#serverEpoch)
|
|
36743
36931
|
throw new Error("Native journal peer incarnation mismatch");
|
|
36744
36932
|
this.#connectionId = identity4.connectionId;
|
|
36745
36933
|
} catch (error) {
|
|
@@ -37100,45 +37288,45 @@ var init_native_tmux_interaction_observer = __esm({
|
|
|
37100
37288
|
}
|
|
37101
37289
|
}
|
|
37102
37290
|
async #probe() {
|
|
37103
|
-
let
|
|
37291
|
+
let capability;
|
|
37104
37292
|
const output = await this.#request(["tmux-ide-events", "-V"], this.#commandMs);
|
|
37105
37293
|
try {
|
|
37106
|
-
|
|
37294
|
+
capability = NativeJournalCapabilitySchemaZ.parse(JSON.parse(output));
|
|
37107
37295
|
} catch {
|
|
37108
37296
|
this.#state("incompatible");
|
|
37109
37297
|
return false;
|
|
37110
37298
|
}
|
|
37111
|
-
if (this.#options.expectedServerEpoch !== void 0 && this.#options.expectedServerEpoch !==
|
|
37299
|
+
if (this.#options.expectedServerEpoch !== void 0 && this.#options.expectedServerEpoch !== capability.serverEpoch || this.#capability && this.#capability.serverEpoch !== capability.serverEpoch || this.#cursor && this.#cursor.serverEpoch !== capability.serverEpoch) {
|
|
37112
37300
|
this.#state("retired");
|
|
37113
37301
|
return false;
|
|
37114
37302
|
}
|
|
37115
|
-
this.#capability =
|
|
37116
|
-
if (!
|
|
37303
|
+
this.#capability = capability;
|
|
37304
|
+
if (!capability.enabled && this.#options.enable) {
|
|
37117
37305
|
const enabled = NativeJournalCapabilitySchemaZ.parse(
|
|
37118
37306
|
JSON.parse(await this.#request(["tmux-ide-events", "-e"], this.#commandMs))
|
|
37119
37307
|
);
|
|
37120
|
-
if (enabled.serverEpoch !==
|
|
37308
|
+
if (enabled.serverEpoch !== capability.serverEpoch) {
|
|
37121
37309
|
this.#state("retired");
|
|
37122
37310
|
return false;
|
|
37123
37311
|
}
|
|
37124
|
-
this.#capability =
|
|
37312
|
+
this.#capability = capability = enabled;
|
|
37125
37313
|
}
|
|
37126
|
-
if (!
|
|
37314
|
+
if (!capability.enabled) {
|
|
37127
37315
|
this.#state("disabled");
|
|
37128
37316
|
return false;
|
|
37129
37317
|
}
|
|
37130
|
-
if (
|
|
37318
|
+
if (capability.degraded) {
|
|
37131
37319
|
this.#state("degraded");
|
|
37132
37320
|
return false;
|
|
37133
37321
|
}
|
|
37134
37322
|
if (!this.#cursor)
|
|
37135
37323
|
this.#cursor = {
|
|
37136
|
-
serverEpoch:
|
|
37137
|
-
journalEpoch:
|
|
37324
|
+
serverEpoch: capability.serverEpoch,
|
|
37325
|
+
journalEpoch: capability.journalEpoch,
|
|
37138
37326
|
sequence: "0"
|
|
37139
37327
|
};
|
|
37140
|
-
else if (this.#cursor.journalEpoch !==
|
|
37141
|
-
this.#reset(
|
|
37328
|
+
else if (this.#cursor.journalEpoch !== capability.journalEpoch)
|
|
37329
|
+
this.#reset(capability.journalEpoch);
|
|
37142
37330
|
this.#state("ready");
|
|
37143
37331
|
return true;
|
|
37144
37332
|
}
|
|
@@ -37497,22 +37685,22 @@ var init_owner_interaction_observation = __esm({
|
|
|
37497
37685
|
cursor: null
|
|
37498
37686
|
});
|
|
37499
37687
|
}
|
|
37500
|
-
#ready(
|
|
37688
|
+
#ready(capability, cursor2) {
|
|
37501
37689
|
this.#selection = "native";
|
|
37502
|
-
this.#capability =
|
|
37503
|
-
if (
|
|
37690
|
+
this.#capability = capability;
|
|
37691
|
+
if (capability.ownedOperationTransport === "direct-wrapper-v1")
|
|
37504
37692
|
this.#bindings ??= new OwnedNativeInteractionBindings({
|
|
37505
37693
|
environmentId: this.#options.environmentId,
|
|
37506
37694
|
serverScope: this.#options.serverScope,
|
|
37507
|
-
serverEpoch:
|
|
37695
|
+
serverEpoch: capability.serverEpoch,
|
|
37508
37696
|
onPlanComplete: this.#options.onOwnedPlanComplete
|
|
37509
37697
|
});
|
|
37510
37698
|
this.#projector ??= new NativeInteractionProjector({
|
|
37511
37699
|
environmentId: this.#options.environmentId,
|
|
37512
37700
|
serverScope: this.#options.serverScope,
|
|
37513
|
-
serverEpoch:
|
|
37701
|
+
serverEpoch: capability.serverEpoch
|
|
37514
37702
|
});
|
|
37515
|
-
this.#options.status.setNativeReady(
|
|
37703
|
+
this.#options.status.setNativeReady(capability.schemaVersion, cursor2);
|
|
37516
37704
|
}
|
|
37517
37705
|
#publish(items) {
|
|
37518
37706
|
if (this.#disposed) return;
|
|
@@ -38336,7 +38524,7 @@ var init_fleet_agent_lifecycle = __esm({
|
|
|
38336
38524
|
});
|
|
38337
38525
|
|
|
38338
38526
|
// packages/daemon/src/lib/fleet-lifecycle-authority.ts
|
|
38339
|
-
import { createHash as createHash16, randomUUID as
|
|
38527
|
+
import { createHash as createHash16, randomUUID as randomUUID22 } from "node:crypto";
|
|
38340
38528
|
import { isAbsolute as isAbsolute16, resolve as resolve21 } from "node:path";
|
|
38341
38529
|
import { realpath as realpath3, stat } from "node:fs/promises";
|
|
38342
38530
|
var MAX_REPLAY_OPERATIONS, sleep2, FleetLifecycleAuthorityError, FleetLifecycleAuthority;
|
|
@@ -38627,7 +38815,7 @@ var init_fleet_lifecycle_authority = __esm({
|
|
|
38627
38815
|
"tmux did not return a pane identity."
|
|
38628
38816
|
);
|
|
38629
38817
|
}
|
|
38630
|
-
const semanticPaneId3 = `pane.agent.${
|
|
38818
|
+
const semanticPaneId3 = `pane.agent.${randomUUID22()}`;
|
|
38631
38819
|
try {
|
|
38632
38820
|
this.#runTmux(["set-option", "-p", "-t", paneId, "@tmux_ide_pane_id", semanticPaneId3]);
|
|
38633
38821
|
this.#runTmux(["set-option", "-p", "-t", paneId, "@agent_launch", input.command]);
|
|
@@ -38743,8 +38931,8 @@ var init_fleet_lifecycle_authority = __esm({
|
|
|
38743
38931
|
} catch {
|
|
38744
38932
|
throw new FleetLifecycleAuthorityError("agent_not_found", "Agent pane disappeared.");
|
|
38745
38933
|
}
|
|
38746
|
-
const [
|
|
38747
|
-
return { start:
|
|
38934
|
+
const [start3 = "", path2 = ""] = output.split(" ");
|
|
38935
|
+
return { start: start3, path: path2 };
|
|
38748
38936
|
}
|
|
38749
38937
|
async #stopAgent(paneId) {
|
|
38750
38938
|
this.#paneStartAndPath(paneId);
|
|
@@ -38829,7 +39017,7 @@ var init_tmux_server_session_create = __esm({
|
|
|
38829
39017
|
|
|
38830
39018
|
// packages/daemon/src/lib/tmux-session-mutation-fence.ts
|
|
38831
39019
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
38832
|
-
import { randomUUID as
|
|
39020
|
+
import { randomUUID as randomUUID23 } from "node:crypto";
|
|
38833
39021
|
function createTmuxSessionMutationFence() {
|
|
38834
39022
|
const context = new AsyncLocalStorage();
|
|
38835
39023
|
return {
|
|
@@ -38844,7 +39032,7 @@ function createTmuxSessionMutationFence() {
|
|
|
38844
39032
|
return (args) => {
|
|
38845
39033
|
const selected = context.getStore();
|
|
38846
39034
|
if (!selected) return run(args);
|
|
38847
|
-
const sentinel = `tmux-session-stale.${
|
|
39035
|
+
const sentinel = `tmux-session-stale.${randomUUID23()}`;
|
|
38848
39036
|
const output = run([
|
|
38849
39037
|
"if-shell",
|
|
38850
39038
|
"-t",
|
|
@@ -39984,7 +40172,7 @@ var init_workspace_promotion2 = __esm({
|
|
|
39984
40172
|
});
|
|
39985
40173
|
|
|
39986
40174
|
// packages/daemon/src/lib/tmux-server-session-open.ts
|
|
39987
|
-
import { randomUUID as
|
|
40175
|
+
import { randomUUID as randomUUID24 } from "node:crypto";
|
|
39988
40176
|
function createNativeTmuxSessionOpener(options) {
|
|
39989
40177
|
let disposed = false;
|
|
39990
40178
|
let tail = Promise.resolve();
|
|
@@ -40007,7 +40195,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40007
40195
|
const [, nativeSessionId, created, name] = matches[0];
|
|
40008
40196
|
const run = async (args) => {
|
|
40009
40197
|
assertOpen();
|
|
40010
|
-
const sentinel = `tmux-session-stale.${
|
|
40198
|
+
const sentinel = `tmux-session-stale.${randomUUID24()}`;
|
|
40011
40199
|
const condition = `#{&&:#{==:#{session_id},${nativeSessionId}},#{==:#{session_created},${created}}}`;
|
|
40012
40200
|
const command3 = args.map((arg) => arg === ";" ? ";" : shellEscape(arg)).join(" ");
|
|
40013
40201
|
const output = await options.run([
|
|
@@ -40033,7 +40221,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40033
40221
|
});
|
|
40034
40222
|
try {
|
|
40035
40223
|
const result2 = await promotion.promote({
|
|
40036
|
-
operationId:
|
|
40224
|
+
operationId: randomUUID24(),
|
|
40037
40225
|
expectedDaemonInstanceId: options.generation,
|
|
40038
40226
|
intent: { sessionId: fleetSessionIdForName(name) }
|
|
40039
40227
|
});
|
|
@@ -40066,7 +40254,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40066
40254
|
const observed = observedAgentSchema.parse(input);
|
|
40067
40255
|
assertOpen();
|
|
40068
40256
|
if (pending.size >= 16) throw new Error("Session admission capacity reached");
|
|
40069
|
-
const key2 =
|
|
40257
|
+
const key2 = randomUUID24();
|
|
40070
40258
|
const operation = tail.then(async () => {
|
|
40071
40259
|
const result2 = await open5(liveSessionId, observed);
|
|
40072
40260
|
if (!result2.semanticPaneId) throw new Error("Agent admission returned no target");
|
|
@@ -40215,7 +40403,7 @@ var init_tmux_pane_editor_context = __esm({
|
|
|
40215
40403
|
});
|
|
40216
40404
|
|
|
40217
40405
|
// packages/daemon/src/terminal/session-runtime/runtime-observability.ts
|
|
40218
|
-
import { randomUUID as
|
|
40406
|
+
import { randomUUID as randomUUID25 } from "node:crypto";
|
|
40219
40407
|
import { z as z104 } from "zod";
|
|
40220
40408
|
function createSessionRuntimeObservability(options = {}) {
|
|
40221
40409
|
const capacity = options.capacity ?? 1024;
|
|
@@ -40225,7 +40413,7 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40225
40413
|
const processId = options.processId ?? `daemon:${process.pid}`;
|
|
40226
40414
|
const clockId = options.clockId ?? "node-performance-now";
|
|
40227
40415
|
const clockKind = options.clockKind ?? "performance-now";
|
|
40228
|
-
const createTraceId = options.createTraceId ??
|
|
40416
|
+
const createTraceId = options.createTraceId ?? randomUUID25;
|
|
40229
40417
|
const spans = [];
|
|
40230
40418
|
let cursor2 = 0;
|
|
40231
40419
|
let droppedSpans = 0;
|
|
@@ -40240,7 +40428,7 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40240
40428
|
});
|
|
40241
40429
|
},
|
|
40242
40430
|
recordSpan(stage, operation, startedAtMicros, endedAtMicros, trace = null, shared, terminalDelivery, terminalReseed) {
|
|
40243
|
-
const
|
|
40431
|
+
const span2 = Object.freeze({
|
|
40244
40432
|
traceId: trace?.traceId ?? null,
|
|
40245
40433
|
scenario: trace?.scenario ?? null,
|
|
40246
40434
|
authority: trace?.authority ?? null,
|
|
@@ -40258,13 +40446,13 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40258
40446
|
...terminalDelivery ? { terminalDelivery: Object.freeze({ ...terminalDelivery }) } : {},
|
|
40259
40447
|
...terminalReseed ? { terminalReseed: Object.freeze({ ...terminalReseed }) } : {}
|
|
40260
40448
|
});
|
|
40261
|
-
if (spans.length < capacity) spans.push(
|
|
40449
|
+
if (spans.length < capacity) spans.push(span2);
|
|
40262
40450
|
else {
|
|
40263
|
-
spans[cursor2] =
|
|
40451
|
+
spans[cursor2] = span2;
|
|
40264
40452
|
cursor2 = (cursor2 + 1) % capacity;
|
|
40265
40453
|
droppedSpans += 1;
|
|
40266
40454
|
}
|
|
40267
|
-
options.onSpan?.(
|
|
40455
|
+
options.onSpan?.(span2);
|
|
40268
40456
|
},
|
|
40269
40457
|
snapshot() {
|
|
40270
40458
|
const ordered = spans.length < capacity || cursor2 === 0 ? [...spans] : [...spans.slice(cursor2), ...spans.slice(0, cursor2)];
|
|
@@ -40875,14 +41063,14 @@ var init_control_channel = __esm({
|
|
|
40875
41063
|
}
|
|
40876
41064
|
if (event.kind === "error" && sink.index !== sink.state.resultIndex)
|
|
40877
41065
|
this.discardedErrors += 1;
|
|
40878
|
-
if (event.kind === "error"
|
|
41066
|
+
if (event.kind === "error") {
|
|
40879
41067
|
while (this.pending[0]?.kind === "command-list" && this.pending[0].state === sink.state)
|
|
40880
41068
|
this.pending.shift();
|
|
40881
41069
|
if (!sink.state.settled) {
|
|
40882
41070
|
sink.state.settled = true;
|
|
40883
41071
|
sink.state.onReply({
|
|
40884
41072
|
ok: false,
|
|
40885
|
-
lines: sink.state.budget || sink.state.resultIndex === 0 ? sink.state.lines : sink.state.leadingErrorLines
|
|
41073
|
+
lines: sink.index > 0 || sink.state.budget || sink.state.resultIndex === 0 ? sink.state.lines : sink.state.leadingErrorLines
|
|
40886
41074
|
});
|
|
40887
41075
|
}
|
|
40888
41076
|
} else if (sink.index === sink.state.resultIndex && !sink.state.settled) {
|
|
@@ -41611,6 +41799,7 @@ var init_control_mode_ownership = __esm({
|
|
|
41611
41799
|
});
|
|
41612
41800
|
|
|
41613
41801
|
// packages/daemon/src/terminal/mirror/mirror-service.ts
|
|
41802
|
+
import { randomUUID as randomUUID26 } from "node:crypto";
|
|
41614
41803
|
import { setTimeout as waitForPublication } from "node:timers/promises";
|
|
41615
41804
|
import { accessSync as accessSync7, constants as constants13, realpathSync as realpathSync15, statSync as statSync12 } from "node:fs";
|
|
41616
41805
|
import { isAbsolute as isAbsolute19 } from "node:path";
|
|
@@ -41621,6 +41810,7 @@ var init_mirror_service = __esm({
|
|
|
41621
41810
|
"use strict";
|
|
41622
41811
|
init_src2();
|
|
41623
41812
|
init_window_split_authority();
|
|
41813
|
+
init_stock_split_resize();
|
|
41624
41814
|
init_shared_window_index();
|
|
41625
41815
|
init_registered_window_guard();
|
|
41626
41816
|
init_tmux_client_execution();
|
|
@@ -41828,9 +42018,16 @@ var init_mirror_service = __esm({
|
|
|
41828
42018
|
ready = await this.opts.splitLayoutPrepare();
|
|
41829
42019
|
} catch {
|
|
41830
42020
|
}
|
|
41831
|
-
if (!ready
|
|
42021
|
+
if (!ready) {
|
|
42022
|
+
const stock = await this.#stockSplitServer();
|
|
42023
|
+
if (!stock || this.disposed || entry.retired || this.channels.get(session) !== entry)
|
|
42024
|
+
throw new WindowSplitLayoutUnavailable();
|
|
42025
|
+
return this.#readStockSplitLayout(entry, target);
|
|
42026
|
+
}
|
|
42027
|
+
if (this.disposed || entry.retired || this.channels.get(session) !== entry)
|
|
41832
42028
|
throw new WindowSplitLayoutUnavailable();
|
|
41833
42029
|
}
|
|
42030
|
+
if (entry.stockSplitEpoch) throw new WindowSplitLayoutUnavailable();
|
|
41834
42031
|
const epoch = this.opts.splitLayoutEpoch?.();
|
|
41835
42032
|
let supported = false;
|
|
41836
42033
|
try {
|
|
@@ -41845,6 +42042,23 @@ var init_mirror_service = __esm({
|
|
|
41845
42042
|
});
|
|
41846
42043
|
return entry.splitAuthority.read(target);
|
|
41847
42044
|
}
|
|
42045
|
+
async #stockSplitServer() {
|
|
42046
|
+
try {
|
|
42047
|
+
return await this.opts.splitLayoutStock?.() === true;
|
|
42048
|
+
} catch {
|
|
42049
|
+
return false;
|
|
42050
|
+
}
|
|
42051
|
+
}
|
|
42052
|
+
#readStockSplitLayout(entry, target) {
|
|
42053
|
+
if (entry.splitAuthority && !entry.stockSplitEpoch) throw new WindowSplitLayoutUnavailable();
|
|
42054
|
+
const epoch = entry.stockSplitEpoch ??= randomUUID26();
|
|
42055
|
+
entry.splitAuthority ??= new WindowSplitAuthority({
|
|
42056
|
+
describe: (window2) => entry.channel.describeSplitLayout(window2, true),
|
|
42057
|
+
serverEpoch: () => epoch,
|
|
42058
|
+
stock: true
|
|
42059
|
+
});
|
|
42060
|
+
return entry.splitAuthority.read(target);
|
|
42061
|
+
}
|
|
41848
42062
|
/** Resolve only issued handles, then revalidate immediately at native dispatch. */
|
|
41849
42063
|
async resizeWindowSplit(session, target, operationId, authorizeBeforeEffect, runNative) {
|
|
41850
42064
|
const captured = WindowSplitResizeTargetSchemaZ.parse(target);
|
|
@@ -41859,15 +42073,19 @@ var init_mirror_service = __esm({
|
|
|
41859
42073
|
await entry.started;
|
|
41860
42074
|
const resolved2 = current().resolve(captured);
|
|
41861
42075
|
const successor = current().prepareSuccessor(captured);
|
|
41862
|
-
const
|
|
42076
|
+
const authorize = () => {
|
|
42077
|
+
current().resolve(captured);
|
|
42078
|
+
authorizeBeforeEffect();
|
|
42079
|
+
};
|
|
42080
|
+
const result2 = entry.stockSplitEpoch ? await resizeStockSplit(resolved2.request, resolved2.session.created, authorize, {
|
|
42081
|
+
readOptions: (windowId) => entry.channel.stockSplitOptions(windowId),
|
|
42082
|
+
send: (command3) => entry.channel.stockSplitCommand(command3)
|
|
42083
|
+
}) : await runNative(resolved2.request, {
|
|
41863
42084
|
operationId,
|
|
41864
42085
|
serverEpoch: resolved2.serverEpoch,
|
|
41865
42086
|
session: resolved2.session,
|
|
41866
42087
|
anchor: resolved2.anchor,
|
|
41867
|
-
authorizeBeforeEffect:
|
|
41868
|
-
current().resolve(captured);
|
|
41869
|
-
authorizeBeforeEffect();
|
|
41870
|
-
}
|
|
42088
|
+
authorizeBeforeEffect: authorize
|
|
41871
42089
|
});
|
|
41872
42090
|
if (result2.status !== "applied") return result2;
|
|
41873
42091
|
const deadline = performance.now() + 100;
|
|
@@ -42473,7 +42691,7 @@ var init_semantic_mutation_resource_changes = __esm({
|
|
|
42473
42691
|
});
|
|
42474
42692
|
|
|
42475
42693
|
// packages/daemon/src/terminal/session-runtime/semantic-mutation-executor.ts
|
|
42476
|
-
import { randomUUID as
|
|
42694
|
+
import { randomUUID as randomUUID27 } from "node:crypto";
|
|
42477
42695
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
42478
42696
|
import { z as z105 } from "zod";
|
|
42479
42697
|
function replayedResult(result2) {
|
|
@@ -42740,7 +42958,7 @@ var init_semantic_mutation_executor = __esm({
|
|
|
42740
42958
|
this.#publish(operationId, intent, "rejected", null, void 0, origin, interactionContext);
|
|
42741
42959
|
throw error;
|
|
42742
42960
|
}
|
|
42743
|
-
const executionId =
|
|
42961
|
+
const executionId = randomUUID27();
|
|
42744
42962
|
const needsTmuxObservation = sessionRuntimeIntentNeedsTmuxObservation(intent);
|
|
42745
42963
|
let observed = null;
|
|
42746
42964
|
if (needsTmuxObservation) {
|
|
@@ -42959,7 +43177,7 @@ var init_semantic_mutation_executor = __esm({
|
|
|
42959
43177
|
});
|
|
42960
43178
|
|
|
42961
43179
|
// packages/daemon/src/terminal/session-runtime/history-anchor-owner.ts
|
|
42962
|
-
import { randomUUID as
|
|
43180
|
+
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
42963
43181
|
var MAX_TOKENS, PROOF_TTL_MS, HistoryAnchorOwner;
|
|
42964
43182
|
var init_history_anchor_owner = __esm({
|
|
42965
43183
|
"packages/daemon/src/terminal/session-runtime/history-anchor-owner.ts"() {
|
|
@@ -43053,7 +43271,7 @@ var init_history_anchor_owner = __esm({
|
|
|
43053
43271
|
const ordinal = known.first + historyIndex;
|
|
43054
43272
|
if (ordinal < this.#first || ordinal >= this.#first + this.#length) return { status: "lost" };
|
|
43055
43273
|
while (this.#tokens.size >= MAX_TOKENS) this.#tokens.delete(this.#tokens.keys().next().value);
|
|
43056
|
-
const token2 =
|
|
43274
|
+
const token2 = randomUUID28();
|
|
43057
43275
|
this.#tokens.set(token2, { ordinal });
|
|
43058
43276
|
return { status: "captured", token: token2 };
|
|
43059
43277
|
}
|
|
@@ -43442,15 +43660,15 @@ var init_terminal_conformance = __esm({
|
|
|
43442
43660
|
|
|
43443
43661
|
// packages/core/src/terminal-compact-capability.ts
|
|
43444
43662
|
function consumeCompactReplicaCapability(owner, baseline, hash) {
|
|
43445
|
-
const
|
|
43663
|
+
const capability = compactReplicaCapabilities.get(owner);
|
|
43446
43664
|
compactReplicaCapabilities.delete(owner);
|
|
43447
|
-
if (!
|
|
43448
|
-
return
|
|
43665
|
+
if (!capability || capability.baseline !== baseline || capability.hash !== hash) return void 0;
|
|
43666
|
+
return capability.snapshot;
|
|
43449
43667
|
}
|
|
43450
43668
|
function consumeVerifiedTombstoneInterval(owner, baseline, hash, baseRevision, revision) {
|
|
43451
|
-
const
|
|
43669
|
+
const capability = compactReplicaCapabilities.get(owner);
|
|
43452
43670
|
compactReplicaCapabilities.delete(owner);
|
|
43453
|
-
return
|
|
43671
|
+
return capability !== void 0 && capability.baseline === baseline && capability.snapshot === null && capability.hash === hash && capability.tombstoneInterval?.baseRevision === baseRevision && capability.tombstoneInterval.revision === revision;
|
|
43454
43672
|
}
|
|
43455
43673
|
var compactReplicaCapabilities;
|
|
43456
43674
|
var init_terminal_compact_capability = __esm({
|
|
@@ -43943,9 +44161,9 @@ var init_terminal_fnv64_wasm = __esm({
|
|
|
43943
44161
|
let offset = 0;
|
|
43944
44162
|
while (offset < value.length) {
|
|
43945
44163
|
const count = Math.min(SCRATCH_BYTES - this.#length, value.length - offset);
|
|
43946
|
-
const
|
|
44164
|
+
const start3 = this.#length;
|
|
43947
44165
|
for (let index = 0; index < count; index++)
|
|
43948
|
-
this.#buffer[
|
|
44166
|
+
this.#buffer[start3 + index] = value.charCodeAt(offset + index);
|
|
43949
44167
|
this.#length += count;
|
|
43950
44168
|
offset += count;
|
|
43951
44169
|
if (this.#length === SCRATCH_BYTES) this.#flush();
|
|
@@ -46859,10 +47077,10 @@ function projectNativeGridRow(source, columns, startColumn = 0, wrapped = false)
|
|
|
46859
47077
|
const clippedOwner = x === 0 && (native2.flags & 4) !== 0 && previous?.width === 2 && !(previous.flags & 4);
|
|
46860
47078
|
const styled = paint(clippedOwner ? previous : native2);
|
|
46861
47079
|
if (native2.flags & (4 | 64 | 128) || native2.width < 1 || native2.width > 2 || x + native2.width > columns) {
|
|
46862
|
-
const
|
|
47080
|
+
const span2 = native2.flags & 128 ? Math.max(1, Math.min(native2.width, columns - x)) : 1;
|
|
46863
47081
|
const blank = freezePaint({ ...styled, grapheme: "", width: 1 });
|
|
46864
|
-
for (let offset = 0; offset <
|
|
46865
|
-
x +=
|
|
47082
|
+
for (let offset = 0; offset < span2; offset++) cells[x + offset] = blank;
|
|
47083
|
+
x += span2 - 1;
|
|
46866
47084
|
continue;
|
|
46867
47085
|
}
|
|
46868
47086
|
cells[x] = freezePaint(styled);
|
|
@@ -46941,9 +47159,9 @@ function stringFromCodePoint(codePoint) {
|
|
|
46941
47159
|
}
|
|
46942
47160
|
return String.fromCharCode(codePoint);
|
|
46943
47161
|
}
|
|
46944
|
-
function utf32ToString(data,
|
|
47162
|
+
function utf32ToString(data, start3 = 0, end = data.length) {
|
|
46945
47163
|
let result2 = "";
|
|
46946
|
-
for (let i =
|
|
47164
|
+
for (let i = start3; i < end; ++i) {
|
|
46947
47165
|
let codepoint = data[i];
|
|
46948
47166
|
if (codepoint > 65535) {
|
|
46949
47167
|
codepoint -= 65536;
|
|
@@ -49856,30 +50074,30 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
49856
50074
|
this.setCellFromCodepoint(pos, 0, 1, fillCellData);
|
|
49857
50075
|
}
|
|
49858
50076
|
}
|
|
49859
|
-
replaceCells(
|
|
50077
|
+
replaceCells(start3, end, fillCellData, respectProtect = false) {
|
|
49860
50078
|
if (respectProtect) {
|
|
49861
|
-
if (
|
|
49862
|
-
this.setCellFromCodepoint(
|
|
50079
|
+
if (start3 && this.getWidth(start3 - 1) === 2 && !this.isProtected(start3 - 1)) {
|
|
50080
|
+
this.setCellFromCodepoint(start3 - 1, 0, 1, fillCellData);
|
|
49863
50081
|
}
|
|
49864
50082
|
if (end < this.length && this.getWidth(end - 1) === 2 && !this.isProtected(end)) {
|
|
49865
50083
|
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
|
49866
50084
|
}
|
|
49867
|
-
while (
|
|
49868
|
-
if (!this.isProtected(
|
|
49869
|
-
this.setCell(
|
|
50085
|
+
while (start3 < end && start3 < this.length) {
|
|
50086
|
+
if (!this.isProtected(start3)) {
|
|
50087
|
+
this.setCell(start3, fillCellData);
|
|
49870
50088
|
}
|
|
49871
|
-
|
|
50089
|
+
start3++;
|
|
49872
50090
|
}
|
|
49873
50091
|
return;
|
|
49874
50092
|
}
|
|
49875
|
-
if (
|
|
49876
|
-
this.setCellFromCodepoint(
|
|
50093
|
+
if (start3 && this.getWidth(start3 - 1) === 2) {
|
|
50094
|
+
this.setCellFromCodepoint(start3 - 1, 0, 1, fillCellData);
|
|
49877
50095
|
}
|
|
49878
50096
|
if (end < this.length && this.getWidth(end - 1) === 2) {
|
|
49879
50097
|
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
|
49880
50098
|
}
|
|
49881
|
-
while (
|
|
49882
|
-
this.setCell(
|
|
50099
|
+
while (start3 < end && start3 < this.length) {
|
|
50100
|
+
this.setCell(start3++, fillCellData);
|
|
49883
50101
|
}
|
|
49884
50102
|
}
|
|
49885
50103
|
/**
|
|
@@ -50344,22 +50562,22 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50344
50562
|
* @param deleteCount The number of elements to delete.
|
|
50345
50563
|
* @param items The items to insert.
|
|
50346
50564
|
*/
|
|
50347
|
-
splice(
|
|
50565
|
+
splice(start3, deleteCount, ...items) {
|
|
50348
50566
|
if (deleteCount) {
|
|
50349
|
-
for (let i =
|
|
50567
|
+
for (let i = start3; i < this._length - deleteCount; i++) {
|
|
50350
50568
|
this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];
|
|
50351
50569
|
}
|
|
50352
50570
|
this._length -= deleteCount;
|
|
50353
|
-
this.onDeleteEmitter.fire({ index:
|
|
50571
|
+
this.onDeleteEmitter.fire({ index: start3, amount: deleteCount });
|
|
50354
50572
|
}
|
|
50355
|
-
for (let i = this._length - 1; i >=
|
|
50573
|
+
for (let i = this._length - 1; i >= start3; i--) {
|
|
50356
50574
|
this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];
|
|
50357
50575
|
}
|
|
50358
50576
|
for (let i = 0; i < items.length; i++) {
|
|
50359
|
-
this._array[this._getCyclicIndex(
|
|
50577
|
+
this._array[this._getCyclicIndex(start3 + i)] = items[i];
|
|
50360
50578
|
}
|
|
50361
50579
|
if (items.length) {
|
|
50362
|
-
this.onInsertEmitter.fire({ index:
|
|
50580
|
+
this.onInsertEmitter.fire({ index: start3, amount: items.length });
|
|
50363
50581
|
}
|
|
50364
50582
|
if (this._length + items.length > this._maxLength) {
|
|
50365
50583
|
const countToTrim = this._length + items.length - this._maxLength;
|
|
@@ -50382,21 +50600,21 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50382
50600
|
this._length -= count;
|
|
50383
50601
|
this.onTrimEmitter.fire(count);
|
|
50384
50602
|
}
|
|
50385
|
-
shiftElements(
|
|
50603
|
+
shiftElements(start3, count, offset) {
|
|
50386
50604
|
if (count <= 0) {
|
|
50387
50605
|
return;
|
|
50388
50606
|
}
|
|
50389
|
-
if (
|
|
50607
|
+
if (start3 < 0 || start3 >= this._length) {
|
|
50390
50608
|
throw new Error("start argument out of range");
|
|
50391
50609
|
}
|
|
50392
|
-
if (
|
|
50610
|
+
if (start3 + offset < 0) {
|
|
50393
50611
|
throw new Error("Cannot shift elements in list beyond index 0");
|
|
50394
50612
|
}
|
|
50395
50613
|
if (offset > 0) {
|
|
50396
50614
|
for (let i = count - 1; i >= 0; i--) {
|
|
50397
|
-
this.set(
|
|
50615
|
+
this.set(start3 + i + offset, this.get(start3 + i));
|
|
50398
50616
|
}
|
|
50399
|
-
const expandListBy =
|
|
50617
|
+
const expandListBy = start3 + count + offset - this._length;
|
|
50400
50618
|
if (expandListBy > 0) {
|
|
50401
50619
|
this._length += expandListBy;
|
|
50402
50620
|
while (this._length > this._maxLength) {
|
|
@@ -50407,7 +50625,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50407
50625
|
}
|
|
50408
50626
|
} else {
|
|
50409
50627
|
for (let i = 0; i < count; i++) {
|
|
50410
|
-
this.set(
|
|
50628
|
+
this.set(start3 + i + offset, this.get(start3 + i));
|
|
50411
50629
|
}
|
|
50412
50630
|
}
|
|
50413
50631
|
}
|
|
@@ -52365,10 +52583,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52365
52583
|
const res = [];
|
|
52366
52584
|
for (let i = 0; i < this.length; ++i) {
|
|
52367
52585
|
res.push(this.params[i]);
|
|
52368
|
-
const
|
|
52586
|
+
const start3 = this._subParamsIdx[i] >> 8;
|
|
52369
52587
|
const end = this._subParamsIdx[i] & 255;
|
|
52370
|
-
if (end -
|
|
52371
|
-
res.push(Array.prototype.slice.call(this._subParams,
|
|
52588
|
+
if (end - start3 > 0) {
|
|
52589
|
+
res.push(Array.prototype.slice.call(this._subParams, start3, end));
|
|
52372
52590
|
}
|
|
52373
52591
|
}
|
|
52374
52592
|
return res;
|
|
@@ -52436,10 +52654,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52436
52654
|
* the values if you need to hold them in nonlocal scope.
|
|
52437
52655
|
*/
|
|
52438
52656
|
getSubParams(idx) {
|
|
52439
|
-
const
|
|
52657
|
+
const start3 = this._subParamsIdx[idx] >> 8;
|
|
52440
52658
|
const end = this._subParamsIdx[idx] & 255;
|
|
52441
|
-
if (end -
|
|
52442
|
-
return this._subParams.subarray(
|
|
52659
|
+
if (end - start3 > 0) {
|
|
52660
|
+
return this._subParams.subarray(start3, end);
|
|
52443
52661
|
}
|
|
52444
52662
|
return null;
|
|
52445
52663
|
}
|
|
@@ -52450,10 +52668,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52450
52668
|
getSubParamsAll() {
|
|
52451
52669
|
const result2 = {};
|
|
52452
52670
|
for (let i = 0; i < this.length; ++i) {
|
|
52453
|
-
const
|
|
52671
|
+
const start3 = this._subParamsIdx[i] >> 8;
|
|
52454
52672
|
const end = this._subParamsIdx[i] & 255;
|
|
52455
|
-
if (end -
|
|
52456
|
-
result2[i] = this._subParams.slice(
|
|
52673
|
+
if (end - start3 > 0) {
|
|
52674
|
+
result2[i] = this._subParams.slice(start3, end);
|
|
52457
52675
|
}
|
|
52458
52676
|
}
|
|
52459
52677
|
return result2;
|
|
@@ -52535,12 +52753,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52535
52753
|
}
|
|
52536
52754
|
}
|
|
52537
52755
|
}
|
|
52538
|
-
_put(data,
|
|
52756
|
+
_put(data, start3, end) {
|
|
52539
52757
|
if (!this._active.length) {
|
|
52540
|
-
this._handlerFb(this._id, "PUT", utf32ToString(data,
|
|
52758
|
+
this._handlerFb(this._id, "PUT", utf32ToString(data, start3, end));
|
|
52541
52759
|
} else {
|
|
52542
52760
|
for (let j = this._active.length - 1; j >= 0; j--) {
|
|
52543
|
-
this._active[j].put(data,
|
|
52761
|
+
this._active[j].put(data, start3, end);
|
|
52544
52762
|
}
|
|
52545
52763
|
}
|
|
52546
52764
|
}
|
|
@@ -52555,13 +52773,13 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52555
52773
|
* Payload chunks are not further processed and get
|
|
52556
52774
|
* directly passed to the handlers.
|
|
52557
52775
|
*/
|
|
52558
|
-
put(data,
|
|
52776
|
+
put(data, start3, end) {
|
|
52559
52777
|
if (this._state === 3) {
|
|
52560
52778
|
return;
|
|
52561
52779
|
}
|
|
52562
52780
|
if (this._state === 1) {
|
|
52563
|
-
while (
|
|
52564
|
-
const code2 = data[
|
|
52781
|
+
while (start3 < end) {
|
|
52782
|
+
const code2 = data[start3++];
|
|
52565
52783
|
if (code2 === 59) {
|
|
52566
52784
|
this._state = 2;
|
|
52567
52785
|
this._start();
|
|
@@ -52577,8 +52795,8 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52577
52795
|
this._id = this._id * 10 + code2 - 48;
|
|
52578
52796
|
}
|
|
52579
52797
|
}
|
|
52580
|
-
if (this._state === 2 && end -
|
|
52581
|
-
this._put(data,
|
|
52798
|
+
if (this._state === 2 && end - start3 > 0) {
|
|
52799
|
+
this._put(data, start3, end);
|
|
52582
52800
|
}
|
|
52583
52801
|
}
|
|
52584
52802
|
/**
|
|
@@ -52646,11 +52864,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52646
52864
|
this._data = "";
|
|
52647
52865
|
this._hitLimit = false;
|
|
52648
52866
|
}
|
|
52649
|
-
put(data,
|
|
52867
|
+
put(data, start3, end) {
|
|
52650
52868
|
if (this._hitLimit) {
|
|
52651
52869
|
return;
|
|
52652
52870
|
}
|
|
52653
|
-
this._data += utf32ToString(data,
|
|
52871
|
+
this._data += utf32ToString(data, start3, end);
|
|
52654
52872
|
if (this._data.length > PAYLOAD_LIMIT) {
|
|
52655
52873
|
this._data = "";
|
|
52656
52874
|
this._hitLimit = true;
|
|
@@ -52738,12 +52956,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52738
52956
|
}
|
|
52739
52957
|
}
|
|
52740
52958
|
}
|
|
52741
|
-
put(data,
|
|
52959
|
+
put(data, start3, end) {
|
|
52742
52960
|
if (!this._active.length) {
|
|
52743
|
-
this._handlerFb(this._ident, "PUT", utf32ToString(data,
|
|
52961
|
+
this._handlerFb(this._ident, "PUT", utf32ToString(data, start3, end));
|
|
52744
52962
|
} else {
|
|
52745
52963
|
for (let j = this._active.length - 1; j >= 0; j--) {
|
|
52746
|
-
this._active[j].put(data,
|
|
52964
|
+
this._active[j].put(data, start3, end);
|
|
52747
52965
|
}
|
|
52748
52966
|
}
|
|
52749
52967
|
}
|
|
@@ -52802,11 +53020,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52802
53020
|
this._data = "";
|
|
52803
53021
|
this._hitLimit = false;
|
|
52804
53022
|
}
|
|
52805
|
-
put(data,
|
|
53023
|
+
put(data, start3, end) {
|
|
52806
53024
|
if (this._hitLimit) {
|
|
52807
53025
|
return;
|
|
52808
53026
|
}
|
|
52809
|
-
this._data += utf32ToString(data,
|
|
53027
|
+
this._data += utf32ToString(data, start3, end);
|
|
52810
53028
|
if (this._data.length > PAYLOAD_LIMIT) {
|
|
52811
53029
|
this._data = "";
|
|
52812
53030
|
this._hitLimit = true;
|
|
@@ -52873,7 +53091,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52873
53091
|
const table2 = new TransitionTable(4095);
|
|
52874
53092
|
const BYTE_VALUES = 256;
|
|
52875
53093
|
const blueprint = Array.apply(null, Array(BYTE_VALUES)).map((unused, i) => i);
|
|
52876
|
-
const r = (
|
|
53094
|
+
const r = (start3, end) => blueprint.slice(start3, end);
|
|
52877
53095
|
const PRINTABLES = r(32, 127);
|
|
52878
53096
|
const EXECUTABLES = r(0, 24);
|
|
52879
53097
|
EXECUTABLES.push(25);
|
|
@@ -53522,7 +53740,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53522
53740
|
this._params.addParam(0);
|
|
53523
53741
|
this._collect = 0;
|
|
53524
53742
|
this.precedingJoinState = 0;
|
|
53525
|
-
this._printHandlerFb = (data,
|
|
53743
|
+
this._printHandlerFb = (data, start3, end) => {
|
|
53526
53744
|
};
|
|
53527
53745
|
this._executeHandlerFb = (code2) => {
|
|
53528
53746
|
};
|
|
@@ -53747,12 +53965,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53747
53965
|
parse(data, length, promiseResult) {
|
|
53748
53966
|
let code2 = 0;
|
|
53749
53967
|
let transition = 0;
|
|
53750
|
-
let
|
|
53968
|
+
let start3 = 0;
|
|
53751
53969
|
let handlerResult;
|
|
53752
53970
|
if (this._parseStack.state) {
|
|
53753
53971
|
if (this._parseStack.state === 2) {
|
|
53754
53972
|
this._parseStack.state = 0;
|
|
53755
|
-
|
|
53973
|
+
start3 = this._parseStack.chunkPos + 1;
|
|
53756
53974
|
} else {
|
|
53757
53975
|
if (promiseResult === void 0 || this._parseStack.state === 1) {
|
|
53758
53976
|
this._parseStack.state = 1;
|
|
@@ -53813,12 +54031,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53813
54031
|
break;
|
|
53814
54032
|
}
|
|
53815
54033
|
this._parseStack.state = 0;
|
|
53816
|
-
|
|
54034
|
+
start3 = this._parseStack.chunkPos + 1;
|
|
53817
54035
|
this.precedingJoinState = 0;
|
|
53818
54036
|
this.currentState = this._parseStack.transition & 15;
|
|
53819
54037
|
}
|
|
53820
54038
|
}
|
|
53821
|
-
for (let i =
|
|
54039
|
+
for (let i = start3; i < length; ++i) {
|
|
53822
54040
|
code2 = data[i];
|
|
53823
54041
|
transition = this._transitions.table[this.currentState << 8 | (code2 < 160 ? code2 : NON_ASCII_PRINTABLE)];
|
|
53824
54042
|
switch (transition >> 4) {
|
|
@@ -54066,7 +54284,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54066
54284
|
}
|
|
54067
54285
|
this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(ident), action, payload });
|
|
54068
54286
|
});
|
|
54069
|
-
this._parser.setPrintHandler((data,
|
|
54287
|
+
this._parser.setPrintHandler((data, start3, end) => this.print(data, start3, end));
|
|
54070
54288
|
this._parser.registerCsiHandler({ final: "@" }, (params) => this.insertChars(params));
|
|
54071
54289
|
this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (params) => this.scrollLeft(params));
|
|
54072
54290
|
this._parser.registerCsiHandler({ final: "A" }, (params) => this.cursorUp(params));
|
|
@@ -54220,7 +54438,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54220
54438
|
let result2;
|
|
54221
54439
|
let cursorStartX = this._activeBuffer.x;
|
|
54222
54440
|
let cursorStartY = this._activeBuffer.y;
|
|
54223
|
-
let
|
|
54441
|
+
let start3 = 0;
|
|
54224
54442
|
const wasPaused = this._parseStack.paused;
|
|
54225
54443
|
if (wasPaused) {
|
|
54226
54444
|
if (result2 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, promiseResult)) {
|
|
@@ -54231,7 +54449,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54231
54449
|
cursorStartY = this._parseStack.cursorStartY;
|
|
54232
54450
|
this._parseStack.paused = false;
|
|
54233
54451
|
if (data.length > MAX_PARSEBUFFER_LENGTH) {
|
|
54234
|
-
|
|
54452
|
+
start3 = this._parseStack.position + MAX_PARSEBUFFER_LENGTH;
|
|
54235
54453
|
}
|
|
54236
54454
|
}
|
|
54237
54455
|
if (this._logService.logLevel <= 1) {
|
|
@@ -54252,7 +54470,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54252
54470
|
this._dirtyRowTracker.clearRange();
|
|
54253
54471
|
}
|
|
54254
54472
|
if (data.length > MAX_PARSEBUFFER_LENGTH) {
|
|
54255
|
-
for (let i =
|
|
54473
|
+
for (let i = start3; i < data.length; i += MAX_PARSEBUFFER_LENGTH) {
|
|
54256
54474
|
const end = i + MAX_PARSEBUFFER_LENGTH < data.length ? i + MAX_PARSEBUFFER_LENGTH : data.length;
|
|
54257
54475
|
const len = typeof data === "string" ? this._stringDecoder.decode(data.substring(i, end), this._parseBuffer) : this._utf8Decoder.decode(data.subarray(i, end), this._parseBuffer);
|
|
54258
54476
|
if (result2 = this._parser.parse(this._parseBuffer, len)) {
|
|
@@ -54283,7 +54501,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54283
54501
|
});
|
|
54284
54502
|
}
|
|
54285
54503
|
}
|
|
54286
|
-
print(data,
|
|
54504
|
+
print(data, start3, end) {
|
|
54287
54505
|
let code2;
|
|
54288
54506
|
let chWidth;
|
|
54289
54507
|
const charset = this._charsetService.charset;
|
|
@@ -54294,11 +54512,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54294
54512
|
const curAttr = this._curAttrData;
|
|
54295
54513
|
let bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
|
|
54296
54514
|
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
|
54297
|
-
if (this._activeBuffer.x && end -
|
|
54515
|
+
if (this._activeBuffer.x && end - start3 > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {
|
|
54298
54516
|
bufferRow.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, curAttr);
|
|
54299
54517
|
}
|
|
54300
54518
|
let precedingJoinState = this._parser.precedingJoinState;
|
|
54301
|
-
for (let pos =
|
|
54519
|
+
for (let pos = start3; pos < end; ++pos) {
|
|
54302
54520
|
code2 = data[pos];
|
|
54303
54521
|
if (code2 < 127 && charset) {
|
|
54304
54522
|
const ch = charset[String.fromCharCode(code2)];
|
|
@@ -54382,7 +54600,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54382
54600
|
}
|
|
54383
54601
|
}
|
|
54384
54602
|
this._parser.precedingJoinState = precedingJoinState;
|
|
54385
|
-
if (this._activeBuffer.x < cols && end -
|
|
54603
|
+
if (this._activeBuffer.x < cols && end - start3 > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {
|
|
54386
54604
|
bufferRow.setCellFromCodepoint(this._activeBuffer.x, 0, 1, curAttr);
|
|
54387
54605
|
}
|
|
54388
54606
|
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
|
@@ -54808,15 +55026,15 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54808
55026
|
* @param clearWrap clear the isWrapped flag
|
|
54809
55027
|
* @param respectProtect Whether to respect the protection attribute (DECSCA).
|
|
54810
55028
|
*/
|
|
54811
|
-
_eraseInBufferLine(y,
|
|
55029
|
+
_eraseInBufferLine(y, start3, end, clearWrap = false, respectProtect = false) {
|
|
54812
55030
|
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y);
|
|
54813
55031
|
line.replaceCells(
|
|
54814
|
-
|
|
55032
|
+
start3,
|
|
54815
55033
|
end,
|
|
54816
55034
|
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
|
54817
55035
|
respectProtect
|
|
54818
55036
|
);
|
|
54819
|
-
if (!respectProtect &&
|
|
55037
|
+
if (!respectProtect && start3 === 0 && end >= this._bufferService.cols) line.tmuxCellUsed = 0;
|
|
54820
55038
|
if (clearWrap) {
|
|
54821
55039
|
line.isWrapped = false;
|
|
54822
55040
|
}
|
|
@@ -64387,7 +64605,7 @@ var init_authority_arbiter = __esm({
|
|
|
64387
64605
|
});
|
|
64388
64606
|
|
|
64389
64607
|
// packages/daemon/src/terminal/session-runtime/registry.ts
|
|
64390
|
-
import { randomUUID as
|
|
64608
|
+
import { randomUUID as randomUUID29 } from "node:crypto";
|
|
64391
64609
|
import { z as z109 } from "zod";
|
|
64392
64610
|
async function abortable(promise, signal) {
|
|
64393
64611
|
if (!signal) return promise;
|
|
@@ -64585,7 +64803,7 @@ var init_registry2 = __esm({
|
|
|
64585
64803
|
observability: options.semanticMutations.observability ?? this.#observability
|
|
64586
64804
|
}) : null;
|
|
64587
64805
|
this.#resolveSession = options.semanticMutations?.resolveSession ?? null;
|
|
64588
|
-
this.#createControllerToken = options.createControllerToken ??
|
|
64806
|
+
this.#createControllerToken = options.createControllerToken ?? randomUUID29;
|
|
64589
64807
|
this.#nativeGeometryHysteresisMs = options.nativeGeometryHysteresisMs;
|
|
64590
64808
|
this.#stopExitObserver = this.#mirror.onSessionExit((session) => {
|
|
64591
64809
|
this.#sessions.get(session)?.noteControlExit();
|
|
@@ -66974,7 +67192,7 @@ var init_grouped_tmux = __esm({
|
|
|
66974
67192
|
});
|
|
66975
67193
|
|
|
66976
67194
|
// packages/daemon/src/terminal/attachments/lease-manager.ts
|
|
66977
|
-
import { createHash as createHash21, randomBytes as randomBytes5, randomUUID as
|
|
67195
|
+
import { createHash as createHash21, randomBytes as randomBytes5, randomUUID as randomUUID30, timingSafeEqual as timingSafeEqual3 } from "node:crypto";
|
|
66978
67196
|
import { z as z113 } from "zod";
|
|
66979
67197
|
function positiveDuration(value, fallback, label4) {
|
|
66980
67198
|
const resolved2 = value ?? fallback;
|
|
@@ -67047,7 +67265,7 @@ var init_lease_manager = __esm({
|
|
|
67047
67265
|
this.#viewExecutor = options.viewExecutor;
|
|
67048
67266
|
this.#now = options.now ?? Date.now;
|
|
67049
67267
|
this.#randomBytes = options.randomBytes ?? randomBytes5;
|
|
67050
|
-
this.#createId = options.createId ??
|
|
67268
|
+
this.#createId = options.createId ?? randomUUID30;
|
|
67051
67269
|
this.#ticketTtlMs = positiveDuration(options.ticketTtlMs, 15e3, "ticketTtlMs");
|
|
67052
67270
|
this.#leaseTtlMs = positiveDuration(options.leaseTtlMs, 6e4, "leaseTtlMs");
|
|
67053
67271
|
this.#maxLeaseTtlMs = positiveDuration(
|
|
@@ -69794,7 +70012,7 @@ var init_tmux_view_executor = __esm({
|
|
|
69794
70012
|
// packages/daemon/src/terminal/attachments/pty-tmux-attachment-launcher.ts
|
|
69795
70013
|
import { accessSync as accessSync8, constants as constants14, realpathSync as realpathSync16, statSync as statSync14 } from "node:fs";
|
|
69796
70014
|
import { delimiter as delimiter3, isAbsolute as isAbsolute20, join as join35 } from "node:path";
|
|
69797
|
-
import { randomUUID as
|
|
70015
|
+
import { randomUUID as randomUUID31 } from "node:crypto";
|
|
69798
70016
|
import { execFileSync as execFileSync16 } from "node:child_process";
|
|
69799
70017
|
function defaultSchedule2(callback, delayMs) {
|
|
69800
70018
|
const timer = setTimeout(callback, delayMs);
|
|
@@ -69988,7 +70206,7 @@ var init_pty_tmux_attachment_launcher = __esm({
|
|
|
69988
70206
|
if (existing) this.#dispose(existing);
|
|
69989
70207
|
this.#reservedAttachments.add(request3.identity.attachmentId);
|
|
69990
70208
|
const lifecycleEpoch = this.#lifecycleEpoch;
|
|
69991
|
-
const attemptId =
|
|
70209
|
+
const attemptId = randomUUID31();
|
|
69992
70210
|
let resolveOutcome;
|
|
69993
70211
|
const outcome = new Promise((resolve45) => {
|
|
69994
70212
|
resolveOutcome = resolve45;
|
|
@@ -72328,7 +72546,7 @@ var init_agent_status_probe = __esm({
|
|
|
72328
72546
|
});
|
|
72329
72547
|
|
|
72330
72548
|
// packages/daemon/src/terminal/pane-stream/lease-manager.ts
|
|
72331
|
-
import { createHash as createHash22, randomBytes as randomBytes6, randomUUID as
|
|
72549
|
+
import { createHash as createHash22, randomBytes as randomBytes6, randomUUID as randomUUID32, timingSafeEqual as timingSafeEqual4 } from "node:crypto";
|
|
72332
72550
|
import { z as z117 } from "zod";
|
|
72333
72551
|
function positiveDuration2(value, fallback, label4) {
|
|
72334
72552
|
const resolved2 = value ?? fallback;
|
|
@@ -72381,7 +72599,7 @@ var init_lease_manager2 = __esm({
|
|
|
72381
72599
|
this.#instanceId = BindingIdSchemaZ3.parse(options.daemonInstanceId);
|
|
72382
72600
|
this.#now = options.now ?? Date.now;
|
|
72383
72601
|
this.#randomBytes = options.randomBytes ?? randomBytes6;
|
|
72384
|
-
this.#createId = options.createId ??
|
|
72602
|
+
this.#createId = options.createId ?? randomUUID32;
|
|
72385
72603
|
this.#ticketTtlMs = positiveDuration2(options.ticketTtlMs, 15e3, "ticketTtlMs");
|
|
72386
72604
|
this.#redemptionProcessingTtlMs = positiveDuration2(
|
|
72387
72605
|
options.redemptionProcessingTtlMs,
|
|
@@ -72549,7 +72767,7 @@ var init_lease_manager2 = __esm({
|
|
|
72549
72767
|
});
|
|
72550
72768
|
|
|
72551
72769
|
// packages/daemon/src/terminal/graphics/native-surface-viewer.ts
|
|
72552
|
-
import { randomUUID as
|
|
72770
|
+
import { randomUUID as randomUUID33 } from "node:crypto";
|
|
72553
72771
|
var MAX_RETAINED, NativeSurfaceViewer;
|
|
72554
72772
|
var init_native_surface_viewer = __esm({
|
|
72555
72773
|
"packages/daemon/src/terminal/graphics/native-surface-viewer.ts"() {
|
|
@@ -72582,7 +72800,7 @@ var init_native_surface_viewer = __esm({
|
|
|
72582
72800
|
this.#active?.session.fallback("unsupported");
|
|
72583
72801
|
this.#active = null;
|
|
72584
72802
|
this.#prune();
|
|
72585
|
-
this.#nonce = available ?
|
|
72803
|
+
this.#nonce = available ? randomUUID33() : null;
|
|
72586
72804
|
this.#used = false;
|
|
72587
72805
|
this.#send({
|
|
72588
72806
|
type: "terminal-surface-available",
|
|
@@ -74454,9 +74672,9 @@ var init_pane_stream_websocket = __esm({
|
|
|
74454
74672
|
if (!batch || this.#closed || channel.closed) return;
|
|
74455
74673
|
let seed = batch.seed ?? new Uint8Array(0);
|
|
74456
74674
|
if (seed.byteLength > PANE_STREAM_MAX_SEED_BYTES) {
|
|
74457
|
-
let
|
|
74458
|
-
while (
|
|
74459
|
-
seed = seed.subarray(Math.min(
|
|
74675
|
+
let start3 = seed.byteLength - PANE_STREAM_MAX_SEED_BYTES;
|
|
74676
|
+
while (start3 < seed.byteLength && seed[start3] !== 10) start3 += 1;
|
|
74677
|
+
seed = seed.subarray(Math.min(start3 + 1, seed.byteLength));
|
|
74460
74678
|
}
|
|
74461
74679
|
const held = chunkBytes(concatBytes(batch.held), PANE_STREAM_MAX_OUTPUT_BYTES).slice(
|
|
74462
74680
|
0,
|
|
@@ -75757,7 +75975,7 @@ var init_interaction_observation_status = __esm({
|
|
|
75757
75975
|
});
|
|
75758
75976
|
|
|
75759
75977
|
// packages/daemon/src/lib/interaction-evidence-authority.ts
|
|
75760
|
-
import { randomUUID as
|
|
75978
|
+
import { randomUUID as randomUUID34 } from "node:crypto";
|
|
75761
75979
|
var HISTORY_CAPACITY, HISTORY_MS, runtimeKey, bindingKey, InteractionEvidenceAuthority;
|
|
75762
75980
|
var init_interaction_evidence_authority = __esm({
|
|
75763
75981
|
"packages/daemon/src/lib/interaction-evidence-authority.ts"() {
|
|
@@ -75820,7 +76038,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75820
76038
|
if (!/^\$(?:0|[1-9][0-9]*)$/u.test(row.sessionId) || !/^%(?:0|[1-9][0-9]*)$/u.test(row.runtimePaneId) || !row.semanticPaneId)
|
|
75821
76039
|
continue;
|
|
75822
76040
|
const lifetimeKey = `${row.runtimePaneId}\0${row.semanticPaneId}`;
|
|
75823
|
-
const paneLifetimeId = lifetimes.get(lifetimeKey) ??
|
|
76041
|
+
const paneLifetimeId = lifetimes.get(lifetimeKey) ?? randomUUID34();
|
|
75824
76042
|
const result2 = InteractionPaneEndpointSchemaZ.safeParse({
|
|
75825
76043
|
kind: "pane",
|
|
75826
76044
|
environmentId: this.#environmentId,
|
|
@@ -75864,7 +76082,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75864
76082
|
kind: "unresolved-pane",
|
|
75865
76083
|
environmentId: this.#environmentId,
|
|
75866
76084
|
serverScope: structuredClone(this.#serverScope),
|
|
75867
|
-
observationRef:
|
|
76085
|
+
observationRef: randomUUID34()
|
|
75868
76086
|
};
|
|
75869
76087
|
}
|
|
75870
76088
|
/** Join a fresh fleet row only to the exact current native binding. */
|
|
@@ -75890,7 +76108,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75890
76108
|
kind: "unresolved-pane",
|
|
75891
76109
|
environmentId: this.#environmentId,
|
|
75892
76110
|
serverScope: structuredClone(this.#serverScope),
|
|
75893
|
-
observationRef:
|
|
76111
|
+
observationRef: randomUUID34()
|
|
75894
76112
|
};
|
|
75895
76113
|
}
|
|
75896
76114
|
/** Grant must come directly from the current credential authority, never caller JSON. */
|
|
@@ -75919,10 +76137,10 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75919
76137
|
});
|
|
75920
76138
|
|
|
75921
76139
|
// packages/daemon/src/lib/tmux-interaction-observation-handler.ts
|
|
75922
|
-
import { randomUUID as
|
|
76140
|
+
import { randomUUID as randomUUID35 } from "node:crypto";
|
|
75923
76141
|
function externalTmuxInteractionDraft(observation2, destination) {
|
|
75924
76142
|
const { workspaceName, semanticPaneId: semanticPaneId3, operationKind } = observation2;
|
|
75925
|
-
const operationId =
|
|
76143
|
+
const operationId = randomUUID35();
|
|
75926
76144
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
75927
76145
|
return {
|
|
75928
76146
|
evidence: InteractionEvidenceSchemaZ.parse({
|
|
@@ -75974,7 +76192,7 @@ var init_tmux_interaction_observation_handler = __esm({
|
|
|
75974
76192
|
|
|
75975
76193
|
// packages/daemon/src/lib/tmux-server-owner.ts
|
|
75976
76194
|
import { execFileSync as execFileSync17 } from "node:child_process";
|
|
75977
|
-
import { createHash as createHash23, randomUUID as
|
|
76195
|
+
import { createHash as createHash23, randomUUID as randomUUID36 } from "node:crypto";
|
|
75978
76196
|
import { mkdirSync as mkdirSync21 } from "node:fs";
|
|
75979
76197
|
import { z as z119 } from "zod";
|
|
75980
76198
|
function discoveredWorkspaceName(registry, sessionName) {
|
|
@@ -76230,6 +76448,7 @@ async function createNativeTmuxServerOwner(options) {
|
|
|
76230
76448
|
observation: () => observationSelector ?? null,
|
|
76231
76449
|
runPinnedTmux: generationRun
|
|
76232
76450
|
}),
|
|
76451
|
+
splitLayoutStock: createStockSplitProbe({ runPinnedTmux: generationRun }),
|
|
76233
76452
|
createOwnedViewerAdapter: createOwnedViewerAdapterFactory({
|
|
76234
76453
|
environmentId: options.environmentId,
|
|
76235
76454
|
serverScope: { serverId: options.serverId, generation },
|
|
@@ -76307,7 +76526,7 @@ async function createNativeTmuxServerOwner(options) {
|
|
|
76307
76526
|
gap.reason === "overflow" ? "retention-overflow" : gap.reason === "hooks-replaced" ? "hooks-replaced" : "uncertain-consume"
|
|
76308
76527
|
);
|
|
76309
76528
|
},
|
|
76310
|
-
internalReadOwnerToken:
|
|
76529
|
+
internalReadOwnerToken: randomUUID36(),
|
|
76311
76530
|
registry: workspaceRegistry,
|
|
76312
76531
|
tmuxAuthority: authority2,
|
|
76313
76532
|
io: { runTmux: generationRunAsync },
|
|
@@ -76599,7 +76818,7 @@ var init_tmux_server_owner = __esm({
|
|
|
76599
76818
|
});
|
|
76600
76819
|
|
|
76601
76820
|
// packages/daemon/src/lib/tmux-server-owners.ts
|
|
76602
|
-
import { randomUUID as
|
|
76821
|
+
import { randomUUID as randomUUID37 } from "node:crypto";
|
|
76603
76822
|
var MAX_TMUX_SERVER_OWNERS, TmuxServerSelectorSchemaZ, TmuxServerRegistrationSchemaZ, TmuxServerScopeError, TmuxServerOwners;
|
|
76604
76823
|
var init_tmux_server_owners = __esm({
|
|
76605
76824
|
"packages/daemon/src/lib/tmux-server-owners.ts"() {
|
|
@@ -76671,7 +76890,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76671
76890
|
(other) => other !== entry && other.observation?.fingerprint === next.fingerprint && other.observation.valid()
|
|
76672
76891
|
);
|
|
76673
76892
|
if (duplicate) return;
|
|
76674
|
-
const scope2 = { serverId: entry.registration.serverId, generation:
|
|
76893
|
+
const scope2 = { serverId: entry.registration.serverId, generation: randomUUID37() };
|
|
76675
76894
|
let owner;
|
|
76676
76895
|
try {
|
|
76677
76896
|
owner = await this.options.create(entry.registration, scope2, next);
|
|
@@ -76690,7 +76909,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76690
76909
|
return this.#serial(async () => {
|
|
76691
76910
|
const registration = TmuxServerRegistrationSchemaZ.parse({
|
|
76692
76911
|
...input,
|
|
76693
|
-
serverId: input.serverId ?? `tmux-server.${
|
|
76912
|
+
serverId: input.serverId ?? `tmux-server.${randomUUID37().replaceAll("-", "")}`
|
|
76694
76913
|
});
|
|
76695
76914
|
const sameSelector = [...this.#entries.values()].find(
|
|
76696
76915
|
(entry2) => JSON.stringify(entry2.registration.selector) === JSON.stringify(registration.selector)
|
|
@@ -76791,7 +77010,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76791
77010
|
// packages/daemon/src/lib/tmux-server-registration.ts
|
|
76792
77011
|
import { execFile as execFile11 } from "node:child_process";
|
|
76793
77012
|
import { promisify as promisify2 } from "node:util";
|
|
76794
|
-
import { createHash as createHash24, randomUUID as
|
|
77013
|
+
import { createHash as createHash24, randomUUID as randomUUID38 } from "node:crypto";
|
|
76795
77014
|
import {
|
|
76796
77015
|
mkdirSync as mkdirSync22,
|
|
76797
77016
|
readFileSync as readFileSync24,
|
|
@@ -76813,7 +77032,7 @@ function readTmuxServerRegistrations(path2) {
|
|
|
76813
77032
|
function writeTmuxServerRegistrations(path2, registrations) {
|
|
76814
77033
|
const file = FileSchema2.parse({ version: 1, servers: registrations });
|
|
76815
77034
|
mkdirSync22(dirname29(path2), { recursive: true, mode: 448 });
|
|
76816
|
-
const temporary = `${path2}.${
|
|
77035
|
+
const temporary = `${path2}.${randomUUID38()}.tmp`;
|
|
76817
77036
|
try {
|
|
76818
77037
|
writeFileSync19(temporary, `${JSON.stringify(file, null, 2)}
|
|
76819
77038
|
`, { mode: 384, flag: "wx" });
|
|
@@ -77010,7 +77229,7 @@ var init_pane_stream_upgrade = __esm({
|
|
|
77010
77229
|
});
|
|
77011
77230
|
|
|
77012
77231
|
// packages/daemon/src/lib/embedded-tmux-server-owners.ts
|
|
77013
|
-
import { randomUUID as
|
|
77232
|
+
import { randomUUID as randomUUID39 } from "node:crypto";
|
|
77014
77233
|
import { join as join36 } from "node:path";
|
|
77015
77234
|
async function createEmbeddedTmuxServerOwners(options) {
|
|
77016
77235
|
const path2 = join36(options.stateDirectory, "tmux-servers.json");
|
|
@@ -77030,7 +77249,7 @@ async function createEmbeddedTmuxServerOwners(options) {
|
|
|
77030
77249
|
}
|
|
77031
77250
|
}
|
|
77032
77251
|
const defaultRegistration = established ?? {
|
|
77033
|
-
serverId: `tmux-server.${
|
|
77252
|
+
serverId: `tmux-server.${randomUUID39().replaceAll("-", "")}`,
|
|
77034
77253
|
label: "Default",
|
|
77035
77254
|
selector: options.defaultAuthority.socketSelector
|
|
77036
77255
|
};
|
|
@@ -77497,7 +77716,7 @@ var init_terminal_native_backing_route = __esm({
|
|
|
77497
77716
|
});
|
|
77498
77717
|
|
|
77499
77718
|
// packages/daemon/src/lib/embedded-daemon-lifecycle.ts
|
|
77500
|
-
async function startOwnedEmbeddedDaemon(options,
|
|
77719
|
+
async function startOwnedEmbeddedDaemon(options, start3) {
|
|
77501
77720
|
let closed = false;
|
|
77502
77721
|
let available = false;
|
|
77503
77722
|
let current;
|
|
@@ -77505,7 +77724,7 @@ async function startOwnedEmbeddedDaemon(options, start2) {
|
|
|
77505
77724
|
let stopping = null;
|
|
77506
77725
|
let pendingRequest = null;
|
|
77507
77726
|
const launch2 = async (nextOptions) => {
|
|
77508
|
-
const generation = await
|
|
77727
|
+
const generation = await start3({
|
|
77509
77728
|
...nextOptions,
|
|
77510
77729
|
requestRestart: (request3) => restart2(generation, request3)
|
|
77511
77730
|
});
|
|
@@ -81658,7 +81877,7 @@ var init_workspace_open2 = __esm({
|
|
|
81658
81877
|
});
|
|
81659
81878
|
|
|
81660
81879
|
// packages/daemon/src/lib/workspace-open-handoff.ts
|
|
81661
|
-
import { randomUUID as
|
|
81880
|
+
import { randomUUID as randomUUID40 } from "node:crypto";
|
|
81662
81881
|
var WorkspaceOpenHandoffError, WorkspaceOpenHandoffCoordinator;
|
|
81663
81882
|
var init_workspace_open_handoff2 = __esm({
|
|
81664
81883
|
"packages/daemon/src/lib/workspace-open-handoff.ts"() {
|
|
@@ -81722,7 +81941,7 @@ var init_workspace_open_handoff2 = __esm({
|
|
|
81722
81941
|
const preferredPaneId = "initialPaneId" in opened.resource ? opened.resource.initialPaneId : void 0;
|
|
81723
81942
|
const proof = await this.#deps.prepareRuntime(workspaceName, preferredPaneId);
|
|
81724
81943
|
this.#assertCurrent(ownerClientId, revision, expectedDaemonInstanceId);
|
|
81725
|
-
const token2 =
|
|
81944
|
+
const token2 = randomUUID40();
|
|
81726
81945
|
const result2 = {
|
|
81727
81946
|
operationId,
|
|
81728
81947
|
daemonInstanceId: this.#deps.daemonInstanceId,
|
|
@@ -82811,11 +83030,11 @@ function boundedCoordinate(value, path2) {
|
|
|
82811
83030
|
}
|
|
82812
83031
|
return Math.max(-APP_WINDOW_COORDINATE_LIMIT, Math.min(APP_WINDOW_COORDINATE_LIMIT, value));
|
|
82813
83032
|
}
|
|
82814
|
-
function boundedExtent(value,
|
|
83033
|
+
function boundedExtent(value, minimum2, path2) {
|
|
82815
83034
|
if (!Number.isFinite(value)) {
|
|
82816
83035
|
throw new AppWindowKernelError("INVALID_INPUT", path2, "extent must be finite");
|
|
82817
83036
|
}
|
|
82818
|
-
return Math.max(
|
|
83037
|
+
return Math.max(minimum2, Math.min(APP_WINDOW_COORDINATE_LIMIT, value));
|
|
82819
83038
|
}
|
|
82820
83039
|
function requireTimestamp(previous, value) {
|
|
82821
83040
|
let timestamp;
|
|
@@ -83597,7 +83816,7 @@ var init_terminal_attachment_upgrade = __esm({
|
|
|
83597
83816
|
});
|
|
83598
83817
|
|
|
83599
83818
|
// packages/daemon/src/terminal/graphics/native-surface-provider-channel.ts
|
|
83600
|
-
import { randomUUID as
|
|
83819
|
+
import { randomUUID as randomUUID41 } from "node:crypto";
|
|
83601
83820
|
import { z as z123 } from "zod";
|
|
83602
83821
|
var Register, Offer, WatchDemand, NativeSurfaceProviderChannel;
|
|
83603
83822
|
var init_native_surface_provider_channel = __esm({
|
|
@@ -83703,7 +83922,7 @@ var init_native_surface_provider_channel = __esm({
|
|
|
83703
83922
|
#open(context) {
|
|
83704
83923
|
if (this.#closed || this.#connections.size >= 32)
|
|
83705
83924
|
throw new Error("Native provider unavailable");
|
|
83706
|
-
const connection =
|
|
83925
|
+
const connection = randomUUID41();
|
|
83707
83926
|
this.#connections.set(connection, context);
|
|
83708
83927
|
return {
|
|
83709
83928
|
start: () => {
|
|
@@ -83851,7 +84070,7 @@ var init_active_projects = __esm({
|
|
|
83851
84070
|
});
|
|
83852
84071
|
|
|
83853
84072
|
// packages/daemon/src/lib/environment-identity.ts
|
|
83854
|
-
import { randomUUID as
|
|
84073
|
+
import { randomUUID as randomUUID42 } from "node:crypto";
|
|
83855
84074
|
import { linkSync as linkSync3, mkdirSync as mkdirSync24, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync21 } from "node:fs";
|
|
83856
84075
|
import { dirname as dirname32, join as join39 } from "node:path";
|
|
83857
84076
|
function environmentIdentityPath() {
|
|
@@ -83868,7 +84087,7 @@ function readPersistedEnvironmentId(path2) {
|
|
|
83868
84087
|
}
|
|
83869
84088
|
}
|
|
83870
84089
|
function persistEnvironmentId(path2, environmentId) {
|
|
83871
|
-
const temporary = `${path2}.${process.pid}.${
|
|
84090
|
+
const temporary = `${path2}.${process.pid}.${randomUUID42()}.tmp`;
|
|
83872
84091
|
try {
|
|
83873
84092
|
mkdirSync24(dirname32(path2), { recursive: true });
|
|
83874
84093
|
writeFileSync21(
|
|
@@ -83894,7 +84113,7 @@ function readOrMintEnvironmentId() {
|
|
|
83894
84113
|
rmSync4(path2, { force: true });
|
|
83895
84114
|
} catch {
|
|
83896
84115
|
}
|
|
83897
|
-
const minted =
|
|
84116
|
+
const minted = randomUUID42();
|
|
83898
84117
|
persistEnvironmentId(path2, minted);
|
|
83899
84118
|
return readPersistedEnvironmentId(path2) ?? minted;
|
|
83900
84119
|
}
|
|
@@ -84432,7 +84651,7 @@ var init_daemon_provenance = __esm({
|
|
|
84432
84651
|
});
|
|
84433
84652
|
|
|
84434
84653
|
// packages/daemon/src/lib/automation-operation-registry.ts
|
|
84435
|
-
import { createHash as createHash26, randomUUID as
|
|
84654
|
+
import { createHash as createHash26, randomUUID as randomUUID43 } from "node:crypto";
|
|
84436
84655
|
var AutomationOperationUnavailableError, AutomationOperationRegistry;
|
|
84437
84656
|
var init_automation_operation_registry = __esm({
|
|
84438
84657
|
"packages/daemon/src/lib/automation-operation-registry.ts"() {
|
|
@@ -84444,7 +84663,7 @@ var init_automation_operation_registry = __esm({
|
|
|
84444
84663
|
}
|
|
84445
84664
|
};
|
|
84446
84665
|
AutomationOperationRegistry = class {
|
|
84447
|
-
#generation =
|
|
84666
|
+
#generation = randomUUID43();
|
|
84448
84667
|
#entries = /* @__PURE__ */ new Map();
|
|
84449
84668
|
#capacity;
|
|
84450
84669
|
#retentionMs;
|
|
@@ -84464,7 +84683,7 @@ var init_automation_operation_registry = __esm({
|
|
|
84464
84683
|
this.#prune();
|
|
84465
84684
|
if (this.#entries.size >= this.#capacity)
|
|
84466
84685
|
throw new Error("Automation operation capacity reached");
|
|
84467
|
-
const operationId =
|
|
84686
|
+
const operationId = randomUUID43();
|
|
84468
84687
|
this.#entries.set(operationId, {
|
|
84469
84688
|
fingerprint: this.#fingerprint(canonicalIntent),
|
|
84470
84689
|
expiresAt: this.#now() + this.#retentionMs,
|
|
@@ -86151,7 +86370,7 @@ var init_workspace_admission_route = __esm({
|
|
|
86151
86370
|
});
|
|
86152
86371
|
|
|
86153
86372
|
// packages/daemon/src/lib/saved-machines.ts
|
|
86154
|
-
import { randomUUID as
|
|
86373
|
+
import { randomUUID as randomUUID44 } from "node:crypto";
|
|
86155
86374
|
import {
|
|
86156
86375
|
closeSync as closeSync9,
|
|
86157
86376
|
fstatSync as fstatSync7,
|
|
@@ -86221,7 +86440,7 @@ function persistSavedMachines(registry, path2) {
|
|
|
86221
86440
|
if (Buffer.byteLength(contents) > MAX_REGISTRY_BYTES)
|
|
86222
86441
|
throw new Error("Saved machine registry exceeds size limit");
|
|
86223
86442
|
mkdirSync25(dirname33(path2), { recursive: true });
|
|
86224
|
-
const temporary = `${path2}.${
|
|
86443
|
+
const temporary = `${path2}.${randomUUID44()}.tmp`;
|
|
86225
86444
|
try {
|
|
86226
86445
|
writeFileSync22(temporary, contents, { flag: "wx", mode: 384 });
|
|
86227
86446
|
renameSync15(temporary, path2);
|
|
@@ -86483,7 +86702,7 @@ import {
|
|
|
86483
86702
|
unlinkSync as unlinkSync8,
|
|
86484
86703
|
writeFileSync as writeFileSync23
|
|
86485
86704
|
} from "node:fs";
|
|
86486
|
-
import { randomUUID as
|
|
86705
|
+
import { randomUUID as randomUUID45 } from "node:crypto";
|
|
86487
86706
|
import { dirname as dirname34, join as join43 } from "node:path";
|
|
86488
86707
|
function fleetClientStatePath() {
|
|
86489
86708
|
return runtimeOwnedPath(join43(resolveRuntimeNamespace().registryDir, "fleet-view.json"));
|
|
@@ -86514,7 +86733,7 @@ function updateFleetClientState(change, path2 = fleetClientStatePath()) {
|
|
|
86514
86733
|
if (Buffer.byteLength(contents) > MAX_BYTES3)
|
|
86515
86734
|
throw new Error("Fleet view state exceeds its size limit");
|
|
86516
86735
|
mkdirSync26(dirname34(path2), { recursive: true });
|
|
86517
|
-
const temporary = `${path2}.${
|
|
86736
|
+
const temporary = `${path2}.${randomUUID45()}.tmp`;
|
|
86518
86737
|
try {
|
|
86519
86738
|
writeFileSync23(temporary, contents, { flag: "wx", mode: 384 });
|
|
86520
86739
|
renameSync16(temporary, path2);
|
|
@@ -90910,14 +91129,14 @@ var init_workspace_files_authority = __esm({
|
|
|
90910
91129
|
// packages/daemon/src/command-center/resources/workspace-changes-git.ts
|
|
90911
91130
|
function splitNul(buffer) {
|
|
90912
91131
|
const tokens = [];
|
|
90913
|
-
let
|
|
91132
|
+
let start3 = 0;
|
|
90914
91133
|
for (let i = 0; i < buffer.length; i += 1) {
|
|
90915
91134
|
if (buffer[i] === 0) {
|
|
90916
|
-
tokens.push(buffer.toString("utf8",
|
|
90917
|
-
|
|
91135
|
+
tokens.push(buffer.toString("utf8", start3, i));
|
|
91136
|
+
start3 = i + 1;
|
|
90918
91137
|
}
|
|
90919
91138
|
}
|
|
90920
|
-
if (
|
|
91139
|
+
if (start3 < buffer.length) tokens.push(buffer.toString("utf8", start3));
|
|
90921
91140
|
return tokens;
|
|
90922
91141
|
}
|
|
90923
91142
|
function mapStatusLetter(letter) {
|
|
@@ -92889,7 +93108,7 @@ function projectApplicationShellAgentGraphOverlay(input) {
|
|
|
92889
93108
|
}
|
|
92890
93109
|
}
|
|
92891
93110
|
const groundTruthPairs = /* @__PURE__ */ new Set();
|
|
92892
|
-
for (const
|
|
93111
|
+
for (const edge of edges) groundTruthPairs.add(pairKey(edge.from, edge.to));
|
|
92893
93112
|
const groundTruthGroupMembers = groups.map((group) => new Set(group.memberWindowIds));
|
|
92894
93113
|
const emittedInferredPairs = /* @__PURE__ */ new Set();
|
|
92895
93114
|
const emitInferred = (from, to, kind) => {
|
|
@@ -93364,7 +93583,7 @@ __export(widget_asset_store_exports, {
|
|
|
93364
93583
|
publishWidgetAsset: () => publishWidgetAsset,
|
|
93365
93584
|
readWidgetAsset: () => readWidgetAsset
|
|
93366
93585
|
});
|
|
93367
|
-
import { createHash as createHash33, randomUUID as
|
|
93586
|
+
import { createHash as createHash33, randomUUID as randomUUID47 } from "node:crypto";
|
|
93368
93587
|
import {
|
|
93369
93588
|
chmodSync as chmodSync7,
|
|
93370
93589
|
existsSync as existsSync33,
|
|
@@ -93465,11 +93684,11 @@ function publishWidgetAsset(bytes, options) {
|
|
|
93465
93684
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
93466
93685
|
};
|
|
93467
93686
|
if (!existsSync33(paths.data)) {
|
|
93468
|
-
const temporary = join47(root, `.${assetId}.${
|
|
93687
|
+
const temporary = join47(root, `.${assetId}.${randomUUID47()}.bin`);
|
|
93469
93688
|
writeFileSync25(temporary, bytes, { mode: 384, flag: "wx" });
|
|
93470
93689
|
renameSync18(temporary, paths.data);
|
|
93471
93690
|
}
|
|
93472
|
-
const metadataTemporary = join47(root, `.${assetId}.${
|
|
93691
|
+
const metadataTemporary = join47(root, `.${assetId}.${randomUUID47()}.json`);
|
|
93473
93692
|
writeFileSync25(metadataTemporary, `${JSON.stringify(metadata)}
|
|
93474
93693
|
`, { mode: 384, flag: "wx" });
|
|
93475
93694
|
renameSync18(metadataTemporary, paths.metadata);
|
|
@@ -93541,7 +93760,7 @@ import { z as z130 } from "zod";
|
|
|
93541
93760
|
import { realpathSync as realpathSync25 } from "node:fs";
|
|
93542
93761
|
import { homedir as homedir7 } from "node:os";
|
|
93543
93762
|
import { isAbsolute as isAbsolute28, resolve as pathResolve } from "node:path";
|
|
93544
|
-
import { randomUUID as
|
|
93763
|
+
import { randomUUID as randomUUID48 } from "node:crypto";
|
|
93545
93764
|
import { WebSocketServer as WebSocketServer4 } from "ws";
|
|
93546
93765
|
function bearerToken(authHeader) {
|
|
93547
93766
|
if (!authHeader?.startsWith("Bearer ")) return null;
|
|
@@ -93679,7 +93898,7 @@ function createApp(options = {}) {
|
|
|
93679
93898
|
const authService = options.authService ?? new AuthService();
|
|
93680
93899
|
const daemonIdentity = options.daemonIdentity ?? {
|
|
93681
93900
|
productVersion: "0.0.0",
|
|
93682
|
-
instanceId:
|
|
93901
|
+
instanceId: randomUUID48(),
|
|
93683
93902
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
93684
93903
|
};
|
|
93685
93904
|
const daemonInstanceIdentity = DaemonInstanceIdentitySchemaZ.parse({
|
|
@@ -94253,7 +94472,7 @@ function createApp(options = {}) {
|
|
|
94253
94472
|
});
|
|
94254
94473
|
scripted = true;
|
|
94255
94474
|
}
|
|
94256
|
-
if (!id2) id2 =
|
|
94475
|
+
if (!id2) id2 = randomUUID48();
|
|
94257
94476
|
try {
|
|
94258
94477
|
const upsertInput = {
|
|
94259
94478
|
id: id2,
|
|
@@ -94678,7 +94897,7 @@ function createApp(options = {}) {
|
|
|
94678
94897
|
if (!existsSync34(parsed.data.dir)) {
|
|
94679
94898
|
return c.json({ error: `Directory "${parsed.data.dir}" does not exist` }, 400);
|
|
94680
94899
|
}
|
|
94681
|
-
const jobId =
|
|
94900
|
+
const jobId = randomUUID48();
|
|
94682
94901
|
const command3 = process.env.TMUX_IDE_INIT_COMMAND ?? "tmux-ide";
|
|
94683
94902
|
void (async () => {
|
|
94684
94903
|
try {
|
|
@@ -94982,7 +95201,7 @@ var init_types = __esm({
|
|
|
94982
95201
|
// packages/daemon/src/lib/daemon-embed.ts
|
|
94983
95202
|
import { dirname as dirname39, join as join49 } from "node:path";
|
|
94984
95203
|
import { execFileSync as execFileSync21 } from "node:child_process";
|
|
94985
|
-
import { randomBytes as randomBytes9, randomUUID as
|
|
95204
|
+
import { randomBytes as randomBytes9, randomUUID as randomUUID49 } from "node:crypto";
|
|
94986
95205
|
import { createWriteStream } from "node:fs";
|
|
94987
95206
|
import { createServer as createServer2 } from "node:http";
|
|
94988
95207
|
import { createRequire as createRequire3 } from "node:module";
|
|
@@ -95681,7 +95900,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95681
95900
|
validatePort(port);
|
|
95682
95901
|
const dir = process.cwd();
|
|
95683
95902
|
const productVersion = resolveDaemonProductVersion(opts.productVersion);
|
|
95684
|
-
const instanceId =
|
|
95903
|
+
const instanceId = randomUUID49();
|
|
95685
95904
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
95686
95905
|
const environmentId = readOrMintEnvironmentId();
|
|
95687
95906
|
const workspaceRegistry = getDefaultWorkspaceRegistry();
|
|
@@ -95741,7 +95960,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95741
95960
|
for (const workspace of workspaceRegistry.list()) {
|
|
95742
95961
|
await workspacePromotion.promote({
|
|
95743
95962
|
expectedDaemonInstanceId: instanceId,
|
|
95744
|
-
operationId:
|
|
95963
|
+
operationId: randomUUID49(),
|
|
95745
95964
|
intent: { sessionId: fleetSessionIdForName(workspace.sessionName) }
|
|
95746
95965
|
});
|
|
95747
95966
|
}
|
|
@@ -95945,11 +96164,11 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95945
96164
|
// retain tens of thousands of frozen span objects or induce GC
|
|
95946
96165
|
// pauses on the daemon's input/output event loop.
|
|
95947
96166
|
capacity: 1024,
|
|
95948
|
-
onSpan: (
|
|
96167
|
+
onSpan: (span2) => {
|
|
95949
96168
|
runtimeTraceWriter?.append(() => ({
|
|
95950
96169
|
version: 1,
|
|
95951
96170
|
type: "performance.stage",
|
|
95952
|
-
...
|
|
96171
|
+
...span2
|
|
95953
96172
|
}));
|
|
95954
96173
|
}
|
|
95955
96174
|
}) : void 0;
|
|
@@ -95964,7 +96183,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95964
96183
|
};
|
|
95965
96184
|
const diagnostics = {
|
|
95966
96185
|
nowMicros: () => Math.floor(performance3.now() * 1e3),
|
|
95967
|
-
createTraceId:
|
|
96186
|
+
createTraceId: randomUUID49,
|
|
95968
96187
|
publish: publishObserverDiagnostic
|
|
95969
96188
|
};
|
|
95970
96189
|
externalInteractionObserver.setDiagnostics(diagnostics);
|
|
@@ -96010,6 +96229,9 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
96010
96229
|
observation: () => observationSelector ?? null,
|
|
96011
96230
|
runPinnedTmux: nativeGenerationTmuxRunner
|
|
96012
96231
|
}),
|
|
96232
|
+
splitLayoutStock: createStockSplitProbe({
|
|
96233
|
+
runPinnedTmux: nativeGenerationTmuxRunner
|
|
96234
|
+
}),
|
|
96013
96235
|
createOwnedViewerAdapter: () => ownedViewerFactory?.(),
|
|
96014
96236
|
nativeServerIdentity: initialNativeServerIdentity,
|
|
96015
96237
|
executable: tmuxAuthority.executablePath,
|
|
@@ -96037,7 +96259,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
96037
96259
|
const consumer = sessionRuntimeRegistry.connect(
|
|
96038
96260
|
record2.sessionName,
|
|
96039
96261
|
"workspace-open-prepare",
|
|
96040
|
-
`workspace-open-${
|
|
96262
|
+
`workspace-open-${randomUUID49()}`
|
|
96041
96263
|
);
|
|
96042
96264
|
try {
|
|
96043
96265
|
const layout = await consumer.describe();
|
|
@@ -98164,7 +98386,7 @@ import {
|
|
|
98164
98386
|
realpathSync as realpathSync28,
|
|
98165
98387
|
linkSync as linkSync4
|
|
98166
98388
|
} from "node:fs";
|
|
98167
|
-
import { randomUUID as
|
|
98389
|
+
import { randomUUID as randomUUID50 } from "node:crypto";
|
|
98168
98390
|
import { dirname as dirname41, join as join54 } from "node:path";
|
|
98169
98391
|
import { homedir as homedir9 } from "node:os";
|
|
98170
98392
|
import { z as z131 } from "zod";
|
|
@@ -98306,7 +98528,7 @@ async function manageDaemonService(action, executable, deps2 = defaults()) {
|
|
|
98306
98528
|
);
|
|
98307
98529
|
wroteRecord = true;
|
|
98308
98530
|
mkdirSync30(dirname41(plan.unitPath), { recursive: true, mode: 448 });
|
|
98309
|
-
const unitStage = `${plan.unitPath}.${
|
|
98531
|
+
const unitStage = `${plan.unitPath}.${randomUUID50()}.tmp`;
|
|
98310
98532
|
writeFileSync28(unitStage, contents, { flag: "wx", mode: 384 });
|
|
98311
98533
|
try {
|
|
98312
98534
|
linkSync4(unitStage, plan.unitPath);
|
|
@@ -98330,7 +98552,7 @@ async function manageDaemonService(action, executable, deps2 = defaults()) {
|
|
|
98330
98552
|
refused("Service manager has not confirmed the daemon stopped; reservation retained");
|
|
98331
98553
|
assertFiles(allowMissingUnit);
|
|
98332
98554
|
const removalRecord = JSON.stringify({ ...record2, removing: true }) + "\n";
|
|
98333
|
-
const temporaryRecord = `${plan.recordPath}.${
|
|
98555
|
+
const temporaryRecord = `${plan.recordPath}.${randomUUID50()}.tmp`;
|
|
98334
98556
|
writeFileSync28(temporaryRecord, removalRecord, { flag: "wx", mode: 384 });
|
|
98335
98557
|
try {
|
|
98336
98558
|
if (ownedFile(plan.recordPath) !== previousRecord)
|
|
@@ -98987,11 +99209,13 @@ __export(doctor_exports, {
|
|
|
98987
99209
|
hooksTargetRow: () => hooksTargetRow,
|
|
98988
99210
|
nodeVersionRow: () => nodeVersionRow,
|
|
98989
99211
|
notifierRow: () => notifierRow,
|
|
99212
|
+
tmuxFeaturesRow: () => tmuxFeaturesRow,
|
|
98990
99213
|
workspaceConfigRow: () => workspaceConfigRow
|
|
98991
99214
|
});
|
|
98992
99215
|
import { execSync as execSync3, execFileSync as execFileSync22 } from "node:child_process";
|
|
98993
|
-
import { accessSync as accessSync12, constants as constants19, existsSync as existsSync37 } from "node:fs";
|
|
98994
|
-
import {
|
|
99216
|
+
import { accessSync as accessSync12, constants as constants19, existsSync as existsSync37, mkdtempSync, rmSync as rmSync7 } from "node:fs";
|
|
99217
|
+
import { tmpdir } from "node:os";
|
|
99218
|
+
import { resolve as resolve39, dirname as dirname43, join as join56 } from "node:path";
|
|
98995
99219
|
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
98996
99220
|
function agentIntegrationRows(agents) {
|
|
98997
99221
|
return presentAgents(agents).map((agent) => {
|
|
@@ -99091,6 +99315,83 @@ function check(label4, fn, { optional = false } = {}) {
|
|
|
99091
99315
|
return { label: label4, pass: false, detail: e.message, optional };
|
|
99092
99316
|
}
|
|
99093
99317
|
}
|
|
99318
|
+
function nativeCommands(probe) {
|
|
99319
|
+
const ask = (command3) => {
|
|
99320
|
+
try {
|
|
99321
|
+
return { output: probe([command3, "-V"]) };
|
|
99322
|
+
} catch (error) {
|
|
99323
|
+
const failure4 = error;
|
|
99324
|
+
return { failure: String(failure4.stderr ?? failure4.message ?? "") };
|
|
99325
|
+
}
|
|
99326
|
+
};
|
|
99327
|
+
const split = ask("tmux-ide-resize-split");
|
|
99328
|
+
const events = ask("tmux-ide-events");
|
|
99329
|
+
const failures = [split.failure, events.failure].filter((text2) => text2 !== void 0);
|
|
99330
|
+
if (failures.some((text2) => /no server running|error connecting/u.test(text2)))
|
|
99331
|
+
return "no-server";
|
|
99332
|
+
const refused3 = (answer, command3) => answer.failure !== void 0 && UNKNOWN(command3).test(answer.failure);
|
|
99333
|
+
if (refused3(split, "tmux-ide-resize-split") && refused3(events, "tmux-ide-events")) return "stock";
|
|
99334
|
+
if (split.output !== void 0 && events.output !== void 0) {
|
|
99335
|
+
try {
|
|
99336
|
+
return nativeSplitCapability(split.output) ? "full" : "partial";
|
|
99337
|
+
} catch {
|
|
99338
|
+
return "partial";
|
|
99339
|
+
}
|
|
99340
|
+
}
|
|
99341
|
+
return failures.length === 2 ? "unknown" : "partial";
|
|
99342
|
+
}
|
|
99343
|
+
function tmuxFeaturesRow(probeServer, probeBinary) {
|
|
99344
|
+
let answer = nativeCommands(probeServer);
|
|
99345
|
+
if (answer === "no-server") answer = nativeCommands(probeBinary);
|
|
99346
|
+
const details = {
|
|
99347
|
+
full: "bundled tmux: full features",
|
|
99348
|
+
stock: "stock tmux: reduced features",
|
|
99349
|
+
partial: "this tmux has only some tmux-ide commands: no pane dividers",
|
|
99350
|
+
"no-server": "could not read the tmux server's features",
|
|
99351
|
+
unknown: "could not read the tmux server's features"
|
|
99352
|
+
};
|
|
99353
|
+
return {
|
|
99354
|
+
label: "tmux features",
|
|
99355
|
+
pass: answer === "full" || answer === "stock",
|
|
99356
|
+
detail: details[answer],
|
|
99357
|
+
optional: true
|
|
99358
|
+
};
|
|
99359
|
+
}
|
|
99360
|
+
function runTmuxFeatureProbes(executable) {
|
|
99361
|
+
const run = (prefix) => (args) => execFileSync22(executable, [...prefix, ...args], {
|
|
99362
|
+
encoding: "utf8",
|
|
99363
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
99364
|
+
timeout: 3e3
|
|
99365
|
+
});
|
|
99366
|
+
const socketPath = process.env[TMUX_SOCKET_PATH_ENV];
|
|
99367
|
+
const socketName = process.env.TMUX_IDE_TMUX_SOCKET_NAME;
|
|
99368
|
+
const server = socketPath ? ["-S", socketPath] : socketName ? ["-L", socketName] : [];
|
|
99369
|
+
const cleanups = [];
|
|
99370
|
+
const probeBinary = /* @__PURE__ */ (() => {
|
|
99371
|
+
let scratch = null;
|
|
99372
|
+
return (args) => {
|
|
99373
|
+
scratch ??= (() => {
|
|
99374
|
+
const dir = mkdtempSync(join56(tmpdir(), "tmi-doctor-"));
|
|
99375
|
+
const prefix = ["-S", join56(dir, "s"), "-f", "/dev/null"];
|
|
99376
|
+
cleanups.push(() => {
|
|
99377
|
+
try {
|
|
99378
|
+
run(prefix)(["kill-server"]);
|
|
99379
|
+
} catch {
|
|
99380
|
+
}
|
|
99381
|
+
rmSync7(dir, { recursive: true, force: true });
|
|
99382
|
+
});
|
|
99383
|
+
run(prefix)(["new-session", "-d", "-s", "probe"]);
|
|
99384
|
+
return { dir, prefix };
|
|
99385
|
+
})();
|
|
99386
|
+
return run(scratch.prefix)(args);
|
|
99387
|
+
};
|
|
99388
|
+
})();
|
|
99389
|
+
try {
|
|
99390
|
+
return tmuxFeaturesRow(run(server), probeBinary);
|
|
99391
|
+
} finally {
|
|
99392
|
+
for (const cleanup of cleanups) cleanup();
|
|
99393
|
+
}
|
|
99394
|
+
}
|
|
99094
99395
|
function nodeVersionRow(version) {
|
|
99095
99396
|
const major = Number(version.split(".")[0]);
|
|
99096
99397
|
const pass = Number.isInteger(major) && major >= 20;
|
|
@@ -99131,6 +99432,10 @@ async function doctor({
|
|
|
99131
99432
|
return `${version} (${executable})`;
|
|
99132
99433
|
})
|
|
99133
99434
|
);
|
|
99435
|
+
try {
|
|
99436
|
+
checks.push(runTmuxFeatureProbes(resolveTmuxExecutable()));
|
|
99437
|
+
} catch {
|
|
99438
|
+
}
|
|
99134
99439
|
checks.push(nodeVersionRow(process.versions.node));
|
|
99135
99440
|
checks.push(
|
|
99136
99441
|
check(
|
|
@@ -99273,11 +99578,14 @@ async function doctor({
|
|
|
99273
99578
|
}
|
|
99274
99579
|
if (!allPass) process.exitCode = 1;
|
|
99275
99580
|
}
|
|
99581
|
+
var UNKNOWN;
|
|
99276
99582
|
var init_doctor = __esm({
|
|
99277
99583
|
"packages/daemon/src/doctor.ts"() {
|
|
99278
99584
|
"use strict";
|
|
99279
99585
|
init_tmux_version();
|
|
99280
99586
|
init_tmux_client_execution();
|
|
99587
|
+
init_runtime_namespace();
|
|
99588
|
+
init_native_split_resize();
|
|
99281
99589
|
init_update_check();
|
|
99282
99590
|
init_skill_sync();
|
|
99283
99591
|
init_agent_discovery();
|
|
@@ -99286,6 +99594,7 @@ var init_doctor = __esm({
|
|
|
99286
99594
|
init_notify();
|
|
99287
99595
|
init_resolved_config();
|
|
99288
99596
|
init_daemon_provenance();
|
|
99597
|
+
UNKNOWN = (command3) => new RegExp(`^unknown command: ${command3}$`, "mu");
|
|
99289
99598
|
}
|
|
99290
99599
|
});
|
|
99291
99600
|
|
|
@@ -100431,7 +100740,7 @@ __export(tmux_servers_cli_exports, {
|
|
|
100431
100740
|
parseTmuxServersOperation: () => parseTmuxServersOperation,
|
|
100432
100741
|
runTmuxServersCli: () => runTmuxServersCli
|
|
100433
100742
|
});
|
|
100434
|
-
import { randomUUID as
|
|
100743
|
+
import { randomUUID as randomUUID51 } from "node:crypto";
|
|
100435
100744
|
function parseTmuxServersOperation(options) {
|
|
100436
100745
|
const command3 = options.command ?? "list";
|
|
100437
100746
|
if (options.ssh !== void 0) SavedMachineSchema.shape.sshTarget.parse(options.ssh);
|
|
@@ -100472,7 +100781,7 @@ function parseTmuxServersOperation(options) {
|
|
|
100472
100781
|
);
|
|
100473
100782
|
}
|
|
100474
100783
|
async function connectTmuxServersCli(options) {
|
|
100475
|
-
const hostClientId =
|
|
100784
|
+
const hostClientId = randomUUID51();
|
|
100476
100785
|
if (options.ssh !== void 0) {
|
|
100477
100786
|
const transport = await openSshDaemonTransport({ alias: options.ssh });
|
|
100478
100787
|
try {
|
|
@@ -100541,7 +100850,7 @@ async function runTmuxServersCli(options, connect4) {
|
|
|
100541
100850
|
generation: server.generation
|
|
100542
100851
|
});
|
|
100543
100852
|
try {
|
|
100544
|
-
return operation.command === "create" ? await client.createSession(
|
|
100853
|
+
return operation.command === "create" ? await client.createSession(randomUUID51(), operation.input) : await client.sessions();
|
|
100545
100854
|
} finally {
|
|
100546
100855
|
client.dispose();
|
|
100547
100856
|
}
|
|
@@ -100686,7 +100995,7 @@ __export(machines_exports, {
|
|
|
100686
100995
|
machines: () => machines
|
|
100687
100996
|
});
|
|
100688
100997
|
import { readFileSync as readFileSync38, statSync as statSync22 } from "node:fs";
|
|
100689
|
-
import { randomUUID as
|
|
100998
|
+
import { randomUUID as randomUUID52 } from "node:crypto";
|
|
100690
100999
|
async function machines(command3, argument, options) {
|
|
100691
101000
|
const current = loadSavedMachines();
|
|
100692
101001
|
if ((command3 === "enable" || command3 === "disable" || command3 === "remove" || command3 === "edit") && argument) {
|
|
@@ -100770,7 +101079,7 @@ async function machines(command3, argument, options) {
|
|
|
100770
101079
|
version: 1,
|
|
100771
101080
|
machines: [
|
|
100772
101081
|
existing ?? SavedMachineSchema.parse({
|
|
100773
|
-
id:
|
|
101082
|
+
id: randomUUID52(),
|
|
100774
101083
|
label: options.label ?? argument,
|
|
100775
101084
|
sshTarget: argument,
|
|
100776
101085
|
enabled: true
|
|
@@ -102010,7 +102319,7 @@ import {
|
|
|
102010
102319
|
accessSync as accessSync13,
|
|
102011
102320
|
constants as constants20
|
|
102012
102321
|
} from "node:fs";
|
|
102013
|
-
import { basename as basename21, delimiter as delimiter5, dirname as dirname45, join as
|
|
102322
|
+
import { basename as basename21, delimiter as delimiter5, dirname as dirname45, join as join57 } from "node:path";
|
|
102014
102323
|
function isOptOut(value) {
|
|
102015
102324
|
if (value === false || value === 0) return true;
|
|
102016
102325
|
return typeof value === "string" && /^\s*(0|false|off|no)\s*$/iu.test(value);
|
|
@@ -102058,8 +102367,8 @@ function agentTeamsPaths() {
|
|
|
102058
102367
|
function claudeOnPath2(path2 = process.env.PATH ?? "") {
|
|
102059
102368
|
return path2.split(delimiter5).filter(Boolean).some((dir) => {
|
|
102060
102369
|
try {
|
|
102061
|
-
accessSync13(
|
|
102062
|
-
return statSync23(
|
|
102370
|
+
accessSync13(join57(dir, "claude"), constants20.X_OK);
|
|
102371
|
+
return statSync23(join57(dir, "claude")).isFile();
|
|
102063
102372
|
} catch {
|
|
102064
102373
|
return false;
|
|
102065
102374
|
}
|
|
@@ -102084,7 +102393,7 @@ function existingBackup(settingsPath) {
|
|
|
102084
102393
|
const prefix = `${basename21(settingsPath)}${BACKUP_INFIX}`;
|
|
102085
102394
|
try {
|
|
102086
102395
|
const found = readdirSync11(dir).find((name) => name.startsWith(prefix));
|
|
102087
|
-
return found ?
|
|
102396
|
+
return found ? join57(dir, found) : null;
|
|
102088
102397
|
} catch {
|
|
102089
102398
|
return null;
|
|
102090
102399
|
}
|
|
@@ -102100,7 +102409,7 @@ function writeSettings(path2, settings, exists) {
|
|
|
102100
102409
|
copyFileSync3(path2, backup);
|
|
102101
102410
|
}
|
|
102102
102411
|
}
|
|
102103
|
-
const temporary =
|
|
102412
|
+
const temporary = join57(dirname45(path2), `.${basename21(path2)}.tmux-ide-${process.pid}.tmp`);
|
|
102104
102413
|
try {
|
|
102105
102414
|
writeFileSync30(temporary, `${JSON.stringify(settings, null, 2)}
|
|
102106
102415
|
`, { mode: 384 });
|
|
@@ -102241,7 +102550,7 @@ __export(worktree_exports, {
|
|
|
102241
102550
|
worktreeSessionName: () => worktreeSessionName
|
|
102242
102551
|
});
|
|
102243
102552
|
import { execFileSync as execFileSync26 } from "node:child_process";
|
|
102244
|
-
import { basename as basename22, dirname as dirname46, isAbsolute as isAbsolute32, join as
|
|
102553
|
+
import { basename as basename22, dirname as dirname46, isAbsolute as isAbsolute32, join as join58, resolve as resolve43 } from "node:path";
|
|
102245
102554
|
function sanitizeForTmux(part) {
|
|
102246
102555
|
return part.replace(/[.:/\s]+/g, "-");
|
|
102247
102556
|
}
|
|
@@ -102250,11 +102559,11 @@ function worktreeSessionName(project, branch) {
|
|
|
102250
102559
|
}
|
|
102251
102560
|
function defaultWorktreeBaseDir(repoDir) {
|
|
102252
102561
|
const abs = resolve43(repoDir);
|
|
102253
|
-
return
|
|
102562
|
+
return join58(dirname46(abs), `${basename22(abs)}-worktrees`);
|
|
102254
102563
|
}
|
|
102255
102564
|
function worktreePath(repoDir, branch, configuredDir) {
|
|
102256
102565
|
const base2 = configuredDir && configuredDir.length > 0 ? isAbsolute32(configuredDir) ? configuredDir : resolve43(repoDir, configuredDir) : defaultWorktreeBaseDir(repoDir);
|
|
102257
|
-
return
|
|
102566
|
+
return join58(base2, branch);
|
|
102258
102567
|
}
|
|
102259
102568
|
function parseWorktreeList(porcelain) {
|
|
102260
102569
|
const entries = [];
|
|
@@ -102388,9 +102697,9 @@ var init_worktree = __esm({
|
|
|
102388
102697
|
});
|
|
102389
102698
|
|
|
102390
102699
|
// packages/daemon/src/lib/managed-installer-update.ts
|
|
102391
|
-
import { mkdtempSync, readFileSync as readFileSync40, realpathSync as realpathSync29, rmSync as
|
|
102392
|
-
import { dirname as dirname47, join as
|
|
102393
|
-
import { tmpdir } from "node:os";
|
|
102700
|
+
import { mkdtempSync as mkdtempSync2, readFileSync as readFileSync40, realpathSync as realpathSync29, rmSync as rmSync8 } from "node:fs";
|
|
102701
|
+
import { dirname as dirname47, join as join59 } from "node:path";
|
|
102702
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
102394
102703
|
import { execFileSync as execFileSync27 } from "node:child_process";
|
|
102395
102704
|
function managedInstallerPrefix(cliPath) {
|
|
102396
102705
|
const match = /^(.*)\/share\/tmux-ide\/releases\/(install-[A-Za-z0-9]{6})\/npm\/lib\/node_modules\/tmux-ide\/bin$/.exec(
|
|
@@ -102398,16 +102707,16 @@ function managedInstallerPrefix(cliPath) {
|
|
|
102398
102707
|
);
|
|
102399
102708
|
if (!match) return null;
|
|
102400
102709
|
const prefix = match[1] || "/";
|
|
102401
|
-
const root =
|
|
102402
|
-
const release =
|
|
102710
|
+
const root = join59(prefix, "share/tmux-ide");
|
|
102711
|
+
const release = join59(root, "releases", match[2]);
|
|
102403
102712
|
try {
|
|
102404
|
-
if (realpathSync29(
|
|
102713
|
+
if (realpathSync29(join59(root, "current")) !== release) return null;
|
|
102405
102714
|
if (realpathSync29(release) !== release) return null;
|
|
102406
|
-
if (readFileSync40(
|
|
102407
|
-
if (readFileSync40(
|
|
102408
|
-
if (!readFileSync40(
|
|
102715
|
+
if (readFileSync40(join59(root, "installer-v1"), "utf8") !== "1\n") return null;
|
|
102716
|
+
if (readFileSync40(join59(release, ".installer-release-v1"), "utf8") !== "1\n") return null;
|
|
102717
|
+
if (!readFileSync40(join59(prefix, "bin/tmux-ide"), "utf8").split("\n").includes("# tmux-ide universal installer v1"))
|
|
102409
102718
|
return null;
|
|
102410
|
-
if (JSON.parse(readFileSync40(
|
|
102719
|
+
if (JSON.parse(readFileSync40(join59(dirname47(cliPath), "package.json"), "utf8")).name !== "tmux-ide")
|
|
102411
102720
|
return null;
|
|
102412
102721
|
return prefix;
|
|
102413
102722
|
} catch {
|
|
@@ -102415,8 +102724,8 @@ function managedInstallerPrefix(cliPath) {
|
|
|
102415
102724
|
}
|
|
102416
102725
|
}
|
|
102417
102726
|
function runManagedInstallerUpdate(prefix, channel, json3, execute2 = execFileSync27) {
|
|
102418
|
-
const temporary =
|
|
102419
|
-
const script =
|
|
102727
|
+
const temporary = mkdtempSync2(join59(tmpdir2(), "tmux-ide-update-"));
|
|
102728
|
+
const script = join59(temporary, "install.sh");
|
|
102420
102729
|
try {
|
|
102421
102730
|
execute2(
|
|
102422
102731
|
"curl",
|
|
@@ -102446,7 +102755,7 @@ function runManagedInstallerUpdate(prefix, channel, json3, execute2 = execFileSy
|
|
|
102446
102755
|
stdio: json3 ? ["ignore", 2, 2] : "inherit"
|
|
102447
102756
|
});
|
|
102448
102757
|
} finally {
|
|
102449
|
-
|
|
102758
|
+
rmSync8(temporary, { recursive: true, force: true });
|
|
102450
102759
|
}
|
|
102451
102760
|
}
|
|
102452
102761
|
var MANAGED_INSTALLER_URL;
|
|
@@ -102459,7 +102768,7 @@ var init_managed_installer_update = __esm({
|
|
|
102459
102768
|
|
|
102460
102769
|
// packages/daemon/src/lib/install-origin.ts
|
|
102461
102770
|
import { existsSync as existsSync39, readFileSync as readFileSync41, realpathSync as realpathSync30 } from "node:fs";
|
|
102462
|
-
import { dirname as dirname48, join as
|
|
102771
|
+
import { dirname as dirname48, join as join60 } from "node:path";
|
|
102463
102772
|
import { fileURLToPath as fileURLToPath14 } from "node:url";
|
|
102464
102773
|
function detectPackageManager(path2) {
|
|
102465
102774
|
if (/\/share\/tmux-ide\/releases\/install-[^/]+\/npm\/lib\/node_modules\/tmux-ide\/bin$/.test(path2))
|
|
@@ -102476,9 +102785,9 @@ function findGitCheckoutRoot(startDir) {
|
|
|
102476
102785
|
let dir = startDir;
|
|
102477
102786
|
for (; ; ) {
|
|
102478
102787
|
if (dir.endsWith("/node_modules")) return null;
|
|
102479
|
-
if (existsSync39(
|
|
102788
|
+
if (existsSync39(join60(dir, ".git"))) {
|
|
102480
102789
|
try {
|
|
102481
|
-
if (JSON.parse(readFileSync41(
|
|
102790
|
+
if (JSON.parse(readFileSync41(join60(dir, "package.json"), "utf8")).name === "tmux-ide")
|
|
102482
102791
|
return dir;
|
|
102483
102792
|
} catch {
|
|
102484
102793
|
}
|
|
@@ -102499,7 +102808,7 @@ function installOrigin(cliDir = dirname48(fileURLToPath14(import.meta.url))) {
|
|
|
102499
102808
|
let detected2 = detectPackageManager(path2);
|
|
102500
102809
|
if (detected2 === "npm" || detected2 === "pnpm" || detected2 === "bun") {
|
|
102501
102810
|
try {
|
|
102502
|
-
if (JSON.parse(readFileSync41(
|
|
102811
|
+
if (JSON.parse(readFileSync41(join60(path2, "../package.json"), "utf8")).name !== "tmux-ide")
|
|
102503
102812
|
detected2 = "unknown";
|
|
102504
102813
|
} catch {
|
|
102505
102814
|
detected2 = "unknown";
|
|
@@ -102525,7 +102834,7 @@ __export(update_exports, {
|
|
|
102525
102834
|
runUpdate: () => runUpdate
|
|
102526
102835
|
});
|
|
102527
102836
|
import { realpathSync as realpathSync31 } from "node:fs";
|
|
102528
|
-
import { dirname as dirname49, join as
|
|
102837
|
+
import { dirname as dirname49, join as join61 } from "node:path";
|
|
102529
102838
|
import { execFileSync as execFileSync28 } from "node:child_process";
|
|
102530
102839
|
function planUpdate(input) {
|
|
102531
102840
|
const current = input.currentVersion ?? getCurrentVersion();
|
|
@@ -102615,7 +102924,7 @@ function runUpdate({ cliDir, dryRun, json: json3 = false }, dependencies = {}) {
|
|
|
102615
102924
|
plan.executable === "bun" ? ["pm", "bin", "-g"] : ["root", "-g"]
|
|
102616
102925
|
).trim();
|
|
102617
102926
|
if (!root.startsWith("/")) throw new Error("invalid manager path");
|
|
102618
|
-
const target = plan.executable === "bun" ? dirname49(realpathSync31(
|
|
102927
|
+
const target = plan.executable === "bun" ? dirname49(realpathSync31(join61(root, "tmux-ide"))) : realpathSync31(join61(root, "tmux-ide", "bin"));
|
|
102619
102928
|
if (target !== source.path) throw new Error("different installation");
|
|
102620
102929
|
} catch {
|
|
102621
102930
|
plan = {
|
|
@@ -102820,7 +103129,7 @@ __export(server_exports3, {
|
|
|
102820
103129
|
SERVER_BIND_HOST: () => SERVER_BIND_HOST,
|
|
102821
103130
|
createApp: () => createApp2,
|
|
102822
103131
|
resolvePort: () => resolvePort,
|
|
102823
|
-
start: () =>
|
|
103132
|
+
start: () => start2
|
|
102824
103133
|
});
|
|
102825
103134
|
import { createServer as createServer6 } from "node:http";
|
|
102826
103135
|
import { parse as parse2 } from "node:url";
|
|
@@ -102840,7 +103149,7 @@ function createApp2() {
|
|
|
102840
103149
|
app.get("/health", (c) => c.json({ ok: true }));
|
|
102841
103150
|
return app;
|
|
102842
103151
|
}
|
|
102843
|
-
async function
|
|
103152
|
+
async function start2(port) {
|
|
102844
103153
|
const resolvedPort = resolvePort(port);
|
|
102845
103154
|
const app = createApp2();
|
|
102846
103155
|
const server = createServer6(getRequestListener2(app.fetch));
|
|
@@ -102892,7 +103201,7 @@ var init_server3 = __esm({
|
|
|
102892
103201
|
init_src();
|
|
102893
103202
|
init_tmux_client_execution();
|
|
102894
103203
|
import { parseArgs as parseArgs2 } from "node:util";
|
|
102895
|
-
import { resolve as resolve44, dirname as dirname50, join as
|
|
103204
|
+
import { resolve as resolve44, dirname as dirname50, join as join62 } from "node:path";
|
|
102896
103205
|
import { execFileSync as execFileSync29 } from "node:child_process";
|
|
102897
103206
|
import { appendFileSync as appendFileSync2, existsSync as existsSync40, mkdirSync as mkdirSync33, writeFileSync as writeFileSync31 } from "node:fs";
|
|
102898
103207
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
@@ -103233,9 +103542,9 @@ Install bun (https://bun.sh) \u2014 the TUI surfaces run on it. Sources ship wit
|
|
|
103233
103542
|
let automaticDiagnosticLog;
|
|
103234
103543
|
if (surface === "app" && !process.env.TMUX_IDE_TUI_PERF_LOG && !process.env.TMUX_IDE_TUI_LOG) {
|
|
103235
103544
|
try {
|
|
103236
|
-
const logDirectory =
|
|
103545
|
+
const logDirectory = join62(stateHome(), "logs");
|
|
103237
103546
|
mkdirSync33(logDirectory, { recursive: true, mode: 448 });
|
|
103238
|
-
automaticDiagnosticLog =
|
|
103547
|
+
automaticDiagnosticLog = join62(logDirectory, "tui-latest.jsonl");
|
|
103239
103548
|
writeFileSync31(
|
|
103240
103549
|
automaticDiagnosticLog,
|
|
103241
103550
|
`${JSON.stringify({
|
|
@@ -104927,8 +105236,8 @@ Known panels: ${POPUP_WIDGETS2.join(", ")}.`,
|
|
|
104927
105236
|
if (values.port) serverArgs.push("--port", values.port);
|
|
104928
105237
|
execFileSync29("node", serverArgs, { stdio: "inherit" });
|
|
104929
105238
|
} else {
|
|
104930
|
-
const { start:
|
|
104931
|
-
await
|
|
105239
|
+
const { start: start3 } = await Promise.resolve().then(() => (init_server3(), server_exports3));
|
|
105240
|
+
await start3(values.port ? parseInt(values.port, 10) : void 0);
|
|
104932
105241
|
}
|
|
104933
105242
|
break;
|
|
104934
105243
|
}
|