terminal-pilot 0.0.9 → 0.0.11

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 +214 -48
  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 +131 -7
  12. package/dist/commands/index.js.map +4 -4
  13. package/dist/commands/install.js +123 -7
  14. package/dist/commands/install.js.map +4 -4
  15. package/dist/commands/installer.js +41 -1
  16. package/dist/commands/installer.js.map +3 -3
  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 +44 -3
  36. package/dist/commands/uninstall.js.map +3 -3
  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 +214 -48
  51. package/dist/testing/cli-repl.js.map +4 -4
  52. package/dist/testing/qa-cli.js +214 -48
  53. package/dist/testing/qa-cli.js.map +4 -4
  54. package/package.json +2 -2
@@ -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) {
@@ -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 };