terminal-pilot 0.0.10 → 0.0.12

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 (54) hide show
  1. package/dist/cli.js +243 -79
  2. package/dist/cli.js.map +4 -4
  3. package/dist/commands/close-session.js +11 -2
  4. package/dist/commands/close-session.js.map +2 -2
  5. package/dist/commands/create-session.js +11 -2
  6. package/dist/commands/create-session.js.map +2 -2
  7. package/dist/commands/fill.js +11 -2
  8. package/dist/commands/fill.js.map +2 -2
  9. package/dist/commands/get-session.js +11 -2
  10. package/dist/commands/get-session.js.map +2 -2
  11. package/dist/commands/index.js +152 -23
  12. package/dist/commands/index.js.map +4 -4
  13. package/dist/commands/install.js +140 -19
  14. package/dist/commands/install.js.map +4 -4
  15. package/dist/commands/installer.js +53 -8
  16. package/dist/commands/installer.js.map +4 -4
  17. package/dist/commands/list-sessions.js +11 -2
  18. package/dist/commands/list-sessions.js.map +2 -2
  19. package/dist/commands/press-key.js +11 -2
  20. package/dist/commands/press-key.js.map +2 -2
  21. package/dist/commands/read-history.js +11 -2
  22. package/dist/commands/read-history.js.map +2 -2
  23. package/dist/commands/read-screen.js +11 -2
  24. package/dist/commands/read-screen.js.map +2 -2
  25. package/dist/commands/resize.js +11 -2
  26. package/dist/commands/resize.js.map +2 -2
  27. package/dist/commands/runtime.js +8 -0
  28. package/dist/commands/runtime.js.map +2 -2
  29. package/dist/commands/screenshot.js +11 -2
  30. package/dist/commands/screenshot.js.map +2 -2
  31. package/dist/commands/send-signal.js +11 -2
  32. package/dist/commands/send-signal.js.map +2 -2
  33. package/dist/commands/type.js +11 -2
  34. package/dist/commands/type.js.map +2 -2
  35. package/dist/commands/uninstall.js +55 -9
  36. package/dist/commands/uninstall.js.map +4 -4
  37. package/dist/commands/wait-for-exit.js +11 -2
  38. package/dist/commands/wait-for-exit.js.map +2 -2
  39. package/dist/commands/wait-for.js +11 -2
  40. package/dist/commands/wait-for.js.map +2 -2
  41. package/dist/index.js +8 -0
  42. package/dist/index.js.map +2 -2
  43. package/dist/terminal-buffer.d.ts +1 -0
  44. package/dist/terminal-buffer.js +8 -0
  45. package/dist/terminal-buffer.js.map +2 -2
  46. package/dist/terminal-pilot.js +8 -0
  47. package/dist/terminal-pilot.js.map +2 -2
  48. package/dist/terminal-session.js +8 -0
  49. package/dist/terminal-session.js.map +2 -2
  50. package/dist/testing/cli-repl.js +243 -79
  51. package/dist/testing/cli-repl.js.map +4 -4
  52. package/dist/testing/qa-cli.js +255 -91
  53. package/dist/testing/qa-cli.js.map +4 -4
  54. package/package.json +1 -1
@@ -45,10 +45,11 @@ var S = {
45
45
  ...options
46
46
  };
47
47
  },
48
- Object(shape) {
48
+ Object(shape, options = {}) {
49
49
  return {
50
50
  kind: "object",
51
- shape
51
+ shape,
52
+ ...options
52
53
  };
53
54
  },
54
55
  Optional(inner) {
@@ -435,6 +436,7 @@ var TerminalBuffer = class {
435
436
  _state = 0 /* Normal */;
436
437
  _csiParams = "";
437
438
  _csiPrivate = "";
439
+ _autoWrap = true;
438
440
  _style = createDefaultStyleState();
439
441
  _styleSequence = "";
440
442
  displayBuffer;
@@ -562,6 +564,9 @@ var TerminalBuffer = class {
562
564
  const p1 = params17[1] ?? 0;
563
565
  if (this._csiPrivate === "?") {
564
566
  if (final === "h" || final === "l") {
567
+ if (params17.includes(7)) {
568
+ this._autoWrap = final === "h";
569
+ }
565
570
  if (params17.includes(1049)) {
566
571
  if (final === "h") {
567
572
  this._screen = this._makeScreen(this._cols, this._rows);
@@ -776,6 +781,10 @@ var TerminalBuffer = class {
776
781
  } else if (code >= 32 && code !== 127) {
777
782
  this._setChar(this._cursorY, this._cursorX, ch);
778
783
  this._cursorX++;
784
+ if (!this._autoWrap) {
785
+ this._cursorX = Math.min(this._cursorX, this._cols - 1);
786
+ return;
787
+ }
779
788
  if (this._cursorX >= this._cols) {
780
789
  this._cursorX = 0;
781
790
  this._newline();
@@ -1690,13 +1699,46 @@ var kimiAgent = {
1690
1699
  }
1691
1700
  };
1692
1701
 
1702
+ // ../agent-defs/src/agents/goose.ts
1703
+ var gooseAgent = {
1704
+ id: "goose",
1705
+ name: "goose",
1706
+ label: "Goose",
1707
+ summary: "Block's open-source AI agent with ACP support.",
1708
+ binaryName: "goose",
1709
+ configPath: "~/.config/goose/config.yaml",
1710
+ branding: {
1711
+ colors: {
1712
+ dark: "#FF6B35",
1713
+ light: "#E85D26"
1714
+ }
1715
+ }
1716
+ };
1717
+
1718
+ // ../agent-defs/src/agents/poe-agent.ts
1719
+ var poeAgentAgent = {
1720
+ id: "poe-agent",
1721
+ name: "poe-agent",
1722
+ label: "Poe Agent",
1723
+ summary: "Run one-shot prompts with the built-in Poe agent runtime.",
1724
+ configPath: "~/.poe-code/config.json",
1725
+ branding: {
1726
+ colors: {
1727
+ dark: "#A465F7",
1728
+ light: "#7A3FD3"
1729
+ }
1730
+ }
1731
+ };
1732
+
1693
1733
  // ../agent-defs/src/registry.ts
1694
1734
  var allAgents = [
1695
1735
  claudeCodeAgent,
1696
1736
  claudeDesktopAgent,
1697
1737
  codexAgent,
1698
1738
  openCodeAgent,
1699
- kimiAgent
1739
+ kimiAgent,
1740
+ gooseAgent,
1741
+ poeAgentAgent
1700
1742
  ];
1701
1743
  var lookup = /* @__PURE__ */ new Map();
1702
1744
  for (const agent of allAgents) {
@@ -1728,6 +1770,10 @@ var agentSkillConfigs = {
1728
1770
  opencode: {
1729
1771
  globalSkillDir: "~/.config/opencode/skills",
1730
1772
  localSkillDir: ".opencode/skills"
1773
+ },
1774
+ goose: {
1775
+ globalSkillDir: "~/.agents/skills",
1776
+ localSkillDir: ".agents/skills"
1731
1777
  }
1732
1778
  };
1733
1779
  var supportedAgents = Object.keys(agentSkillConfigs);
@@ -1991,14 +2037,92 @@ var tomlFormat = {
1991
2037
  prune: prune2
1992
2038
  };
1993
2039
 
2040
+ // ../config-mutations/src/formats/yaml.ts
2041
+ import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
2042
+ function isConfigObject3(value) {
2043
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2044
+ }
2045
+ function parse4(content) {
2046
+ if (!content || content.trim() === "") {
2047
+ return {};
2048
+ }
2049
+ const parsed = parseYaml(content);
2050
+ if (parsed === null || parsed === void 0) {
2051
+ return {};
2052
+ }
2053
+ if (!isConfigObject3(parsed)) {
2054
+ throw new Error("Expected YAML object.");
2055
+ }
2056
+ return parsed;
2057
+ }
2058
+ function serialize3(obj) {
2059
+ const serialized = stringifyYaml(obj);
2060
+ return serialized.endsWith("\n") ? serialized : `${serialized}
2061
+ `;
2062
+ }
2063
+ function merge3(base, patch) {
2064
+ const result = { ...base };
2065
+ for (const [key, value] of Object.entries(patch)) {
2066
+ if (value === void 0) {
2067
+ continue;
2068
+ }
2069
+ const existing = result[key];
2070
+ if (isConfigObject3(existing) && isConfigObject3(value)) {
2071
+ result[key] = merge3(existing, value);
2072
+ continue;
2073
+ }
2074
+ result[key] = value;
2075
+ }
2076
+ return result;
2077
+ }
2078
+ function prune3(obj, shape) {
2079
+ let changed = false;
2080
+ const result = { ...obj };
2081
+ for (const [key, pattern] of Object.entries(shape)) {
2082
+ if (!(key in result)) {
2083
+ continue;
2084
+ }
2085
+ const current = result[key];
2086
+ if (isConfigObject3(pattern) && Object.keys(pattern).length === 0) {
2087
+ delete result[key];
2088
+ changed = true;
2089
+ continue;
2090
+ }
2091
+ if (isConfigObject3(pattern) && isConfigObject3(current)) {
2092
+ const { changed: childChanged, result: childResult } = prune3(current, pattern);
2093
+ if (childChanged) {
2094
+ changed = true;
2095
+ }
2096
+ if (Object.keys(childResult).length === 0) {
2097
+ delete result[key];
2098
+ } else {
2099
+ result[key] = childResult;
2100
+ }
2101
+ continue;
2102
+ }
2103
+ delete result[key];
2104
+ changed = true;
2105
+ }
2106
+ return { changed, result };
2107
+ }
2108
+ var yamlFormat = {
2109
+ parse: parse4,
2110
+ serialize: serialize3,
2111
+ merge: merge3,
2112
+ prune: prune3
2113
+ };
2114
+
1994
2115
  // ../config-mutations/src/formats/index.ts
1995
2116
  var formatRegistry = {
1996
2117
  json: jsonFormat,
1997
- toml: tomlFormat
2118
+ toml: tomlFormat,
2119
+ yaml: yamlFormat
1998
2120
  };
1999
2121
  var extensionMap = {
2000
2122
  ".json": "json",
2001
- ".toml": "toml"
2123
+ ".toml": "toml",
2124
+ ".yaml": "yaml",
2125
+ ".yml": "yaml"
2002
2126
  };
2003
2127
  function getConfigFormat(pathOrFormat) {
2004
2128
  if (pathOrFormat in formatRegistry) {
@@ -2013,16 +2137,16 @@ function getConfigFormat(pathOrFormat) {
2013
2137
  }
2014
2138
  return formatRegistry[formatName];
2015
2139
  }
2016
- function detectFormat(path4) {
2017
- const ext = getExtension(path4);
2140
+ function detectFormat(path5) {
2141
+ const ext = getExtension(path5);
2018
2142
  return extensionMap[ext];
2019
2143
  }
2020
- function getExtension(path4) {
2021
- const lastDot = path4.lastIndexOf(".");
2144
+ function getExtension(path5) {
2145
+ const lastDot = path5.lastIndexOf(".");
2022
2146
  if (lastDot === -1) {
2023
2147
  return "";
2024
2148
  }
2025
- return path4.slice(lastDot).toLowerCase();
2149
+ return path5.slice(lastDot).toLowerCase();
2026
2150
  }
2027
2151
 
2028
2152
  // ../config-mutations/src/execution/path-utils.ts
@@ -2147,7 +2271,7 @@ function pruneKeysByPrefix(table, prefix) {
2147
2271
  }
2148
2272
  return result;
2149
2273
  }
2150
- function isConfigObject3(value) {
2274
+ function isConfigObject4(value) {
2151
2275
  return typeof value === "object" && value !== null && !Array.isArray(value);
2152
2276
  }
2153
2277
  function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
@@ -2156,7 +2280,7 @@ function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
2156
2280
  for (const [key, value] of Object.entries(patch)) {
2157
2281
  const current = result[key];
2158
2282
  const prefix = prefixMap[key];
2159
- if (isConfigObject3(current) && isConfigObject3(value)) {
2283
+ if (isConfigObject4(current) && isConfigObject4(value)) {
2160
2284
  if (prefix) {
2161
2285
  const pruned = pruneKeysByPrefix(current, prefix);
2162
2286
  result[key] = { ...pruned, ...value };
@@ -2324,8 +2448,8 @@ async function applyChmod(mutation, context, options) {
2324
2448
  };
2325
2449
  }
2326
2450
  try {
2327
- const stat = await context.fs.stat(targetPath);
2328
- const currentMode = typeof stat.mode === "number" ? stat.mode & 511 : null;
2451
+ const stat2 = await context.fs.stat(targetPath);
2452
+ const currentMode = typeof stat2.mode === "number" ? stat2.mode & 511 : null;
2329
2453
  if (currentMode === mutation.mode) {
2330
2454
  return {
2331
2455
  outcome: { changed: false, effect: "none", detail: "noop" },
@@ -2672,6 +2796,11 @@ async function executeMutation(mutation, context, options) {
2672
2796
  import Mustache2 from "mustache";
2673
2797
  var originalEscape = Mustache2.escape;
2674
2798
 
2799
+ // ../agent-skill-config/src/templates.ts
2800
+ import { readFile, stat } from "node:fs/promises";
2801
+ import path3 from "node:path";
2802
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
2803
+
2675
2804
  // ../agent-skill-config/src/apply.ts
2676
2805
  var UnsupportedAgentError = class extends Error {
2677
2806
  constructor(agentId) {
@@ -2728,9 +2857,9 @@ async function installSkill(agentId, skill, options) {
2728
2857
 
2729
2858
  // src/commands/installer.ts
2730
2859
  import os2 from "node:os";
2731
- import path3 from "node:path";
2860
+ import path4 from "node:path";
2732
2861
  import * as nodeFs from "node:fs/promises";
2733
- import { readFile } from "node:fs/promises";
2862
+ import { readFile as readFile2 } from "node:fs/promises";
2734
2863
  var DEFAULT_INSTALL_AGENT = "claude-code";
2735
2864
  var DEFAULT_INSTALL_SCOPE = "local";
2736
2865
  var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
@@ -2780,7 +2909,7 @@ async function loadTerminalPilotTemplate() {
2780
2909
  ];
2781
2910
  for (const candidate of candidates) {
2782
2911
  try {
2783
- terminalPilotTemplateCache = await readFile(candidate, "utf8");
2912
+ terminalPilotTemplateCache = await readFile2(candidate, "utf8");
2784
2913
  return terminalPilotTemplateCache;
2785
2914
  } catch (error) {
2786
2915
  if (!isNotFoundError(error)) {
@@ -2795,7 +2924,7 @@ function resolveHomeRelativePath(targetPath, homeDir) {
2795
2924
  return homeDir;
2796
2925
  }
2797
2926
  if (targetPath.startsWith("~/")) {
2798
- return path3.join(homeDir, targetPath.slice(2));
2927
+ return path4.join(homeDir, targetPath.slice(2));
2799
2928
  }
2800
2929
  return targetPath;
2801
2930
  }
@@ -2805,12 +2934,12 @@ function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
2805
2934
  throwUnsupportedAgent(agent);
2806
2935
  }
2807
2936
  return {
2808
- displayPath: path3.join(
2937
+ displayPath: path4.join(
2809
2938
  scope === "global" ? config.globalSkillDir : config.localSkillDir,
2810
2939
  TERMINAL_PILOT_SKILL_NAME
2811
2940
  ),
2812
- fullPath: path3.join(
2813
- scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path3.resolve(cwd, config.localSkillDir),
2941
+ fullPath: path4.join(
2942
+ scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path4.resolve(cwd, config.localSkillDir),
2814
2943
  TERMINAL_PILOT_SKILL_NAME
2815
2944
  )
2816
2945
  };
@@ -3217,7 +3346,7 @@ import { Resvg } from "@resvg/resvg-js";
3217
3346
  import { readFileSync } from "node:fs";
3218
3347
  import { createRequire as createRequire2 } from "node:module";
3219
3348
  import { dirname as dirname2, join as join2 } from "node:path";
3220
- import { fileURLToPath as fileURLToPath2 } from "node:url";
3349
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
3221
3350
  var require2 = createRequire2(import.meta.url);
3222
3351
  var fontPackageRoot = dirname2(require2.resolve("jetbrains-mono/package.json"));
3223
3352
  var webfontRoot = join2(fontPackageRoot, "fonts/webfonts");
@@ -3225,7 +3354,7 @@ function readWebfontBase64(filename) {
3225
3354
  return readFileSync(join2(webfontRoot, filename)).toString("base64");
3226
3355
  }
3227
3356
  function resolveAssetPath(filename) {
3228
- return fileURLToPath2(new URL(`../assets/${filename}`, import.meta.url));
3357
+ return fileURLToPath3(new URL(`../assets/${filename}`, import.meta.url));
3229
3358
  }
3230
3359
  function createFontFace(base64, weight, style) {
3231
3360
  return `@font-face {