@ever-works/pty-local-plugin 1.0.10 → 1.0.15
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/index.cjs +94 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +92 -2
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var child_process = require('child_process');
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
6
8
|
|
|
7
9
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
10
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -23,6 +25,10 @@ var PROBLEM_CODES = [
|
|
|
23
25
|
"not_connection_owner",
|
|
24
26
|
"integration_disabled",
|
|
25
27
|
"integration_revoked",
|
|
28
|
+
"subject_unknown",
|
|
29
|
+
"link_not_found",
|
|
30
|
+
"oidc_client_exists",
|
|
31
|
+
"redirect_uri_invalid",
|
|
26
32
|
"denied_by_policy",
|
|
27
33
|
"integration_not_available",
|
|
28
34
|
"entitlement_required",
|
|
@@ -51,6 +57,8 @@ var PROBLEM_CODES = [
|
|
|
51
57
|
"illegal_transition",
|
|
52
58
|
"already_exists",
|
|
53
59
|
"already_completed",
|
|
60
|
+
"legal_basis_required",
|
|
61
|
+
"receipt_final",
|
|
54
62
|
"billing_active",
|
|
55
63
|
"sso_required",
|
|
56
64
|
"reauth_required",
|
|
@@ -117,6 +125,9 @@ var RECORD_VISIBILITIES = ["private", "team", "organization"];
|
|
|
117
125
|
new Set(RECORD_VISIBILITIES);
|
|
118
126
|
var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
|
|
119
127
|
new Set(RECORD_LIST_VIEWS);
|
|
128
|
+
new Set(
|
|
129
|
+
"a abbr address applet area article aside audio b base bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe image img input ins kbd label legend li link main map mark marquee math menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select slot small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr xmp".split(" ")
|
|
130
|
+
);
|
|
120
131
|
var VERSION = "1.0.0";
|
|
121
132
|
var GTM_SKILLS = [
|
|
122
133
|
// ── research ────────────────────────────────────────────────────────
|
|
@@ -1824,6 +1835,9 @@ var DOMAIN_EVENT_CATALOG = [
|
|
|
1824
1835
|
{ type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1825
1836
|
{ type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1826
1837
|
{ type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1838
|
+
// Integration inbox push: an integration's PATCH of its own item, and the member's
|
|
1839
|
+
// answer to an integration item (stored on the item; no run is started).
|
|
1840
|
+
{ type: "inbox.item.updated", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1827
1841
|
{ type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
1828
1842
|
{ type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
1829
1843
|
{ type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
@@ -1853,12 +1867,85 @@ var TerminalNotProvisionedError = class extends Error {
|
|
|
1853
1867
|
this.name = "TerminalNotProvisionedError";
|
|
1854
1868
|
}
|
|
1855
1869
|
};
|
|
1870
|
+
var GITHUB_FULL_SCOPES_ALL = [
|
|
1871
|
+
"user:email",
|
|
1872
|
+
"read:user",
|
|
1873
|
+
"repo",
|
|
1874
|
+
"delete_repo",
|
|
1875
|
+
"workflow",
|
|
1876
|
+
"write:repo_hook",
|
|
1877
|
+
"read:org",
|
|
1878
|
+
"project"
|
|
1879
|
+
];
|
|
1880
|
+
var GITHUB_DELETE_REPO_SCOPE = "delete_repo";
|
|
1881
|
+
function isGithubDeleteRepoScopeEnabled(env = readEnv()) {
|
|
1882
|
+
return (env?.GITHUB_OAUTH_DELETE_REPO_SCOPE_ENABLED ?? "").trim().toLowerCase() === "true";
|
|
1883
|
+
}
|
|
1884
|
+
function readEnv() {
|
|
1885
|
+
return typeof process !== "undefined" ? process.env : void 0;
|
|
1886
|
+
}
|
|
1887
|
+
Object.freeze(
|
|
1888
|
+
GITHUB_FULL_SCOPES_ALL.filter((scope) => scope !== GITHUB_DELETE_REPO_SCOPE || isGithubDeleteRepoScopeEnabled())
|
|
1889
|
+
);
|
|
1890
|
+
var realProbe = () => ({
|
|
1891
|
+
platform: process.platform,
|
|
1892
|
+
readFile: (path) => {
|
|
1893
|
+
try {
|
|
1894
|
+
return fs.readFileSync(path, "utf8");
|
|
1895
|
+
} catch {
|
|
1896
|
+
return null;
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
readDir: (path) => {
|
|
1900
|
+
try {
|
|
1901
|
+
return fs.readdirSync(path);
|
|
1902
|
+
} catch {
|
|
1903
|
+
return [];
|
|
1904
|
+
}
|
|
1905
|
+
},
|
|
1906
|
+
reportHeader: () => {
|
|
1907
|
+
const report = process.report;
|
|
1908
|
+
if (!report?.getReport) return void 0;
|
|
1909
|
+
const previous = report.excludeNetwork;
|
|
1910
|
+
report.excludeNetwork = true;
|
|
1911
|
+
try {
|
|
1912
|
+
return report.getReport().header;
|
|
1913
|
+
} finally {
|
|
1914
|
+
report.excludeNetwork = previous;
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
});
|
|
1918
|
+
function detectMuslLinux(probe) {
|
|
1919
|
+
if (probe.platform !== "linux") return false;
|
|
1920
|
+
try {
|
|
1921
|
+
if (probe.readDir("/lib").some((name) => name.startsWith("ld-musl-"))) return true;
|
|
1922
|
+
const ldd = probe.readFile("/usr/bin/ldd");
|
|
1923
|
+
if (ldd !== null) return ldd.includes("musl");
|
|
1924
|
+
const header = probe.reportHeader();
|
|
1925
|
+
return header !== void 0 && !header.glibcVersionRuntime;
|
|
1926
|
+
} catch {
|
|
1927
|
+
return false;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
var cachedMusl = null;
|
|
1931
|
+
function isMuslLinux() {
|
|
1932
|
+
if (cachedMusl === null) cachedMusl = detectMuslLinux(realProbe());
|
|
1933
|
+
return cachedMusl;
|
|
1934
|
+
}
|
|
1935
|
+
function muslBlocksPtyAddon(resolvePackageJson, musl = isMuslLinux(), fileExists = fs.existsSync) {
|
|
1936
|
+
if (!musl) return false;
|
|
1937
|
+
try {
|
|
1938
|
+
return !fileExists(path.join(path.dirname(resolvePackageJson()), "build", "Release", "pty.node"));
|
|
1939
|
+
} catch {
|
|
1940
|
+
return true;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1856
1943
|
|
|
1857
1944
|
// src/pty-local.plugin.ts
|
|
1858
1945
|
var DEFAULT_COLS = 120;
|
|
1859
1946
|
var DEFAULT_ROWS = 32;
|
|
1860
1947
|
function makePtyLocalSessionId(runId, pid) {
|
|
1861
|
-
const suffix = typeof pid === "number" && Number.
|
|
1948
|
+
const suffix = typeof pid === "number" && Number.isInteger(pid) && pid > 0 ? String(pid) : "no-pid";
|
|
1862
1949
|
return `pty-local:${runId}:${suffix}`;
|
|
1863
1950
|
}
|
|
1864
1951
|
var PtyLocalPlugin = class {
|
|
@@ -2052,6 +2139,9 @@ var PtyLocalPlugin = class {
|
|
|
2052
2139
|
}
|
|
2053
2140
|
// ── runtime require ─────────────────────────────────────────────
|
|
2054
2141
|
tryLoadPty() {
|
|
2142
|
+
if (muslBlocksPtyAddon(() => __require.resolve("@homebridge/node-pty-prebuilt-multiarch/package.json"))) {
|
|
2143
|
+
return null;
|
|
2144
|
+
}
|
|
2055
2145
|
try {
|
|
2056
2146
|
const required = __require("@homebridge/node-pty-prebuilt-multiarch");
|
|
2057
2147
|
return typeof required?.spawn === "function" ? required : null;
|
|
@@ -2103,4 +2193,7 @@ var index_default = PtyLocalPlugin;
|
|
|
2103
2193
|
|
|
2104
2194
|
exports.PtyLocalPlugin = PtyLocalPlugin;
|
|
2105
2195
|
exports.default = index_default;
|
|
2196
|
+
exports.detectMuslLinux = detectMuslLinux;
|
|
2197
|
+
exports.isMuslLinux = isMuslLinux;
|
|
2106
2198
|
exports.makePtyLocalSessionId = makePtyLocalSessionId;
|
|
2199
|
+
exports.muslBlocksPtyAddon = muslBlocksPtyAddon;
|
package/dist/index.d.cts
CHANGED
|
@@ -55,4 +55,43 @@ declare class PtyLocalPlugin implements IPlugin, ITerminalStreamPlugin {
|
|
|
55
55
|
getManifest(): PluginManifest;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* musl Linux (Alpine) and the PTY addon.
|
|
60
|
+
*
|
|
61
|
+
* `@homebridge/node-pty-prebuilt-multiarch` 0.15 ships `linux-musl-*`
|
|
62
|
+
* prebuilds, but its loader (`lib/utils.js` `loadNativeModule`) looks only in
|
|
63
|
+
* `build/Release`, `build/Debug` and `prebuilds/<platform>-<arch>`. On musl it
|
|
64
|
+
* therefore loads the GLIBC prebuild: the `require` succeeds and the first
|
|
65
|
+
* `spawn()` segfaults the whole process (seen on `node:26-alpine`,
|
|
66
|
+
* 2026-11-11). A source build in `build/Release` (an install with
|
|
67
|
+
* `npm_config_build_from_source`) is built for this libc and is safe.
|
|
68
|
+
*/
|
|
69
|
+
/** How the check reads the machine; tests inject their own. */
|
|
70
|
+
interface MuslProbe {
|
|
71
|
+
platform: string;
|
|
72
|
+
/** A file's text, or null when it cannot be read. */
|
|
73
|
+
readFile(path: string): string | null;
|
|
74
|
+
/** A folder's entries, or [] when it cannot be read. */
|
|
75
|
+
readDir(path: string): string[];
|
|
76
|
+
/** Node's diagnostic report header, read without touching the network. */
|
|
77
|
+
reportHeader(): {
|
|
78
|
+
glibcVersionRuntime?: unknown;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The libc, from the cheapest evidence first — the files `detect-libc` and
|
|
83
|
+
* the claude-code plugin read (`/lib/ld-musl-*`, `/usr/bin/ldd`), then the
|
|
84
|
+
* diagnostic report (no `glibcVersionRuntime` on musl). Never throws.
|
|
85
|
+
*/
|
|
86
|
+
declare function detectMuslLinux(probe: MuslProbe): boolean;
|
|
87
|
+
/** True on musl Linux. Detected once per process (the libc does not change under it). */
|
|
88
|
+
declare function isMuslLinux(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* True when the PTY addon must not be loaded here: musl Linux without a
|
|
91
|
+
* source build of the addon. `resolvePackageJson` returns the addon's
|
|
92
|
+
* `package.json` path (throws when it is not installed — then nothing is
|
|
93
|
+
* loadable anyway, so the answer is `musl`).
|
|
94
|
+
*/
|
|
95
|
+
declare function muslBlocksPtyAddon(resolvePackageJson: () => string, musl?: boolean, fileExists?: (path: string) => boolean): boolean;
|
|
96
|
+
|
|
97
|
+
export { type MuslProbe, PtyLocalPlugin, PtyLocalPlugin as default, detectMuslLinux, isMuslLinux, makePtyLocalSessionId, muslBlocksPtyAddon };
|
package/dist/index.d.ts
CHANGED
|
@@ -55,4 +55,43 @@ declare class PtyLocalPlugin implements IPlugin, ITerminalStreamPlugin {
|
|
|
55
55
|
getManifest(): PluginManifest;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* musl Linux (Alpine) and the PTY addon.
|
|
60
|
+
*
|
|
61
|
+
* `@homebridge/node-pty-prebuilt-multiarch` 0.15 ships `linux-musl-*`
|
|
62
|
+
* prebuilds, but its loader (`lib/utils.js` `loadNativeModule`) looks only in
|
|
63
|
+
* `build/Release`, `build/Debug` and `prebuilds/<platform>-<arch>`. On musl it
|
|
64
|
+
* therefore loads the GLIBC prebuild: the `require` succeeds and the first
|
|
65
|
+
* `spawn()` segfaults the whole process (seen on `node:26-alpine`,
|
|
66
|
+
* 2026-11-11). A source build in `build/Release` (an install with
|
|
67
|
+
* `npm_config_build_from_source`) is built for this libc and is safe.
|
|
68
|
+
*/
|
|
69
|
+
/** How the check reads the machine; tests inject their own. */
|
|
70
|
+
interface MuslProbe {
|
|
71
|
+
platform: string;
|
|
72
|
+
/** A file's text, or null when it cannot be read. */
|
|
73
|
+
readFile(path: string): string | null;
|
|
74
|
+
/** A folder's entries, or [] when it cannot be read. */
|
|
75
|
+
readDir(path: string): string[];
|
|
76
|
+
/** Node's diagnostic report header, read without touching the network. */
|
|
77
|
+
reportHeader(): {
|
|
78
|
+
glibcVersionRuntime?: unknown;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The libc, from the cheapest evidence first — the files `detect-libc` and
|
|
83
|
+
* the claude-code plugin read (`/lib/ld-musl-*`, `/usr/bin/ldd`), then the
|
|
84
|
+
* diagnostic report (no `glibcVersionRuntime` on musl). Never throws.
|
|
85
|
+
*/
|
|
86
|
+
declare function detectMuslLinux(probe: MuslProbe): boolean;
|
|
87
|
+
/** True on musl Linux. Detected once per process (the libc does not change under it). */
|
|
88
|
+
declare function isMuslLinux(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* True when the PTY addon must not be loaded here: musl Linux without a
|
|
91
|
+
* source build of the addon. `resolvePackageJson` returns the addon's
|
|
92
|
+
* `package.json` path (throws when it is not installed — then nothing is
|
|
93
|
+
* loadable anyway, so the answer is `musl`).
|
|
94
|
+
*/
|
|
95
|
+
declare function muslBlocksPtyAddon(resolvePackageJson: () => string, musl?: boolean, fileExists?: (path: string) => boolean): boolean;
|
|
96
|
+
|
|
97
|
+
export { type MuslProbe, PtyLocalPlugin, PtyLocalPlugin as default, detectMuslLinux, isMuslLinux, makePtyLocalSessionId, muslBlocksPtyAddon };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
3
|
+
import { join, dirname } from 'path';
|
|
2
4
|
|
|
3
5
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
6
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -19,6 +21,10 @@ var PROBLEM_CODES = [
|
|
|
19
21
|
"not_connection_owner",
|
|
20
22
|
"integration_disabled",
|
|
21
23
|
"integration_revoked",
|
|
24
|
+
"subject_unknown",
|
|
25
|
+
"link_not_found",
|
|
26
|
+
"oidc_client_exists",
|
|
27
|
+
"redirect_uri_invalid",
|
|
22
28
|
"denied_by_policy",
|
|
23
29
|
"integration_not_available",
|
|
24
30
|
"entitlement_required",
|
|
@@ -47,6 +53,8 @@ var PROBLEM_CODES = [
|
|
|
47
53
|
"illegal_transition",
|
|
48
54
|
"already_exists",
|
|
49
55
|
"already_completed",
|
|
56
|
+
"legal_basis_required",
|
|
57
|
+
"receipt_final",
|
|
50
58
|
"billing_active",
|
|
51
59
|
"sso_required",
|
|
52
60
|
"reauth_required",
|
|
@@ -113,6 +121,9 @@ var RECORD_VISIBILITIES = ["private", "team", "organization"];
|
|
|
113
121
|
new Set(RECORD_VISIBILITIES);
|
|
114
122
|
var RECORD_LIST_VIEWS = ["mine", "shared", "organization"];
|
|
115
123
|
new Set(RECORD_LIST_VIEWS);
|
|
124
|
+
new Set(
|
|
125
|
+
"a abbr address applet area article aside audio b base bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe image img input ins kbd label legend li link main map mark marquee math menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select slot small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr xmp".split(" ")
|
|
126
|
+
);
|
|
116
127
|
var VERSION = "1.0.0";
|
|
117
128
|
var GTM_SKILLS = [
|
|
118
129
|
// ── research ────────────────────────────────────────────────────────
|
|
@@ -1820,6 +1831,9 @@ var DOMAIN_EVENT_CATALOG = [
|
|
|
1820
1831
|
{ type: "inbox.item.answered", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1821
1832
|
{ type: "inbox.item.state_changed", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1822
1833
|
{ type: "inbox.item.deleted", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1834
|
+
// Integration inbox push: an integration's PATCH of its own item, and the member's
|
|
1835
|
+
// answer to an integration item (stored on the item; no run is started).
|
|
1836
|
+
{ type: "inbox.item.updated", domain: "inbox", aggregateType: "inbox_item", phase: "P3" },
|
|
1823
1837
|
{ type: "kb.document.created", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
1824
1838
|
{ type: "kb.document.updated", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
1825
1839
|
{ type: "kb.document.moved", domain: "kb", aggregateType: "kb_document", phase: "P3" },
|
|
@@ -1849,12 +1863,85 @@ var TerminalNotProvisionedError = class extends Error {
|
|
|
1849
1863
|
this.name = "TerminalNotProvisionedError";
|
|
1850
1864
|
}
|
|
1851
1865
|
};
|
|
1866
|
+
var GITHUB_FULL_SCOPES_ALL = [
|
|
1867
|
+
"user:email",
|
|
1868
|
+
"read:user",
|
|
1869
|
+
"repo",
|
|
1870
|
+
"delete_repo",
|
|
1871
|
+
"workflow",
|
|
1872
|
+
"write:repo_hook",
|
|
1873
|
+
"read:org",
|
|
1874
|
+
"project"
|
|
1875
|
+
];
|
|
1876
|
+
var GITHUB_DELETE_REPO_SCOPE = "delete_repo";
|
|
1877
|
+
function isGithubDeleteRepoScopeEnabled(env = readEnv()) {
|
|
1878
|
+
return (env?.GITHUB_OAUTH_DELETE_REPO_SCOPE_ENABLED ?? "").trim().toLowerCase() === "true";
|
|
1879
|
+
}
|
|
1880
|
+
function readEnv() {
|
|
1881
|
+
return typeof process !== "undefined" ? process.env : void 0;
|
|
1882
|
+
}
|
|
1883
|
+
Object.freeze(
|
|
1884
|
+
GITHUB_FULL_SCOPES_ALL.filter((scope) => scope !== GITHUB_DELETE_REPO_SCOPE || isGithubDeleteRepoScopeEnabled())
|
|
1885
|
+
);
|
|
1886
|
+
var realProbe = () => ({
|
|
1887
|
+
platform: process.platform,
|
|
1888
|
+
readFile: (path) => {
|
|
1889
|
+
try {
|
|
1890
|
+
return readFileSync(path, "utf8");
|
|
1891
|
+
} catch {
|
|
1892
|
+
return null;
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
readDir: (path) => {
|
|
1896
|
+
try {
|
|
1897
|
+
return readdirSync(path);
|
|
1898
|
+
} catch {
|
|
1899
|
+
return [];
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
reportHeader: () => {
|
|
1903
|
+
const report = process.report;
|
|
1904
|
+
if (!report?.getReport) return void 0;
|
|
1905
|
+
const previous = report.excludeNetwork;
|
|
1906
|
+
report.excludeNetwork = true;
|
|
1907
|
+
try {
|
|
1908
|
+
return report.getReport().header;
|
|
1909
|
+
} finally {
|
|
1910
|
+
report.excludeNetwork = previous;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
});
|
|
1914
|
+
function detectMuslLinux(probe) {
|
|
1915
|
+
if (probe.platform !== "linux") return false;
|
|
1916
|
+
try {
|
|
1917
|
+
if (probe.readDir("/lib").some((name) => name.startsWith("ld-musl-"))) return true;
|
|
1918
|
+
const ldd = probe.readFile("/usr/bin/ldd");
|
|
1919
|
+
if (ldd !== null) return ldd.includes("musl");
|
|
1920
|
+
const header = probe.reportHeader();
|
|
1921
|
+
return header !== void 0 && !header.glibcVersionRuntime;
|
|
1922
|
+
} catch {
|
|
1923
|
+
return false;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
var cachedMusl = null;
|
|
1927
|
+
function isMuslLinux() {
|
|
1928
|
+
if (cachedMusl === null) cachedMusl = detectMuslLinux(realProbe());
|
|
1929
|
+
return cachedMusl;
|
|
1930
|
+
}
|
|
1931
|
+
function muslBlocksPtyAddon(resolvePackageJson, musl = isMuslLinux(), fileExists = existsSync) {
|
|
1932
|
+
if (!musl) return false;
|
|
1933
|
+
try {
|
|
1934
|
+
return !fileExists(join(dirname(resolvePackageJson()), "build", "Release", "pty.node"));
|
|
1935
|
+
} catch {
|
|
1936
|
+
return true;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1852
1939
|
|
|
1853
1940
|
// src/pty-local.plugin.ts
|
|
1854
1941
|
var DEFAULT_COLS = 120;
|
|
1855
1942
|
var DEFAULT_ROWS = 32;
|
|
1856
1943
|
function makePtyLocalSessionId(runId, pid) {
|
|
1857
|
-
const suffix = typeof pid === "number" && Number.
|
|
1944
|
+
const suffix = typeof pid === "number" && Number.isInteger(pid) && pid > 0 ? String(pid) : "no-pid";
|
|
1858
1945
|
return `pty-local:${runId}:${suffix}`;
|
|
1859
1946
|
}
|
|
1860
1947
|
var PtyLocalPlugin = class {
|
|
@@ -2048,6 +2135,9 @@ var PtyLocalPlugin = class {
|
|
|
2048
2135
|
}
|
|
2049
2136
|
// ── runtime require ─────────────────────────────────────────────
|
|
2050
2137
|
tryLoadPty() {
|
|
2138
|
+
if (muslBlocksPtyAddon(() => __require.resolve("@homebridge/node-pty-prebuilt-multiarch/package.json"))) {
|
|
2139
|
+
return null;
|
|
2140
|
+
}
|
|
2051
2141
|
try {
|
|
2052
2142
|
const required = __require("@homebridge/node-pty-prebuilt-multiarch");
|
|
2053
2143
|
return typeof required?.spawn === "function" ? required : null;
|
|
@@ -2097,4 +2187,4 @@ var index_default = PtyLocalPlugin;
|
|
|
2097
2187
|
* implementation adds is additive.
|
|
2098
2188
|
*/
|
|
2099
2189
|
|
|
2100
|
-
export { PtyLocalPlugin, index_default as default, makePtyLocalSessionId };
|
|
2190
|
+
export { PtyLocalPlugin, index_default as default, detectMuslLinux, isMuslLinux, makePtyLocalSessionId, muslBlocksPtyAddon };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ever-works/pty-local-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Streaming-terminal session host for Ever Works — spawns the agent CLI under a real PTY inside the executing job-runtime worker (node-pty prebuilt), degrading to a child_process pipe floor when the native addon is unavailable.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ever Co. LTD",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"test:coverage": "vitest run --coverage"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@ever-works/plugin": "^1.2.
|
|
35
|
+
"@ever-works/plugin": "^1.2.28"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@homebridge/node-pty-prebuilt-multiarch": "^0.
|
|
38
|
+
"@homebridge/node-pty-prebuilt-multiarch": "^0.15.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ever-works/contracts": "^1.
|
|
42
|
-
"@ever-works/plugin": "^1.2.
|
|
41
|
+
"@ever-works/contracts": "^1.1.1",
|
|
42
|
+
"@ever-works/plugin": "^1.2.28",
|
|
43
43
|
"@types/node": "^26.6.4",
|
|
44
44
|
"tsup": "^8.4.0",
|
|
45
45
|
"typescript": "^5.7.3",
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
},
|
|
63
63
|
"repository": {
|
|
64
64
|
"type": "git",
|
|
65
|
-
"url": "git+https://github.com/ever-
|
|
65
|
+
"url": "git+https://github.com/ever-co/ever-works.git",
|
|
66
66
|
"directory": "packages/plugins/pty-local"
|
|
67
67
|
},
|
|
68
|
-
"homepage": "https://github.com/ever-
|
|
68
|
+
"homepage": "https://github.com/ever-co/ever-works/tree/main/packages/plugins/pty-local#readme",
|
|
69
69
|
"bugs": {
|
|
70
|
-
"url": "https://github.com/ever-
|
|
70
|
+
"url": "https://github.com/ever-co/ever-works/issues"
|
|
71
71
|
},
|
|
72
72
|
"everworksRelease": {
|
|
73
|
-
"contentHash": "sha256:
|
|
74
|
-
"commit": "
|
|
75
|
-
"source": "https://github.com/ever-
|
|
73
|
+
"contentHash": "sha256:299638dd2395733f561d5954180b571cd9cd73431573bde4eed6fe099ca2ab12",
|
|
74
|
+
"commit": "2288ff7e91562b0f079c365348ba08ab3a16f1dd",
|
|
75
|
+
"source": "https://github.com/ever-co/ever-works/tree/2288ff7e91562b0f079c365348ba08ab3a16f1dd/packages/plugins/pty-local"
|
|
76
76
|
}
|
|
77
77
|
}
|