terminal-pilot 0.0.38 → 0.0.40
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/cli.d.ts +1 -0
- package/dist/cli.js +20 -4
- package/dist/cli.js.map +2 -2
- package/dist/commands/close-session.js +3 -0
- package/dist/commands/close-session.js.map +2 -2
- package/dist/commands/create-session.js +3 -0
- package/dist/commands/create-session.js.map +2 -2
- package/dist/commands/daemon-runtime.js +14 -3
- package/dist/commands/daemon-runtime.js.map +2 -2
- package/dist/commands/fill.js +3 -0
- package/dist/commands/fill.js.map +2 -2
- package/dist/commands/get-session.js +3 -0
- package/dist/commands/get-session.js.map +2 -2
- package/dist/commands/index.js +3 -0
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list-sessions.js +3 -0
- package/dist/commands/list-sessions.js.map +2 -2
- package/dist/commands/press-key.js +3 -0
- package/dist/commands/press-key.js.map +2 -2
- package/dist/commands/read-history.js +3 -0
- package/dist/commands/read-history.js.map +2 -2
- package/dist/commands/read-screen.js +3 -0
- package/dist/commands/read-screen.js.map +2 -2
- package/dist/commands/resize.js +3 -0
- package/dist/commands/resize.js.map +2 -2
- package/dist/commands/runtime.d.ts +1 -0
- package/dist/commands/runtime.js +3 -0
- package/dist/commands/runtime.js.map +2 -2
- package/dist/commands/screenshot.js +3 -0
- package/dist/commands/screenshot.js.map +2 -2
- package/dist/commands/send-signal.js +3 -0
- package/dist/commands/send-signal.js.map +2 -2
- package/dist/commands/type.js +3 -0
- package/dist/commands/type.js.map +2 -2
- package/dist/commands/wait-for-exit.js +3 -0
- package/dist/commands/wait-for-exit.js.map +2 -2
- package/dist/commands/wait-for.js +3 -0
- package/dist/commands/wait-for.js.map +2 -2
- package/dist/testing/cli-repl.js +20 -4
- package/dist/testing/cli-repl.js.map +2 -2
- package/dist/testing/qa-cli.js +20 -4
- package/dist/testing/qa-cli.js.map +2 -2
- package/package.json +1 -1
|
@@ -1541,6 +1541,9 @@ function createTerminalPilotRuntime(options = {}) {
|
|
|
1541
1541
|
};
|
|
1542
1542
|
},
|
|
1543
1543
|
listSessions,
|
|
1544
|
+
async hasRetainedSessions() {
|
|
1545
|
+
return nameToId.size > 0 || pendingNames.size > 0;
|
|
1546
|
+
},
|
|
1544
1547
|
async close() {
|
|
1545
1548
|
if (pilotPromise === void 0) {
|
|
1546
1549
|
return;
|
|
@@ -1609,8 +1612,7 @@ async function runTerminalPilotDaemon() {
|
|
|
1609
1612
|
clearTimeout(idleTimer);
|
|
1610
1613
|
idleTimer = void 0;
|
|
1611
1614
|
}
|
|
1612
|
-
|
|
1613
|
-
if (sessions.length > 0) {
|
|
1615
|
+
if (await runtime.hasRetainedSessions()) {
|
|
1614
1616
|
return;
|
|
1615
1617
|
}
|
|
1616
1618
|
idleTimer = setTimeout(() => {
|
|
@@ -1671,7 +1673,10 @@ function createDaemonTerminalPilotRuntime() {
|
|
|
1671
1673
|
return {
|
|
1672
1674
|
async createSession(params, env) {
|
|
1673
1675
|
const result = await request("createSession", {
|
|
1674
|
-
params
|
|
1676
|
+
params: {
|
|
1677
|
+
...params,
|
|
1678
|
+
cwd: params.cwd ?? process.cwd()
|
|
1679
|
+
},
|
|
1675
1680
|
envSession: env?.get(SESSION_ENV_VAR)
|
|
1676
1681
|
});
|
|
1677
1682
|
return { name: result.name, session: proxySession(result.name, result.session) };
|
|
@@ -1696,6 +1701,9 @@ function createDaemonTerminalPilotRuntime() {
|
|
|
1696
1701
|
session: proxySession(entry.name, entry.session)
|
|
1697
1702
|
}));
|
|
1698
1703
|
},
|
|
1704
|
+
async hasRetainedSessions() {
|
|
1705
|
+
return request("hasRetainedSessions");
|
|
1706
|
+
},
|
|
1699
1707
|
async close() {
|
|
1700
1708
|
await request("shutdown").catch(() => void 0);
|
|
1701
1709
|
}
|
|
@@ -1747,6 +1755,9 @@ async function handleRequest(runtime, request) {
|
|
|
1747
1755
|
const sessions = await runtime.listSessions();
|
|
1748
1756
|
return sessions.map(formatNamedSession);
|
|
1749
1757
|
}
|
|
1758
|
+
if (request.method === "hasRetainedSessions") {
|
|
1759
|
+
return runtime.hasRetainedSessions();
|
|
1760
|
+
}
|
|
1750
1761
|
if (request.method === "closeSession") {
|
|
1751
1762
|
return runtime.closeSession(optionalString(params.name), envFromValue(params.envSession));
|
|
1752
1763
|
}
|