terminal-pilot 0.0.11 → 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.
package/dist/cli.js CHANGED
@@ -83,8 +83,8 @@ var require_src = __commonJS({
83
83
 
84
84
  // src/cli.ts
85
85
  import { realpath } from "node:fs/promises";
86
- import path5 from "node:path";
87
- import { fileURLToPath as fileURLToPath3 } from "node:url";
86
+ import path6 from "node:path";
87
+ import { fileURLToPath as fileURLToPath4 } from "node:url";
88
88
 
89
89
  // ../cmdkit/src/cli.ts
90
90
  import { access, readFile, writeFile } from "node:fs/promises";
@@ -1439,11 +1439,11 @@ function formatSegment(segment, casing) {
1439
1439
  const separator = casing === "snake" ? "_" : "-";
1440
1440
  return splitWords(segment).join(separator);
1441
1441
  }
1442
- function toOptionFlag(path6, casing) {
1443
- return `--${path6.map((segment) => formatSegment(segment, casing)).join(".")}`;
1442
+ function toOptionFlag(path7, casing) {
1443
+ return `--${path7.map((segment) => formatSegment(segment, casing)).join(".")}`;
1444
1444
  }
1445
- function toOptionAttribute(path6, casing) {
1446
- return path6.map((segment) => {
1445
+ function toOptionAttribute(path7, casing) {
1446
+ return path7.map((segment) => {
1447
1447
  const formatted = formatSegment(segment, casing);
1448
1448
  if (casing === "snake") {
1449
1449
  return formatted;
@@ -1454,13 +1454,13 @@ function toOptionAttribute(path6, casing) {
1454
1454
  ).join("");
1455
1455
  }).join(".");
1456
1456
  }
1457
- function toDisplayPath(path6) {
1458
- return path6.join(".");
1457
+ function toDisplayPath(path7) {
1458
+ return path7.join(".");
1459
1459
  }
1460
- function collectFields(schema, casing, path6 = [], inheritedOptional = false) {
1460
+ function collectFields(schema, casing, path7 = [], inheritedOptional = false) {
1461
1461
  const fields = [];
1462
1462
  for (const [key, rawChildSchema] of Object.entries(schema.shape)) {
1463
- const nextPath = [...path6, key];
1463
+ const nextPath = [...path7, key];
1464
1464
  const optional = inheritedOptional || rawChildSchema.kind === "optional";
1465
1465
  const childSchema = unwrapOptional(rawChildSchema);
1466
1466
  if (childSchema.kind === "object") {
@@ -1483,9 +1483,9 @@ function collectFields(schema, casing, path6 = [], inheritedOptional = false) {
1483
1483
  }
1484
1484
  return fields;
1485
1485
  }
1486
- function toCommanderOptionAttribute(path6, casing) {
1487
- const optionAttribute = toOptionAttribute(path6, casing);
1488
- const optionFlag = toOptionFlag(path6, casing);
1486
+ function toCommanderOptionAttribute(path7, casing) {
1487
+ const optionAttribute = toOptionAttribute(path7, casing);
1488
+ const optionFlag = toOptionFlag(path7, casing);
1489
1489
  if (!GLOBAL_LONG_OPTION_FLAGS.has(optionFlag)) {
1490
1490
  return optionAttribute;
1491
1491
  }
@@ -1945,10 +1945,10 @@ function addGlobalOptions(command) {
1945
1945
  throw new InvalidArgumentError('Invalid value for "--output". Expected one of: rich, md, markdown, json.');
1946
1946
  }).option("--verbose", "Print stack traces for unexpected errors.");
1947
1947
  }
1948
- function setNestedValue(target, path6, value) {
1948
+ function setNestedValue(target, path7, value) {
1949
1949
  let cursor = target;
1950
- for (let index = 0; index < path6.length - 1; index += 1) {
1951
- const segment = path6[index] ?? "";
1950
+ for (let index = 0; index < path7.length - 1; index += 1) {
1951
+ const segment = path7[index] ?? "";
1952
1952
  const existing = cursor[segment];
1953
1953
  if (typeof existing === "object" && existing !== null) {
1954
1954
  cursor = existing;
@@ -1958,7 +1958,7 @@ function setNestedValue(target, path6, value) {
1958
1958
  cursor[segment] = next;
1959
1959
  cursor = next;
1960
1960
  }
1961
- const leaf = path6[path6.length - 1];
1961
+ const leaf = path7[path7.length - 1];
1962
1962
  if (leaf !== void 0) {
1963
1963
  cursor[leaf] = value;
1964
1964
  }
@@ -2054,13 +2054,13 @@ async function withOutputFormat2(output, fn) {
2054
2054
  }
2055
2055
  function createFs() {
2056
2056
  return {
2057
- readFile: async (path6, encoding = "utf8") => readFile(path6, { encoding }),
2058
- writeFile: async (path6, contents) => {
2059
- await writeFile(path6, contents);
2057
+ readFile: async (path7, encoding = "utf8") => readFile(path7, { encoding }),
2058
+ writeFile: async (path7, contents) => {
2059
+ await writeFile(path7, contents);
2060
2060
  },
2061
- exists: async (path6) => {
2061
+ exists: async (path7) => {
2062
2062
  try {
2063
- await access(path6);
2063
+ await access(path7);
2064
2064
  return true;
2065
2065
  } catch {
2066
2066
  return false;
@@ -2081,9 +2081,9 @@ function isPlainObject(value) {
2081
2081
  function hasFieldValue(value) {
2082
2082
  return value !== void 0;
2083
2083
  }
2084
- function hasNestedField(fields, path6) {
2084
+ function hasNestedField(fields, path7) {
2085
2085
  return fields.some(
2086
- (field) => path6.length < field.path.length && path6.every((segment, index) => field.path[index] === segment)
2086
+ (field) => path7.length < field.path.length && path7.every((segment, index) => field.path[index] === segment)
2087
2087
  );
2088
2088
  }
2089
2089
  function describeExpectedPresetValue(schema) {
@@ -2170,9 +2170,9 @@ async function loadPresetValues(fields, presetPath) {
2170
2170
  }
2171
2171
  const fieldByPath = new Map(fields.map((field) => [field.displayPath, field]));
2172
2172
  const presetValues = {};
2173
- function visitObject(current, path6) {
2173
+ function visitObject(current, path7) {
2174
2174
  for (const [key, value] of Object.entries(current)) {
2175
- const nextPath = [...path6, key];
2175
+ const nextPath = [...path7, key];
2176
2176
  const displayPath = toDisplayPath(nextPath);
2177
2177
  const field = fieldByPath.get(displayPath);
2178
2178
  if (field !== void 0) {
@@ -4456,16 +4456,16 @@ function getConfigFormat(pathOrFormat) {
4456
4456
  }
4457
4457
  return formatRegistry[formatName];
4458
4458
  }
4459
- function detectFormat(path6) {
4460
- const ext = getExtension(path6);
4459
+ function detectFormat(path7) {
4460
+ const ext = getExtension(path7);
4461
4461
  return extensionMap[ext];
4462
4462
  }
4463
- function getExtension(path6) {
4464
- const lastDot = path6.lastIndexOf(".");
4463
+ function getExtension(path7) {
4464
+ const lastDot = path7.lastIndexOf(".");
4465
4465
  if (lastDot === -1) {
4466
4466
  return "";
4467
4467
  }
4468
- return path6.slice(lastDot).toLowerCase();
4468
+ return path7.slice(lastDot).toLowerCase();
4469
4469
  }
4470
4470
 
4471
4471
  // ../config-mutations/src/execution/path-utils.ts
@@ -4767,8 +4767,8 @@ async function applyChmod(mutation, context, options) {
4767
4767
  };
4768
4768
  }
4769
4769
  try {
4770
- const stat = await context.fs.stat(targetPath);
4771
- const currentMode = typeof stat.mode === "number" ? stat.mode & 511 : null;
4770
+ const stat2 = await context.fs.stat(targetPath);
4771
+ const currentMode = typeof stat2.mode === "number" ? stat2.mode & 511 : null;
4772
4772
  if (currentMode === mutation.mode) {
4773
4773
  return {
4774
4774
  outcome: { changed: false, effect: "none", detail: "noop" },
@@ -5115,6 +5115,11 @@ async function executeMutation(mutation, context, options) {
5115
5115
  import Mustache2 from "mustache";
5116
5116
  var originalEscape = Mustache2.escape;
5117
5117
 
5118
+ // ../agent-skill-config/src/templates.ts
5119
+ import { readFile as readFile2, stat } from "node:fs/promises";
5120
+ import path4 from "node:path";
5121
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
5122
+
5118
5123
  // ../agent-skill-config/src/apply.ts
5119
5124
  var UnsupportedAgentError = class extends Error {
5120
5125
  constructor(agentId) {
@@ -5171,9 +5176,9 @@ async function installSkill(agentId, skill, options) {
5171
5176
 
5172
5177
  // src/commands/installer.ts
5173
5178
  import os2 from "node:os";
5174
- import path4 from "node:path";
5179
+ import path5 from "node:path";
5175
5180
  import * as nodeFs from "node:fs/promises";
5176
- import { readFile as readFile2 } from "node:fs/promises";
5181
+ import { readFile as readFile3 } from "node:fs/promises";
5177
5182
  var DEFAULT_INSTALL_AGENT = "claude-code";
5178
5183
  var DEFAULT_INSTALL_SCOPE = "local";
5179
5184
  var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
@@ -5223,7 +5228,7 @@ async function loadTerminalPilotTemplate() {
5223
5228
  ];
5224
5229
  for (const candidate of candidates) {
5225
5230
  try {
5226
- terminalPilotTemplateCache = await readFile2(candidate, "utf8");
5231
+ terminalPilotTemplateCache = await readFile3(candidate, "utf8");
5227
5232
  return terminalPilotTemplateCache;
5228
5233
  } catch (error2) {
5229
5234
  if (!isNotFoundError(error2)) {
@@ -5238,7 +5243,7 @@ function resolveHomeRelativePath(targetPath, homeDir) {
5238
5243
  return homeDir;
5239
5244
  }
5240
5245
  if (targetPath.startsWith("~/")) {
5241
- return path4.join(homeDir, targetPath.slice(2));
5246
+ return path5.join(homeDir, targetPath.slice(2));
5242
5247
  }
5243
5248
  return targetPath;
5244
5249
  }
@@ -5248,12 +5253,12 @@ function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
5248
5253
  throwUnsupportedAgent(agent);
5249
5254
  }
5250
5255
  return {
5251
- displayPath: path4.join(
5256
+ displayPath: path5.join(
5252
5257
  scope === "global" ? config.globalSkillDir : config.localSkillDir,
5253
5258
  TERMINAL_PILOT_SKILL_NAME
5254
5259
  ),
5255
- fullPath: path4.join(
5256
- scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path4.resolve(cwd, config.localSkillDir),
5260
+ fullPath: path5.join(
5261
+ scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path5.resolve(cwd, config.localSkillDir),
5257
5262
  TERMINAL_PILOT_SKILL_NAME
5258
5263
  )
5259
5264
  };
@@ -5660,7 +5665,7 @@ import { Resvg } from "@resvg/resvg-js";
5660
5665
  import { readFileSync } from "node:fs";
5661
5666
  import { createRequire as createRequire2 } from "node:module";
5662
5667
  import { dirname as dirname2, join as join2 } from "node:path";
5663
- import { fileURLToPath as fileURLToPath2 } from "node:url";
5668
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
5664
5669
  var require2 = createRequire2(import.meta.url);
5665
5670
  var fontPackageRoot = dirname2(require2.resolve("jetbrains-mono/package.json"));
5666
5671
  var webfontRoot = join2(fontPackageRoot, "fonts/webfonts");
@@ -5668,7 +5673,7 @@ function readWebfontBase64(filename) {
5668
5673
  return readFileSync(join2(webfontRoot, filename)).toString("base64");
5669
5674
  }
5670
5675
  function resolveAssetPath(filename) {
5671
- return fileURLToPath2(new URL(`../assets/${filename}`, import.meta.url));
5676
+ return fileURLToPath3(new URL(`../assets/${filename}`, import.meta.url));
5672
5677
  }
5673
5678
  function createFontFace(base64, weight, style) {
5674
5679
  return `@font-face {
@@ -6364,9 +6369,9 @@ async function isDirectExecution(argv) {
6364
6369
  return false;
6365
6370
  }
6366
6371
  try {
6367
- const modulePath = fileURLToPath3(import.meta.url);
6372
+ const modulePath = fileURLToPath4(import.meta.url);
6368
6373
  const [resolvedEntryPoint, resolvedModulePath] = await Promise.all([
6369
- realpath(path5.resolve(entryPoint)),
6374
+ realpath(path6.resolve(entryPoint)),
6370
6375
  realpath(modulePath)
6371
6376
  ]);
6372
6377
  return resolvedEntryPoint === resolvedModulePath;