@heyditto/cli 2.12.0 → 2.12.1
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/README.md +7 -5
- package/dist/agents/launch.js +1 -1
- package/dist/remote/pty.d.ts +4 -3
- package/dist/remote/pty.js +12 -8
- package/dist/remote/pty.js.map +1 -1
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -639,11 +639,13 @@ How it works:
|
|
|
639
639
|
machine stays the same device across launches. A backend without the bridge,
|
|
640
640
|
or no network, never blocks the harness: remote control just stays off.
|
|
641
641
|
- **TUI mode** runs the harness in a pseudo-terminal the CLI owns (via the
|
|
642
|
-
optional
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
642
|
+
optional `@lydell/node-pty` dependency, which ships prebuilt binaries for
|
|
643
|
+
macOS, Linux and Windows on x64/arm64 and runs no install scripts) and
|
|
644
|
+
mirrors it to your terminal. A prompt from the app is pasted into the
|
|
645
|
+
harness's input box (bracketed paste) and submitted; `turn.interrupt` sends
|
|
646
|
+
Esc (Claude Code) or Ctrl+C (Codex). Without a PTY module for your platform,
|
|
647
|
+
or outside a terminal, the launch falls back to a plain spawn and says why
|
|
648
|
+
remote control is off.
|
|
647
649
|
- **Turn boundaries come from the harnesses, not from parsing the screen.**
|
|
648
650
|
Claude Code is launched with `--settings` hooks (`UserPromptSubmit`, `Stop`,
|
|
649
651
|
`Notification`, `PreToolUse` for `AskUserQuestion`); Codex with
|
package/dist/agents/launch.js
CHANGED
|
@@ -506,7 +506,7 @@ async function runInTerminal(plan, cwd) {
|
|
|
506
506
|
/**
|
|
507
507
|
* Remote-controllable TUI: the harness runs in a pseudo-terminal this process
|
|
508
508
|
* owns and mirrors to the real one, so prompts from the app can be typed into
|
|
509
|
-
* its input box. Anything that stops that (no
|
|
509
|
+
* its input box. Anything that stops that (no PTY module, not a terminal) falls
|
|
510
510
|
* back to the plain launch with a note, never a failure.
|
|
511
511
|
*/
|
|
512
512
|
async function runInTerminalWithRemote(harness, plan, ctx) {
|
package/dist/remote/pty.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import type { Harness } from "../agents/types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Runs a harness inside a pseudo-terminal this process owns, mirrored to the
|
|
4
4
|
* real terminal, so Remote Control can type into the harness's own input box
|
|
5
|
-
* exactly as the user would. node-pty is an optional dependency
|
|
6
|
-
*
|
|
5
|
+
* exactly as the user would. `@lydell/node-pty` is an optional dependency
|
|
6
|
+
* (node-pty repackaged as script-free prebuilt binaries per platform): when
|
|
7
|
+
* it is missing the launcher falls back to a plain spawn and says why remote
|
|
7
8
|
* control is off.
|
|
8
9
|
*/
|
|
9
10
|
interface PtyModule {
|
|
@@ -26,7 +27,7 @@ interface PtyProcess {
|
|
|
26
27
|
kill(signal?: string): void;
|
|
27
28
|
pid: number;
|
|
28
29
|
}
|
|
29
|
-
/** Loads
|
|
30
|
+
/** Loads the PTY module, or explains what is missing. */
|
|
30
31
|
export declare function loadPty(): {
|
|
31
32
|
pty?: PtyModule;
|
|
32
33
|
reason?: string;
|
package/dist/remote/pty.js
CHANGED
|
@@ -2,27 +2,31 @@ import { chmod } from "node:fs/promises";
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
const requireModule = createRequire(import.meta.url);
|
|
5
|
-
|
|
5
|
+
const PTY_PACKAGE = "@lydell/node-pty";
|
|
6
|
+
/** The per-platform package that carries the prebuilt binary. */
|
|
7
|
+
const PTY_PLATFORM_PACKAGE = `${PTY_PACKAGE}-${process.platform}-${process.arch}`;
|
|
8
|
+
/** Loads the PTY module, or explains what is missing. */
|
|
6
9
|
export function loadPty() {
|
|
7
10
|
try {
|
|
8
|
-
return { pty: requireModule(
|
|
11
|
+
return { pty: requireModule(PTY_PACKAGE) };
|
|
9
12
|
}
|
|
10
13
|
catch (err) {
|
|
11
14
|
const message = err instanceof Error ? err.message : String(err);
|
|
12
15
|
return {
|
|
13
|
-
reason:
|
|
16
|
+
reason: `${PTY_PACKAGE} is not installed or has no prebuilt binary for ${process.platform}-${process.arch} (${message.split("\n")[0]}); reinstall with \`npm i -g @heyditto/cli\` without \`--omit=optional\``,
|
|
14
17
|
};
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
|
-
* npm sometimes extracts
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* npm sometimes extracts the prebuilt `spawn-helper` without its execute bit,
|
|
22
|
+
* which surfaces as "posix_spawnp failed". The prebuilt package has no
|
|
23
|
+
* install script that could restore it, so we do: the bit is safe to set (it
|
|
24
|
+
* is the PTY package's own binary) and fixes the spawn on retry.
|
|
21
25
|
*/
|
|
22
26
|
async function repairSpawnHelper() {
|
|
23
27
|
try {
|
|
24
|
-
const
|
|
25
|
-
const helper = path.join(
|
|
28
|
+
const entry = requireModule.resolve(PTY_PLATFORM_PACKAGE); // <pkg>/lib/index.js
|
|
29
|
+
const helper = path.join(path.dirname(entry), "..", "prebuilds", `${process.platform}-${process.arch}`, "spawn-helper");
|
|
26
30
|
await chmod(helper, 0o755);
|
|
27
31
|
return true;
|
|
28
32
|
}
|
package/dist/remote/pty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pty.js","sourceRoot":"","sources":["../../src/remote/pty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"pty.js","sourceRoot":"","sources":["../../src/remote/pty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AA6B7B,MAAM,aAAa,G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12.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"description": "Ditto Memory CLI — save, search, fetch, and traverse the Ditto memory graph from the shell.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -57,9 +57,6 @@
|
|
|
57
57
|
"node": ">=22.12.0"
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"node-pty": "^1.
|
|
61
|
-
},
|
|
62
|
-
"allowScripts": {
|
|
63
|
-
"node-pty@1.1.0": true
|
|
60
|
+
"@lydell/node-pty": "^1.2.0-beta.15"
|
|
64
61
|
}
|
|
65
62
|
}
|