terminal-pilot 0.0.32 → 0.0.33

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
@@ -17195,15 +17195,16 @@ function configureCommanderSuggestionOutput(command) {
17195
17195
  }
17196
17196
  async function runCLI(roots, options = {}) {
17197
17197
  enableSourceMaps();
17198
- const normalizedRoot = normalizeRoots(roots, process.argv);
17198
+ const argv = [...options.argv ?? process.argv];
17199
+ const normalizedRoot = normalizeRoots(roots, argv);
17199
17200
  const root = options.approvals === true ? mergeApprovalsGroup(normalizedRoot) : normalizedRoot;
17200
17201
  await resolveMcpProxies(root, { projectRoot: options.projectRoot });
17201
17202
  const casing = options.casing ?? "kebab";
17202
17203
  const services = options.services ?? {};
17203
17204
  const runtimeOptions = options.humanInLoop ?? {};
17204
17205
  const runtimeFetch = options.fetch ?? globalThis.fetch;
17205
- const version = options.version ?? findEntrypointPackageMetadata(process.argv[1])?.version;
17206
- const rootUsageName = options.rootUsageName ?? inferProgramName(process.argv);
17206
+ const version = options.version ?? findEntrypointPackageMetadata(argv[1])?.version;
17207
+ const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
17207
17208
  const controls = resolveCLIControls(options.controls);
17208
17209
  const servicesWithBuiltIns = {
17209
17210
  ...services,
@@ -17214,8 +17215,8 @@ async function runCLI(roots, options = {}) {
17214
17215
  apiVersion: options.apiVersion
17215
17216
  };
17216
17217
  validateServices(services);
17217
- if (hasHelpFlag(process.argv)) {
17218
- await renderGeneratedHelp(root, process.argv, { ...options, version });
17218
+ if (hasHelpFlag(argv)) {
17219
+ await renderGeneratedHelp(root, argv, { ...options, version });
17219
17220
  return;
17220
17221
  }
17221
17222
  const program = new CommanderCommand();
@@ -17274,7 +17275,7 @@ async function runCLI(roots, options = {}) {
17274
17275
  addCommanderChild(program, command, isDefaultChild, rootChildNames);
17275
17276
  }
17276
17277
  configureCommanderSuggestionOutput(program);
17277
- const unknownCommand = findUnknownCommanderCommand(program, process.argv);
17278
+ const unknownCommand = findUnknownCommanderCommand(program, argv);
17278
17279
  if (unknownCommand !== void 0) {
17279
17280
  createLogger().error(
17280
17281
  appendUsagePointer(
@@ -17289,7 +17290,7 @@ async function runCLI(roots, options = {}) {
17289
17290
  return;
17290
17291
  }
17291
17292
  try {
17292
- await program.parseAsync(process.argv);
17293
+ await program.parseAsync(argv);
17293
17294
  } catch (error3) {
17294
17295
  if (error3 instanceof ApprovalDeclinedError) {
17295
17296
  renderApprovalDeclined(error3);
@@ -17297,7 +17298,7 @@ async function runCLI(roots, options = {}) {
17297
17298
  }
17298
17299
  const resolvedFlags = lastActionCommand ? getResolvedFlags(lastActionCommand) : void 0;
17299
17300
  const report = await writeErrorReport({
17300
- argv: process.argv,
17301
+ argv,
17301
17302
  command: errorReportContext?.command,
17302
17303
  commandPath: errorReportContext?.commandPath ?? resolvedCommandPath,
17303
17304
  env: process.env,
@@ -17313,11 +17314,11 @@ async function runCLI(roots, options = {}) {
17313
17314
  `);
17314
17315
  }
17315
17316
  await handleRunError(error3, {
17316
- debugStackMode: resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(process.argv),
17317
- output: resolvedFlags !== void 0 ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(process.argv),
17318
- verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : process.argv.includes("--verbose"),
17317
+ debugStackMode: resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv),
17318
+ output: resolvedFlags !== void 0 ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(argv),
17319
+ verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
17319
17320
  program,
17320
- argv: process.argv,
17321
+ argv,
17321
17322
  rootUsageName,
17322
17323
  commandPath: resolvedCommandPath,
17323
17324
  userErrorPattern: errorReportContext?.params === void 0 ? "usage" : "runtime-user"
@@ -20683,7 +20684,6 @@ import path22 from "node:path";
20683
20684
  import os3 from "node:os";
20684
20685
  import path23 from "node:path";
20685
20686
  import * as nodeFs2 from "node:fs/promises";
20686
- import { readFile as readFile7 } from "node:fs/promises";
20687
20687
  var DEFAULT_INSTALL_AGENT = "claude-code";
20688
20688
  var DEFAULT_INSTALL_SCOPE = "local";
20689
20689
  var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
@@ -20726,19 +20726,15 @@ async function loadTerminalPilotTemplate() {
20726
20726
  if (terminalPilotTemplateCache !== void 0) {
20727
20727
  return terminalPilotTemplateCache;
20728
20728
  }
20729
- const candidates = [
20730
- new URL("./templates/terminal-pilot.md", import.meta.url),
20731
- new URL("../templates/terminal-pilot.md", import.meta.url),
20732
- new URL("../../../agent-skill-config/src/templates/terminal-pilot.md", import.meta.url)
20733
- ];
20734
- for (const candidate of candidates) {
20735
- try {
20736
- terminalPilotTemplateCache = await readFile7(candidate, "utf8");
20737
- return terminalPilotTemplateCache;
20738
- } catch (error3) {
20739
- if (!isNotFoundError2(error3)) {
20740
- throw error3;
20741
- }
20729
+ try {
20730
+ terminalPilotTemplateCache = await nodeFs2.readFile(
20731
+ new URL("../templates/terminal-pilot.md", import.meta.url),
20732
+ "utf8"
20733
+ );
20734
+ return terminalPilotTemplateCache;
20735
+ } catch (error3) {
20736
+ if (!isNotFoundError2(error3)) {
20737
+ throw error3;
20742
20738
  }
20743
20739
  }
20744
20740
  throw new UserError("terminal-pilot skill template is missing.");