@camstack/addon-terminal 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +13 -0
- package/dist/addon.mjs +15 -2
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -23,6 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
}) : target, mod));
|
|
24
24
|
//#endregion
|
|
25
25
|
let node_fs = require("node:fs");
|
|
26
|
+
let node_module = require("node:module");
|
|
26
27
|
let node_path = require("node:path");
|
|
27
28
|
let sharp = require("sharp");
|
|
28
29
|
sharp = __toESM(sharp);
|
|
@@ -32970,6 +32971,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
|
32970
32971
|
* a full-screen program (`btm`) gets no terminal and no runtime resize channel.
|
|
32971
32972
|
* See docs/design/2026-07-26-terminal-session-design.md ("The pty").
|
|
32972
32973
|
*/
|
|
32974
|
+
var require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
32973
32975
|
/**
|
|
32974
32976
|
* Resolve `file` to an executable path the way a shell would: a path-qualified
|
|
32975
32977
|
* name is checked directly, a bare name is searched on `PATH`. Returns the
|
|
@@ -32996,8 +32998,19 @@ function isExecutableFile(p) {
|
|
|
32996
32998
|
}
|
|
32997
32999
|
}
|
|
32998
33000
|
var cachedModule = null;
|
|
33001
|
+
function ensureSpawnHelperExecutable() {
|
|
33002
|
+
if (process.platform === "win32") return;
|
|
33003
|
+
const packageRoot = (0, node_path.dirname)(require$1.resolve("node-pty/package.json"));
|
|
33004
|
+
const candidates = [(0, node_path.join)(packageRoot, "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper"), (0, node_path.join)(packageRoot, "build", "Release", "spawn-helper")];
|
|
33005
|
+
for (const candidate of candidates) {
|
|
33006
|
+
if (!(0, node_fs.existsSync)(candidate)) continue;
|
|
33007
|
+
const mode = (0, node_fs.statSync)(candidate).mode & 511;
|
|
33008
|
+
if ((mode & 73) === 0) (0, node_fs.chmodSync)(candidate, mode | (mode & 292) >> 2);
|
|
33009
|
+
}
|
|
33010
|
+
}
|
|
32999
33011
|
async function loadNodePty() {
|
|
33000
33012
|
if (cachedModule) return cachedModule;
|
|
33013
|
+
ensureSpawnHelperExecutable();
|
|
33001
33014
|
const mod = await import("node-pty");
|
|
33002
33015
|
cachedModule = mod;
|
|
33003
33016
|
return mod;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { accessSync, chmodSync, constants, existsSync, statSync } from "node:fs";
|
|
3
|
+
import { delimiter, dirname, join } from "node:path";
|
|
3
4
|
import sharp from "sharp";
|
|
4
5
|
import { createServer } from "node:http";
|
|
5
6
|
//#region \0rolldown/runtime.js
|
|
@@ -32948,6 +32949,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
|
32948
32949
|
* a full-screen program (`btm`) gets no terminal and no runtime resize channel.
|
|
32949
32950
|
* See docs/design/2026-07-26-terminal-session-design.md ("The pty").
|
|
32950
32951
|
*/
|
|
32952
|
+
var require = createRequire(import.meta.url);
|
|
32951
32953
|
/**
|
|
32952
32954
|
* Resolve `file` to an executable path the way a shell would: a path-qualified
|
|
32953
32955
|
* name is checked directly, a bare name is searched on `PATH`. Returns the
|
|
@@ -32974,8 +32976,19 @@ function isExecutableFile(p) {
|
|
|
32974
32976
|
}
|
|
32975
32977
|
}
|
|
32976
32978
|
var cachedModule = null;
|
|
32979
|
+
function ensureSpawnHelperExecutable() {
|
|
32980
|
+
if (process.platform === "win32") return;
|
|
32981
|
+
const packageRoot = dirname(require.resolve("node-pty/package.json"));
|
|
32982
|
+
const candidates = [join(packageRoot, "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper"), join(packageRoot, "build", "Release", "spawn-helper")];
|
|
32983
|
+
for (const candidate of candidates) {
|
|
32984
|
+
if (!existsSync(candidate)) continue;
|
|
32985
|
+
const mode = statSync(candidate).mode & 511;
|
|
32986
|
+
if ((mode & 73) === 0) chmodSync(candidate, mode | (mode & 292) >> 2);
|
|
32987
|
+
}
|
|
32988
|
+
}
|
|
32977
32989
|
async function loadNodePty() {
|
|
32978
32990
|
if (cachedModule) return cachedModule;
|
|
32991
|
+
ensureSpawnHelperExecutable();
|
|
32979
32992
|
const mod = await import("node-pty");
|
|
32980
32993
|
cachedModule = mod;
|
|
32981
32994
|
return mod;
|