@adhdev/daemon-core 0.8.14 → 0.8.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.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -27
- package/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +1 -9
- package/src/cli-adapters/pty-transport.ts +17 -6
package/dist/index.mjs
CHANGED
|
@@ -700,17 +700,35 @@ var init_terminal_screen = __esm({
|
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
702
|
|
|
703
|
+
// src/cli-adapters/spawn-env.ts
|
|
704
|
+
import {
|
|
705
|
+
sanitizeSpawnEnv,
|
|
706
|
+
applyTerminalColorEnv,
|
|
707
|
+
ensureNodePtySpawnHelperPermissions
|
|
708
|
+
} from "@adhdev/session-host-core";
|
|
709
|
+
var init_spawn_env = __esm({
|
|
710
|
+
"src/cli-adapters/spawn-env.ts"() {
|
|
711
|
+
"use strict";
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
|
|
703
715
|
// src/cli-adapters/pty-transport.ts
|
|
704
716
|
import * as os7 from "os";
|
|
705
|
-
|
|
717
|
+
function loadNodePty() {
|
|
718
|
+
if (cachedPty !== void 0) return cachedPty;
|
|
719
|
+
try {
|
|
720
|
+
cachedPty = __require("node-pty");
|
|
721
|
+
ensureNodePtySpawnHelperPermissions();
|
|
722
|
+
} catch {
|
|
723
|
+
cachedPty = null;
|
|
724
|
+
}
|
|
725
|
+
return cachedPty;
|
|
726
|
+
}
|
|
727
|
+
var cachedPty, NodePtyRuntimeTransport, NodePtyTransportFactory;
|
|
706
728
|
var init_pty_transport = __esm({
|
|
707
729
|
"src/cli-adapters/pty-transport.ts"() {
|
|
708
730
|
"use strict";
|
|
709
|
-
|
|
710
|
-
pty = __require("node-pty");
|
|
711
|
-
} catch {
|
|
712
|
-
pty = null;
|
|
713
|
-
}
|
|
731
|
+
init_spawn_env();
|
|
714
732
|
NodePtyRuntimeTransport = class {
|
|
715
733
|
constructor(handle) {
|
|
716
734
|
this.handle = handle;
|
|
@@ -741,6 +759,7 @@ var init_pty_transport = __esm({
|
|
|
741
759
|
};
|
|
742
760
|
NodePtyTransportFactory = class {
|
|
743
761
|
spawn(command, args, options) {
|
|
762
|
+
const pty = loadNodePty();
|
|
744
763
|
if (!pty) throw new Error("node-pty is not installed");
|
|
745
764
|
let cwd = options.cwd;
|
|
746
765
|
if (cwd) {
|
|
@@ -765,18 +784,6 @@ var init_pty_transport = __esm({
|
|
|
765
784
|
}
|
|
766
785
|
});
|
|
767
786
|
|
|
768
|
-
// src/cli-adapters/spawn-env.ts
|
|
769
|
-
import {
|
|
770
|
-
sanitizeSpawnEnv,
|
|
771
|
-
applyTerminalColorEnv,
|
|
772
|
-
ensureNodePtySpawnHelperPermissions
|
|
773
|
-
} from "@adhdev/session-host-core";
|
|
774
|
-
var init_spawn_env = __esm({
|
|
775
|
-
"src/cli-adapters/spawn-env.ts"() {
|
|
776
|
-
"use strict";
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
|
|
780
787
|
// src/cli-adapters/provider-cli-adapter.ts
|
|
781
788
|
var provider_cli_adapter_exports = {};
|
|
782
789
|
__export(provider_cli_adapter_exports, {
|
|
@@ -923,7 +930,7 @@ function normalizeCliProviderForRuntime(raw) {
|
|
|
923
930
|
}
|
|
924
931
|
};
|
|
925
932
|
}
|
|
926
|
-
var
|
|
933
|
+
var buildCliSpawnEnv, ProviderCliAdapter;
|
|
927
934
|
var init_provider_cli_adapter = __esm({
|
|
928
935
|
"src/cli-adapters/provider-cli-adapter.ts"() {
|
|
929
936
|
"use strict";
|
|
@@ -931,12 +938,6 @@ var init_provider_cli_adapter = __esm({
|
|
|
931
938
|
init_terminal_screen();
|
|
932
939
|
init_pty_transport();
|
|
933
940
|
init_spawn_env();
|
|
934
|
-
try {
|
|
935
|
-
pty2 = __require("node-pty");
|
|
936
|
-
ensureNodePtySpawnHelperPermissions((msg) => LOG.info("CLI", msg));
|
|
937
|
-
} catch {
|
|
938
|
-
LOG.error("CLI", "[ProviderCliAdapter] node-pty not found. Terminal features disabled.");
|
|
939
|
-
}
|
|
940
941
|
buildCliSpawnEnv = sanitizeSpawnEnv;
|
|
941
942
|
ProviderCliAdapter = class _ProviderCliAdapter {
|
|
942
943
|
constructor(provider, workingDir, extraArgs = [], transportFactory = new NodePtyTransportFactory()) {
|
|
@@ -15979,10 +15980,10 @@ async function handleAutoImplement(ctx, type, req, res) {
|
|
|
15979
15980
|
let isPty = false;
|
|
15980
15981
|
const { spawn: spawnFn } = await import("child_process");
|
|
15981
15982
|
try {
|
|
15982
|
-
const
|
|
15983
|
+
const pty = __require("node-pty");
|
|
15983
15984
|
ctx.log(`Auto-implement spawn (PTY): ${shellCmd}`);
|
|
15984
15985
|
const isWin2 = os17.platform() === "win32";
|
|
15985
|
-
child =
|
|
15986
|
+
child = pty.spawn(isWin2 ? "cmd.exe" : process.env.SHELL || "/bin/zsh", [isWin2 ? "/c" : "-c", shellCmd], {
|
|
15986
15987
|
name: "xterm-256color",
|
|
15987
15988
|
cols: 120,
|
|
15988
15989
|
rows: 40,
|