terminal-pilot 0.0.22 → 0.0.23

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
@@ -2707,6 +2707,11 @@ function getCommandSourcePath(command) {
2707
2707
  return command[commandSourcePathSymbol];
2708
2708
  }
2709
2709
 
2710
+ // ../toolcraft/src/error-codes.ts
2711
+ function hasOwnErrorCode(error3, code) {
2712
+ return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
2713
+ }
2714
+
2710
2715
  // ../task-list/src/open.ts
2711
2716
  import * as fsPromises from "node:fs/promises";
2712
2717
 
@@ -2875,10 +2880,12 @@ import path5 from "node:path";
2875
2880
  // ../process-runner/src/host/host-runner.ts
2876
2881
  import { spawn as spawnChildProcess } from "node:child_process";
2877
2882
  function createHostRunner(options = {}) {
2878
- const detachedByDefault = options.detached === true;
2883
+ const runnerOptions = normalizeHostRunnerOptions(options);
2884
+ const detachedByDefault = runnerOptions.detached === true;
2879
2885
  return {
2880
2886
  name: "host",
2881
- exec(spec) {
2887
+ exec(inputSpec) {
2888
+ const spec = normalizeRunSpec(inputSpec);
2882
2889
  if (spec.signal?.aborted === true) {
2883
2890
  return {
2884
2891
  pid: null,
@@ -2895,12 +2902,16 @@ function createHostRunner(options = {}) {
2895
2902
  const stderrMode = spec.stderr ?? "pipe";
2896
2903
  const killProcessGroup = detachedByDefault || spec.killProcessGroup === true;
2897
2904
  const stdio = stdinMode === "inherit" && stdoutMode === "inherit" && stderrMode === "inherit" ? "inherit" : [stdinMode, stdoutMode, stderrMode];
2898
- const child = spawnChildProcess(spec.command, spec.args ?? [], {
2899
- cwd: spec.cwd,
2900
- env: spec.env,
2901
- stdio,
2902
- ...killProcessGroup ? { detached: true } : {}
2903
- });
2905
+ const child = spawnChildProcess(
2906
+ spec.command,
2907
+ spec.args ?? [],
2908
+ createNullRecord({
2909
+ cwd: spec.cwd,
2910
+ env: spec.env,
2911
+ stdio,
2912
+ ...killProcessGroup ? { detached: true } : {}
2913
+ })
2914
+ );
2904
2915
  if (killProcessGroup) {
2905
2916
  child.unref();
2906
2917
  }
@@ -2946,6 +2957,38 @@ function createHostRunner(options = {}) {
2946
2957
  }
2947
2958
  };
2948
2959
  }
2960
+ function normalizeHostRunnerOptions(options) {
2961
+ return createNullRecord({
2962
+ ...optionalOwnProperty(options, "detached")
2963
+ });
2964
+ }
2965
+ function normalizeRunSpec(spec) {
2966
+ return createNullRecord({
2967
+ command: getOwnProperty(spec, "command"),
2968
+ ...optionalOwnProperty(spec, "args"),
2969
+ ...optionalOwnProperty(spec, "cwd"),
2970
+ ...optionalOwnProperty(spec, "env"),
2971
+ ...optionalOwnProperty(spec, "stdin"),
2972
+ ...optionalOwnProperty(spec, "stdout"),
2973
+ ...optionalOwnProperty(spec, "stderr"),
2974
+ ...optionalOwnProperty(spec, "tty"),
2975
+ ...optionalOwnProperty(spec, "signal"),
2976
+ ...optionalOwnProperty(spec, "killProcessGroup")
2977
+ });
2978
+ }
2979
+ function optionalOwnProperty(value, name) {
2980
+ const property = getOwnProperty(value, name);
2981
+ return property === void 0 ? {} : { [name]: property };
2982
+ }
2983
+ function getOwnProperty(value, name) {
2984
+ return hasOwnProperty(value, name) ? value[name] : void 0;
2985
+ }
2986
+ function hasOwnProperty(value, name) {
2987
+ return Object.prototype.hasOwnProperty.call(value, name);
2988
+ }
2989
+ function createNullRecord(value) {
2990
+ return Object.assign(/* @__PURE__ */ Object.create(null), value);
2991
+ }
2949
2992
  function bindAbortSignal(signal, onAbort) {
2950
2993
  if (signal === void 0) {
2951
2994
  return () => {
@@ -5839,51 +5882,74 @@ function createDefaultFs() {
5839
5882
  return fsPromises;
5840
5883
  }
5841
5884
  async function openTaskList(options) {
5842
- switch (options.type) {
5885
+ const type2 = getOwnProperty2(options, "type");
5886
+ switch (type2) {
5843
5887
  case "markdown-dir":
5844
5888
  case "yaml-file":
5845
5889
  return openFileBackend(options);
5846
5890
  case "gh-issues":
5847
5891
  return openGhIssuesBackend(options);
5848
5892
  default:
5849
- throw new Error(`Unknown task list backend type "${options.type}".`);
5893
+ throw new Error(`Unknown task list backend type "${String(type2)}".`);
5850
5894
  }
5851
5895
  }
5852
5896
  async function openFileBackend(options) {
5853
- const factory = backendFactories[options.type];
5854
- const stateMachine = resolveStateMachine(options.stateMachine);
5897
+ const type2 = getOwnProperty2(options, "type");
5898
+ const factory = backendFactories[type2];
5899
+ const stateMachine = resolveStateMachine(
5900
+ getOwnProperty2(options, "stateMachine")
5901
+ );
5855
5902
  validateMachine(stateMachine);
5856
- const markdownOptions = options.type === "markdown-dir" ? options : void 0;
5903
+ const markdownOptions = type2 === "markdown-dir" ? options : void 0;
5904
+ const defaults2 = getOwnProperty2(options, "defaults");
5857
5905
  const deps = {
5858
- path: options.path,
5906
+ path: getOwnProperty2(options, "path"),
5859
5907
  defaults: {
5860
- metadata: { ...options.defaults?.metadata ?? {} }
5908
+ metadata: readDefaultMetadata(defaults2)
5861
5909
  },
5862
- singleList: markdownOptions?.singleList,
5863
- frontmatterMode: markdownOptions?.frontmatterMode ?? "strict",
5864
- create: options.create ?? false,
5865
- fs: options.fs ?? createDefaultFs(),
5910
+ singleList: markdownOptions === void 0 ? void 0 : getOwnProperty2(markdownOptions, "singleList"),
5911
+ frontmatterMode: markdownOptions === void 0 ? "strict" : getOwnProperty2(
5912
+ markdownOptions,
5913
+ "frontmatterMode"
5914
+ ) ?? "strict",
5915
+ create: getOwnProperty2(options, "create") ?? false,
5916
+ fs: getOwnProperty2(options, "fs") ?? createDefaultFs(),
5866
5917
  stateMachine
5867
5918
  };
5868
5919
  return factory(deps);
5869
5920
  }
5870
5921
  async function openGhIssuesBackend(options) {
5871
- const token = await resolveAuth({ explicitToken: options.auth?.token });
5922
+ const auth = getOwnProperty2(options, "auth");
5923
+ const explicitToken = auth && hasOwnProperty2(auth, "token") ? auth.token : void 0;
5872
5924
  const endpoint = resolveEndpoint();
5925
+ const defaults2 = getOwnProperty2(options, "defaults");
5873
5926
  return ghIssuesBackend({
5874
- repo: options.repo,
5875
- project: options.project,
5876
- filter: options.filter,
5877
- state: options.state,
5878
- stateMachine: options.stateMachine,
5927
+ repo: getOwnProperty2(options, "repo"),
5928
+ project: getOwnProperty2(options, "project"),
5929
+ filter: getOwnProperty2(options, "filter"),
5930
+ state: getOwnProperty2(options, "state"),
5931
+ stateMachine: getOwnProperty2(options, "stateMachine"),
5879
5932
  defaults: {
5880
- metadata: { ...options.defaults?.metadata ?? {} }
5933
+ metadata: readDefaultMetadata(defaults2)
5881
5934
  },
5882
- token,
5935
+ token: await resolveAuth({ explicitToken }),
5883
5936
  endpoint,
5884
- fetch: options.fetch
5937
+ fetch: getOwnProperty2(options, "fetch")
5885
5938
  });
5886
5939
  }
5940
+ function readDefaultMetadata(defaults2) {
5941
+ const metadata = defaults2 === void 0 ? void 0 : getOwnProperty2(defaults2, "metadata");
5942
+ return isRecord4(metadata) ? { ...metadata } : {};
5943
+ }
5944
+ function getOwnProperty2(value, name) {
5945
+ return hasOwnProperty2(value, name) ? value[name] : void 0;
5946
+ }
5947
+ function hasOwnProperty2(value, name) {
5948
+ return Object.prototype.hasOwnProperty.call(value, name);
5949
+ }
5950
+ function isRecord4(value) {
5951
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5952
+ }
5887
5953
 
5888
5954
  // ../task-list/src/move.ts
5889
5955
  import * as fsPromises2 from "node:fs/promises";
@@ -6141,7 +6207,7 @@ function osascriptProvider(options = {}) {
6141
6207
  const { stdout } = await execFileAsync(binary, ["-e", script]);
6142
6208
  return parseStdout(stdout);
6143
6209
  } catch (error3) {
6144
- if (error3.code === "ENOENT") {
6210
+ if (hasOwnErrorCode2(error3, "ENOENT")) {
6145
6211
  throw new Error("osascript not found \u2014 provide a different provider on this platform");
6146
6212
  }
6147
6213
  if (isUserCanceled(error3)) {
@@ -6153,6 +6219,9 @@ function osascriptProvider(options = {}) {
6153
6219
  }
6154
6220
  };
6155
6221
  }
6222
+ function hasOwnErrorCode2(error3, code) {
6223
+ return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
6224
+ }
6156
6225
 
6157
6226
  // ../toolcraft/src/human-in-loop/default-provider.ts
6158
6227
  function noProviderConfigured() {
@@ -6710,7 +6779,7 @@ function escapeMarkdownCell(value) {
6710
6779
  return value.replaceAll("|", "\\|");
6711
6780
  }
6712
6781
  function isMissingStateError(error3) {
6713
- return typeof error3 === "object" && error3 !== null && "code" in error3 && error3.code === "ENOENT";
6782
+ return hasOwnErrorCode(error3, "ENOENT");
6714
6783
  }
6715
6784
 
6716
6785
  // ../toolcraft/src/error-report.ts
@@ -6739,6 +6808,13 @@ import { createCipheriv, createDecipheriv, randomBytes as randomBytes4, randomUU
6739
6808
  import { promises as fs } from "node:fs";
6740
6809
  import { homedir, hostname, userInfo } from "node:os";
6741
6810
  import path10 from "node:path";
6811
+
6812
+ // ../auth-store/src/error-codes.ts
6813
+ function hasOwnErrorCode3(error3, code) {
6814
+ return error3 instanceof Error && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
6815
+ }
6816
+
6817
+ // ../auth-store/src/encrypted-file-store.ts
6742
6818
  var derivedKeyCache = /* @__PURE__ */ new Map();
6743
6819
  var ENCRYPTION_ALGORITHM = "aes-256-gcm";
6744
6820
  var ENCRYPTION_VERSION = 1;
@@ -6954,7 +7030,7 @@ async function deriveEncryptionKey(getMachineIdentity, salt) {
6954
7030
  function parseEncryptedDocument(raw) {
6955
7031
  try {
6956
7032
  const parsed = JSON.parse(raw);
6957
- if (!isRecord4(parsed)) {
7033
+ if (!isRecord5(parsed)) {
6958
7034
  return null;
6959
7035
  }
6960
7036
  const version = getOwnEntry2(parsed, "version");
@@ -6977,21 +7053,17 @@ function parseEncryptedDocument(raw) {
6977
7053
  return null;
6978
7054
  }
6979
7055
  }
6980
- function isRecord4(value) {
7056
+ function isRecord5(value) {
6981
7057
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
6982
7058
  }
6983
7059
  function getOwnEntry2(record, key2) {
6984
7060
  return Object.prototype.hasOwnProperty.call(record, key2) ? record[key2] : void 0;
6985
7061
  }
6986
7062
  function isNotFoundError(error3) {
6987
- return Boolean(
6988
- error3 && typeof error3 === "object" && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "ENOENT"
6989
- );
7063
+ return hasOwnErrorCode3(error3, "ENOENT");
6990
7064
  }
6991
7065
  function isAlreadyExistsError(error3) {
6992
- return Boolean(
6993
- error3 && typeof error3 === "object" && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "EEXIST"
6994
- );
7066
+ return hasOwnErrorCode3(error3, "EEXIST");
6995
7067
  }
6996
7068
 
6997
7069
  // ../auth-store/src/keychain-store.ts
@@ -10986,8 +11058,7 @@ async function readCache(cachePath) {
10986
11058
  version: parsed.version === 1 ? 1 : 1
10987
11059
  };
10988
11060
  } catch (error3) {
10989
- const code = error3.code;
10990
- if (code === "ENOENT" || error3 instanceof SyntaxError) {
11061
+ if (hasOwnErrorCode(error3, "ENOENT") || error3 instanceof SyntaxError) {
10991
11062
  return void 0;
10992
11063
  }
10993
11064
  return void 0;
@@ -11020,9 +11091,7 @@ async function writeCache(cachePath, cache) {
11020
11091
  }
11021
11092
  }
11022
11093
  function isAlreadyExistsError2(error3) {
11023
- return Boolean(
11024
- error3 && typeof error3 === "object" && error3.code === "EEXIST"
11025
- );
11094
+ return hasOwnErrorCode(error3, "EEXIST");
11026
11095
  }
11027
11096
  async function fetchCache(name, config2) {
11028
11097
  const logger2 = createLogger((message2) => {
@@ -11226,7 +11295,7 @@ async function assertCachePathHasNoSymlinks(filePath) {
11226
11295
  throw new Error(`MCP cache path must not contain symbolic links: ${currentPath}.`);
11227
11296
  }
11228
11297
  } catch (error3) {
11229
- if (error3.code !== "ENOENT") {
11298
+ if (!hasOwnErrorCode(error3, "ENOENT")) {
11230
11299
  throw error3;
11231
11300
  }
11232
11301
  }
@@ -12674,7 +12743,7 @@ function getJsonParseErrorLocation(error3, source) {
12674
12743
  return null;
12675
12744
  }
12676
12745
  function getJsonParseCauseLocation(error3) {
12677
- if (typeof error3 !== "object" || error3 === null || !("cause" in error3)) {
12746
+ if (typeof error3 !== "object" || error3 === null || !hasOwnProperty3(error3, "cause")) {
12678
12747
  return null;
12679
12748
  }
12680
12749
  const cause = error3.cause;
@@ -12686,7 +12755,7 @@ function getJsonParseCauseLocation(error3) {
12686
12755
  return { line, column };
12687
12756
  }
12688
12757
  function getNumericProperty(value, key2) {
12689
- if (typeof value !== "object" || value === null || !(key2 in value)) {
12758
+ if (typeof value !== "object" || value === null || !hasOwnProperty3(value, key2)) {
12690
12759
  return null;
12691
12760
  }
12692
12761
  const propertyValue = value[key2];
@@ -13743,7 +13812,7 @@ async function loadPresetValues(fields, presetPath) {
13743
13812
  encoding: "utf8"
13744
13813
  });
13745
13814
  } catch (error3) {
13746
- if (typeof error3 === "object" && error3 !== null && "code" in error3 && error3.code === "ENOENT") {
13815
+ if (hasOwnErrorCode(error3, "ENOENT")) {
13747
13816
  throw new UserError(`Preset file "${presetPath}" was not found.`);
13748
13817
  }
13749
13818
  const message2 = error3 instanceof Error && error3.message.length > 0 ? error3.message : "Unknown read error.";
@@ -14842,10 +14911,10 @@ function isHttpErrorLike(error3) {
14842
14911
  }
14843
14912
  const request = error3.request;
14844
14913
  const response = error3.response;
14845
- return isPlainObject4(request) && typeof request.method === "string" && typeof request.url === "string" && isStringRecord(request.headers) && isPlainObject4(response) && typeof response.status === "number" && typeof response.statusText === "string" && isStringRecord(response.headers) && "body" in response;
14914
+ return isPlainObject4(request) && typeof request.method === "string" && typeof request.url === "string" && isStringRecord(request.headers) && isPlainObject4(response) && typeof response.status === "number" && typeof response.statusText === "string" && isStringRecord(response.headers) && hasOwnProperty3(response, "body");
14846
14915
  }
14847
14916
  function hasTypedOptionalField(value, field, type2) {
14848
- return !(field in value) || typeof value[field] === type2;
14917
+ return !hasOwnProperty3(value, field) || typeof value[field] === type2;
14849
14918
  }
14850
14919
  function isNonEmptyString(value) {
14851
14920
  return typeof value === "string" && value.trim().length > 0;
@@ -14869,7 +14938,7 @@ function isProblemDetailsLike(body) {
14869
14938
  if (!hasTypedOptionalField(body, "instance", "string")) {
14870
14939
  return false;
14871
14940
  }
14872
- return isNonEmptyString(body.title) || isNonEmptyString(body.detail);
14941
+ return hasOwnNonEmptyString(body, "title") || hasOwnNonEmptyString(body, "detail");
14873
14942
  }
14874
14943
  function isGraphQLErrorEnvelopeLike(body) {
14875
14944
  if (!isPlainObject4(body) || !Array.isArray(body.errors) || body.errors.length === 0) {
@@ -14879,23 +14948,29 @@ function isGraphQLErrorEnvelopeLike(body) {
14879
14948
  if (!isPlainObject4(error3) || typeof error3.message !== "string") {
14880
14949
  return false;
14881
14950
  }
14882
- if ("path" in error3) {
14951
+ if (hasOwnProperty3(error3, "path")) {
14883
14952
  const pathValue = error3.path;
14884
14953
  if (!Array.isArray(pathValue) || !pathValue.every((entry) => typeof entry === "string" || typeof entry === "number")) {
14885
14954
  return false;
14886
14955
  }
14887
14956
  }
14888
- if ("extensions" in error3) {
14957
+ if (hasOwnProperty3(error3, "extensions")) {
14889
14958
  if (!isPlainObject4(error3.extensions)) {
14890
14959
  return false;
14891
14960
  }
14892
- if ("code" in error3.extensions && typeof error3.extensions.code !== "string") {
14961
+ if (hasOwnProperty3(error3.extensions, "code") && typeof error3.extensions.code !== "string") {
14893
14962
  return false;
14894
14963
  }
14895
14964
  }
14896
14965
  return true;
14897
14966
  });
14898
14967
  }
14968
+ function hasOwnProperty3(value, name) {
14969
+ return Object.prototype.hasOwnProperty.call(value, name);
14970
+ }
14971
+ function hasOwnNonEmptyString(value, name) {
14972
+ return hasOwnProperty3(value, name) && isNonEmptyString(value[name]);
14973
+ }
14899
14974
  function styleHttpErrorLine(value, style) {
14900
14975
  return process.stdout.isTTY !== true ? value : style(value);
14901
14976
  }
@@ -14904,19 +14979,19 @@ function formatHttpErrorStatus(value) {
14904
14979
  }
14905
14980
  function formatProblemDetailsBody(body) {
14906
14981
  const lines = [];
14907
- if (isNonEmptyString(body.title)) {
14982
+ if (hasOwnNonEmptyString(body, "title")) {
14908
14983
  lines.push(`Problem: ${body.title}`);
14909
14984
  }
14910
- if (isNonEmptyString(body.detail)) {
14985
+ if (hasOwnNonEmptyString(body, "detail")) {
14911
14986
  lines.push(`Detail: ${body.detail}`);
14912
14987
  }
14913
- if (body.type !== void 0) {
14988
+ if (hasOwnProperty3(body, "type") && body.type !== void 0) {
14914
14989
  lines.push(`Type: ${body.type}`);
14915
14990
  }
14916
- if (body.instance !== void 0) {
14991
+ if (hasOwnProperty3(body, "instance") && body.instance !== void 0) {
14917
14992
  lines.push(`Instance: ${body.instance}`);
14918
14993
  }
14919
- if (body.status !== void 0) {
14994
+ if (hasOwnProperty3(body, "status") && body.status !== void 0) {
14920
14995
  lines.push(`Status: ${body.status}`);
14921
14996
  }
14922
14997
  return lines.join("\n");
@@ -14924,10 +14999,10 @@ function formatProblemDetailsBody(body) {
14924
14999
  function formatGraphQLErrorEnvelopeBody(body) {
14925
15000
  return body.errors.map((error3) => {
14926
15001
  const lines = [`GraphQL error: ${error3.message}`];
14927
- if (error3.path !== void 0) {
15002
+ if (hasOwnProperty3(error3, "path") && error3.path !== void 0) {
14928
15003
  lines.push(` at path: ${error3.path.join(".")}`);
14929
15004
  }
14930
- if (error3.extensions?.code !== void 0) {
15005
+ if (hasOwnProperty3(error3, "extensions") && error3.extensions !== void 0 && hasOwnProperty3(error3.extensions, "code") && error3.extensions.code !== void 0) {
14931
15006
  lines.push(` code: ${error3.extensions.code}`);
14932
15007
  }
14933
15008
  return lines.join("\n");
@@ -15462,7 +15537,7 @@ function consumeTerminatedString(input, index, allowBellTerminator) {
15462
15537
  }
15463
15538
 
15464
15539
  // src/errors.ts
15465
- function hasOwnErrorCode(error3, code) {
15540
+ function hasOwnErrorCode4(error3, code) {
15466
15541
  return error3 instanceof Error && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
15467
15542
  }
15468
15543
 
@@ -16565,7 +16640,7 @@ function ensureSpawnHelperExecutable() {
16565
16640
  }
16566
16641
  }
16567
16642
  function isMissingFileError(error3) {
16568
- return hasOwnErrorCode(error3, "ENOENT");
16643
+ return hasOwnErrorCode4(error3, "ENOENT");
16569
16644
  }
16570
16645
  function matchPattern(buffer, pattern) {
16571
16646
  const clean = normalizeHistoryBuffer(stripAnsi4(buffer));
@@ -17679,9 +17754,14 @@ function resolvePath(rawPath, homeDir, pathMapper) {
17679
17754
  return filename.length === 0 ? mappedDirectory : path16.join(mappedDirectory, filename);
17680
17755
  }
17681
17756
 
17757
+ // ../config-mutations/src/error-codes.ts
17758
+ function hasOwnErrorCode5(error3, code) {
17759
+ return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
17760
+ }
17761
+
17682
17762
  // ../config-mutations/src/fs-utils.ts
17683
17763
  function isNotFound(error3) {
17684
- return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "ENOENT";
17764
+ return hasOwnErrorCode5(error3, "ENOENT");
17685
17765
  }
17686
17766
  async function readFileIfExists(fs4, target) {
17687
17767
  try {
@@ -17738,7 +17818,7 @@ async function backupInvalidDocument(context, targetPath, content) {
17738
17818
  }
17739
17819
  }
17740
17820
  function isAlreadyExists(error3) {
17741
- return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "EEXIST";
17821
+ return hasOwnErrorCode5(error3, "EEXIST");
17742
17822
  }
17743
17823
  async function assertRegularWriteTarget(context, targetPath) {
17744
17824
  const boundary = path17.dirname(path17.resolve(context.homeDir));
@@ -18465,6 +18545,11 @@ async function executeMutation(mutation, context, options) {
18465
18545
  }
18466
18546
  }
18467
18547
 
18548
+ // ../agent-skill-config/src/error-codes.ts
18549
+ function hasOwnErrorCode6(error3, code) {
18550
+ return error3 instanceof Error && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
18551
+ }
18552
+
18468
18553
  // ../agent-skill-config/src/templates.ts
18469
18554
  import { readFile as readFile5, stat } from "node:fs/promises";
18470
18555
  import path18 from "node:path";
@@ -18489,7 +18574,7 @@ async function pathExists2(fs4, targetPath) {
18489
18574
  await fs4.stat(targetPath);
18490
18575
  return true;
18491
18576
  } catch (error3) {
18492
- if (typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "ENOENT") {
18577
+ if (hasOwnErrorCode6(error3, "ENOENT")) {
18493
18578
  return false;
18494
18579
  }
18495
18580
  throw error3;
@@ -18567,7 +18652,7 @@ var DEFAULT_INSTALL_SCOPE = "local";
18567
18652
  var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
18568
18653
  var installableAgents = supportedAgents;
18569
18654
  function isNotFoundError2(error3) {
18570
- return hasOwnErrorCode(error3, "ENOENT");
18655
+ return hasOwnErrorCode4(error3, "ENOENT");
18571
18656
  }
18572
18657
  function resolveInstallerServices(installer) {
18573
18658
  return {
@@ -19185,6 +19270,11 @@ function parseAnsi2(input) {
19185
19270
  return buildRuns(lines, lineBreakStyles);
19186
19271
  }
19187
19272
 
19273
+ // ../terminal-png/src/error-codes.ts
19274
+ function hasOwnErrorCode7(error3, code) {
19275
+ return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
19276
+ }
19277
+
19188
19278
  // ../terminal-png/src/png-renderer.ts
19189
19279
  import { Resvg } from "@resvg/resvg-js";
19190
19280
 
@@ -19758,7 +19848,7 @@ async function renderTerminalPng(ansiText, options = {}) {
19758
19848
  return png;
19759
19849
  }
19760
19850
  function isAlreadyExistsError3(error3) {
19761
- return error3 instanceof Error && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === "EEXIST";
19851
+ return error3 instanceof Error && hasOwnErrorCode7(error3, "EEXIST");
19762
19852
  }
19763
19853
 
19764
19854
  // src/commands/screenshot.ts
@@ -19884,7 +19974,7 @@ async function folderExists(fs4, folderPath) {
19884
19974
  await fs4.stat(folderPath);
19885
19975
  return true;
19886
19976
  } catch (error3) {
19887
- if (hasOwnErrorCode(error3, "ENOENT")) {
19977
+ if (hasOwnErrorCode4(error3, "ENOENT")) {
19888
19978
  return false;
19889
19979
  }
19890
19980
  throw error3;
@@ -19938,8 +20028,6 @@ var waitForExit2 = defineCommand({
19938
20028
 
19939
20029
  // src/commands/index.ts
19940
20030
  var children = [
19941
- install,
19942
- uninstall,
19943
20031
  createSession,
19944
20032
  fill,
19945
20033
  type,
@@ -19953,7 +20041,9 @@ var children = [
19953
20041
  resize,
19954
20042
  closeSession,
19955
20043
  getSession,
19956
- listSessions
20044
+ listSessions,
20045
+ install,
20046
+ uninstall
19957
20047
  ];
19958
20048
  function createTerminalPilotGroup() {
19959
20049
  return defineGroup({
@@ -19976,7 +20066,7 @@ async function main(argv = process.argv) {
19976
20066
  const originalArgv = process.argv;
19977
20067
  process.argv = normalizeArgv(argv);
19978
20068
  try {
19979
- await runCLI(createTerminalPilotGroup());
20069
+ await runCLI(createTerminalPilotGroup(), { approvals: false });
19980
20070
  } finally {
19981
20071
  process.argv = originalArgv;
19982
20072
  }