terminal-pilot 0.0.38 → 0.0.39

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.
Files changed (43) hide show
  1. package/dist/cli.d.ts +1 -0
  2. package/dist/cli.js +16 -3
  3. package/dist/cli.js.map +2 -2
  4. package/dist/commands/close-session.js +3 -0
  5. package/dist/commands/close-session.js.map +2 -2
  6. package/dist/commands/create-session.js +3 -0
  7. package/dist/commands/create-session.js.map +2 -2
  8. package/dist/commands/daemon-runtime.js +10 -2
  9. package/dist/commands/daemon-runtime.js.map +2 -2
  10. package/dist/commands/fill.js +3 -0
  11. package/dist/commands/fill.js.map +2 -2
  12. package/dist/commands/get-session.js +3 -0
  13. package/dist/commands/get-session.js.map +2 -2
  14. package/dist/commands/index.js +3 -0
  15. package/dist/commands/index.js.map +2 -2
  16. package/dist/commands/list-sessions.js +3 -0
  17. package/dist/commands/list-sessions.js.map +2 -2
  18. package/dist/commands/press-key.js +3 -0
  19. package/dist/commands/press-key.js.map +2 -2
  20. package/dist/commands/read-history.js +3 -0
  21. package/dist/commands/read-history.js.map +2 -2
  22. package/dist/commands/read-screen.js +3 -0
  23. package/dist/commands/read-screen.js.map +2 -2
  24. package/dist/commands/resize.js +3 -0
  25. package/dist/commands/resize.js.map +2 -2
  26. package/dist/commands/runtime.d.ts +1 -0
  27. package/dist/commands/runtime.js +3 -0
  28. package/dist/commands/runtime.js.map +2 -2
  29. package/dist/commands/screenshot.js +3 -0
  30. package/dist/commands/screenshot.js.map +2 -2
  31. package/dist/commands/send-signal.js +3 -0
  32. package/dist/commands/send-signal.js.map +2 -2
  33. package/dist/commands/type.js +3 -0
  34. package/dist/commands/type.js.map +2 -2
  35. package/dist/commands/wait-for-exit.js +3 -0
  36. package/dist/commands/wait-for-exit.js.map +2 -2
  37. package/dist/commands/wait-for.js +3 -0
  38. package/dist/commands/wait-for.js.map +2 -2
  39. package/dist/testing/cli-repl.js +16 -3
  40. package/dist/testing/cli-repl.js.map +2 -2
  41. package/dist/testing/qa-cli.js +16 -3
  42. package/dist/testing/qa-cli.js.map +2 -2
  43. package/package.json +1 -1
@@ -19454,6 +19454,9 @@ function createTerminalPilotRuntime(options = {}) {
19454
19454
  };
19455
19455
  },
19456
19456
  listSessions: listSessions2,
19457
+ async hasRetainedSessions() {
19458
+ return nameToId.size > 0 || pendingNames.size > 0;
19459
+ },
19457
19460
  async close() {
19458
19461
  if (pilotPromise === void 0) {
19459
19462
  return;
@@ -22976,8 +22979,7 @@ async function runTerminalPilotDaemon() {
22976
22979
  clearTimeout(idleTimer);
22977
22980
  idleTimer = void 0;
22978
22981
  }
22979
- const sessions = await runtime.listSessions();
22980
- if (sessions.length > 0) {
22982
+ if (await runtime.hasRetainedSessions()) {
22981
22983
  return;
22982
22984
  }
22983
22985
  idleTimer = setTimeout(() => {
@@ -23063,6 +23065,9 @@ function createDaemonTerminalPilotRuntime() {
23063
23065
  session: proxySession(entry.name, entry.session)
23064
23066
  }));
23065
23067
  },
23068
+ async hasRetainedSessions() {
23069
+ return request("hasRetainedSessions");
23070
+ },
23066
23071
  async close() {
23067
23072
  await request("shutdown").catch(() => void 0);
23068
23073
  }
@@ -23114,6 +23119,9 @@ async function handleRequest(runtime, request) {
23114
23119
  const sessions = await runtime.listSessions();
23115
23120
  return sessions.map(formatNamedSession);
23116
23121
  }
23122
+ if (request.method === "hasRetainedSessions") {
23123
+ return runtime.hasRetainedSessions();
23124
+ }
23117
23125
  if (request.method === "closeSession") {
23118
23126
  return runtime.closeSession(optionalString2(params17.name), envFromValue(params17.envSession));
23119
23127
  }
@@ -23306,6 +23314,9 @@ function sleep2(ms) {
23306
23314
 
23307
23315
  // src/cli.ts
23308
23316
  configureTheme({ brand: "green", label: "Terminal Pilot" });
23317
+ function getBundledPackageVersion() {
23318
+ return true ? "0.0.39" : void 0;
23319
+ }
23309
23320
  function normalizeArgv(argv) {
23310
23321
  if (argv.includes("--json") && !argv.some((argument) => argument === "--output" || argument.startsWith("--output="))) {
23311
23322
  return argv.flatMap((argument) => argument === "--json" ? ["--output", "json"] : [argument]);
@@ -23320,6 +23331,7 @@ async function main(argv = process.argv, options = {}) {
23320
23331
  const originalArgv = process.argv;
23321
23332
  process.argv = normalizeArgv(argv);
23322
23333
  try {
23334
+ const packageVersion = options.packageVersion ?? getBundledPackageVersion();
23323
23335
  await runCLI(createTerminalPilotGroup(), {
23324
23336
  services: {
23325
23337
  terminalPilotRuntime: options.terminalPilotRuntime ?? createDaemonTerminalPilotRuntime()
@@ -23329,7 +23341,8 @@ async function main(argv = process.argv, options = {}) {
23329
23341
  output: true,
23330
23342
  verbose: true,
23331
23343
  yes: true
23332
- }
23344
+ },
23345
+ ...packageVersion === void 0 ? {} : { version: packageVersion }
23333
23346
  });
23334
23347
  } finally {
23335
23348
  process.argv = originalArgv;