tmux-ide 2.9.17 → 2.9.20
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 +631 -320
- package/package.json +1 -1
- package/packages/daemon/dist/doctor.js +108 -2
- package/packages/daemon/dist/lib/daemon-embed.js +4 -1
- package/packages/daemon/dist/lib/native-split-capability.js +18 -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 +20 -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 +111 -2
- package/packages/daemon/src/lib/daemon-embed.ts +4 -0
- package/packages/daemon/src/lib/native-split-capability.ts +20 -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 +24 -4
- package/packages/daemon/src/terminal/mirror/window-split-authority.ts +16 -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.20",
|
|
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,6 +27005,19 @@ function createNativeSplitReadiness(options) {
|
|
|
27005
27005
|
pending = null;
|
|
27006
27006
|
});
|
|
27007
27007
|
}
|
|
27008
|
+
function createStockSplitProbe(options) {
|
|
27009
|
+
const command3 = "tmux-ide-resize-split";
|
|
27010
|
+
return async () => {
|
|
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
|
+
return new RegExp(`^unknown command: ${command3}$`, "mu").test(text2);
|
|
27018
|
+
}
|
|
27019
|
+
};
|
|
27020
|
+
}
|
|
27008
27021
|
var init_native_split_capability = __esm({
|
|
27009
27022
|
"packages/daemon/src/lib/native-split-capability.ts"() {
|
|
27010
27023
|
"use strict";
|
|
@@ -28706,11 +28719,11 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28706
28719
|
return null;
|
|
28707
28720
|
}
|
|
28708
28721
|
};
|
|
28709
|
-
const record2 = (operation,
|
|
28722
|
+
const record2 = (operation, start3) => {
|
|
28710
28723
|
const end = now();
|
|
28711
|
-
if (
|
|
28724
|
+
if (start3 !== null && end !== null) {
|
|
28712
28725
|
try {
|
|
28713
|
-
timing?.record(operation,
|
|
28726
|
+
timing?.record(operation, start3, end);
|
|
28714
28727
|
} catch {
|
|
28715
28728
|
}
|
|
28716
28729
|
}
|
|
@@ -28841,9 +28854,9 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28841
28854
|
reason: "pane_identity_changed_during_read"
|
|
28842
28855
|
});
|
|
28843
28856
|
}
|
|
28844
|
-
let
|
|
28845
|
-
while (
|
|
28846
|
-
const text2 = bytes.subarray(
|
|
28857
|
+
let start3 = Math.max(0, bytes.byteLength - SESSION_RUNTIME_PANE_READ_MAX_BYTES);
|
|
28858
|
+
while (start3 < bytes.byteLength && (bytes[start3] & 192) === 128) start3++;
|
|
28859
|
+
const text2 = bytes.subarray(start3).toString("utf8");
|
|
28847
28860
|
return SessionRuntimePaneReadResultSchemaZ.parse({
|
|
28848
28861
|
verb: "workspace.pane.read",
|
|
28849
28862
|
operationId,
|
|
@@ -28853,9 +28866,9 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
28853
28866
|
format: "ansi",
|
|
28854
28867
|
availability: "available",
|
|
28855
28868
|
text: text2,
|
|
28856
|
-
byteCount: bytes.byteLength -
|
|
28869
|
+
byteCount: bytes.byteLength - start3,
|
|
28857
28870
|
capturedByteCount: bytes.byteLength,
|
|
28858
|
-
truncated:
|
|
28871
|
+
truncated: start3 > 0
|
|
28859
28872
|
});
|
|
28860
28873
|
}
|
|
28861
28874
|
dispose() {
|
|
@@ -29506,7 +29519,7 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
29506
29519
|
/** Optional metadata path; null alone permits pre-dispatch stock fallback. */
|
|
29507
29520
|
#runAuthored(operationId, execution, pane, expectedKinds, commands2, dispatch, options) {
|
|
29508
29521
|
if (execution && pane.nativePaneBirthId && this.#io.runAuthoredNative) {
|
|
29509
|
-
const
|
|
29522
|
+
const nativeCommands2 = commands2.filter(
|
|
29510
29523
|
(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
29524
|
);
|
|
29512
29525
|
dispatch.native = true;
|
|
@@ -29516,7 +29529,7 @@ var init_workspace_multiplexer_verbs = __esm({
|
|
|
29516
29529
|
context: execution,
|
|
29517
29530
|
targetPaneId: pane.paneId,
|
|
29518
29531
|
targetBirthId: pane.nativePaneBirthId,
|
|
29519
|
-
commands:
|
|
29532
|
+
commands: nativeCommands2,
|
|
29520
29533
|
expectedKinds
|
|
29521
29534
|
},
|
|
29522
29535
|
options
|
|
@@ -29969,6 +29982,158 @@ var init_guarded_native_split_resize = __esm({
|
|
|
29969
29982
|
}
|
|
29970
29983
|
});
|
|
29971
29984
|
|
|
29985
|
+
// packages/daemon/src/terminal/protocol/stock-split-resize.ts
|
|
29986
|
+
import { randomUUID as randomUUID14 } from "node:crypto";
|
|
29987
|
+
function minimum(node, axis, sizes, root) {
|
|
29988
|
+
if (node.kind === "leaf") {
|
|
29989
|
+
if (axis === "cols") return 1 + sizes.scrollbar;
|
|
29990
|
+
const onEdge = sizes.borderStatus === "top" && node.top === root.top || sizes.borderStatus === "bottom" && node.top + node.height === root.top + root.height;
|
|
29991
|
+
return onEdge ? 2 : 1;
|
|
29992
|
+
}
|
|
29993
|
+
const mins = node.children.map((child) => minimum(child, axis, sizes, root));
|
|
29994
|
+
return node.axis === axis ? mins.reduce((sum, size) => sum + size, node.children.length - 1) : Math.max(...mins);
|
|
29995
|
+
}
|
|
29996
|
+
function reachingLeaf(node, axis) {
|
|
29997
|
+
if (node.kind === "leaf") return node.id;
|
|
29998
|
+
if (node.axis === axis) return null;
|
|
29999
|
+
for (const child of node.children) {
|
|
30000
|
+
const leaf = reachingLeaf(child, axis);
|
|
30001
|
+
if (leaf) return leaf;
|
|
30002
|
+
}
|
|
30003
|
+
return null;
|
|
30004
|
+
}
|
|
30005
|
+
function stockSplitTarget(tree, path2, axis) {
|
|
30006
|
+
const located = locateSplit(tree, path2);
|
|
30007
|
+
if (!located || located.parent.axis !== axis) return null;
|
|
30008
|
+
const leading = reachingLeaf(located.node, axis);
|
|
30009
|
+
if (leading) return leading;
|
|
30010
|
+
const index = path2.at(-1);
|
|
30011
|
+
if (index + 1 !== located.parent.children.length - 1) return null;
|
|
30012
|
+
return reachingLeaf(located.parent.children[index + 1], axis);
|
|
30013
|
+
}
|
|
30014
|
+
function stockSplitRange(tree, path2, axis, sizes) {
|
|
30015
|
+
const located = locateSplit(tree, path2);
|
|
30016
|
+
if (!located) return null;
|
|
30017
|
+
const after = located.parent.children[path2.at(-1) + 1];
|
|
30018
|
+
const low = start(located.node, axis) + minimum(located.node, axis, sizes, tree);
|
|
30019
|
+
const high = start(after, axis) + span(after, axis) - minimum(after, axis, sizes, tree) - 1;
|
|
30020
|
+
return { low, high };
|
|
30021
|
+
}
|
|
30022
|
+
function stockSplitMovable(tree, path2, axis, sizes) {
|
|
30023
|
+
const range = stockSplitRange(tree, path2, axis, sizes);
|
|
30024
|
+
return stockSplitTarget(tree, path2, axis) !== null && range !== null && range.high > range.low;
|
|
30025
|
+
}
|
|
30026
|
+
function planStockSplitResize(tree, path2, axis, boundary2, sizes) {
|
|
30027
|
+
const paneId = stockSplitTarget(tree, path2, axis);
|
|
30028
|
+
const range = stockSplitRange(tree, path2, axis, sizes);
|
|
30029
|
+
const located = locateSplit(tree, path2);
|
|
30030
|
+
if (!paneId || !range || !located || range.high < range.low) return null;
|
|
30031
|
+
const clamped = Math.min(range.high, Math.max(range.low, boundary2));
|
|
30032
|
+
return { paneId, boundary: clamped, delta: clamped - splitEdge(located.node, axis) };
|
|
30033
|
+
}
|
|
30034
|
+
function formatLiteral(layout) {
|
|
30035
|
+
return layout.replaceAll(",", "#,").replaceAll("}", "#}");
|
|
30036
|
+
}
|
|
30037
|
+
function leafCount(node) {
|
|
30038
|
+
return node.kind === "leaf" ? 1 : node.children.reduce((sum, child) => sum + leafCount(child), 0);
|
|
30039
|
+
}
|
|
30040
|
+
function stockSplitCommand(request3, sessionCreated, plan, panes, options, marker) {
|
|
30041
|
+
const equal = (name, value) => `#{==:#{${name}},${value}}`;
|
|
30042
|
+
const condition = [
|
|
30043
|
+
equal("window_id", request3.windowId),
|
|
30044
|
+
equal("session_id", request3.sessionId),
|
|
30045
|
+
equal("session_created", sessionCreated),
|
|
30046
|
+
equal("window_zoomed_flag", 0),
|
|
30047
|
+
// Control clients' layouts leave out floating panes; this count includes them.
|
|
30048
|
+
equal("window_panes", panes),
|
|
30049
|
+
equal("pane-border-status", options.borderStatus),
|
|
30050
|
+
equal("pane-scrollbars", options.scrollbars),
|
|
30051
|
+
equal("window_layout", formatLiteral(request3.expectedLayout))
|
|
30052
|
+
].reduceRight((rest, next) => `#{&&:${next},${rest}}`);
|
|
30053
|
+
const flag = request3.axis === "cols" ? plan.delta > 0 ? "-R" : "-L" : plan.delta > 0 ? "-D" : "-U";
|
|
30054
|
+
const move = plan.delta === 0 ? `display-message -p ""` : `resize-pane -t ${plan.paneId} ${flag} ${Math.abs(plan.delta)}`;
|
|
30055
|
+
const readback = `display-message -p -t ${request3.windowId} "${marker} #{window_layout}"`;
|
|
30056
|
+
return `if-shell -F -t '${request3.sessionId}:${request3.windowId}' '${condition}' '${move} ; ${readback}' 'display-message -p ${marker} ; display-message -p ${marker}'`;
|
|
30057
|
+
}
|
|
30058
|
+
function parseStockSplitOptions(line) {
|
|
30059
|
+
const [borderStatus, scrollbars, style] = (line ?? "").split(" ");
|
|
30060
|
+
if (!/^(off|top|bottom)$/u.test(borderStatus ?? "") || !/^[a-z]+$/u.test(scrollbars ?? ""))
|
|
30061
|
+
return null;
|
|
30062
|
+
const field = (name) => Number(new RegExp(`\\b${name}=(\\d+)`, "u").exec(style ?? "")?.[1] ?? 0);
|
|
30063
|
+
return {
|
|
30064
|
+
borderStatus,
|
|
30065
|
+
scrollbars,
|
|
30066
|
+
scrollbar: scrollbars === "off" ? 0 : Math.max(field("width"), 1) + field("pad")
|
|
30067
|
+
};
|
|
30068
|
+
}
|
|
30069
|
+
async function resizeStockSplit(request3, sessionCreated, authorizeBeforeEffect, io) {
|
|
30070
|
+
const before = parseLayoutTree(request3.expectedLayout);
|
|
30071
|
+
if (!before || !validSplitTree(before) || !/^\$\d+$/u.test(request3.sessionId) || !/^@\d+$/u.test(request3.windowId) || !/^[1-9]\d*$/u.test(sessionCreated))
|
|
30072
|
+
return { status: "refused", reason: "invalid-request" };
|
|
30073
|
+
let options;
|
|
30074
|
+
try {
|
|
30075
|
+
options = parseStockSplitOptions((await io.readOptions(request3.windowId))[0]);
|
|
30076
|
+
} catch {
|
|
30077
|
+
return { status: "refused", reason: "unsupported" };
|
|
30078
|
+
}
|
|
30079
|
+
if (!options) return { status: "refused", reason: "unsupported" };
|
|
30080
|
+
const plan = planStockSplitResize(before, request3.path, request3.axis, request3.boundary, options);
|
|
30081
|
+
if (!plan) return { status: "refused", reason: "invalid-request" };
|
|
30082
|
+
const marker = `tmux-ide-split-${randomUUID14()}`;
|
|
30083
|
+
const command3 = stockSplitCommand(
|
|
30084
|
+
request3,
|
|
30085
|
+
sessionCreated,
|
|
30086
|
+
plan,
|
|
30087
|
+
leafCount(before),
|
|
30088
|
+
options,
|
|
30089
|
+
marker
|
|
30090
|
+
);
|
|
30091
|
+
authorizeBeforeEffect();
|
|
30092
|
+
let reply;
|
|
30093
|
+
try {
|
|
30094
|
+
reply = await io.send(command3);
|
|
30095
|
+
} catch {
|
|
30096
|
+
return { status: "uncertain", reason: "command-failed" };
|
|
30097
|
+
}
|
|
30098
|
+
const answer = reply.join("\n");
|
|
30099
|
+
if (answer === marker) return { status: "refused", reason: "stale-layout" };
|
|
30100
|
+
if (reply.length !== 1 || !answer.startsWith(`${marker} `))
|
|
30101
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30102
|
+
const layout = answer.slice(marker.length + 1);
|
|
30103
|
+
const after = parseLayoutTree(layout);
|
|
30104
|
+
const original = locateSplit(before, request3.path);
|
|
30105
|
+
const actual = after && locateSplit(after, request3.path);
|
|
30106
|
+
if (!after || !validSplitTree(after) || !actual || !preservesSplitTree(before, after, original.parent, request3.axis))
|
|
30107
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30108
|
+
const edges = (parent) => parent.children.map((child) => splitEdge(child, request3.axis));
|
|
30109
|
+
const moved = request3.path.at(-1);
|
|
30110
|
+
const others = edges(actual.parent);
|
|
30111
|
+
if (edges(original.parent).some((edge, index) => index !== moved && edge !== others[index]))
|
|
30112
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30113
|
+
const boundary2 = splitEdge(actual.node, request3.axis);
|
|
30114
|
+
const previous = splitEdge(original.node, request3.axis);
|
|
30115
|
+
if (boundary2 < Math.min(previous, plan.boundary) || boundary2 > Math.max(previous, plan.boundary))
|
|
30116
|
+
return { status: "uncertain", reason: "invalid-receipt" };
|
|
30117
|
+
return {
|
|
30118
|
+
status: "applied",
|
|
30119
|
+
boundary: boundary2,
|
|
30120
|
+
layout,
|
|
30121
|
+
tree: after,
|
|
30122
|
+
changed: layout !== request3.expectedLayout
|
|
30123
|
+
};
|
|
30124
|
+
}
|
|
30125
|
+
var span, start, STOCK_SPLIT_OPTIONS_FORMAT;
|
|
30126
|
+
var init_stock_split_resize = __esm({
|
|
30127
|
+
"packages/daemon/src/terminal/protocol/stock-split-resize.ts"() {
|
|
30128
|
+
"use strict";
|
|
30129
|
+
init_layout_parse();
|
|
30130
|
+
init_native_split_resize();
|
|
30131
|
+
span = (node, axis) => axis === "cols" ? node.width : node.height;
|
|
30132
|
+
start = (node, axis) => axis === "cols" ? node.left : node.top;
|
|
30133
|
+
STOCK_SPLIT_OPTIONS_FORMAT = "#{pane-border-status} #{pane-scrollbars} #{pane-scrollbars-style}";
|
|
30134
|
+
}
|
|
30135
|
+
});
|
|
30136
|
+
|
|
29972
30137
|
// packages/daemon/src/terminal/mirror/layout-content-rows.ts
|
|
29973
30138
|
function layoutContentRows(paneTop, paneHeight, windowRows, border) {
|
|
29974
30139
|
if (border === "off") return paneHeight;
|
|
@@ -31257,6 +31422,7 @@ var TMUX_SERVER_HOSTNAME, STRUCTURAL_NOTIFICATIONS, NATIVE_CLIENT_NOTIFICATIONS,
|
|
|
31257
31422
|
var init_session_channel = __esm({
|
|
31258
31423
|
"packages/daemon/src/terminal/mirror/session-channel.ts"() {
|
|
31259
31424
|
"use strict";
|
|
31425
|
+
init_stock_split_resize();
|
|
31260
31426
|
init_layout_content_rows();
|
|
31261
31427
|
init_native_atomic_snapshot();
|
|
31262
31428
|
init_tmux_interaction_retention();
|
|
@@ -31701,7 +31867,7 @@ var init_session_channel = __esm({
|
|
|
31701
31867
|
};
|
|
31702
31868
|
}
|
|
31703
31869
|
/** Exact native ancestry, never reconstructed from published pane rectangles. */
|
|
31704
|
-
describeSplitLayout(target) {
|
|
31870
|
+
describeSplitLayout(target, stock = false) {
|
|
31705
31871
|
const authority2 = this.windowLinkAuthority;
|
|
31706
31872
|
const identity4 = this.attachedIdentity;
|
|
31707
31873
|
const generation = this.attachedServerGeneration;
|
|
@@ -31723,14 +31889,15 @@ var init_session_channel = __esm({
|
|
|
31723
31889
|
const panes = native2.leaves.map((leaf) => {
|
|
31724
31890
|
const pane = this.panesByRuntime.get(leaf.id);
|
|
31725
31891
|
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 ||
|
|
31892
|
+
if (!pane || pane.windowRuntimeId !== resolved2.runtimeWindowId || pane.descriptor?.runtimeSessionId !== identity4.runtimeSessionId || pane.descriptor?.windowId !== resolved2.runtimeWindowId || this.panesBySemantic.get(pane.semanticId) !== pane || // A stock server has no birth ids; a server that has them must give valid ones.
|
|
31893
|
+
(!stock || birth) && (!birth || !/^[1-9]\d*$/u.test(birth)) || !layout.leaves.some(
|
|
31727
31894
|
(visible) => visible.id === leaf.id && visible.left === leaf.left && visible.top === leaf.top && visible.width === leaf.width && visible.height === leaf.height
|
|
31728
31895
|
))
|
|
31729
31896
|
throw new Error("Split layout pane identity incomplete");
|
|
31730
31897
|
return Object.freeze({
|
|
31731
31898
|
runtimePaneId: pane.runtimeId,
|
|
31732
31899
|
semanticPaneId: pane.semanticId,
|
|
31733
|
-
nativePaneBirthId: birth
|
|
31900
|
+
nativePaneBirthId: birth || ""
|
|
31734
31901
|
});
|
|
31735
31902
|
});
|
|
31736
31903
|
return Object.freeze({
|
|
@@ -31740,9 +31907,23 @@ var init_session_channel = __esm({
|
|
|
31740
31907
|
runtimeWindowId: resolved2.runtimeWindowId,
|
|
31741
31908
|
semanticWindowId: window2.semanticId,
|
|
31742
31909
|
rawLayout: layout.rawLayout,
|
|
31910
|
+
...stock ? { paneBorderStatus: window2.paneBorderStatus } : {},
|
|
31743
31911
|
panes: Object.freeze(panes)
|
|
31744
31912
|
});
|
|
31745
31913
|
}
|
|
31914
|
+
stockSplitOptions(windowId) {
|
|
31915
|
+
return this.io.request(`display-message -p -t ${windowId} "${STOCK_SPLIT_OPTIONS_FORMAT}"`);
|
|
31916
|
+
}
|
|
31917
|
+
/** One guarded resize on this control connection, for a stock tmux server. */
|
|
31918
|
+
stockSplitCommand(command3) {
|
|
31919
|
+
return new Promise((resolve45, reject) => {
|
|
31920
|
+
const onReply = (reply) => reply.ok ? resolve45(reply.lines) : reject(new Error("Stock split command failed"));
|
|
31921
|
+
const limits = { maxBytes: 16 * 1024, maxLines: 4 };
|
|
31922
|
+
if (this.io.commandListBoundedInline)
|
|
31923
|
+
this.io.commandListBoundedInline(command3, 3, 2, limits, onReply);
|
|
31924
|
+
else this.io.commandListInline(command3, 3, 2, onReply);
|
|
31925
|
+
});
|
|
31926
|
+
}
|
|
31746
31927
|
async executeWindowLinkAction(request3) {
|
|
31747
31928
|
const authority2 = this.windowLinkAuthority;
|
|
31748
31929
|
if (!authority2 || this.disposed) throw new WindowLinkResolutionError("window_link_stale");
|
|
@@ -34273,7 +34454,7 @@ var init_session_channel = __esm({
|
|
|
34273
34454
|
});
|
|
34274
34455
|
|
|
34275
34456
|
// packages/daemon/src/terminal/mirror/window-split-authority.ts
|
|
34276
|
-
import { randomUUID as
|
|
34457
|
+
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
34277
34458
|
import { z as z99 } from "zod";
|
|
34278
34459
|
var MAX_RETAINED_WINDOWS, WindowSplitLayoutUnavailable, WindowSplitAuthority;
|
|
34279
34460
|
var init_window_split_authority = __esm({
|
|
@@ -34282,6 +34463,7 @@ var init_window_split_authority = __esm({
|
|
|
34282
34463
|
init_src2();
|
|
34283
34464
|
init_native_operation_command();
|
|
34284
34465
|
init_layout_parse();
|
|
34466
|
+
init_stock_split_resize();
|
|
34285
34467
|
init_session_channel();
|
|
34286
34468
|
MAX_RETAINED_WINDOWS = 32;
|
|
34287
34469
|
WindowSplitLayoutUnavailable = class extends Error {
|
|
@@ -34311,7 +34493,7 @@ var init_window_split_authority = __esm({
|
|
|
34311
34493
|
if (!tree || tree.width > 4096 || tree.height > 4096 || snapshot3.panes.length > 256)
|
|
34312
34494
|
throw new WindowSplitLayoutUnavailable();
|
|
34313
34495
|
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(
|
|
34496
|
+
if (!/^%(0|[1-9][0-9]{0,9})$/u.test(pane.runtimePaneId) || Number(pane.runtimePaneId.slice(1)) > 4294967295 || !(this.options.stock && pane.nativePaneBirthId === "") && !NativeJournalUint64SchemaZ.refine((birth) => birth !== "0").safeParse(
|
|
34315
34497
|
pane.nativePaneBirthId
|
|
34316
34498
|
).success)
|
|
34317
34499
|
throw new WindowSplitLayoutUnavailable();
|
|
@@ -34339,8 +34521,11 @@ var init_window_split_authority = __esm({
|
|
|
34339
34521
|
}
|
|
34340
34522
|
node.children.forEach((child, index) => {
|
|
34341
34523
|
const childPath = [...path2, index];
|
|
34342
|
-
if (index < node.children.length - 1
|
|
34343
|
-
|
|
34524
|
+
if (index < node.children.length - 1 && (!this.options.stock || stockSplitMovable(tree, childPath, node.axis, {
|
|
34525
|
+
borderStatus: snapshot3.paneBorderStatus ?? "off",
|
|
34526
|
+
scrollbar: 0
|
|
34527
|
+
}))) {
|
|
34528
|
+
const splitId = randomUUID15();
|
|
34344
34529
|
paths.set(splitId, childPath);
|
|
34345
34530
|
splits.push({
|
|
34346
34531
|
splitId,
|
|
@@ -34359,7 +34544,7 @@ var init_window_split_authority = __esm({
|
|
|
34359
34544
|
const resource3 = WindowSplitLayoutResourceSchemaZ.parse({
|
|
34360
34545
|
version: 1,
|
|
34361
34546
|
window: window2,
|
|
34362
|
-
layoutId:
|
|
34547
|
+
layoutId: randomUUID15(),
|
|
34363
34548
|
cols: tree.width,
|
|
34364
34549
|
rows: tree.height,
|
|
34365
34550
|
panes,
|
|
@@ -34486,7 +34671,7 @@ var init_tmux_version = __esm({
|
|
|
34486
34671
|
});
|
|
34487
34672
|
|
|
34488
34673
|
// packages/daemon/src/terminal/graphics/local-image-store.ts
|
|
34489
|
-
import { randomUUID as
|
|
34674
|
+
import { randomUUID as randomUUID16, webcrypto } from "node:crypto";
|
|
34490
34675
|
import { constants as constants11 } from "node:fs";
|
|
34491
34676
|
import { chmod, link, lstat as lstat2, mkdtemp, open, realpath, rmdir, unlink } from "node:fs/promises";
|
|
34492
34677
|
import { join as join31 } from "node:path";
|
|
@@ -34594,7 +34779,7 @@ var init_local_image_store = __esm({
|
|
|
34594
34779
|
this.#bytes += entry.bytes;
|
|
34595
34780
|
}
|
|
34596
34781
|
const lease = Object.freeze({
|
|
34597
|
-
id:
|
|
34782
|
+
id: randomUUID16(),
|
|
34598
34783
|
generation: this.generation,
|
|
34599
34784
|
client,
|
|
34600
34785
|
digest: digest3,
|
|
@@ -34611,7 +34796,7 @@ var init_local_image_store = __esm({
|
|
|
34611
34796
|
}
|
|
34612
34797
|
async #write(digest3, data) {
|
|
34613
34798
|
const path2 = join31(this.directory, digest3);
|
|
34614
|
-
const temporary = join31(this.directory, `.pending-${
|
|
34799
|
+
const temporary = join31(this.directory, `.pending-${randomUUID16()}`);
|
|
34615
34800
|
const file = await open(
|
|
34616
34801
|
temporary,
|
|
34617
34802
|
constants11.O_CREAT | constants11.O_EXCL | constants11.O_WRONLY | constants11.O_NOFOLLOW,
|
|
@@ -34711,7 +34896,7 @@ var init_local_image_store = __esm({
|
|
|
34711
34896
|
});
|
|
34712
34897
|
|
|
34713
34898
|
// packages/daemon/src/terminal/graphics/local-image-owner.ts
|
|
34714
|
-
import { randomUUID as
|
|
34899
|
+
import { randomUUID as randomUUID17 } from "node:crypto";
|
|
34715
34900
|
import { constants as constants12 } from "node:fs";
|
|
34716
34901
|
import {
|
|
34717
34902
|
link as link2,
|
|
@@ -34942,7 +35127,7 @@ var init_local_image_owner = __esm({
|
|
|
34942
35127
|
throw new Error("Local image manifest replaced");
|
|
34943
35128
|
if (JSON.stringify(current.manifest) === encoded) return;
|
|
34944
35129
|
}
|
|
34945
|
-
const temporary = join32(this.path, `.owner-${
|
|
35130
|
+
const temporary = join32(this.path, `.owner-${randomUUID17()}`);
|
|
34946
35131
|
const file = await open2(
|
|
34947
35132
|
temporary,
|
|
34948
35133
|
constants12.O_CREAT | constants12.O_EXCL | constants12.O_WRONLY | constants12.O_NOFOLLOW,
|
|
@@ -35224,7 +35409,7 @@ var init_pane_source_discovery = __esm({
|
|
|
35224
35409
|
});
|
|
35225
35410
|
|
|
35226
35411
|
// packages/daemon/src/lib/background-native-capture.ts
|
|
35227
|
-
import { randomUUID as
|
|
35412
|
+
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
35228
35413
|
function createBackgroundNativeCapture(options) {
|
|
35229
35414
|
return async (request3, signal) => {
|
|
35230
35415
|
signal?.throwIfAborted();
|
|
@@ -35235,7 +35420,7 @@ function createBackgroundNativeCapture(options) {
|
|
|
35235
35420
|
return null;
|
|
35236
35421
|
if (request3.mode !== "agent-status" && request3.mode !== "fleet-preview")
|
|
35237
35422
|
throw new TypeError("Invalid background capture mode");
|
|
35238
|
-
const operationId =
|
|
35423
|
+
const operationId = randomUUID18();
|
|
35239
35424
|
const command3 = [
|
|
35240
35425
|
"capture-pane",
|
|
35241
35426
|
"-p",
|
|
@@ -35358,7 +35543,7 @@ var init_background_native_capture = __esm({
|
|
|
35358
35543
|
});
|
|
35359
35544
|
|
|
35360
35545
|
// packages/daemon/src/terminal/mirror/owned-viewer-adapter.ts
|
|
35361
|
-
import { randomUUID as
|
|
35546
|
+
import { randomUUID as randomUUID19 } from "node:crypto";
|
|
35362
35547
|
var commands, OwnedViewerAdapter;
|
|
35363
35548
|
var init_owned_viewer_adapter = __esm({
|
|
35364
35549
|
"packages/daemon/src/terminal/mirror/owned-viewer-adapter.ts"() {
|
|
@@ -35383,18 +35568,18 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35383
35568
|
});
|
|
35384
35569
|
}
|
|
35385
35570
|
controlOptions() {
|
|
35386
|
-
let
|
|
35571
|
+
let capability;
|
|
35387
35572
|
try {
|
|
35388
|
-
|
|
35573
|
+
capability = this.authority.capability();
|
|
35389
35574
|
} catch {
|
|
35390
35575
|
this.#uncertain();
|
|
35391
35576
|
return void 0;
|
|
35392
35577
|
}
|
|
35393
|
-
if (this.#disposed || !
|
|
35578
|
+
if (this.#disposed || !capability) return void 0;
|
|
35394
35579
|
return {
|
|
35395
|
-
serverEpoch:
|
|
35580
|
+
serverEpoch: capability.serverEpoch,
|
|
35396
35581
|
onIdentity: (identity4) => {
|
|
35397
|
-
if (this.#disposed || !this.#io || this.#connection || identity4.serverEpoch !==
|
|
35582
|
+
if (this.#disposed || !this.#io || this.#connection || identity4.serverEpoch !== capability.serverEpoch || this.authority.capability()?.serverEpoch !== identity4.serverEpoch)
|
|
35398
35583
|
return false;
|
|
35399
35584
|
const connection = this.authority.register(identity4);
|
|
35400
35585
|
if (!connection) return false;
|
|
@@ -35412,9 +35597,9 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35412
35597
|
/** Available only on the actual attached issuer, never the journal reader. */
|
|
35413
35598
|
atomicSnapshotEpoch(io, representation = "native") {
|
|
35414
35599
|
try {
|
|
35415
|
-
const
|
|
35600
|
+
const capability = this.authority.capability();
|
|
35416
35601
|
const actual = io.nativeViewerIdentity;
|
|
35417
|
-
return !this.#disposed && io === this.#io && this.#connection && this.#identity && (representation === "dual" ?
|
|
35602
|
+
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
35603
|
} catch {
|
|
35419
35604
|
this.#uncertain();
|
|
35420
35605
|
return null;
|
|
@@ -35423,20 +35608,20 @@ var init_owned_viewer_adapter = __esm({
|
|
|
35423
35608
|
tryDispatch(io, request3, onReply) {
|
|
35424
35609
|
const identity4 = this.#identity, connection = this.#connection;
|
|
35425
35610
|
let actual;
|
|
35426
|
-
let
|
|
35611
|
+
let capability;
|
|
35427
35612
|
try {
|
|
35428
35613
|
actual = io.nativeViewerIdentity;
|
|
35429
|
-
|
|
35614
|
+
capability = this.authority.capability();
|
|
35430
35615
|
} catch {
|
|
35431
35616
|
this.#uncertain();
|
|
35432
35617
|
return false;
|
|
35433
35618
|
}
|
|
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 ||
|
|
35619
|
+
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
35620
|
return false;
|
|
35436
35621
|
let permit;
|
|
35437
35622
|
try {
|
|
35438
35623
|
permit = this.authority.admit({
|
|
35439
|
-
operationId:
|
|
35624
|
+
operationId: randomUUID19(),
|
|
35440
35625
|
role: "viewer",
|
|
35441
35626
|
source: null,
|
|
35442
35627
|
connection,
|
|
@@ -36180,7 +36365,7 @@ var init_authored_native_receipt_staging = __esm({
|
|
|
36180
36365
|
|
|
36181
36366
|
// packages/daemon/src/lib/owned-native-interaction-bindings.ts
|
|
36182
36367
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
36183
|
-
import { randomUUID as
|
|
36368
|
+
import { randomUUID as randomUUID20 } from "node:crypto";
|
|
36184
36369
|
function isOwnedNativePlanCompletion(value) {
|
|
36185
36370
|
return value !== null && typeof value === "object" && ownedCompletions.has(value);
|
|
36186
36371
|
}
|
|
@@ -36266,7 +36451,7 @@ var init_owned_native_interaction_bindings = __esm({
|
|
|
36266
36451
|
return null;
|
|
36267
36452
|
if ([...this.#connections.values()].some((c) => c.identity.connectionId === identity4.connectionId))
|
|
36268
36453
|
return null;
|
|
36269
|
-
const token2 = Object.freeze({ bindingId:
|
|
36454
|
+
const token2 = Object.freeze({ bindingId: randomUUID20() });
|
|
36270
36455
|
this.#connections.set(token2, {
|
|
36271
36456
|
token: token2,
|
|
36272
36457
|
identity: freeze(identity4),
|
|
@@ -36608,7 +36793,7 @@ var init_owned_native_interaction_bindings = __esm({
|
|
|
36608
36793
|
});
|
|
36609
36794
|
|
|
36610
36795
|
// packages/daemon/src/lib/tmux-server-generation-runner.ts
|
|
36611
|
-
import { randomUUID as
|
|
36796
|
+
import { randomUUID as randomUUID21 } from "node:crypto";
|
|
36612
36797
|
function fenceNativeTmuxCommand(args, expected) {
|
|
36613
36798
|
const { pid, startTime } = expected;
|
|
36614
36799
|
if (!/^[1-9][0-9]*$/u.test(pid) || !/^[1-9][0-9]*$/u.test(startTime))
|
|
@@ -36627,7 +36812,7 @@ function fenceNativeTmuxCommand(args, expected) {
|
|
|
36627
36812
|
if (firstCommand === args.length) throw new Error("Missing tmux command");
|
|
36628
36813
|
const condition = `#{&&:#{==:#{pid},${pid}},#{==:#{start_time},${startTime}}}`;
|
|
36629
36814
|
const command3 = args.slice(firstCommand).map((arg) => arg === ";" ? ";" : shellEscape(arg)).join(" ");
|
|
36630
|
-
const refusal = `tmux-server-stale.${
|
|
36815
|
+
const refusal = `tmux-server-stale.${randomUUID21()}`;
|
|
36631
36816
|
return {
|
|
36632
36817
|
argv: [...globalFlags, "if-shell", "-F", condition, command3, `display-message -p '${refusal}'`],
|
|
36633
36818
|
verify(output) {
|
|
@@ -36737,9 +36922,9 @@ var init_native_journal_control_connection = __esm({
|
|
|
36737
36922
|
try {
|
|
36738
36923
|
if (this.#failure) throw this.#failure;
|
|
36739
36924
|
if (lines.length !== 2) throw new Error("Invalid native journal greeting");
|
|
36740
|
-
const
|
|
36925
|
+
const capability = NativeJournalCapabilitySchemaZ.parse(JSON.parse(lines[0]));
|
|
36741
36926
|
const identity4 = NativeJournalIdentitySchemaZ.parse(JSON.parse(lines[1]));
|
|
36742
|
-
if (
|
|
36927
|
+
if (capability.readerTransport !== "sessionless-control-v1" || !capability.enabled || capability.serverEpoch !== this.#serverEpoch || identity4.serverEpoch !== this.#serverEpoch)
|
|
36743
36928
|
throw new Error("Native journal peer incarnation mismatch");
|
|
36744
36929
|
this.#connectionId = identity4.connectionId;
|
|
36745
36930
|
} catch (error) {
|
|
@@ -37100,45 +37285,45 @@ var init_native_tmux_interaction_observer = __esm({
|
|
|
37100
37285
|
}
|
|
37101
37286
|
}
|
|
37102
37287
|
async #probe() {
|
|
37103
|
-
let
|
|
37288
|
+
let capability;
|
|
37104
37289
|
const output = await this.#request(["tmux-ide-events", "-V"], this.#commandMs);
|
|
37105
37290
|
try {
|
|
37106
|
-
|
|
37291
|
+
capability = NativeJournalCapabilitySchemaZ.parse(JSON.parse(output));
|
|
37107
37292
|
} catch {
|
|
37108
37293
|
this.#state("incompatible");
|
|
37109
37294
|
return false;
|
|
37110
37295
|
}
|
|
37111
|
-
if (this.#options.expectedServerEpoch !== void 0 && this.#options.expectedServerEpoch !==
|
|
37296
|
+
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
37297
|
this.#state("retired");
|
|
37113
37298
|
return false;
|
|
37114
37299
|
}
|
|
37115
|
-
this.#capability =
|
|
37116
|
-
if (!
|
|
37300
|
+
this.#capability = capability;
|
|
37301
|
+
if (!capability.enabled && this.#options.enable) {
|
|
37117
37302
|
const enabled = NativeJournalCapabilitySchemaZ.parse(
|
|
37118
37303
|
JSON.parse(await this.#request(["tmux-ide-events", "-e"], this.#commandMs))
|
|
37119
37304
|
);
|
|
37120
|
-
if (enabled.serverEpoch !==
|
|
37305
|
+
if (enabled.serverEpoch !== capability.serverEpoch) {
|
|
37121
37306
|
this.#state("retired");
|
|
37122
37307
|
return false;
|
|
37123
37308
|
}
|
|
37124
|
-
this.#capability =
|
|
37309
|
+
this.#capability = capability = enabled;
|
|
37125
37310
|
}
|
|
37126
|
-
if (!
|
|
37311
|
+
if (!capability.enabled) {
|
|
37127
37312
|
this.#state("disabled");
|
|
37128
37313
|
return false;
|
|
37129
37314
|
}
|
|
37130
|
-
if (
|
|
37315
|
+
if (capability.degraded) {
|
|
37131
37316
|
this.#state("degraded");
|
|
37132
37317
|
return false;
|
|
37133
37318
|
}
|
|
37134
37319
|
if (!this.#cursor)
|
|
37135
37320
|
this.#cursor = {
|
|
37136
|
-
serverEpoch:
|
|
37137
|
-
journalEpoch:
|
|
37321
|
+
serverEpoch: capability.serverEpoch,
|
|
37322
|
+
journalEpoch: capability.journalEpoch,
|
|
37138
37323
|
sequence: "0"
|
|
37139
37324
|
};
|
|
37140
|
-
else if (this.#cursor.journalEpoch !==
|
|
37141
|
-
this.#reset(
|
|
37325
|
+
else if (this.#cursor.journalEpoch !== capability.journalEpoch)
|
|
37326
|
+
this.#reset(capability.journalEpoch);
|
|
37142
37327
|
this.#state("ready");
|
|
37143
37328
|
return true;
|
|
37144
37329
|
}
|
|
@@ -37497,22 +37682,22 @@ var init_owner_interaction_observation = __esm({
|
|
|
37497
37682
|
cursor: null
|
|
37498
37683
|
});
|
|
37499
37684
|
}
|
|
37500
|
-
#ready(
|
|
37685
|
+
#ready(capability, cursor2) {
|
|
37501
37686
|
this.#selection = "native";
|
|
37502
|
-
this.#capability =
|
|
37503
|
-
if (
|
|
37687
|
+
this.#capability = capability;
|
|
37688
|
+
if (capability.ownedOperationTransport === "direct-wrapper-v1")
|
|
37504
37689
|
this.#bindings ??= new OwnedNativeInteractionBindings({
|
|
37505
37690
|
environmentId: this.#options.environmentId,
|
|
37506
37691
|
serverScope: this.#options.serverScope,
|
|
37507
|
-
serverEpoch:
|
|
37692
|
+
serverEpoch: capability.serverEpoch,
|
|
37508
37693
|
onPlanComplete: this.#options.onOwnedPlanComplete
|
|
37509
37694
|
});
|
|
37510
37695
|
this.#projector ??= new NativeInteractionProjector({
|
|
37511
37696
|
environmentId: this.#options.environmentId,
|
|
37512
37697
|
serverScope: this.#options.serverScope,
|
|
37513
|
-
serverEpoch:
|
|
37698
|
+
serverEpoch: capability.serverEpoch
|
|
37514
37699
|
});
|
|
37515
|
-
this.#options.status.setNativeReady(
|
|
37700
|
+
this.#options.status.setNativeReady(capability.schemaVersion, cursor2);
|
|
37516
37701
|
}
|
|
37517
37702
|
#publish(items) {
|
|
37518
37703
|
if (this.#disposed) return;
|
|
@@ -38336,7 +38521,7 @@ var init_fleet_agent_lifecycle = __esm({
|
|
|
38336
38521
|
});
|
|
38337
38522
|
|
|
38338
38523
|
// packages/daemon/src/lib/fleet-lifecycle-authority.ts
|
|
38339
|
-
import { createHash as createHash16, randomUUID as
|
|
38524
|
+
import { createHash as createHash16, randomUUID as randomUUID22 } from "node:crypto";
|
|
38340
38525
|
import { isAbsolute as isAbsolute16, resolve as resolve21 } from "node:path";
|
|
38341
38526
|
import { realpath as realpath3, stat } from "node:fs/promises";
|
|
38342
38527
|
var MAX_REPLAY_OPERATIONS, sleep2, FleetLifecycleAuthorityError, FleetLifecycleAuthority;
|
|
@@ -38627,7 +38812,7 @@ var init_fleet_lifecycle_authority = __esm({
|
|
|
38627
38812
|
"tmux did not return a pane identity."
|
|
38628
38813
|
);
|
|
38629
38814
|
}
|
|
38630
|
-
const semanticPaneId3 = `pane.agent.${
|
|
38815
|
+
const semanticPaneId3 = `pane.agent.${randomUUID22()}`;
|
|
38631
38816
|
try {
|
|
38632
38817
|
this.#runTmux(["set-option", "-p", "-t", paneId, "@tmux_ide_pane_id", semanticPaneId3]);
|
|
38633
38818
|
this.#runTmux(["set-option", "-p", "-t", paneId, "@agent_launch", input.command]);
|
|
@@ -38743,8 +38928,8 @@ var init_fleet_lifecycle_authority = __esm({
|
|
|
38743
38928
|
} catch {
|
|
38744
38929
|
throw new FleetLifecycleAuthorityError("agent_not_found", "Agent pane disappeared.");
|
|
38745
38930
|
}
|
|
38746
|
-
const [
|
|
38747
|
-
return { start:
|
|
38931
|
+
const [start3 = "", path2 = ""] = output.split(" ");
|
|
38932
|
+
return { start: start3, path: path2 };
|
|
38748
38933
|
}
|
|
38749
38934
|
async #stopAgent(paneId) {
|
|
38750
38935
|
this.#paneStartAndPath(paneId);
|
|
@@ -38829,7 +39014,7 @@ var init_tmux_server_session_create = __esm({
|
|
|
38829
39014
|
|
|
38830
39015
|
// packages/daemon/src/lib/tmux-session-mutation-fence.ts
|
|
38831
39016
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
38832
|
-
import { randomUUID as
|
|
39017
|
+
import { randomUUID as randomUUID23 } from "node:crypto";
|
|
38833
39018
|
function createTmuxSessionMutationFence() {
|
|
38834
39019
|
const context = new AsyncLocalStorage();
|
|
38835
39020
|
return {
|
|
@@ -38844,7 +39029,7 @@ function createTmuxSessionMutationFence() {
|
|
|
38844
39029
|
return (args) => {
|
|
38845
39030
|
const selected = context.getStore();
|
|
38846
39031
|
if (!selected) return run(args);
|
|
38847
|
-
const sentinel = `tmux-session-stale.${
|
|
39032
|
+
const sentinel = `tmux-session-stale.${randomUUID23()}`;
|
|
38848
39033
|
const output = run([
|
|
38849
39034
|
"if-shell",
|
|
38850
39035
|
"-t",
|
|
@@ -39984,7 +40169,7 @@ var init_workspace_promotion2 = __esm({
|
|
|
39984
40169
|
});
|
|
39985
40170
|
|
|
39986
40171
|
// packages/daemon/src/lib/tmux-server-session-open.ts
|
|
39987
|
-
import { randomUUID as
|
|
40172
|
+
import { randomUUID as randomUUID24 } from "node:crypto";
|
|
39988
40173
|
function createNativeTmuxSessionOpener(options) {
|
|
39989
40174
|
let disposed = false;
|
|
39990
40175
|
let tail = Promise.resolve();
|
|
@@ -40007,7 +40192,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40007
40192
|
const [, nativeSessionId, created, name] = matches[0];
|
|
40008
40193
|
const run = async (args) => {
|
|
40009
40194
|
assertOpen();
|
|
40010
|
-
const sentinel = `tmux-session-stale.${
|
|
40195
|
+
const sentinel = `tmux-session-stale.${randomUUID24()}`;
|
|
40011
40196
|
const condition = `#{&&:#{==:#{session_id},${nativeSessionId}},#{==:#{session_created},${created}}}`;
|
|
40012
40197
|
const command3 = args.map((arg) => arg === ";" ? ";" : shellEscape(arg)).join(" ");
|
|
40013
40198
|
const output = await options.run([
|
|
@@ -40033,7 +40218,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40033
40218
|
});
|
|
40034
40219
|
try {
|
|
40035
40220
|
const result2 = await promotion.promote({
|
|
40036
|
-
operationId:
|
|
40221
|
+
operationId: randomUUID24(),
|
|
40037
40222
|
expectedDaemonInstanceId: options.generation,
|
|
40038
40223
|
intent: { sessionId: fleetSessionIdForName(name) }
|
|
40039
40224
|
});
|
|
@@ -40066,7 +40251,7 @@ function createNativeTmuxSessionOpener(options) {
|
|
|
40066
40251
|
const observed = observedAgentSchema.parse(input);
|
|
40067
40252
|
assertOpen();
|
|
40068
40253
|
if (pending.size >= 16) throw new Error("Session admission capacity reached");
|
|
40069
|
-
const key2 =
|
|
40254
|
+
const key2 = randomUUID24();
|
|
40070
40255
|
const operation = tail.then(async () => {
|
|
40071
40256
|
const result2 = await open5(liveSessionId, observed);
|
|
40072
40257
|
if (!result2.semanticPaneId) throw new Error("Agent admission returned no target");
|
|
@@ -40215,7 +40400,7 @@ var init_tmux_pane_editor_context = __esm({
|
|
|
40215
40400
|
});
|
|
40216
40401
|
|
|
40217
40402
|
// packages/daemon/src/terminal/session-runtime/runtime-observability.ts
|
|
40218
|
-
import { randomUUID as
|
|
40403
|
+
import { randomUUID as randomUUID25 } from "node:crypto";
|
|
40219
40404
|
import { z as z104 } from "zod";
|
|
40220
40405
|
function createSessionRuntimeObservability(options = {}) {
|
|
40221
40406
|
const capacity = options.capacity ?? 1024;
|
|
@@ -40225,7 +40410,7 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40225
40410
|
const processId = options.processId ?? `daemon:${process.pid}`;
|
|
40226
40411
|
const clockId = options.clockId ?? "node-performance-now";
|
|
40227
40412
|
const clockKind = options.clockKind ?? "performance-now";
|
|
40228
|
-
const createTraceId = options.createTraceId ??
|
|
40413
|
+
const createTraceId = options.createTraceId ?? randomUUID25;
|
|
40229
40414
|
const spans = [];
|
|
40230
40415
|
let cursor2 = 0;
|
|
40231
40416
|
let droppedSpans = 0;
|
|
@@ -40240,7 +40425,7 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40240
40425
|
});
|
|
40241
40426
|
},
|
|
40242
40427
|
recordSpan(stage, operation, startedAtMicros, endedAtMicros, trace = null, shared, terminalDelivery, terminalReseed) {
|
|
40243
|
-
const
|
|
40428
|
+
const span2 = Object.freeze({
|
|
40244
40429
|
traceId: trace?.traceId ?? null,
|
|
40245
40430
|
scenario: trace?.scenario ?? null,
|
|
40246
40431
|
authority: trace?.authority ?? null,
|
|
@@ -40258,13 +40443,13 @@ function createSessionRuntimeObservability(options = {}) {
|
|
|
40258
40443
|
...terminalDelivery ? { terminalDelivery: Object.freeze({ ...terminalDelivery }) } : {},
|
|
40259
40444
|
...terminalReseed ? { terminalReseed: Object.freeze({ ...terminalReseed }) } : {}
|
|
40260
40445
|
});
|
|
40261
|
-
if (spans.length < capacity) spans.push(
|
|
40446
|
+
if (spans.length < capacity) spans.push(span2);
|
|
40262
40447
|
else {
|
|
40263
|
-
spans[cursor2] =
|
|
40448
|
+
spans[cursor2] = span2;
|
|
40264
40449
|
cursor2 = (cursor2 + 1) % capacity;
|
|
40265
40450
|
droppedSpans += 1;
|
|
40266
40451
|
}
|
|
40267
|
-
options.onSpan?.(
|
|
40452
|
+
options.onSpan?.(span2);
|
|
40268
40453
|
},
|
|
40269
40454
|
snapshot() {
|
|
40270
40455
|
const ordered = spans.length < capacity || cursor2 === 0 ? [...spans] : [...spans.slice(cursor2), ...spans.slice(0, cursor2)];
|
|
@@ -40875,14 +41060,14 @@ var init_control_channel = __esm({
|
|
|
40875
41060
|
}
|
|
40876
41061
|
if (event.kind === "error" && sink.index !== sink.state.resultIndex)
|
|
40877
41062
|
this.discardedErrors += 1;
|
|
40878
|
-
if (event.kind === "error"
|
|
41063
|
+
if (event.kind === "error") {
|
|
40879
41064
|
while (this.pending[0]?.kind === "command-list" && this.pending[0].state === sink.state)
|
|
40880
41065
|
this.pending.shift();
|
|
40881
41066
|
if (!sink.state.settled) {
|
|
40882
41067
|
sink.state.settled = true;
|
|
40883
41068
|
sink.state.onReply({
|
|
40884
41069
|
ok: false,
|
|
40885
|
-
lines: sink.state.budget || sink.state.resultIndex === 0 ? sink.state.lines : sink.state.leadingErrorLines
|
|
41070
|
+
lines: sink.index > 0 || sink.state.budget || sink.state.resultIndex === 0 ? sink.state.lines : sink.state.leadingErrorLines
|
|
40886
41071
|
});
|
|
40887
41072
|
}
|
|
40888
41073
|
} else if (sink.index === sink.state.resultIndex && !sink.state.settled) {
|
|
@@ -41611,6 +41796,7 @@ var init_control_mode_ownership = __esm({
|
|
|
41611
41796
|
});
|
|
41612
41797
|
|
|
41613
41798
|
// packages/daemon/src/terminal/mirror/mirror-service.ts
|
|
41799
|
+
import { randomUUID as randomUUID26 } from "node:crypto";
|
|
41614
41800
|
import { setTimeout as waitForPublication } from "node:timers/promises";
|
|
41615
41801
|
import { accessSync as accessSync7, constants as constants13, realpathSync as realpathSync15, statSync as statSync12 } from "node:fs";
|
|
41616
41802
|
import { isAbsolute as isAbsolute19 } from "node:path";
|
|
@@ -41621,6 +41807,7 @@ var init_mirror_service = __esm({
|
|
|
41621
41807
|
"use strict";
|
|
41622
41808
|
init_src2();
|
|
41623
41809
|
init_window_split_authority();
|
|
41810
|
+
init_stock_split_resize();
|
|
41624
41811
|
init_shared_window_index();
|
|
41625
41812
|
init_registered_window_guard();
|
|
41626
41813
|
init_tmux_client_execution();
|
|
@@ -41828,9 +42015,16 @@ var init_mirror_service = __esm({
|
|
|
41828
42015
|
ready = await this.opts.splitLayoutPrepare();
|
|
41829
42016
|
} catch {
|
|
41830
42017
|
}
|
|
41831
|
-
if (!ready
|
|
42018
|
+
if (!ready) {
|
|
42019
|
+
const stock = await this.#stockSplitServer();
|
|
42020
|
+
if (!stock || this.disposed || entry.retired || this.channels.get(session) !== entry)
|
|
42021
|
+
throw new WindowSplitLayoutUnavailable();
|
|
42022
|
+
return this.#readStockSplitLayout(entry, target);
|
|
42023
|
+
}
|
|
42024
|
+
if (this.disposed || entry.retired || this.channels.get(session) !== entry)
|
|
41832
42025
|
throw new WindowSplitLayoutUnavailable();
|
|
41833
42026
|
}
|
|
42027
|
+
if (entry.stockSplitEpoch) throw new WindowSplitLayoutUnavailable();
|
|
41834
42028
|
const epoch = this.opts.splitLayoutEpoch?.();
|
|
41835
42029
|
let supported = false;
|
|
41836
42030
|
try {
|
|
@@ -41845,6 +42039,23 @@ var init_mirror_service = __esm({
|
|
|
41845
42039
|
});
|
|
41846
42040
|
return entry.splitAuthority.read(target);
|
|
41847
42041
|
}
|
|
42042
|
+
async #stockSplitServer() {
|
|
42043
|
+
try {
|
|
42044
|
+
return await this.opts.splitLayoutStock?.() === true;
|
|
42045
|
+
} catch {
|
|
42046
|
+
return false;
|
|
42047
|
+
}
|
|
42048
|
+
}
|
|
42049
|
+
#readStockSplitLayout(entry, target) {
|
|
42050
|
+
if (entry.splitAuthority && !entry.stockSplitEpoch) throw new WindowSplitLayoutUnavailable();
|
|
42051
|
+
const epoch = entry.stockSplitEpoch ??= randomUUID26();
|
|
42052
|
+
entry.splitAuthority ??= new WindowSplitAuthority({
|
|
42053
|
+
describe: (window2) => entry.channel.describeSplitLayout(window2, true),
|
|
42054
|
+
serverEpoch: () => epoch,
|
|
42055
|
+
stock: true
|
|
42056
|
+
});
|
|
42057
|
+
return entry.splitAuthority.read(target);
|
|
42058
|
+
}
|
|
41848
42059
|
/** Resolve only issued handles, then revalidate immediately at native dispatch. */
|
|
41849
42060
|
async resizeWindowSplit(session, target, operationId, authorizeBeforeEffect, runNative) {
|
|
41850
42061
|
const captured = WindowSplitResizeTargetSchemaZ.parse(target);
|
|
@@ -41859,15 +42070,19 @@ var init_mirror_service = __esm({
|
|
|
41859
42070
|
await entry.started;
|
|
41860
42071
|
const resolved2 = current().resolve(captured);
|
|
41861
42072
|
const successor = current().prepareSuccessor(captured);
|
|
41862
|
-
const
|
|
42073
|
+
const authorize = () => {
|
|
42074
|
+
current().resolve(captured);
|
|
42075
|
+
authorizeBeforeEffect();
|
|
42076
|
+
};
|
|
42077
|
+
const result2 = entry.stockSplitEpoch ? await resizeStockSplit(resolved2.request, resolved2.session.created, authorize, {
|
|
42078
|
+
readOptions: (windowId) => entry.channel.stockSplitOptions(windowId),
|
|
42079
|
+
send: (command3) => entry.channel.stockSplitCommand(command3)
|
|
42080
|
+
}) : await runNative(resolved2.request, {
|
|
41863
42081
|
operationId,
|
|
41864
42082
|
serverEpoch: resolved2.serverEpoch,
|
|
41865
42083
|
session: resolved2.session,
|
|
41866
42084
|
anchor: resolved2.anchor,
|
|
41867
|
-
authorizeBeforeEffect:
|
|
41868
|
-
current().resolve(captured);
|
|
41869
|
-
authorizeBeforeEffect();
|
|
41870
|
-
}
|
|
42085
|
+
authorizeBeforeEffect: authorize
|
|
41871
42086
|
});
|
|
41872
42087
|
if (result2.status !== "applied") return result2;
|
|
41873
42088
|
const deadline = performance.now() + 100;
|
|
@@ -42473,7 +42688,7 @@ var init_semantic_mutation_resource_changes = __esm({
|
|
|
42473
42688
|
});
|
|
42474
42689
|
|
|
42475
42690
|
// packages/daemon/src/terminal/session-runtime/semantic-mutation-executor.ts
|
|
42476
|
-
import { randomUUID as
|
|
42691
|
+
import { randomUUID as randomUUID27 } from "node:crypto";
|
|
42477
42692
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
42478
42693
|
import { z as z105 } from "zod";
|
|
42479
42694
|
function replayedResult(result2) {
|
|
@@ -42740,7 +42955,7 @@ var init_semantic_mutation_executor = __esm({
|
|
|
42740
42955
|
this.#publish(operationId, intent, "rejected", null, void 0, origin, interactionContext);
|
|
42741
42956
|
throw error;
|
|
42742
42957
|
}
|
|
42743
|
-
const executionId =
|
|
42958
|
+
const executionId = randomUUID27();
|
|
42744
42959
|
const needsTmuxObservation = sessionRuntimeIntentNeedsTmuxObservation(intent);
|
|
42745
42960
|
let observed = null;
|
|
42746
42961
|
if (needsTmuxObservation) {
|
|
@@ -42959,7 +43174,7 @@ var init_semantic_mutation_executor = __esm({
|
|
|
42959
43174
|
});
|
|
42960
43175
|
|
|
42961
43176
|
// packages/daemon/src/terminal/session-runtime/history-anchor-owner.ts
|
|
42962
|
-
import { randomUUID as
|
|
43177
|
+
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
42963
43178
|
var MAX_TOKENS, PROOF_TTL_MS, HistoryAnchorOwner;
|
|
42964
43179
|
var init_history_anchor_owner = __esm({
|
|
42965
43180
|
"packages/daemon/src/terminal/session-runtime/history-anchor-owner.ts"() {
|
|
@@ -43053,7 +43268,7 @@ var init_history_anchor_owner = __esm({
|
|
|
43053
43268
|
const ordinal = known.first + historyIndex;
|
|
43054
43269
|
if (ordinal < this.#first || ordinal >= this.#first + this.#length) return { status: "lost" };
|
|
43055
43270
|
while (this.#tokens.size >= MAX_TOKENS) this.#tokens.delete(this.#tokens.keys().next().value);
|
|
43056
|
-
const token2 =
|
|
43271
|
+
const token2 = randomUUID28();
|
|
43057
43272
|
this.#tokens.set(token2, { ordinal });
|
|
43058
43273
|
return { status: "captured", token: token2 };
|
|
43059
43274
|
}
|
|
@@ -43442,15 +43657,15 @@ var init_terminal_conformance = __esm({
|
|
|
43442
43657
|
|
|
43443
43658
|
// packages/core/src/terminal-compact-capability.ts
|
|
43444
43659
|
function consumeCompactReplicaCapability(owner, baseline, hash) {
|
|
43445
|
-
const
|
|
43660
|
+
const capability = compactReplicaCapabilities.get(owner);
|
|
43446
43661
|
compactReplicaCapabilities.delete(owner);
|
|
43447
|
-
if (!
|
|
43448
|
-
return
|
|
43662
|
+
if (!capability || capability.baseline !== baseline || capability.hash !== hash) return void 0;
|
|
43663
|
+
return capability.snapshot;
|
|
43449
43664
|
}
|
|
43450
43665
|
function consumeVerifiedTombstoneInterval(owner, baseline, hash, baseRevision, revision) {
|
|
43451
|
-
const
|
|
43666
|
+
const capability = compactReplicaCapabilities.get(owner);
|
|
43452
43667
|
compactReplicaCapabilities.delete(owner);
|
|
43453
|
-
return
|
|
43668
|
+
return capability !== void 0 && capability.baseline === baseline && capability.snapshot === null && capability.hash === hash && capability.tombstoneInterval?.baseRevision === baseRevision && capability.tombstoneInterval.revision === revision;
|
|
43454
43669
|
}
|
|
43455
43670
|
var compactReplicaCapabilities;
|
|
43456
43671
|
var init_terminal_compact_capability = __esm({
|
|
@@ -43943,9 +44158,9 @@ var init_terminal_fnv64_wasm = __esm({
|
|
|
43943
44158
|
let offset = 0;
|
|
43944
44159
|
while (offset < value.length) {
|
|
43945
44160
|
const count = Math.min(SCRATCH_BYTES - this.#length, value.length - offset);
|
|
43946
|
-
const
|
|
44161
|
+
const start3 = this.#length;
|
|
43947
44162
|
for (let index = 0; index < count; index++)
|
|
43948
|
-
this.#buffer[
|
|
44163
|
+
this.#buffer[start3 + index] = value.charCodeAt(offset + index);
|
|
43949
44164
|
this.#length += count;
|
|
43950
44165
|
offset += count;
|
|
43951
44166
|
if (this.#length === SCRATCH_BYTES) this.#flush();
|
|
@@ -46859,10 +47074,10 @@ function projectNativeGridRow(source, columns, startColumn = 0, wrapped = false)
|
|
|
46859
47074
|
const clippedOwner = x === 0 && (native2.flags & 4) !== 0 && previous?.width === 2 && !(previous.flags & 4);
|
|
46860
47075
|
const styled = paint(clippedOwner ? previous : native2);
|
|
46861
47076
|
if (native2.flags & (4 | 64 | 128) || native2.width < 1 || native2.width > 2 || x + native2.width > columns) {
|
|
46862
|
-
const
|
|
47077
|
+
const span2 = native2.flags & 128 ? Math.max(1, Math.min(native2.width, columns - x)) : 1;
|
|
46863
47078
|
const blank = freezePaint({ ...styled, grapheme: "", width: 1 });
|
|
46864
|
-
for (let offset = 0; offset <
|
|
46865
|
-
x +=
|
|
47079
|
+
for (let offset = 0; offset < span2; offset++) cells[x + offset] = blank;
|
|
47080
|
+
x += span2 - 1;
|
|
46866
47081
|
continue;
|
|
46867
47082
|
}
|
|
46868
47083
|
cells[x] = freezePaint(styled);
|
|
@@ -46941,9 +47156,9 @@ function stringFromCodePoint(codePoint) {
|
|
|
46941
47156
|
}
|
|
46942
47157
|
return String.fromCharCode(codePoint);
|
|
46943
47158
|
}
|
|
46944
|
-
function utf32ToString(data,
|
|
47159
|
+
function utf32ToString(data, start3 = 0, end = data.length) {
|
|
46945
47160
|
let result2 = "";
|
|
46946
|
-
for (let i =
|
|
47161
|
+
for (let i = start3; i < end; ++i) {
|
|
46947
47162
|
let codepoint = data[i];
|
|
46948
47163
|
if (codepoint > 65535) {
|
|
46949
47164
|
codepoint -= 65536;
|
|
@@ -49856,30 +50071,30 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
49856
50071
|
this.setCellFromCodepoint(pos, 0, 1, fillCellData);
|
|
49857
50072
|
}
|
|
49858
50073
|
}
|
|
49859
|
-
replaceCells(
|
|
50074
|
+
replaceCells(start3, end, fillCellData, respectProtect = false) {
|
|
49860
50075
|
if (respectProtect) {
|
|
49861
|
-
if (
|
|
49862
|
-
this.setCellFromCodepoint(
|
|
50076
|
+
if (start3 && this.getWidth(start3 - 1) === 2 && !this.isProtected(start3 - 1)) {
|
|
50077
|
+
this.setCellFromCodepoint(start3 - 1, 0, 1, fillCellData);
|
|
49863
50078
|
}
|
|
49864
50079
|
if (end < this.length && this.getWidth(end - 1) === 2 && !this.isProtected(end)) {
|
|
49865
50080
|
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
|
49866
50081
|
}
|
|
49867
|
-
while (
|
|
49868
|
-
if (!this.isProtected(
|
|
49869
|
-
this.setCell(
|
|
50082
|
+
while (start3 < end && start3 < this.length) {
|
|
50083
|
+
if (!this.isProtected(start3)) {
|
|
50084
|
+
this.setCell(start3, fillCellData);
|
|
49870
50085
|
}
|
|
49871
|
-
|
|
50086
|
+
start3++;
|
|
49872
50087
|
}
|
|
49873
50088
|
return;
|
|
49874
50089
|
}
|
|
49875
|
-
if (
|
|
49876
|
-
this.setCellFromCodepoint(
|
|
50090
|
+
if (start3 && this.getWidth(start3 - 1) === 2) {
|
|
50091
|
+
this.setCellFromCodepoint(start3 - 1, 0, 1, fillCellData);
|
|
49877
50092
|
}
|
|
49878
50093
|
if (end < this.length && this.getWidth(end - 1) === 2) {
|
|
49879
50094
|
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
|
49880
50095
|
}
|
|
49881
|
-
while (
|
|
49882
|
-
this.setCell(
|
|
50096
|
+
while (start3 < end && start3 < this.length) {
|
|
50097
|
+
this.setCell(start3++, fillCellData);
|
|
49883
50098
|
}
|
|
49884
50099
|
}
|
|
49885
50100
|
/**
|
|
@@ -50344,22 +50559,22 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50344
50559
|
* @param deleteCount The number of elements to delete.
|
|
50345
50560
|
* @param items The items to insert.
|
|
50346
50561
|
*/
|
|
50347
|
-
splice(
|
|
50562
|
+
splice(start3, deleteCount, ...items) {
|
|
50348
50563
|
if (deleteCount) {
|
|
50349
|
-
for (let i =
|
|
50564
|
+
for (let i = start3; i < this._length - deleteCount; i++) {
|
|
50350
50565
|
this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];
|
|
50351
50566
|
}
|
|
50352
50567
|
this._length -= deleteCount;
|
|
50353
|
-
this.onDeleteEmitter.fire({ index:
|
|
50568
|
+
this.onDeleteEmitter.fire({ index: start3, amount: deleteCount });
|
|
50354
50569
|
}
|
|
50355
|
-
for (let i = this._length - 1; i >=
|
|
50570
|
+
for (let i = this._length - 1; i >= start3; i--) {
|
|
50356
50571
|
this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];
|
|
50357
50572
|
}
|
|
50358
50573
|
for (let i = 0; i < items.length; i++) {
|
|
50359
|
-
this._array[this._getCyclicIndex(
|
|
50574
|
+
this._array[this._getCyclicIndex(start3 + i)] = items[i];
|
|
50360
50575
|
}
|
|
50361
50576
|
if (items.length) {
|
|
50362
|
-
this.onInsertEmitter.fire({ index:
|
|
50577
|
+
this.onInsertEmitter.fire({ index: start3, amount: items.length });
|
|
50363
50578
|
}
|
|
50364
50579
|
if (this._length + items.length > this._maxLength) {
|
|
50365
50580
|
const countToTrim = this._length + items.length - this._maxLength;
|
|
@@ -50382,21 +50597,21 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50382
50597
|
this._length -= count;
|
|
50383
50598
|
this.onTrimEmitter.fire(count);
|
|
50384
50599
|
}
|
|
50385
|
-
shiftElements(
|
|
50600
|
+
shiftElements(start3, count, offset) {
|
|
50386
50601
|
if (count <= 0) {
|
|
50387
50602
|
return;
|
|
50388
50603
|
}
|
|
50389
|
-
if (
|
|
50604
|
+
if (start3 < 0 || start3 >= this._length) {
|
|
50390
50605
|
throw new Error("start argument out of range");
|
|
50391
50606
|
}
|
|
50392
|
-
if (
|
|
50607
|
+
if (start3 + offset < 0) {
|
|
50393
50608
|
throw new Error("Cannot shift elements in list beyond index 0");
|
|
50394
50609
|
}
|
|
50395
50610
|
if (offset > 0) {
|
|
50396
50611
|
for (let i = count - 1; i >= 0; i--) {
|
|
50397
|
-
this.set(
|
|
50612
|
+
this.set(start3 + i + offset, this.get(start3 + i));
|
|
50398
50613
|
}
|
|
50399
|
-
const expandListBy =
|
|
50614
|
+
const expandListBy = start3 + count + offset - this._length;
|
|
50400
50615
|
if (expandListBy > 0) {
|
|
50401
50616
|
this._length += expandListBy;
|
|
50402
50617
|
while (this._length > this._maxLength) {
|
|
@@ -50407,7 +50622,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
50407
50622
|
}
|
|
50408
50623
|
} else {
|
|
50409
50624
|
for (let i = 0; i < count; i++) {
|
|
50410
|
-
this.set(
|
|
50625
|
+
this.set(start3 + i + offset, this.get(start3 + i));
|
|
50411
50626
|
}
|
|
50412
50627
|
}
|
|
50413
50628
|
}
|
|
@@ -52365,10 +52580,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52365
52580
|
const res = [];
|
|
52366
52581
|
for (let i = 0; i < this.length; ++i) {
|
|
52367
52582
|
res.push(this.params[i]);
|
|
52368
|
-
const
|
|
52583
|
+
const start3 = this._subParamsIdx[i] >> 8;
|
|
52369
52584
|
const end = this._subParamsIdx[i] & 255;
|
|
52370
|
-
if (end -
|
|
52371
|
-
res.push(Array.prototype.slice.call(this._subParams,
|
|
52585
|
+
if (end - start3 > 0) {
|
|
52586
|
+
res.push(Array.prototype.slice.call(this._subParams, start3, end));
|
|
52372
52587
|
}
|
|
52373
52588
|
}
|
|
52374
52589
|
return res;
|
|
@@ -52436,10 +52651,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52436
52651
|
* the values if you need to hold them in nonlocal scope.
|
|
52437
52652
|
*/
|
|
52438
52653
|
getSubParams(idx) {
|
|
52439
|
-
const
|
|
52654
|
+
const start3 = this._subParamsIdx[idx] >> 8;
|
|
52440
52655
|
const end = this._subParamsIdx[idx] & 255;
|
|
52441
|
-
if (end -
|
|
52442
|
-
return this._subParams.subarray(
|
|
52656
|
+
if (end - start3 > 0) {
|
|
52657
|
+
return this._subParams.subarray(start3, end);
|
|
52443
52658
|
}
|
|
52444
52659
|
return null;
|
|
52445
52660
|
}
|
|
@@ -52450,10 +52665,10 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52450
52665
|
getSubParamsAll() {
|
|
52451
52666
|
const result2 = {};
|
|
52452
52667
|
for (let i = 0; i < this.length; ++i) {
|
|
52453
|
-
const
|
|
52668
|
+
const start3 = this._subParamsIdx[i] >> 8;
|
|
52454
52669
|
const end = this._subParamsIdx[i] & 255;
|
|
52455
|
-
if (end -
|
|
52456
|
-
result2[i] = this._subParams.slice(
|
|
52670
|
+
if (end - start3 > 0) {
|
|
52671
|
+
result2[i] = this._subParams.slice(start3, end);
|
|
52457
52672
|
}
|
|
52458
52673
|
}
|
|
52459
52674
|
return result2;
|
|
@@ -52535,12 +52750,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52535
52750
|
}
|
|
52536
52751
|
}
|
|
52537
52752
|
}
|
|
52538
|
-
_put(data,
|
|
52753
|
+
_put(data, start3, end) {
|
|
52539
52754
|
if (!this._active.length) {
|
|
52540
|
-
this._handlerFb(this._id, "PUT", utf32ToString(data,
|
|
52755
|
+
this._handlerFb(this._id, "PUT", utf32ToString(data, start3, end));
|
|
52541
52756
|
} else {
|
|
52542
52757
|
for (let j = this._active.length - 1; j >= 0; j--) {
|
|
52543
|
-
this._active[j].put(data,
|
|
52758
|
+
this._active[j].put(data, start3, end);
|
|
52544
52759
|
}
|
|
52545
52760
|
}
|
|
52546
52761
|
}
|
|
@@ -52555,13 +52770,13 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52555
52770
|
* Payload chunks are not further processed and get
|
|
52556
52771
|
* directly passed to the handlers.
|
|
52557
52772
|
*/
|
|
52558
|
-
put(data,
|
|
52773
|
+
put(data, start3, end) {
|
|
52559
52774
|
if (this._state === 3) {
|
|
52560
52775
|
return;
|
|
52561
52776
|
}
|
|
52562
52777
|
if (this._state === 1) {
|
|
52563
|
-
while (
|
|
52564
|
-
const code2 = data[
|
|
52778
|
+
while (start3 < end) {
|
|
52779
|
+
const code2 = data[start3++];
|
|
52565
52780
|
if (code2 === 59) {
|
|
52566
52781
|
this._state = 2;
|
|
52567
52782
|
this._start();
|
|
@@ -52577,8 +52792,8 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52577
52792
|
this._id = this._id * 10 + code2 - 48;
|
|
52578
52793
|
}
|
|
52579
52794
|
}
|
|
52580
|
-
if (this._state === 2 && end -
|
|
52581
|
-
this._put(data,
|
|
52795
|
+
if (this._state === 2 && end - start3 > 0) {
|
|
52796
|
+
this._put(data, start3, end);
|
|
52582
52797
|
}
|
|
52583
52798
|
}
|
|
52584
52799
|
/**
|
|
@@ -52646,11 +52861,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52646
52861
|
this._data = "";
|
|
52647
52862
|
this._hitLimit = false;
|
|
52648
52863
|
}
|
|
52649
|
-
put(data,
|
|
52864
|
+
put(data, start3, end) {
|
|
52650
52865
|
if (this._hitLimit) {
|
|
52651
52866
|
return;
|
|
52652
52867
|
}
|
|
52653
|
-
this._data += utf32ToString(data,
|
|
52868
|
+
this._data += utf32ToString(data, start3, end);
|
|
52654
52869
|
if (this._data.length > PAYLOAD_LIMIT) {
|
|
52655
52870
|
this._data = "";
|
|
52656
52871
|
this._hitLimit = true;
|
|
@@ -52738,12 +52953,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52738
52953
|
}
|
|
52739
52954
|
}
|
|
52740
52955
|
}
|
|
52741
|
-
put(data,
|
|
52956
|
+
put(data, start3, end) {
|
|
52742
52957
|
if (!this._active.length) {
|
|
52743
|
-
this._handlerFb(this._ident, "PUT", utf32ToString(data,
|
|
52958
|
+
this._handlerFb(this._ident, "PUT", utf32ToString(data, start3, end));
|
|
52744
52959
|
} else {
|
|
52745
52960
|
for (let j = this._active.length - 1; j >= 0; j--) {
|
|
52746
|
-
this._active[j].put(data,
|
|
52961
|
+
this._active[j].put(data, start3, end);
|
|
52747
52962
|
}
|
|
52748
52963
|
}
|
|
52749
52964
|
}
|
|
@@ -52802,11 +53017,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52802
53017
|
this._data = "";
|
|
52803
53018
|
this._hitLimit = false;
|
|
52804
53019
|
}
|
|
52805
|
-
put(data,
|
|
53020
|
+
put(data, start3, end) {
|
|
52806
53021
|
if (this._hitLimit) {
|
|
52807
53022
|
return;
|
|
52808
53023
|
}
|
|
52809
|
-
this._data += utf32ToString(data,
|
|
53024
|
+
this._data += utf32ToString(data, start3, end);
|
|
52810
53025
|
if (this._data.length > PAYLOAD_LIMIT) {
|
|
52811
53026
|
this._data = "";
|
|
52812
53027
|
this._hitLimit = true;
|
|
@@ -52873,7 +53088,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
52873
53088
|
const table2 = new TransitionTable(4095);
|
|
52874
53089
|
const BYTE_VALUES = 256;
|
|
52875
53090
|
const blueprint = Array.apply(null, Array(BYTE_VALUES)).map((unused, i) => i);
|
|
52876
|
-
const r = (
|
|
53091
|
+
const r = (start3, end) => blueprint.slice(start3, end);
|
|
52877
53092
|
const PRINTABLES = r(32, 127);
|
|
52878
53093
|
const EXECUTABLES = r(0, 24);
|
|
52879
53094
|
EXECUTABLES.push(25);
|
|
@@ -53522,7 +53737,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53522
53737
|
this._params.addParam(0);
|
|
53523
53738
|
this._collect = 0;
|
|
53524
53739
|
this.precedingJoinState = 0;
|
|
53525
|
-
this._printHandlerFb = (data,
|
|
53740
|
+
this._printHandlerFb = (data, start3, end) => {
|
|
53526
53741
|
};
|
|
53527
53742
|
this._executeHandlerFb = (code2) => {
|
|
53528
53743
|
};
|
|
@@ -53747,12 +53962,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53747
53962
|
parse(data, length, promiseResult) {
|
|
53748
53963
|
let code2 = 0;
|
|
53749
53964
|
let transition = 0;
|
|
53750
|
-
let
|
|
53965
|
+
let start3 = 0;
|
|
53751
53966
|
let handlerResult;
|
|
53752
53967
|
if (this._parseStack.state) {
|
|
53753
53968
|
if (this._parseStack.state === 2) {
|
|
53754
53969
|
this._parseStack.state = 0;
|
|
53755
|
-
|
|
53970
|
+
start3 = this._parseStack.chunkPos + 1;
|
|
53756
53971
|
} else {
|
|
53757
53972
|
if (promiseResult === void 0 || this._parseStack.state === 1) {
|
|
53758
53973
|
this._parseStack.state = 1;
|
|
@@ -53813,12 +54028,12 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
53813
54028
|
break;
|
|
53814
54029
|
}
|
|
53815
54030
|
this._parseStack.state = 0;
|
|
53816
|
-
|
|
54031
|
+
start3 = this._parseStack.chunkPos + 1;
|
|
53817
54032
|
this.precedingJoinState = 0;
|
|
53818
54033
|
this.currentState = this._parseStack.transition & 15;
|
|
53819
54034
|
}
|
|
53820
54035
|
}
|
|
53821
|
-
for (let i =
|
|
54036
|
+
for (let i = start3; i < length; ++i) {
|
|
53822
54037
|
code2 = data[i];
|
|
53823
54038
|
transition = this._transitions.table[this.currentState << 8 | (code2 < 160 ? code2 : NON_ASCII_PRINTABLE)];
|
|
53824
54039
|
switch (transition >> 4) {
|
|
@@ -54066,7 +54281,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54066
54281
|
}
|
|
54067
54282
|
this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(ident), action, payload });
|
|
54068
54283
|
});
|
|
54069
|
-
this._parser.setPrintHandler((data,
|
|
54284
|
+
this._parser.setPrintHandler((data, start3, end) => this.print(data, start3, end));
|
|
54070
54285
|
this._parser.registerCsiHandler({ final: "@" }, (params) => this.insertChars(params));
|
|
54071
54286
|
this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (params) => this.scrollLeft(params));
|
|
54072
54287
|
this._parser.registerCsiHandler({ final: "A" }, (params) => this.cursorUp(params));
|
|
@@ -54220,7 +54435,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54220
54435
|
let result2;
|
|
54221
54436
|
let cursorStartX = this._activeBuffer.x;
|
|
54222
54437
|
let cursorStartY = this._activeBuffer.y;
|
|
54223
|
-
let
|
|
54438
|
+
let start3 = 0;
|
|
54224
54439
|
const wasPaused = this._parseStack.paused;
|
|
54225
54440
|
if (wasPaused) {
|
|
54226
54441
|
if (result2 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, promiseResult)) {
|
|
@@ -54231,7 +54446,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54231
54446
|
cursorStartY = this._parseStack.cursorStartY;
|
|
54232
54447
|
this._parseStack.paused = false;
|
|
54233
54448
|
if (data.length > MAX_PARSEBUFFER_LENGTH) {
|
|
54234
|
-
|
|
54449
|
+
start3 = this._parseStack.position + MAX_PARSEBUFFER_LENGTH;
|
|
54235
54450
|
}
|
|
54236
54451
|
}
|
|
54237
54452
|
if (this._logService.logLevel <= 1) {
|
|
@@ -54252,7 +54467,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54252
54467
|
this._dirtyRowTracker.clearRange();
|
|
54253
54468
|
}
|
|
54254
54469
|
if (data.length > MAX_PARSEBUFFER_LENGTH) {
|
|
54255
|
-
for (let i =
|
|
54470
|
+
for (let i = start3; i < data.length; i += MAX_PARSEBUFFER_LENGTH) {
|
|
54256
54471
|
const end = i + MAX_PARSEBUFFER_LENGTH < data.length ? i + MAX_PARSEBUFFER_LENGTH : data.length;
|
|
54257
54472
|
const len = typeof data === "string" ? this._stringDecoder.decode(data.substring(i, end), this._parseBuffer) : this._utf8Decoder.decode(data.subarray(i, end), this._parseBuffer);
|
|
54258
54473
|
if (result2 = this._parser.parse(this._parseBuffer, len)) {
|
|
@@ -54283,7 +54498,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54283
54498
|
});
|
|
54284
54499
|
}
|
|
54285
54500
|
}
|
|
54286
|
-
print(data,
|
|
54501
|
+
print(data, start3, end) {
|
|
54287
54502
|
let code2;
|
|
54288
54503
|
let chWidth;
|
|
54289
54504
|
const charset = this._charsetService.charset;
|
|
@@ -54294,11 +54509,11 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54294
54509
|
const curAttr = this._curAttrData;
|
|
54295
54510
|
let bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
|
|
54296
54511
|
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
|
54297
|
-
if (this._activeBuffer.x && end -
|
|
54512
|
+
if (this._activeBuffer.x && end - start3 > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {
|
|
54298
54513
|
bufferRow.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, curAttr);
|
|
54299
54514
|
}
|
|
54300
54515
|
let precedingJoinState = this._parser.precedingJoinState;
|
|
54301
|
-
for (let pos =
|
|
54516
|
+
for (let pos = start3; pos < end; ++pos) {
|
|
54302
54517
|
code2 = data[pos];
|
|
54303
54518
|
if (code2 < 127 && charset) {
|
|
54304
54519
|
const ch = charset[String.fromCharCode(code2)];
|
|
@@ -54382,7 +54597,7 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54382
54597
|
}
|
|
54383
54598
|
}
|
|
54384
54599
|
this._parser.precedingJoinState = precedingJoinState;
|
|
54385
|
-
if (this._activeBuffer.x < cols && end -
|
|
54600
|
+
if (this._activeBuffer.x < cols && end - start3 > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {
|
|
54386
54601
|
bufferRow.setCellFromCodepoint(this._activeBuffer.x, 0, 1, curAttr);
|
|
54387
54602
|
}
|
|
54388
54603
|
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
|
@@ -54808,15 +55023,15 @@ ${stackTraceFormattedLines.join("\n")}
|
|
|
54808
55023
|
* @param clearWrap clear the isWrapped flag
|
|
54809
55024
|
* @param respectProtect Whether to respect the protection attribute (DECSCA).
|
|
54810
55025
|
*/
|
|
54811
|
-
_eraseInBufferLine(y,
|
|
55026
|
+
_eraseInBufferLine(y, start3, end, clearWrap = false, respectProtect = false) {
|
|
54812
55027
|
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y);
|
|
54813
55028
|
line.replaceCells(
|
|
54814
|
-
|
|
55029
|
+
start3,
|
|
54815
55030
|
end,
|
|
54816
55031
|
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
|
54817
55032
|
respectProtect
|
|
54818
55033
|
);
|
|
54819
|
-
if (!respectProtect &&
|
|
55034
|
+
if (!respectProtect && start3 === 0 && end >= this._bufferService.cols) line.tmuxCellUsed = 0;
|
|
54820
55035
|
if (clearWrap) {
|
|
54821
55036
|
line.isWrapped = false;
|
|
54822
55037
|
}
|
|
@@ -64387,7 +64602,7 @@ var init_authority_arbiter = __esm({
|
|
|
64387
64602
|
});
|
|
64388
64603
|
|
|
64389
64604
|
// packages/daemon/src/terminal/session-runtime/registry.ts
|
|
64390
|
-
import { randomUUID as
|
|
64605
|
+
import { randomUUID as randomUUID29 } from "node:crypto";
|
|
64391
64606
|
import { z as z109 } from "zod";
|
|
64392
64607
|
async function abortable(promise, signal) {
|
|
64393
64608
|
if (!signal) return promise;
|
|
@@ -64585,7 +64800,7 @@ var init_registry2 = __esm({
|
|
|
64585
64800
|
observability: options.semanticMutations.observability ?? this.#observability
|
|
64586
64801
|
}) : null;
|
|
64587
64802
|
this.#resolveSession = options.semanticMutations?.resolveSession ?? null;
|
|
64588
|
-
this.#createControllerToken = options.createControllerToken ??
|
|
64803
|
+
this.#createControllerToken = options.createControllerToken ?? randomUUID29;
|
|
64589
64804
|
this.#nativeGeometryHysteresisMs = options.nativeGeometryHysteresisMs;
|
|
64590
64805
|
this.#stopExitObserver = this.#mirror.onSessionExit((session) => {
|
|
64591
64806
|
this.#sessions.get(session)?.noteControlExit();
|
|
@@ -66974,7 +67189,7 @@ var init_grouped_tmux = __esm({
|
|
|
66974
67189
|
});
|
|
66975
67190
|
|
|
66976
67191
|
// packages/daemon/src/terminal/attachments/lease-manager.ts
|
|
66977
|
-
import { createHash as createHash21, randomBytes as randomBytes5, randomUUID as
|
|
67192
|
+
import { createHash as createHash21, randomBytes as randomBytes5, randomUUID as randomUUID30, timingSafeEqual as timingSafeEqual3 } from "node:crypto";
|
|
66978
67193
|
import { z as z113 } from "zod";
|
|
66979
67194
|
function positiveDuration(value, fallback, label4) {
|
|
66980
67195
|
const resolved2 = value ?? fallback;
|
|
@@ -67047,7 +67262,7 @@ var init_lease_manager = __esm({
|
|
|
67047
67262
|
this.#viewExecutor = options.viewExecutor;
|
|
67048
67263
|
this.#now = options.now ?? Date.now;
|
|
67049
67264
|
this.#randomBytes = options.randomBytes ?? randomBytes5;
|
|
67050
|
-
this.#createId = options.createId ??
|
|
67265
|
+
this.#createId = options.createId ?? randomUUID30;
|
|
67051
67266
|
this.#ticketTtlMs = positiveDuration(options.ticketTtlMs, 15e3, "ticketTtlMs");
|
|
67052
67267
|
this.#leaseTtlMs = positiveDuration(options.leaseTtlMs, 6e4, "leaseTtlMs");
|
|
67053
67268
|
this.#maxLeaseTtlMs = positiveDuration(
|
|
@@ -69794,7 +70009,7 @@ var init_tmux_view_executor = __esm({
|
|
|
69794
70009
|
// packages/daemon/src/terminal/attachments/pty-tmux-attachment-launcher.ts
|
|
69795
70010
|
import { accessSync as accessSync8, constants as constants14, realpathSync as realpathSync16, statSync as statSync14 } from "node:fs";
|
|
69796
70011
|
import { delimiter as delimiter3, isAbsolute as isAbsolute20, join as join35 } from "node:path";
|
|
69797
|
-
import { randomUUID as
|
|
70012
|
+
import { randomUUID as randomUUID31 } from "node:crypto";
|
|
69798
70013
|
import { execFileSync as execFileSync16 } from "node:child_process";
|
|
69799
70014
|
function defaultSchedule2(callback, delayMs) {
|
|
69800
70015
|
const timer = setTimeout(callback, delayMs);
|
|
@@ -69988,7 +70203,7 @@ var init_pty_tmux_attachment_launcher = __esm({
|
|
|
69988
70203
|
if (existing) this.#dispose(existing);
|
|
69989
70204
|
this.#reservedAttachments.add(request3.identity.attachmentId);
|
|
69990
70205
|
const lifecycleEpoch = this.#lifecycleEpoch;
|
|
69991
|
-
const attemptId =
|
|
70206
|
+
const attemptId = randomUUID31();
|
|
69992
70207
|
let resolveOutcome;
|
|
69993
70208
|
const outcome = new Promise((resolve45) => {
|
|
69994
70209
|
resolveOutcome = resolve45;
|
|
@@ -72328,7 +72543,7 @@ var init_agent_status_probe = __esm({
|
|
|
72328
72543
|
});
|
|
72329
72544
|
|
|
72330
72545
|
// packages/daemon/src/terminal/pane-stream/lease-manager.ts
|
|
72331
|
-
import { createHash as createHash22, randomBytes as randomBytes6, randomUUID as
|
|
72546
|
+
import { createHash as createHash22, randomBytes as randomBytes6, randomUUID as randomUUID32, timingSafeEqual as timingSafeEqual4 } from "node:crypto";
|
|
72332
72547
|
import { z as z117 } from "zod";
|
|
72333
72548
|
function positiveDuration2(value, fallback, label4) {
|
|
72334
72549
|
const resolved2 = value ?? fallback;
|
|
@@ -72381,7 +72596,7 @@ var init_lease_manager2 = __esm({
|
|
|
72381
72596
|
this.#instanceId = BindingIdSchemaZ3.parse(options.daemonInstanceId);
|
|
72382
72597
|
this.#now = options.now ?? Date.now;
|
|
72383
72598
|
this.#randomBytes = options.randomBytes ?? randomBytes6;
|
|
72384
|
-
this.#createId = options.createId ??
|
|
72599
|
+
this.#createId = options.createId ?? randomUUID32;
|
|
72385
72600
|
this.#ticketTtlMs = positiveDuration2(options.ticketTtlMs, 15e3, "ticketTtlMs");
|
|
72386
72601
|
this.#redemptionProcessingTtlMs = positiveDuration2(
|
|
72387
72602
|
options.redemptionProcessingTtlMs,
|
|
@@ -72549,7 +72764,7 @@ var init_lease_manager2 = __esm({
|
|
|
72549
72764
|
});
|
|
72550
72765
|
|
|
72551
72766
|
// packages/daemon/src/terminal/graphics/native-surface-viewer.ts
|
|
72552
|
-
import { randomUUID as
|
|
72767
|
+
import { randomUUID as randomUUID33 } from "node:crypto";
|
|
72553
72768
|
var MAX_RETAINED, NativeSurfaceViewer;
|
|
72554
72769
|
var init_native_surface_viewer = __esm({
|
|
72555
72770
|
"packages/daemon/src/terminal/graphics/native-surface-viewer.ts"() {
|
|
@@ -72582,7 +72797,7 @@ var init_native_surface_viewer = __esm({
|
|
|
72582
72797
|
this.#active?.session.fallback("unsupported");
|
|
72583
72798
|
this.#active = null;
|
|
72584
72799
|
this.#prune();
|
|
72585
|
-
this.#nonce = available ?
|
|
72800
|
+
this.#nonce = available ? randomUUID33() : null;
|
|
72586
72801
|
this.#used = false;
|
|
72587
72802
|
this.#send({
|
|
72588
72803
|
type: "terminal-surface-available",
|
|
@@ -74454,9 +74669,9 @@ var init_pane_stream_websocket = __esm({
|
|
|
74454
74669
|
if (!batch || this.#closed || channel.closed) return;
|
|
74455
74670
|
let seed = batch.seed ?? new Uint8Array(0);
|
|
74456
74671
|
if (seed.byteLength > PANE_STREAM_MAX_SEED_BYTES) {
|
|
74457
|
-
let
|
|
74458
|
-
while (
|
|
74459
|
-
seed = seed.subarray(Math.min(
|
|
74672
|
+
let start3 = seed.byteLength - PANE_STREAM_MAX_SEED_BYTES;
|
|
74673
|
+
while (start3 < seed.byteLength && seed[start3] !== 10) start3 += 1;
|
|
74674
|
+
seed = seed.subarray(Math.min(start3 + 1, seed.byteLength));
|
|
74460
74675
|
}
|
|
74461
74676
|
const held = chunkBytes(concatBytes(batch.held), PANE_STREAM_MAX_OUTPUT_BYTES).slice(
|
|
74462
74677
|
0,
|
|
@@ -75757,7 +75972,7 @@ var init_interaction_observation_status = __esm({
|
|
|
75757
75972
|
});
|
|
75758
75973
|
|
|
75759
75974
|
// packages/daemon/src/lib/interaction-evidence-authority.ts
|
|
75760
|
-
import { randomUUID as
|
|
75975
|
+
import { randomUUID as randomUUID34 } from "node:crypto";
|
|
75761
75976
|
var HISTORY_CAPACITY, HISTORY_MS, runtimeKey, bindingKey, InteractionEvidenceAuthority;
|
|
75762
75977
|
var init_interaction_evidence_authority = __esm({
|
|
75763
75978
|
"packages/daemon/src/lib/interaction-evidence-authority.ts"() {
|
|
@@ -75820,7 +76035,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75820
76035
|
if (!/^\$(?:0|[1-9][0-9]*)$/u.test(row.sessionId) || !/^%(?:0|[1-9][0-9]*)$/u.test(row.runtimePaneId) || !row.semanticPaneId)
|
|
75821
76036
|
continue;
|
|
75822
76037
|
const lifetimeKey = `${row.runtimePaneId}\0${row.semanticPaneId}`;
|
|
75823
|
-
const paneLifetimeId = lifetimes.get(lifetimeKey) ??
|
|
76038
|
+
const paneLifetimeId = lifetimes.get(lifetimeKey) ?? randomUUID34();
|
|
75824
76039
|
const result2 = InteractionPaneEndpointSchemaZ.safeParse({
|
|
75825
76040
|
kind: "pane",
|
|
75826
76041
|
environmentId: this.#environmentId,
|
|
@@ -75864,7 +76079,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75864
76079
|
kind: "unresolved-pane",
|
|
75865
76080
|
environmentId: this.#environmentId,
|
|
75866
76081
|
serverScope: structuredClone(this.#serverScope),
|
|
75867
|
-
observationRef:
|
|
76082
|
+
observationRef: randomUUID34()
|
|
75868
76083
|
};
|
|
75869
76084
|
}
|
|
75870
76085
|
/** Join a fresh fleet row only to the exact current native binding. */
|
|
@@ -75890,7 +76105,7 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75890
76105
|
kind: "unresolved-pane",
|
|
75891
76106
|
environmentId: this.#environmentId,
|
|
75892
76107
|
serverScope: structuredClone(this.#serverScope),
|
|
75893
|
-
observationRef:
|
|
76108
|
+
observationRef: randomUUID34()
|
|
75894
76109
|
};
|
|
75895
76110
|
}
|
|
75896
76111
|
/** Grant must come directly from the current credential authority, never caller JSON. */
|
|
@@ -75919,10 +76134,10 @@ var init_interaction_evidence_authority = __esm({
|
|
|
75919
76134
|
});
|
|
75920
76135
|
|
|
75921
76136
|
// packages/daemon/src/lib/tmux-interaction-observation-handler.ts
|
|
75922
|
-
import { randomUUID as
|
|
76137
|
+
import { randomUUID as randomUUID35 } from "node:crypto";
|
|
75923
76138
|
function externalTmuxInteractionDraft(observation2, destination) {
|
|
75924
76139
|
const { workspaceName, semanticPaneId: semanticPaneId3, operationKind } = observation2;
|
|
75925
|
-
const operationId =
|
|
76140
|
+
const operationId = randomUUID35();
|
|
75926
76141
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
75927
76142
|
return {
|
|
75928
76143
|
evidence: InteractionEvidenceSchemaZ.parse({
|
|
@@ -75974,7 +76189,7 @@ var init_tmux_interaction_observation_handler = __esm({
|
|
|
75974
76189
|
|
|
75975
76190
|
// packages/daemon/src/lib/tmux-server-owner.ts
|
|
75976
76191
|
import { execFileSync as execFileSync17 } from "node:child_process";
|
|
75977
|
-
import { createHash as createHash23, randomUUID as
|
|
76192
|
+
import { createHash as createHash23, randomUUID as randomUUID36 } from "node:crypto";
|
|
75978
76193
|
import { mkdirSync as mkdirSync21 } from "node:fs";
|
|
75979
76194
|
import { z as z119 } from "zod";
|
|
75980
76195
|
function discoveredWorkspaceName(registry, sessionName) {
|
|
@@ -76230,6 +76445,7 @@ async function createNativeTmuxServerOwner(options) {
|
|
|
76230
76445
|
observation: () => observationSelector ?? null,
|
|
76231
76446
|
runPinnedTmux: generationRun
|
|
76232
76447
|
}),
|
|
76448
|
+
splitLayoutStock: createStockSplitProbe({ runPinnedTmux: generationRun }),
|
|
76233
76449
|
createOwnedViewerAdapter: createOwnedViewerAdapterFactory({
|
|
76234
76450
|
environmentId: options.environmentId,
|
|
76235
76451
|
serverScope: { serverId: options.serverId, generation },
|
|
@@ -76307,7 +76523,7 @@ async function createNativeTmuxServerOwner(options) {
|
|
|
76307
76523
|
gap.reason === "overflow" ? "retention-overflow" : gap.reason === "hooks-replaced" ? "hooks-replaced" : "uncertain-consume"
|
|
76308
76524
|
);
|
|
76309
76525
|
},
|
|
76310
|
-
internalReadOwnerToken:
|
|
76526
|
+
internalReadOwnerToken: randomUUID36(),
|
|
76311
76527
|
registry: workspaceRegistry,
|
|
76312
76528
|
tmuxAuthority: authority2,
|
|
76313
76529
|
io: { runTmux: generationRunAsync },
|
|
@@ -76599,7 +76815,7 @@ var init_tmux_server_owner = __esm({
|
|
|
76599
76815
|
});
|
|
76600
76816
|
|
|
76601
76817
|
// packages/daemon/src/lib/tmux-server-owners.ts
|
|
76602
|
-
import { randomUUID as
|
|
76818
|
+
import { randomUUID as randomUUID37 } from "node:crypto";
|
|
76603
76819
|
var MAX_TMUX_SERVER_OWNERS, TmuxServerSelectorSchemaZ, TmuxServerRegistrationSchemaZ, TmuxServerScopeError, TmuxServerOwners;
|
|
76604
76820
|
var init_tmux_server_owners = __esm({
|
|
76605
76821
|
"packages/daemon/src/lib/tmux-server-owners.ts"() {
|
|
@@ -76671,7 +76887,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76671
76887
|
(other) => other !== entry && other.observation?.fingerprint === next.fingerprint && other.observation.valid()
|
|
76672
76888
|
);
|
|
76673
76889
|
if (duplicate) return;
|
|
76674
|
-
const scope2 = { serverId: entry.registration.serverId, generation:
|
|
76890
|
+
const scope2 = { serverId: entry.registration.serverId, generation: randomUUID37() };
|
|
76675
76891
|
let owner;
|
|
76676
76892
|
try {
|
|
76677
76893
|
owner = await this.options.create(entry.registration, scope2, next);
|
|
@@ -76690,7 +76906,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76690
76906
|
return this.#serial(async () => {
|
|
76691
76907
|
const registration = TmuxServerRegistrationSchemaZ.parse({
|
|
76692
76908
|
...input,
|
|
76693
|
-
serverId: input.serverId ?? `tmux-server.${
|
|
76909
|
+
serverId: input.serverId ?? `tmux-server.${randomUUID37().replaceAll("-", "")}`
|
|
76694
76910
|
});
|
|
76695
76911
|
const sameSelector = [...this.#entries.values()].find(
|
|
76696
76912
|
(entry2) => JSON.stringify(entry2.registration.selector) === JSON.stringify(registration.selector)
|
|
@@ -76791,7 +77007,7 @@ var init_tmux_server_owners = __esm({
|
|
|
76791
77007
|
// packages/daemon/src/lib/tmux-server-registration.ts
|
|
76792
77008
|
import { execFile as execFile11 } from "node:child_process";
|
|
76793
77009
|
import { promisify as promisify2 } from "node:util";
|
|
76794
|
-
import { createHash as createHash24, randomUUID as
|
|
77010
|
+
import { createHash as createHash24, randomUUID as randomUUID38 } from "node:crypto";
|
|
76795
77011
|
import {
|
|
76796
77012
|
mkdirSync as mkdirSync22,
|
|
76797
77013
|
readFileSync as readFileSync24,
|
|
@@ -76813,7 +77029,7 @@ function readTmuxServerRegistrations(path2) {
|
|
|
76813
77029
|
function writeTmuxServerRegistrations(path2, registrations) {
|
|
76814
77030
|
const file = FileSchema2.parse({ version: 1, servers: registrations });
|
|
76815
77031
|
mkdirSync22(dirname29(path2), { recursive: true, mode: 448 });
|
|
76816
|
-
const temporary = `${path2}.${
|
|
77032
|
+
const temporary = `${path2}.${randomUUID38()}.tmp`;
|
|
76817
77033
|
try {
|
|
76818
77034
|
writeFileSync19(temporary, `${JSON.stringify(file, null, 2)}
|
|
76819
77035
|
`, { mode: 384, flag: "wx" });
|
|
@@ -77010,7 +77226,7 @@ var init_pane_stream_upgrade = __esm({
|
|
|
77010
77226
|
});
|
|
77011
77227
|
|
|
77012
77228
|
// packages/daemon/src/lib/embedded-tmux-server-owners.ts
|
|
77013
|
-
import { randomUUID as
|
|
77229
|
+
import { randomUUID as randomUUID39 } from "node:crypto";
|
|
77014
77230
|
import { join as join36 } from "node:path";
|
|
77015
77231
|
async function createEmbeddedTmuxServerOwners(options) {
|
|
77016
77232
|
const path2 = join36(options.stateDirectory, "tmux-servers.json");
|
|
@@ -77030,7 +77246,7 @@ async function createEmbeddedTmuxServerOwners(options) {
|
|
|
77030
77246
|
}
|
|
77031
77247
|
}
|
|
77032
77248
|
const defaultRegistration = established ?? {
|
|
77033
|
-
serverId: `tmux-server.${
|
|
77249
|
+
serverId: `tmux-server.${randomUUID39().replaceAll("-", "")}`,
|
|
77034
77250
|
label: "Default",
|
|
77035
77251
|
selector: options.defaultAuthority.socketSelector
|
|
77036
77252
|
};
|
|
@@ -77497,7 +77713,7 @@ var init_terminal_native_backing_route = __esm({
|
|
|
77497
77713
|
});
|
|
77498
77714
|
|
|
77499
77715
|
// packages/daemon/src/lib/embedded-daemon-lifecycle.ts
|
|
77500
|
-
async function startOwnedEmbeddedDaemon(options,
|
|
77716
|
+
async function startOwnedEmbeddedDaemon(options, start3) {
|
|
77501
77717
|
let closed = false;
|
|
77502
77718
|
let available = false;
|
|
77503
77719
|
let current;
|
|
@@ -77505,7 +77721,7 @@ async function startOwnedEmbeddedDaemon(options, start2) {
|
|
|
77505
77721
|
let stopping = null;
|
|
77506
77722
|
let pendingRequest = null;
|
|
77507
77723
|
const launch2 = async (nextOptions) => {
|
|
77508
|
-
const generation = await
|
|
77724
|
+
const generation = await start3({
|
|
77509
77725
|
...nextOptions,
|
|
77510
77726
|
requestRestart: (request3) => restart2(generation, request3)
|
|
77511
77727
|
});
|
|
@@ -81658,7 +81874,7 @@ var init_workspace_open2 = __esm({
|
|
|
81658
81874
|
});
|
|
81659
81875
|
|
|
81660
81876
|
// packages/daemon/src/lib/workspace-open-handoff.ts
|
|
81661
|
-
import { randomUUID as
|
|
81877
|
+
import { randomUUID as randomUUID40 } from "node:crypto";
|
|
81662
81878
|
var WorkspaceOpenHandoffError, WorkspaceOpenHandoffCoordinator;
|
|
81663
81879
|
var init_workspace_open_handoff2 = __esm({
|
|
81664
81880
|
"packages/daemon/src/lib/workspace-open-handoff.ts"() {
|
|
@@ -81722,7 +81938,7 @@ var init_workspace_open_handoff2 = __esm({
|
|
|
81722
81938
|
const preferredPaneId = "initialPaneId" in opened.resource ? opened.resource.initialPaneId : void 0;
|
|
81723
81939
|
const proof = await this.#deps.prepareRuntime(workspaceName, preferredPaneId);
|
|
81724
81940
|
this.#assertCurrent(ownerClientId, revision, expectedDaemonInstanceId);
|
|
81725
|
-
const token2 =
|
|
81941
|
+
const token2 = randomUUID40();
|
|
81726
81942
|
const result2 = {
|
|
81727
81943
|
operationId,
|
|
81728
81944
|
daemonInstanceId: this.#deps.daemonInstanceId,
|
|
@@ -82811,11 +83027,11 @@ function boundedCoordinate(value, path2) {
|
|
|
82811
83027
|
}
|
|
82812
83028
|
return Math.max(-APP_WINDOW_COORDINATE_LIMIT, Math.min(APP_WINDOW_COORDINATE_LIMIT, value));
|
|
82813
83029
|
}
|
|
82814
|
-
function boundedExtent(value,
|
|
83030
|
+
function boundedExtent(value, minimum2, path2) {
|
|
82815
83031
|
if (!Number.isFinite(value)) {
|
|
82816
83032
|
throw new AppWindowKernelError("INVALID_INPUT", path2, "extent must be finite");
|
|
82817
83033
|
}
|
|
82818
|
-
return Math.max(
|
|
83034
|
+
return Math.max(minimum2, Math.min(APP_WINDOW_COORDINATE_LIMIT, value));
|
|
82819
83035
|
}
|
|
82820
83036
|
function requireTimestamp(previous, value) {
|
|
82821
83037
|
let timestamp;
|
|
@@ -83597,7 +83813,7 @@ var init_terminal_attachment_upgrade = __esm({
|
|
|
83597
83813
|
});
|
|
83598
83814
|
|
|
83599
83815
|
// packages/daemon/src/terminal/graphics/native-surface-provider-channel.ts
|
|
83600
|
-
import { randomUUID as
|
|
83816
|
+
import { randomUUID as randomUUID41 } from "node:crypto";
|
|
83601
83817
|
import { z as z123 } from "zod";
|
|
83602
83818
|
var Register, Offer, WatchDemand, NativeSurfaceProviderChannel;
|
|
83603
83819
|
var init_native_surface_provider_channel = __esm({
|
|
@@ -83703,7 +83919,7 @@ var init_native_surface_provider_channel = __esm({
|
|
|
83703
83919
|
#open(context) {
|
|
83704
83920
|
if (this.#closed || this.#connections.size >= 32)
|
|
83705
83921
|
throw new Error("Native provider unavailable");
|
|
83706
|
-
const connection =
|
|
83922
|
+
const connection = randomUUID41();
|
|
83707
83923
|
this.#connections.set(connection, context);
|
|
83708
83924
|
return {
|
|
83709
83925
|
start: () => {
|
|
@@ -83851,7 +84067,7 @@ var init_active_projects = __esm({
|
|
|
83851
84067
|
});
|
|
83852
84068
|
|
|
83853
84069
|
// packages/daemon/src/lib/environment-identity.ts
|
|
83854
|
-
import { randomUUID as
|
|
84070
|
+
import { randomUUID as randomUUID42 } from "node:crypto";
|
|
83855
84071
|
import { linkSync as linkSync3, mkdirSync as mkdirSync24, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync21 } from "node:fs";
|
|
83856
84072
|
import { dirname as dirname32, join as join39 } from "node:path";
|
|
83857
84073
|
function environmentIdentityPath() {
|
|
@@ -83868,7 +84084,7 @@ function readPersistedEnvironmentId(path2) {
|
|
|
83868
84084
|
}
|
|
83869
84085
|
}
|
|
83870
84086
|
function persistEnvironmentId(path2, environmentId) {
|
|
83871
|
-
const temporary = `${path2}.${process.pid}.${
|
|
84087
|
+
const temporary = `${path2}.${process.pid}.${randomUUID42()}.tmp`;
|
|
83872
84088
|
try {
|
|
83873
84089
|
mkdirSync24(dirname32(path2), { recursive: true });
|
|
83874
84090
|
writeFileSync21(
|
|
@@ -83894,7 +84110,7 @@ function readOrMintEnvironmentId() {
|
|
|
83894
84110
|
rmSync4(path2, { force: true });
|
|
83895
84111
|
} catch {
|
|
83896
84112
|
}
|
|
83897
|
-
const minted =
|
|
84113
|
+
const minted = randomUUID42();
|
|
83898
84114
|
persistEnvironmentId(path2, minted);
|
|
83899
84115
|
return readPersistedEnvironmentId(path2) ?? minted;
|
|
83900
84116
|
}
|
|
@@ -84432,7 +84648,7 @@ var init_daemon_provenance = __esm({
|
|
|
84432
84648
|
});
|
|
84433
84649
|
|
|
84434
84650
|
// packages/daemon/src/lib/automation-operation-registry.ts
|
|
84435
|
-
import { createHash as createHash26, randomUUID as
|
|
84651
|
+
import { createHash as createHash26, randomUUID as randomUUID43 } from "node:crypto";
|
|
84436
84652
|
var AutomationOperationUnavailableError, AutomationOperationRegistry;
|
|
84437
84653
|
var init_automation_operation_registry = __esm({
|
|
84438
84654
|
"packages/daemon/src/lib/automation-operation-registry.ts"() {
|
|
@@ -84444,7 +84660,7 @@ var init_automation_operation_registry = __esm({
|
|
|
84444
84660
|
}
|
|
84445
84661
|
};
|
|
84446
84662
|
AutomationOperationRegistry = class {
|
|
84447
|
-
#generation =
|
|
84663
|
+
#generation = randomUUID43();
|
|
84448
84664
|
#entries = /* @__PURE__ */ new Map();
|
|
84449
84665
|
#capacity;
|
|
84450
84666
|
#retentionMs;
|
|
@@ -84464,7 +84680,7 @@ var init_automation_operation_registry = __esm({
|
|
|
84464
84680
|
this.#prune();
|
|
84465
84681
|
if (this.#entries.size >= this.#capacity)
|
|
84466
84682
|
throw new Error("Automation operation capacity reached");
|
|
84467
|
-
const operationId =
|
|
84683
|
+
const operationId = randomUUID43();
|
|
84468
84684
|
this.#entries.set(operationId, {
|
|
84469
84685
|
fingerprint: this.#fingerprint(canonicalIntent),
|
|
84470
84686
|
expiresAt: this.#now() + this.#retentionMs,
|
|
@@ -86151,7 +86367,7 @@ var init_workspace_admission_route = __esm({
|
|
|
86151
86367
|
});
|
|
86152
86368
|
|
|
86153
86369
|
// packages/daemon/src/lib/saved-machines.ts
|
|
86154
|
-
import { randomUUID as
|
|
86370
|
+
import { randomUUID as randomUUID44 } from "node:crypto";
|
|
86155
86371
|
import {
|
|
86156
86372
|
closeSync as closeSync9,
|
|
86157
86373
|
fstatSync as fstatSync7,
|
|
@@ -86221,7 +86437,7 @@ function persistSavedMachines(registry, path2) {
|
|
|
86221
86437
|
if (Buffer.byteLength(contents) > MAX_REGISTRY_BYTES)
|
|
86222
86438
|
throw new Error("Saved machine registry exceeds size limit");
|
|
86223
86439
|
mkdirSync25(dirname33(path2), { recursive: true });
|
|
86224
|
-
const temporary = `${path2}.${
|
|
86440
|
+
const temporary = `${path2}.${randomUUID44()}.tmp`;
|
|
86225
86441
|
try {
|
|
86226
86442
|
writeFileSync22(temporary, contents, { flag: "wx", mode: 384 });
|
|
86227
86443
|
renameSync15(temporary, path2);
|
|
@@ -86483,7 +86699,7 @@ import {
|
|
|
86483
86699
|
unlinkSync as unlinkSync8,
|
|
86484
86700
|
writeFileSync as writeFileSync23
|
|
86485
86701
|
} from "node:fs";
|
|
86486
|
-
import { randomUUID as
|
|
86702
|
+
import { randomUUID as randomUUID45 } from "node:crypto";
|
|
86487
86703
|
import { dirname as dirname34, join as join43 } from "node:path";
|
|
86488
86704
|
function fleetClientStatePath() {
|
|
86489
86705
|
return runtimeOwnedPath(join43(resolveRuntimeNamespace().registryDir, "fleet-view.json"));
|
|
@@ -86514,7 +86730,7 @@ function updateFleetClientState(change, path2 = fleetClientStatePath()) {
|
|
|
86514
86730
|
if (Buffer.byteLength(contents) > MAX_BYTES3)
|
|
86515
86731
|
throw new Error("Fleet view state exceeds its size limit");
|
|
86516
86732
|
mkdirSync26(dirname34(path2), { recursive: true });
|
|
86517
|
-
const temporary = `${path2}.${
|
|
86733
|
+
const temporary = `${path2}.${randomUUID45()}.tmp`;
|
|
86518
86734
|
try {
|
|
86519
86735
|
writeFileSync23(temporary, contents, { flag: "wx", mode: 384 });
|
|
86520
86736
|
renameSync16(temporary, path2);
|
|
@@ -90910,14 +91126,14 @@ var init_workspace_files_authority = __esm({
|
|
|
90910
91126
|
// packages/daemon/src/command-center/resources/workspace-changes-git.ts
|
|
90911
91127
|
function splitNul(buffer) {
|
|
90912
91128
|
const tokens = [];
|
|
90913
|
-
let
|
|
91129
|
+
let start3 = 0;
|
|
90914
91130
|
for (let i = 0; i < buffer.length; i += 1) {
|
|
90915
91131
|
if (buffer[i] === 0) {
|
|
90916
|
-
tokens.push(buffer.toString("utf8",
|
|
90917
|
-
|
|
91132
|
+
tokens.push(buffer.toString("utf8", start3, i));
|
|
91133
|
+
start3 = i + 1;
|
|
90918
91134
|
}
|
|
90919
91135
|
}
|
|
90920
|
-
if (
|
|
91136
|
+
if (start3 < buffer.length) tokens.push(buffer.toString("utf8", start3));
|
|
90921
91137
|
return tokens;
|
|
90922
91138
|
}
|
|
90923
91139
|
function mapStatusLetter(letter) {
|
|
@@ -92889,7 +93105,7 @@ function projectApplicationShellAgentGraphOverlay(input) {
|
|
|
92889
93105
|
}
|
|
92890
93106
|
}
|
|
92891
93107
|
const groundTruthPairs = /* @__PURE__ */ new Set();
|
|
92892
|
-
for (const
|
|
93108
|
+
for (const edge of edges) groundTruthPairs.add(pairKey(edge.from, edge.to));
|
|
92893
93109
|
const groundTruthGroupMembers = groups.map((group) => new Set(group.memberWindowIds));
|
|
92894
93110
|
const emittedInferredPairs = /* @__PURE__ */ new Set();
|
|
92895
93111
|
const emitInferred = (from, to, kind) => {
|
|
@@ -93364,7 +93580,7 @@ __export(widget_asset_store_exports, {
|
|
|
93364
93580
|
publishWidgetAsset: () => publishWidgetAsset,
|
|
93365
93581
|
readWidgetAsset: () => readWidgetAsset
|
|
93366
93582
|
});
|
|
93367
|
-
import { createHash as createHash33, randomUUID as
|
|
93583
|
+
import { createHash as createHash33, randomUUID as randomUUID47 } from "node:crypto";
|
|
93368
93584
|
import {
|
|
93369
93585
|
chmodSync as chmodSync7,
|
|
93370
93586
|
existsSync as existsSync33,
|
|
@@ -93465,11 +93681,11 @@ function publishWidgetAsset(bytes, options) {
|
|
|
93465
93681
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
93466
93682
|
};
|
|
93467
93683
|
if (!existsSync33(paths.data)) {
|
|
93468
|
-
const temporary = join47(root, `.${assetId}.${
|
|
93684
|
+
const temporary = join47(root, `.${assetId}.${randomUUID47()}.bin`);
|
|
93469
93685
|
writeFileSync25(temporary, bytes, { mode: 384, flag: "wx" });
|
|
93470
93686
|
renameSync18(temporary, paths.data);
|
|
93471
93687
|
}
|
|
93472
|
-
const metadataTemporary = join47(root, `.${assetId}.${
|
|
93688
|
+
const metadataTemporary = join47(root, `.${assetId}.${randomUUID47()}.json`);
|
|
93473
93689
|
writeFileSync25(metadataTemporary, `${JSON.stringify(metadata)}
|
|
93474
93690
|
`, { mode: 384, flag: "wx" });
|
|
93475
93691
|
renameSync18(metadataTemporary, paths.metadata);
|
|
@@ -93541,7 +93757,7 @@ import { z as z130 } from "zod";
|
|
|
93541
93757
|
import { realpathSync as realpathSync25 } from "node:fs";
|
|
93542
93758
|
import { homedir as homedir7 } from "node:os";
|
|
93543
93759
|
import { isAbsolute as isAbsolute28, resolve as pathResolve } from "node:path";
|
|
93544
|
-
import { randomUUID as
|
|
93760
|
+
import { randomUUID as randomUUID48 } from "node:crypto";
|
|
93545
93761
|
import { WebSocketServer as WebSocketServer4 } from "ws";
|
|
93546
93762
|
function bearerToken(authHeader) {
|
|
93547
93763
|
if (!authHeader?.startsWith("Bearer ")) return null;
|
|
@@ -93679,7 +93895,7 @@ function createApp(options = {}) {
|
|
|
93679
93895
|
const authService = options.authService ?? new AuthService();
|
|
93680
93896
|
const daemonIdentity = options.daemonIdentity ?? {
|
|
93681
93897
|
productVersion: "0.0.0",
|
|
93682
|
-
instanceId:
|
|
93898
|
+
instanceId: randomUUID48(),
|
|
93683
93899
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
93684
93900
|
};
|
|
93685
93901
|
const daemonInstanceIdentity = DaemonInstanceIdentitySchemaZ.parse({
|
|
@@ -94253,7 +94469,7 @@ function createApp(options = {}) {
|
|
|
94253
94469
|
});
|
|
94254
94470
|
scripted = true;
|
|
94255
94471
|
}
|
|
94256
|
-
if (!id2) id2 =
|
|
94472
|
+
if (!id2) id2 = randomUUID48();
|
|
94257
94473
|
try {
|
|
94258
94474
|
const upsertInput = {
|
|
94259
94475
|
id: id2,
|
|
@@ -94678,7 +94894,7 @@ function createApp(options = {}) {
|
|
|
94678
94894
|
if (!existsSync34(parsed.data.dir)) {
|
|
94679
94895
|
return c.json({ error: `Directory "${parsed.data.dir}" does not exist` }, 400);
|
|
94680
94896
|
}
|
|
94681
|
-
const jobId =
|
|
94897
|
+
const jobId = randomUUID48();
|
|
94682
94898
|
const command3 = process.env.TMUX_IDE_INIT_COMMAND ?? "tmux-ide";
|
|
94683
94899
|
void (async () => {
|
|
94684
94900
|
try {
|
|
@@ -94982,7 +95198,7 @@ var init_types = __esm({
|
|
|
94982
95198
|
// packages/daemon/src/lib/daemon-embed.ts
|
|
94983
95199
|
import { dirname as dirname39, join as join49 } from "node:path";
|
|
94984
95200
|
import { execFileSync as execFileSync21 } from "node:child_process";
|
|
94985
|
-
import { randomBytes as randomBytes9, randomUUID as
|
|
95201
|
+
import { randomBytes as randomBytes9, randomUUID as randomUUID49 } from "node:crypto";
|
|
94986
95202
|
import { createWriteStream } from "node:fs";
|
|
94987
95203
|
import { createServer as createServer2 } from "node:http";
|
|
94988
95204
|
import { createRequire as createRequire3 } from "node:module";
|
|
@@ -95681,7 +95897,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95681
95897
|
validatePort(port);
|
|
95682
95898
|
const dir = process.cwd();
|
|
95683
95899
|
const productVersion = resolveDaemonProductVersion(opts.productVersion);
|
|
95684
|
-
const instanceId =
|
|
95900
|
+
const instanceId = randomUUID49();
|
|
95685
95901
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
95686
95902
|
const environmentId = readOrMintEnvironmentId();
|
|
95687
95903
|
const workspaceRegistry = getDefaultWorkspaceRegistry();
|
|
@@ -95741,7 +95957,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95741
95957
|
for (const workspace of workspaceRegistry.list()) {
|
|
95742
95958
|
await workspacePromotion.promote({
|
|
95743
95959
|
expectedDaemonInstanceId: instanceId,
|
|
95744
|
-
operationId:
|
|
95960
|
+
operationId: randomUUID49(),
|
|
95745
95961
|
intent: { sessionId: fleetSessionIdForName(workspace.sessionName) }
|
|
95746
95962
|
});
|
|
95747
95963
|
}
|
|
@@ -95945,11 +96161,11 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95945
96161
|
// retain tens of thousands of frozen span objects or induce GC
|
|
95946
96162
|
// pauses on the daemon's input/output event loop.
|
|
95947
96163
|
capacity: 1024,
|
|
95948
|
-
onSpan: (
|
|
96164
|
+
onSpan: (span2) => {
|
|
95949
96165
|
runtimeTraceWriter?.append(() => ({
|
|
95950
96166
|
version: 1,
|
|
95951
96167
|
type: "performance.stage",
|
|
95952
|
-
...
|
|
96168
|
+
...span2
|
|
95953
96169
|
}));
|
|
95954
96170
|
}
|
|
95955
96171
|
}) : void 0;
|
|
@@ -95964,7 +96180,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
95964
96180
|
};
|
|
95965
96181
|
const diagnostics = {
|
|
95966
96182
|
nowMicros: () => Math.floor(performance3.now() * 1e3),
|
|
95967
|
-
createTraceId:
|
|
96183
|
+
createTraceId: randomUUID49,
|
|
95968
96184
|
publish: publishObserverDiagnostic
|
|
95969
96185
|
};
|
|
95970
96186
|
externalInteractionObserver.setDiagnostics(diagnostics);
|
|
@@ -96010,6 +96226,9 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
96010
96226
|
observation: () => observationSelector ?? null,
|
|
96011
96227
|
runPinnedTmux: nativeGenerationTmuxRunner
|
|
96012
96228
|
}),
|
|
96229
|
+
splitLayoutStock: createStockSplitProbe({
|
|
96230
|
+
runPinnedTmux: nativeGenerationTmuxRunner
|
|
96231
|
+
}),
|
|
96013
96232
|
createOwnedViewerAdapter: () => ownedViewerFactory?.(),
|
|
96014
96233
|
nativeServerIdentity: initialNativeServerIdentity,
|
|
96015
96234
|
executable: tmuxAuthority.executablePath,
|
|
@@ -96037,7 +96256,7 @@ async function startEmbeddedDaemonGeneration(opts) {
|
|
|
96037
96256
|
const consumer = sessionRuntimeRegistry.connect(
|
|
96038
96257
|
record2.sessionName,
|
|
96039
96258
|
"workspace-open-prepare",
|
|
96040
|
-
`workspace-open-${
|
|
96259
|
+
`workspace-open-${randomUUID49()}`
|
|
96041
96260
|
);
|
|
96042
96261
|
try {
|
|
96043
96262
|
const layout = await consumer.describe();
|
|
@@ -98164,7 +98383,7 @@ import {
|
|
|
98164
98383
|
realpathSync as realpathSync28,
|
|
98165
98384
|
linkSync as linkSync4
|
|
98166
98385
|
} from "node:fs";
|
|
98167
|
-
import { randomUUID as
|
|
98386
|
+
import { randomUUID as randomUUID50 } from "node:crypto";
|
|
98168
98387
|
import { dirname as dirname41, join as join54 } from "node:path";
|
|
98169
98388
|
import { homedir as homedir9 } from "node:os";
|
|
98170
98389
|
import { z as z131 } from "zod";
|
|
@@ -98306,7 +98525,7 @@ async function manageDaemonService(action, executable, deps2 = defaults()) {
|
|
|
98306
98525
|
);
|
|
98307
98526
|
wroteRecord = true;
|
|
98308
98527
|
mkdirSync30(dirname41(plan.unitPath), { recursive: true, mode: 448 });
|
|
98309
|
-
const unitStage = `${plan.unitPath}.${
|
|
98528
|
+
const unitStage = `${plan.unitPath}.${randomUUID50()}.tmp`;
|
|
98310
98529
|
writeFileSync28(unitStage, contents, { flag: "wx", mode: 384 });
|
|
98311
98530
|
try {
|
|
98312
98531
|
linkSync4(unitStage, plan.unitPath);
|
|
@@ -98330,7 +98549,7 @@ async function manageDaemonService(action, executable, deps2 = defaults()) {
|
|
|
98330
98549
|
refused("Service manager has not confirmed the daemon stopped; reservation retained");
|
|
98331
98550
|
assertFiles(allowMissingUnit);
|
|
98332
98551
|
const removalRecord = JSON.stringify({ ...record2, removing: true }) + "\n";
|
|
98333
|
-
const temporaryRecord = `${plan.recordPath}.${
|
|
98552
|
+
const temporaryRecord = `${plan.recordPath}.${randomUUID50()}.tmp`;
|
|
98334
98553
|
writeFileSync28(temporaryRecord, removalRecord, { flag: "wx", mode: 384 });
|
|
98335
98554
|
try {
|
|
98336
98555
|
if (ownedFile(plan.recordPath) !== previousRecord)
|
|
@@ -98987,11 +99206,13 @@ __export(doctor_exports, {
|
|
|
98987
99206
|
hooksTargetRow: () => hooksTargetRow,
|
|
98988
99207
|
nodeVersionRow: () => nodeVersionRow,
|
|
98989
99208
|
notifierRow: () => notifierRow,
|
|
99209
|
+
tmuxFeaturesRow: () => tmuxFeaturesRow,
|
|
98990
99210
|
workspaceConfigRow: () => workspaceConfigRow
|
|
98991
99211
|
});
|
|
98992
99212
|
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 {
|
|
99213
|
+
import { accessSync as accessSync12, constants as constants19, existsSync as existsSync37, mkdtempSync, rmSync as rmSync7 } from "node:fs";
|
|
99214
|
+
import { tmpdir } from "node:os";
|
|
99215
|
+
import { resolve as resolve39, dirname as dirname43, join as join56 } from "node:path";
|
|
98995
99216
|
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
98996
99217
|
function agentIntegrationRows(agents) {
|
|
98997
99218
|
return presentAgents(agents).map((agent) => {
|
|
@@ -99091,6 +99312,88 @@ function check(label4, fn, { optional = false } = {}) {
|
|
|
99091
99312
|
return { label: label4, pass: false, detail: e.message, optional };
|
|
99092
99313
|
}
|
|
99093
99314
|
}
|
|
99315
|
+
function nativeCommands(probe) {
|
|
99316
|
+
const ask = (command3) => {
|
|
99317
|
+
try {
|
|
99318
|
+
return { output: probe([command3, "-V"]) };
|
|
99319
|
+
} catch (error) {
|
|
99320
|
+
const failure4 = error;
|
|
99321
|
+
return { failure: String(failure4.stderr ?? failure4.message ?? "") };
|
|
99322
|
+
}
|
|
99323
|
+
};
|
|
99324
|
+
const split = ask("tmux-ide-resize-split");
|
|
99325
|
+
const events = ask("tmux-ide-events");
|
|
99326
|
+
const failures = [split.failure, events.failure].filter((text2) => text2 !== void 0);
|
|
99327
|
+
if (failures.some((text2) => /no server running|error connecting/u.test(text2)))
|
|
99328
|
+
return "no-server";
|
|
99329
|
+
const refused3 = (answer, command3) => answer.failure !== void 0 && UNKNOWN(command3).test(answer.failure);
|
|
99330
|
+
if (refused3(split, "tmux-ide-resize-split")) {
|
|
99331
|
+
if (refused3(events, "tmux-ide-events")) return "stock";
|
|
99332
|
+
if (events.output !== void 0) return "older";
|
|
99333
|
+
return "unknown";
|
|
99334
|
+
}
|
|
99335
|
+
if (split.output !== void 0 && events.output !== void 0) {
|
|
99336
|
+
try {
|
|
99337
|
+
return nativeSplitCapability(split.output) ? "full" : "partial";
|
|
99338
|
+
} catch {
|
|
99339
|
+
return "partial";
|
|
99340
|
+
}
|
|
99341
|
+
}
|
|
99342
|
+
return failures.length === 2 ? "unknown" : "partial";
|
|
99343
|
+
}
|
|
99344
|
+
function tmuxFeaturesRow(probeServer, probeBinary) {
|
|
99345
|
+
let answer = nativeCommands(probeServer);
|
|
99346
|
+
if (answer === "no-server") answer = nativeCommands(probeBinary);
|
|
99347
|
+
const details = {
|
|
99348
|
+
full: "bundled tmux: full features",
|
|
99349
|
+
stock: "stock tmux: reduced features",
|
|
99350
|
+
older: "older tmux-ide tmux: reduced features (restart it with tmux-ide's own tmux for every feature; that ends its sessions)",
|
|
99351
|
+
partial: "this tmux has only some tmux-ide commands: no pane dividers",
|
|
99352
|
+
"no-server": "could not read the tmux server's features",
|
|
99353
|
+
unknown: "could not read the tmux server's features"
|
|
99354
|
+
};
|
|
99355
|
+
return {
|
|
99356
|
+
label: "tmux features",
|
|
99357
|
+
pass: answer === "full" || answer === "stock" || answer === "older",
|
|
99358
|
+
detail: details[answer],
|
|
99359
|
+
optional: true
|
|
99360
|
+
};
|
|
99361
|
+
}
|
|
99362
|
+
function runTmuxFeatureProbes(executable) {
|
|
99363
|
+
const run = (prefix) => (args) => execFileSync22(executable, [...prefix, ...args], {
|
|
99364
|
+
encoding: "utf8",
|
|
99365
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
99366
|
+
timeout: 3e3
|
|
99367
|
+
});
|
|
99368
|
+
const socketPath = process.env[TMUX_SOCKET_PATH_ENV];
|
|
99369
|
+
const socketName = process.env.TMUX_IDE_TMUX_SOCKET_NAME;
|
|
99370
|
+
const server = socketPath ? ["-S", socketPath] : socketName ? ["-L", socketName] : [];
|
|
99371
|
+
const cleanups = [];
|
|
99372
|
+
const probeBinary = /* @__PURE__ */ (() => {
|
|
99373
|
+
let scratch = null;
|
|
99374
|
+
return (args) => {
|
|
99375
|
+
scratch ??= (() => {
|
|
99376
|
+
const dir = mkdtempSync(join56(tmpdir(), "tmi-doctor-"));
|
|
99377
|
+
const prefix = ["-S", join56(dir, "s"), "-f", "/dev/null"];
|
|
99378
|
+
cleanups.push(() => {
|
|
99379
|
+
try {
|
|
99380
|
+
run(prefix)(["kill-server"]);
|
|
99381
|
+
} catch {
|
|
99382
|
+
}
|
|
99383
|
+
rmSync7(dir, { recursive: true, force: true });
|
|
99384
|
+
});
|
|
99385
|
+
run(prefix)(["new-session", "-d", "-s", "probe"]);
|
|
99386
|
+
return { dir, prefix };
|
|
99387
|
+
})();
|
|
99388
|
+
return run(scratch.prefix)(args);
|
|
99389
|
+
};
|
|
99390
|
+
})();
|
|
99391
|
+
try {
|
|
99392
|
+
return tmuxFeaturesRow(run(server), probeBinary);
|
|
99393
|
+
} finally {
|
|
99394
|
+
for (const cleanup of cleanups) cleanup();
|
|
99395
|
+
}
|
|
99396
|
+
}
|
|
99094
99397
|
function nodeVersionRow(version) {
|
|
99095
99398
|
const major = Number(version.split(".")[0]);
|
|
99096
99399
|
const pass = Number.isInteger(major) && major >= 20;
|
|
@@ -99131,6 +99434,10 @@ async function doctor({
|
|
|
99131
99434
|
return `${version} (${executable})`;
|
|
99132
99435
|
})
|
|
99133
99436
|
);
|
|
99437
|
+
try {
|
|
99438
|
+
checks.push(runTmuxFeatureProbes(resolveTmuxExecutable()));
|
|
99439
|
+
} catch {
|
|
99440
|
+
}
|
|
99134
99441
|
checks.push(nodeVersionRow(process.versions.node));
|
|
99135
99442
|
checks.push(
|
|
99136
99443
|
check(
|
|
@@ -99273,11 +99580,14 @@ async function doctor({
|
|
|
99273
99580
|
}
|
|
99274
99581
|
if (!allPass) process.exitCode = 1;
|
|
99275
99582
|
}
|
|
99583
|
+
var UNKNOWN;
|
|
99276
99584
|
var init_doctor = __esm({
|
|
99277
99585
|
"packages/daemon/src/doctor.ts"() {
|
|
99278
99586
|
"use strict";
|
|
99279
99587
|
init_tmux_version();
|
|
99280
99588
|
init_tmux_client_execution();
|
|
99589
|
+
init_runtime_namespace();
|
|
99590
|
+
init_native_split_resize();
|
|
99281
99591
|
init_update_check();
|
|
99282
99592
|
init_skill_sync();
|
|
99283
99593
|
init_agent_discovery();
|
|
@@ -99286,6 +99596,7 @@ var init_doctor = __esm({
|
|
|
99286
99596
|
init_notify();
|
|
99287
99597
|
init_resolved_config();
|
|
99288
99598
|
init_daemon_provenance();
|
|
99599
|
+
UNKNOWN = (command3) => new RegExp(`^unknown command: ${command3}$`, "mu");
|
|
99289
99600
|
}
|
|
99290
99601
|
});
|
|
99291
99602
|
|
|
@@ -100431,7 +100742,7 @@ __export(tmux_servers_cli_exports, {
|
|
|
100431
100742
|
parseTmuxServersOperation: () => parseTmuxServersOperation,
|
|
100432
100743
|
runTmuxServersCli: () => runTmuxServersCli
|
|
100433
100744
|
});
|
|
100434
|
-
import { randomUUID as
|
|
100745
|
+
import { randomUUID as randomUUID51 } from "node:crypto";
|
|
100435
100746
|
function parseTmuxServersOperation(options) {
|
|
100436
100747
|
const command3 = options.command ?? "list";
|
|
100437
100748
|
if (options.ssh !== void 0) SavedMachineSchema.shape.sshTarget.parse(options.ssh);
|
|
@@ -100472,7 +100783,7 @@ function parseTmuxServersOperation(options) {
|
|
|
100472
100783
|
);
|
|
100473
100784
|
}
|
|
100474
100785
|
async function connectTmuxServersCli(options) {
|
|
100475
|
-
const hostClientId =
|
|
100786
|
+
const hostClientId = randomUUID51();
|
|
100476
100787
|
if (options.ssh !== void 0) {
|
|
100477
100788
|
const transport = await openSshDaemonTransport({ alias: options.ssh });
|
|
100478
100789
|
try {
|
|
@@ -100541,7 +100852,7 @@ async function runTmuxServersCli(options, connect4) {
|
|
|
100541
100852
|
generation: server.generation
|
|
100542
100853
|
});
|
|
100543
100854
|
try {
|
|
100544
|
-
return operation.command === "create" ? await client.createSession(
|
|
100855
|
+
return operation.command === "create" ? await client.createSession(randomUUID51(), operation.input) : await client.sessions();
|
|
100545
100856
|
} finally {
|
|
100546
100857
|
client.dispose();
|
|
100547
100858
|
}
|
|
@@ -100686,7 +100997,7 @@ __export(machines_exports, {
|
|
|
100686
100997
|
machines: () => machines
|
|
100687
100998
|
});
|
|
100688
100999
|
import { readFileSync as readFileSync38, statSync as statSync22 } from "node:fs";
|
|
100689
|
-
import { randomUUID as
|
|
101000
|
+
import { randomUUID as randomUUID52 } from "node:crypto";
|
|
100690
101001
|
async function machines(command3, argument, options) {
|
|
100691
101002
|
const current = loadSavedMachines();
|
|
100692
101003
|
if ((command3 === "enable" || command3 === "disable" || command3 === "remove" || command3 === "edit") && argument) {
|
|
@@ -100770,7 +101081,7 @@ async function machines(command3, argument, options) {
|
|
|
100770
101081
|
version: 1,
|
|
100771
101082
|
machines: [
|
|
100772
101083
|
existing ?? SavedMachineSchema.parse({
|
|
100773
|
-
id:
|
|
101084
|
+
id: randomUUID52(),
|
|
100774
101085
|
label: options.label ?? argument,
|
|
100775
101086
|
sshTarget: argument,
|
|
100776
101087
|
enabled: true
|
|
@@ -102010,7 +102321,7 @@ import {
|
|
|
102010
102321
|
accessSync as accessSync13,
|
|
102011
102322
|
constants as constants20
|
|
102012
102323
|
} from "node:fs";
|
|
102013
|
-
import { basename as basename21, delimiter as delimiter5, dirname as dirname45, join as
|
|
102324
|
+
import { basename as basename21, delimiter as delimiter5, dirname as dirname45, join as join57 } from "node:path";
|
|
102014
102325
|
function isOptOut(value) {
|
|
102015
102326
|
if (value === false || value === 0) return true;
|
|
102016
102327
|
return typeof value === "string" && /^\s*(0|false|off|no)\s*$/iu.test(value);
|
|
@@ -102058,8 +102369,8 @@ function agentTeamsPaths() {
|
|
|
102058
102369
|
function claudeOnPath2(path2 = process.env.PATH ?? "") {
|
|
102059
102370
|
return path2.split(delimiter5).filter(Boolean).some((dir) => {
|
|
102060
102371
|
try {
|
|
102061
|
-
accessSync13(
|
|
102062
|
-
return statSync23(
|
|
102372
|
+
accessSync13(join57(dir, "claude"), constants20.X_OK);
|
|
102373
|
+
return statSync23(join57(dir, "claude")).isFile();
|
|
102063
102374
|
} catch {
|
|
102064
102375
|
return false;
|
|
102065
102376
|
}
|
|
@@ -102084,7 +102395,7 @@ function existingBackup(settingsPath) {
|
|
|
102084
102395
|
const prefix = `${basename21(settingsPath)}${BACKUP_INFIX}`;
|
|
102085
102396
|
try {
|
|
102086
102397
|
const found = readdirSync11(dir).find((name) => name.startsWith(prefix));
|
|
102087
|
-
return found ?
|
|
102398
|
+
return found ? join57(dir, found) : null;
|
|
102088
102399
|
} catch {
|
|
102089
102400
|
return null;
|
|
102090
102401
|
}
|
|
@@ -102100,7 +102411,7 @@ function writeSettings(path2, settings, exists) {
|
|
|
102100
102411
|
copyFileSync3(path2, backup);
|
|
102101
102412
|
}
|
|
102102
102413
|
}
|
|
102103
|
-
const temporary =
|
|
102414
|
+
const temporary = join57(dirname45(path2), `.${basename21(path2)}.tmux-ide-${process.pid}.tmp`);
|
|
102104
102415
|
try {
|
|
102105
102416
|
writeFileSync30(temporary, `${JSON.stringify(settings, null, 2)}
|
|
102106
102417
|
`, { mode: 384 });
|
|
@@ -102241,7 +102552,7 @@ __export(worktree_exports, {
|
|
|
102241
102552
|
worktreeSessionName: () => worktreeSessionName
|
|
102242
102553
|
});
|
|
102243
102554
|
import { execFileSync as execFileSync26 } from "node:child_process";
|
|
102244
|
-
import { basename as basename22, dirname as dirname46, isAbsolute as isAbsolute32, join as
|
|
102555
|
+
import { basename as basename22, dirname as dirname46, isAbsolute as isAbsolute32, join as join58, resolve as resolve43 } from "node:path";
|
|
102245
102556
|
function sanitizeForTmux(part) {
|
|
102246
102557
|
return part.replace(/[.:/\s]+/g, "-");
|
|
102247
102558
|
}
|
|
@@ -102250,11 +102561,11 @@ function worktreeSessionName(project, branch) {
|
|
|
102250
102561
|
}
|
|
102251
102562
|
function defaultWorktreeBaseDir(repoDir) {
|
|
102252
102563
|
const abs = resolve43(repoDir);
|
|
102253
|
-
return
|
|
102564
|
+
return join58(dirname46(abs), `${basename22(abs)}-worktrees`);
|
|
102254
102565
|
}
|
|
102255
102566
|
function worktreePath(repoDir, branch, configuredDir) {
|
|
102256
102567
|
const base2 = configuredDir && configuredDir.length > 0 ? isAbsolute32(configuredDir) ? configuredDir : resolve43(repoDir, configuredDir) : defaultWorktreeBaseDir(repoDir);
|
|
102257
|
-
return
|
|
102568
|
+
return join58(base2, branch);
|
|
102258
102569
|
}
|
|
102259
102570
|
function parseWorktreeList(porcelain) {
|
|
102260
102571
|
const entries = [];
|
|
@@ -102388,9 +102699,9 @@ var init_worktree = __esm({
|
|
|
102388
102699
|
});
|
|
102389
102700
|
|
|
102390
102701
|
// 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";
|
|
102702
|
+
import { mkdtempSync as mkdtempSync2, readFileSync as readFileSync40, realpathSync as realpathSync29, rmSync as rmSync8 } from "node:fs";
|
|
102703
|
+
import { dirname as dirname47, join as join59 } from "node:path";
|
|
102704
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
102394
102705
|
import { execFileSync as execFileSync27 } from "node:child_process";
|
|
102395
102706
|
function managedInstallerPrefix(cliPath) {
|
|
102396
102707
|
const match = /^(.*)\/share\/tmux-ide\/releases\/(install-[A-Za-z0-9]{6})\/npm\/lib\/node_modules\/tmux-ide\/bin$/.exec(
|
|
@@ -102398,16 +102709,16 @@ function managedInstallerPrefix(cliPath) {
|
|
|
102398
102709
|
);
|
|
102399
102710
|
if (!match) return null;
|
|
102400
102711
|
const prefix = match[1] || "/";
|
|
102401
|
-
const root =
|
|
102402
|
-
const release =
|
|
102712
|
+
const root = join59(prefix, "share/tmux-ide");
|
|
102713
|
+
const release = join59(root, "releases", match[2]);
|
|
102403
102714
|
try {
|
|
102404
|
-
if (realpathSync29(
|
|
102715
|
+
if (realpathSync29(join59(root, "current")) !== release) return null;
|
|
102405
102716
|
if (realpathSync29(release) !== release) return null;
|
|
102406
|
-
if (readFileSync40(
|
|
102407
|
-
if (readFileSync40(
|
|
102408
|
-
if (!readFileSync40(
|
|
102717
|
+
if (readFileSync40(join59(root, "installer-v1"), "utf8") !== "1\n") return null;
|
|
102718
|
+
if (readFileSync40(join59(release, ".installer-release-v1"), "utf8") !== "1\n") return null;
|
|
102719
|
+
if (!readFileSync40(join59(prefix, "bin/tmux-ide"), "utf8").split("\n").includes("# tmux-ide universal installer v1"))
|
|
102409
102720
|
return null;
|
|
102410
|
-
if (JSON.parse(readFileSync40(
|
|
102721
|
+
if (JSON.parse(readFileSync40(join59(dirname47(cliPath), "package.json"), "utf8")).name !== "tmux-ide")
|
|
102411
102722
|
return null;
|
|
102412
102723
|
return prefix;
|
|
102413
102724
|
} catch {
|
|
@@ -102415,8 +102726,8 @@ function managedInstallerPrefix(cliPath) {
|
|
|
102415
102726
|
}
|
|
102416
102727
|
}
|
|
102417
102728
|
function runManagedInstallerUpdate(prefix, channel, json3, execute2 = execFileSync27) {
|
|
102418
|
-
const temporary =
|
|
102419
|
-
const script =
|
|
102729
|
+
const temporary = mkdtempSync2(join59(tmpdir2(), "tmux-ide-update-"));
|
|
102730
|
+
const script = join59(temporary, "install.sh");
|
|
102420
102731
|
try {
|
|
102421
102732
|
execute2(
|
|
102422
102733
|
"curl",
|
|
@@ -102446,7 +102757,7 @@ function runManagedInstallerUpdate(prefix, channel, json3, execute2 = execFileSy
|
|
|
102446
102757
|
stdio: json3 ? ["ignore", 2, 2] : "inherit"
|
|
102447
102758
|
});
|
|
102448
102759
|
} finally {
|
|
102449
|
-
|
|
102760
|
+
rmSync8(temporary, { recursive: true, force: true });
|
|
102450
102761
|
}
|
|
102451
102762
|
}
|
|
102452
102763
|
var MANAGED_INSTALLER_URL;
|
|
@@ -102459,7 +102770,7 @@ var init_managed_installer_update = __esm({
|
|
|
102459
102770
|
|
|
102460
102771
|
// packages/daemon/src/lib/install-origin.ts
|
|
102461
102772
|
import { existsSync as existsSync39, readFileSync as readFileSync41, realpathSync as realpathSync30 } from "node:fs";
|
|
102462
|
-
import { dirname as dirname48, join as
|
|
102773
|
+
import { dirname as dirname48, join as join60 } from "node:path";
|
|
102463
102774
|
import { fileURLToPath as fileURLToPath14 } from "node:url";
|
|
102464
102775
|
function detectPackageManager(path2) {
|
|
102465
102776
|
if (/\/share\/tmux-ide\/releases\/install-[^/]+\/npm\/lib\/node_modules\/tmux-ide\/bin$/.test(path2))
|
|
@@ -102476,9 +102787,9 @@ function findGitCheckoutRoot(startDir) {
|
|
|
102476
102787
|
let dir = startDir;
|
|
102477
102788
|
for (; ; ) {
|
|
102478
102789
|
if (dir.endsWith("/node_modules")) return null;
|
|
102479
|
-
if (existsSync39(
|
|
102790
|
+
if (existsSync39(join60(dir, ".git"))) {
|
|
102480
102791
|
try {
|
|
102481
|
-
if (JSON.parse(readFileSync41(
|
|
102792
|
+
if (JSON.parse(readFileSync41(join60(dir, "package.json"), "utf8")).name === "tmux-ide")
|
|
102482
102793
|
return dir;
|
|
102483
102794
|
} catch {
|
|
102484
102795
|
}
|
|
@@ -102499,7 +102810,7 @@ function installOrigin(cliDir = dirname48(fileURLToPath14(import.meta.url))) {
|
|
|
102499
102810
|
let detected2 = detectPackageManager(path2);
|
|
102500
102811
|
if (detected2 === "npm" || detected2 === "pnpm" || detected2 === "bun") {
|
|
102501
102812
|
try {
|
|
102502
|
-
if (JSON.parse(readFileSync41(
|
|
102813
|
+
if (JSON.parse(readFileSync41(join60(path2, "../package.json"), "utf8")).name !== "tmux-ide")
|
|
102503
102814
|
detected2 = "unknown";
|
|
102504
102815
|
} catch {
|
|
102505
102816
|
detected2 = "unknown";
|
|
@@ -102525,7 +102836,7 @@ __export(update_exports, {
|
|
|
102525
102836
|
runUpdate: () => runUpdate
|
|
102526
102837
|
});
|
|
102527
102838
|
import { realpathSync as realpathSync31 } from "node:fs";
|
|
102528
|
-
import { dirname as dirname49, join as
|
|
102839
|
+
import { dirname as dirname49, join as join61 } from "node:path";
|
|
102529
102840
|
import { execFileSync as execFileSync28 } from "node:child_process";
|
|
102530
102841
|
function planUpdate(input) {
|
|
102531
102842
|
const current = input.currentVersion ?? getCurrentVersion();
|
|
@@ -102615,7 +102926,7 @@ function runUpdate({ cliDir, dryRun, json: json3 = false }, dependencies = {}) {
|
|
|
102615
102926
|
plan.executable === "bun" ? ["pm", "bin", "-g"] : ["root", "-g"]
|
|
102616
102927
|
).trim();
|
|
102617
102928
|
if (!root.startsWith("/")) throw new Error("invalid manager path");
|
|
102618
|
-
const target = plan.executable === "bun" ? dirname49(realpathSync31(
|
|
102929
|
+
const target = plan.executable === "bun" ? dirname49(realpathSync31(join61(root, "tmux-ide"))) : realpathSync31(join61(root, "tmux-ide", "bin"));
|
|
102619
102930
|
if (target !== source.path) throw new Error("different installation");
|
|
102620
102931
|
} catch {
|
|
102621
102932
|
plan = {
|
|
@@ -102820,7 +103131,7 @@ __export(server_exports3, {
|
|
|
102820
103131
|
SERVER_BIND_HOST: () => SERVER_BIND_HOST,
|
|
102821
103132
|
createApp: () => createApp2,
|
|
102822
103133
|
resolvePort: () => resolvePort,
|
|
102823
|
-
start: () =>
|
|
103134
|
+
start: () => start2
|
|
102824
103135
|
});
|
|
102825
103136
|
import { createServer as createServer6 } from "node:http";
|
|
102826
103137
|
import { parse as parse2 } from "node:url";
|
|
@@ -102840,7 +103151,7 @@ function createApp2() {
|
|
|
102840
103151
|
app.get("/health", (c) => c.json({ ok: true }));
|
|
102841
103152
|
return app;
|
|
102842
103153
|
}
|
|
102843
|
-
async function
|
|
103154
|
+
async function start2(port) {
|
|
102844
103155
|
const resolvedPort = resolvePort(port);
|
|
102845
103156
|
const app = createApp2();
|
|
102846
103157
|
const server = createServer6(getRequestListener2(app.fetch));
|
|
@@ -102892,7 +103203,7 @@ var init_server3 = __esm({
|
|
|
102892
103203
|
init_src();
|
|
102893
103204
|
init_tmux_client_execution();
|
|
102894
103205
|
import { parseArgs as parseArgs2 } from "node:util";
|
|
102895
|
-
import { resolve as resolve44, dirname as dirname50, join as
|
|
103206
|
+
import { resolve as resolve44, dirname as dirname50, join as join62 } from "node:path";
|
|
102896
103207
|
import { execFileSync as execFileSync29 } from "node:child_process";
|
|
102897
103208
|
import { appendFileSync as appendFileSync2, existsSync as existsSync40, mkdirSync as mkdirSync33, writeFileSync as writeFileSync31 } from "node:fs";
|
|
102898
103209
|
import { fileURLToPath as fileURLToPath15 } from "node:url";
|
|
@@ -103233,9 +103544,9 @@ Install bun (https://bun.sh) \u2014 the TUI surfaces run on it. Sources ship wit
|
|
|
103233
103544
|
let automaticDiagnosticLog;
|
|
103234
103545
|
if (surface === "app" && !process.env.TMUX_IDE_TUI_PERF_LOG && !process.env.TMUX_IDE_TUI_LOG) {
|
|
103235
103546
|
try {
|
|
103236
|
-
const logDirectory =
|
|
103547
|
+
const logDirectory = join62(stateHome(), "logs");
|
|
103237
103548
|
mkdirSync33(logDirectory, { recursive: true, mode: 448 });
|
|
103238
|
-
automaticDiagnosticLog =
|
|
103549
|
+
automaticDiagnosticLog = join62(logDirectory, "tui-latest.jsonl");
|
|
103239
103550
|
writeFileSync31(
|
|
103240
103551
|
automaticDiagnosticLog,
|
|
103241
103552
|
`${JSON.stringify({
|
|
@@ -104927,8 +105238,8 @@ Known panels: ${POPUP_WIDGETS2.join(", ")}.`,
|
|
|
104927
105238
|
if (values.port) serverArgs.push("--port", values.port);
|
|
104928
105239
|
execFileSync29("node", serverArgs, { stdio: "inherit" });
|
|
104929
105240
|
} else {
|
|
104930
|
-
const { start:
|
|
104931
|
-
await
|
|
105241
|
+
const { start: start3 } = await Promise.resolve().then(() => (init_server3(), server_exports3));
|
|
105242
|
+
await start3(values.port ? parseInt(values.port, 10) : void 0);
|
|
104932
105243
|
}
|
|
104933
105244
|
break;
|
|
104934
105245
|
}
|