shoplazza-ai-dev-cli 0.1.5 → 0.1.6

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.
@@ -1,8 +1,8 @@
1
- import { n as __require, t as __commonJSMin } from "../rolldown-runtime.mjs";
2
- import { t as require_isarray } from "./isarray.mjs";
3
- import { t as require_util } from "./core-util-is.mjs";
4
- import { t as require_inherits } from "./inherits.mjs";
5
- import { t as require_lib$2 } from "./immediate.mjs";
1
+ import { __commonJSMin, __require } from "../rolldown-runtime.mjs";
2
+ import { require_isarray } from "./isarray.mjs";
3
+ import { require_util } from "./core-util-is.mjs";
4
+ import { require_inherits } from "./inherits.mjs";
5
+ import { require_lib as require_lib$2 } from "./immediate.mjs";
6
6
  var require_process_nextick_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
7
  if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) module.exports = { nextTick };
8
8
  else module.exports = process;
@@ -250,7 +250,8 @@ var require__stream_writable = /* @__PURE__ */ __commonJSMin(((exports, module)
250
250
  this.ended = false;
251
251
  this.finished = false;
252
252
  this.destroyed = false;
253
- this.decodeStrings = !(options.decodeStrings === false);
253
+ var noDecode = options.decodeStrings === false;
254
+ this.decodeStrings = !noDecode;
254
255
  this.defaultEncoding = options.defaultEncoding || "utf8";
255
256
  this.length = 0;
256
257
  this.writing = false;
@@ -1744,13 +1745,11 @@ var require_nodejsUtils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1744
1745
  }));
1745
1746
  var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1746
1747
  var immediate = require_lib$2();
1747
- /* istanbul ignore next */
1748
1748
  function INTERNAL() {}
1749
1749
  var handlers = {};
1750
1750
  var REJECTED = ["REJECTED"];
1751
1751
  var FULFILLED = ["FULFILLED"];
1752
1752
  var PENDING = ["PENDING"];
1753
- /* istanbul ignore else */
1754
1753
  if (!process.browser) var UNHANDLED = ["UNHANDLED"];
1755
1754
  module.exports = Promise;
1756
1755
  function Promise(resolver) {
@@ -1758,7 +1757,6 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1758
1757
  this.state = PENDING;
1759
1758
  this.queue = [];
1760
1759
  this.outcome = void 0;
1761
- /* istanbul ignore else */
1762
1760
  if (!process.browser) this.handled = UNHANDLED;
1763
1761
  if (resolver !== INTERNAL) safelyResolveThenable(this, resolver);
1764
1762
  }
@@ -1785,7 +1783,6 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1785
1783
  Promise.prototype.then = function(onFulfilled, onRejected) {
1786
1784
  if (typeof onFulfilled !== "function" && this.state === FULFILLED || typeof onRejected !== "function" && this.state === REJECTED) return this;
1787
1785
  var promise = new this.constructor(INTERNAL);
1788
- /* istanbul ignore else */
1789
1786
  if (!process.browser) {
1790
1787
  if (this.handled === UNHANDLED) this.handled = null;
1791
1788
  }
@@ -1845,7 +1842,6 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1845
1842
  handlers.reject = function(self, error) {
1846
1843
  self.state = REJECTED;
1847
1844
  self.outcome = error;
1848
- /* istanbul ignore else */
1849
1845
  if (!process.browser) {
1850
1846
  if (self.handled === UNHANDLED) immediate(function() {
1851
1847
  if (self.handled === UNHANDLED) process.emit("unhandledRejection", error, self);
@@ -2088,7 +2084,7 @@ var require_setImmediate = /* @__PURE__ */ __commonJSMin((() => {
2088
2084
  else installSetTimeoutImplementation();
2089
2085
  attachTo.setImmediate = setImmediate;
2090
2086
  attachTo.clearImmediate = clearImmediate;
2091
- })(typeof self === "undefined" ? typeof global === "undefined" ? exports : global : self);
2087
+ })(typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self);
2092
2088
  }));
2093
2089
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
2094
2090
  var support = require_support();
@@ -7508,4 +7504,4 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7508
7504
  JSZip.external = require_external();
7509
7505
  module.exports = JSZip;
7510
7506
  }));
7511
- export { require_lib as t };
7507
+ export { require_lib };
@@ -1,9 +1,10 @@
1
- import { r as __toESM } from "../rolldown-runtime.mjs";
2
- import { n as require_src, t as require_dist } from "./@kwsites/file-exists.mjs";
3
- import { t as require_dist$1 } from "./@kwsites/promise-deferred.mjs";
1
+ import { __toESM } from "../rolldown-runtime.mjs";
2
+ import { require_dist, require_src } from "./@kwsites/file-exists.mjs";
3
+ import { c, o, r } from "./@simple-git/args-pathspec.mjs";
4
+ import { require_dist as require_dist$1 } from "./@kwsites/promise-deferred.mjs";
5
+ import { ne } from "./@simple-git/argv-parser.mjs";
4
6
  import { spawn } from "child_process";
5
7
  import { normalize } from "node:path";
6
- import { Buffer as Buffer$1 } from "node:buffer";
7
8
  import { EventEmitter } from "node:events";
8
9
  var import_dist = require_dist();
9
10
  var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
@@ -34,22 +35,6 @@ var __copyProps = (to, from, except, desc) => {
34
35
  return to;
35
36
  };
36
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- function pathspec(...paths) {
38
- const key = new String(paths);
39
- cache.set(key, paths);
40
- return key;
41
- }
42
- function isPathSpec(path) {
43
- return path instanceof String && cache.has(path);
44
- }
45
- function toPaths(pathSpec) {
46
- return cache.get(pathSpec) || [];
47
- }
48
- var cache;
49
- var init_pathspec = __esm({ "src/lib/args/pathspec.ts"() {
50
- "use strict";
51
- cache = /* @__PURE__ */ new WeakMap();
52
- } });
53
38
  var GitError;
54
39
  var init_git_error = __esm({ "src/lib/errors/git-error.ts"() {
55
40
  "use strict";
@@ -157,7 +142,7 @@ function prefixedArray(input, prefix) {
157
142
  return output;
158
143
  }
159
144
  function bufferToString(input) {
160
- return (Array.isArray(input) ? Buffer$1.concat(input) : input).toString("utf-8");
145
+ return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
161
146
  }
162
147
  function pick(source, properties) {
163
148
  const out = {};
@@ -186,7 +171,7 @@ function filterType(input, filter, def) {
186
171
  return arguments.length > 2 ? def : void 0;
187
172
  }
188
173
  function filterPrimitives(input, omit) {
189
- const type = isPathSpec(input) ? "string" : typeof input;
174
+ const type = r(input) ? "string" : typeof input;
190
175
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
191
176
  }
192
177
  function filterPlainObject(input) {
@@ -198,7 +183,6 @@ function filterFunction(input) {
198
183
  var filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
199
184
  var init_argument_filters = __esm({ "src/lib/utils/argument-filters.ts"() {
200
185
  "use strict";
201
- init_pathspec();
202
186
  init_util();
203
187
  filterArray = (input) => {
204
188
  return Array.isArray(input);
@@ -207,7 +191,7 @@ var init_argument_filters = __esm({ "src/lib/utils/argument-filters.ts"() {
207
191
  return typeof input === "number";
208
192
  };
209
193
  filterString = (input) => {
210
- return typeof input === "string";
194
+ return typeof input === "string" || r(input);
211
195
  };
212
196
  filterStringOrStringArray = (input) => {
213
197
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -307,7 +291,7 @@ function appendTaskOptions(options, commands = []) {
307
291
  if (!filterPlainObject(options)) return commands;
308
292
  return Object.keys(options).reduce((commands2, key) => {
309
293
  const value = options[key];
310
- if (isPathSpec(value)) commands2.push(value);
294
+ if (r(value)) commands2.push(value);
311
295
  else if (filterPrimitives(value, ["boolean"])) commands2.push(key + "=" + value);
312
296
  else if (Array.isArray(value)) {
313
297
  for (const v of value) if (!filterPrimitives(v, ["string", "number"])) commands2.push(key + "=" + v);
@@ -336,7 +320,6 @@ var init_task_options = __esm({ "src/lib/utils/task-options.ts"() {
336
320
  "use strict";
337
321
  init_argument_filters();
338
322
  init_util();
339
- init_pathspec();
340
323
  } });
341
324
  function callTaskParser(parser4, streams) {
342
325
  return parser4(streams.stdOut, streams.stdErr);
@@ -1090,7 +1073,10 @@ var init_git_executor_chain = __esm({ "src/lib/runners/git-executor-chain.ts"()
1090
1073
  }
1091
1074
  async attemptRemoteTask(task, logger) {
1092
1075
  const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
1093
- const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands));
1076
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
1077
+ ...pluginContext(task, task.commands),
1078
+ env: { ...this.env }
1079
+ });
1094
1080
  const raw = await this.gitResponse(task, binary, args, this.outputHandler, logger.step("SPAWN"));
1095
1081
  const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
1096
1082
  logger(`passing response to task's parser as a %s`, task.format);
@@ -1684,7 +1670,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
1684
1670
  const rangeOperator = opt.symmetric !== false ? "..." : "..";
1685
1671
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
1686
1672
  }
1687
- if (filterString(opt.file)) command.push("--follow", pathspec(opt.file));
1673
+ if (filterString(opt.file)) command.push("--follow", c(opt.file));
1688
1674
  appendTaskOptions(userOptions(opt), command);
1689
1675
  return {
1690
1676
  fields,
@@ -1718,7 +1704,6 @@ var excludeOptions;
1718
1704
  var init_log = __esm({ "src/lib/tasks/log.ts"() {
1719
1705
  "use strict";
1720
1706
  init_log_format();
1721
- init_pathspec();
1722
1707
  init_parse_list_log_summary();
1723
1708
  init_utils();
1724
1709
  init_task();
@@ -2125,13 +2110,13 @@ function parser3(indexX, indexY, handler) {
2125
2110
  return [`${indexX}${indexY}`, handler];
2126
2111
  }
2127
2112
  function conflicts(indexX, ...indexY) {
2128
- return indexY.map((y) => parser3(indexX, y, (result, file) => append(result.conflicted, file)));
2113
+ return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));
2129
2114
  }
2130
2115
  function splitLine(result, lineStr) {
2131
2116
  const trimmed2 = lineStr.trim();
2132
2117
  switch (" ") {
2133
- case trimmed2.charAt(2): return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
2134
- case trimmed2.charAt(1): return data(" ", trimmed2.charAt(0), trimmed2.substr(2));
2118
+ case trimmed2.charAt(2): return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
2119
+ case trimmed2.charAt(1): return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
2135
2120
  default: return;
2136
2121
  }
2137
2122
  function data(index, workingDir, path) {
@@ -2168,26 +2153,42 @@ var init_StatusSummary = __esm({ "src/lib/responses/StatusSummary.ts"() {
2168
2153
  }
2169
2154
  };
2170
2155
  parsers6 = new Map([
2171
- parser3(" ", "A", (result, file) => append(result.created, file)),
2172
- parser3(" ", "D", (result, file) => append(result.deleted, file)),
2173
- parser3(" ", "M", (result, file) => append(result.modified, file)),
2174
- parser3("A", " ", (result, file) => append(result.created, file) && append(result.staged, file)),
2175
- parser3("A", "M", (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)),
2176
- parser3("D", " ", (result, file) => append(result.deleted, file) && append(result.staged, file)),
2177
- parser3("M", " ", (result, file) => append(result.modified, file) && append(result.staged, file)),
2178
- parser3("M", "M", (result, file) => append(result.modified, file) && append(result.staged, file)),
2156
+ parser3(" ", "A", (result, file) => result.created.push(file)),
2157
+ parser3(" ", "D", (result, file) => result.deleted.push(file)),
2158
+ parser3(" ", "M", (result, file) => result.modified.push(file)),
2159
+ parser3("A", " ", (result, file) => {
2160
+ result.created.push(file);
2161
+ result.staged.push(file);
2162
+ }),
2163
+ parser3("A", "M", (result, file) => {
2164
+ result.created.push(file);
2165
+ result.staged.push(file);
2166
+ result.modified.push(file);
2167
+ }),
2168
+ parser3("D", " ", (result, file) => {
2169
+ result.deleted.push(file);
2170
+ result.staged.push(file);
2171
+ }),
2172
+ parser3("M", " ", (result, file) => {
2173
+ result.modified.push(file);
2174
+ result.staged.push(file);
2175
+ }),
2176
+ parser3("M", "M", (result, file) => {
2177
+ result.modified.push(file);
2178
+ result.staged.push(file);
2179
+ }),
2179
2180
  parser3("R", " ", (result, file) => {
2180
- append(result.renamed, renamedFile(file));
2181
+ result.renamed.push(renamedFile(file));
2181
2182
  }),
2182
2183
  parser3("R", "M", (result, file) => {
2183
2184
  const renamed = renamedFile(file);
2184
- append(result.renamed, renamed);
2185
- append(result.modified, renamed.to);
2185
+ result.renamed.push(renamed);
2186
+ result.modified.push(renamed.to);
2186
2187
  }),
2187
2188
  parser3("!", "!", (_result, _file) => {
2188
- append(_result.ignored = _result.ignored || [], _file);
2189
+ (_result.ignored = _result.ignored || []).push(_file);
2189
2190
  }),
2190
- parser3("?", "?", (result, file) => append(result.not_added, file)),
2191
+ parser3("?", "?", (result, file) => result.not_added.push(file)),
2191
2192
  ...conflicts("A", "A", "U"),
2192
2193
  ...conflicts("D", "D", "U"),
2193
2194
  ...conflicts("U", "A", "D", "U"),
@@ -2290,6 +2291,36 @@ var init_version = __esm({ "src/lib/tasks/version.ts"() {
2290
2291
  Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));
2291
2292
  })];
2292
2293
  } });
2294
+ function createCloneTask(api, task, repoPath, ...args) {
2295
+ if (!filterString(repoPath)) return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
2296
+ return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
2297
+ }
2298
+ function clone_default() {
2299
+ return {
2300
+ clone(repo, ...rest) {
2301
+ return this._runTask(createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
2302
+ },
2303
+ mirror(repo, ...rest) {
2304
+ return this._runTask(createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest), trailingFunctionArgument(arguments));
2305
+ }
2306
+ };
2307
+ }
2308
+ var cloneTask, cloneMirrorTask;
2309
+ var init_clone = __esm({ "src/lib/tasks/clone.ts"() {
2310
+ "use strict";
2311
+ init_task();
2312
+ init_utils();
2313
+ cloneTask = (repo, directory, customArgs) => {
2314
+ const commands = ["clone", ...customArgs];
2315
+ filterString(repo) && commands.push(c(repo));
2316
+ filterString(directory) && commands.push(c(directory));
2317
+ return straightThroughStringTask(commands);
2318
+ };
2319
+ cloneMirrorTask = (repo, directory, customArgs) => {
2320
+ append(customArgs, "--mirror");
2321
+ return cloneTask(repo, directory, customArgs);
2322
+ };
2323
+ } });
2293
2324
  var simple_git_api_exports = {};
2294
2325
  __export(simple_git_api_exports, { SimpleGitApi: () => SimpleGitApi });
2295
2326
  var SimpleGitApi;
@@ -2313,6 +2344,7 @@ var init_simple_git_api = __esm({ "src/lib/simple-git-api.ts"() {
2313
2344
  init_task();
2314
2345
  init_version();
2315
2346
  init_utils();
2347
+ init_clone();
2316
2348
  SimpleGitApi = class {
2317
2349
  constructor(_executor) {
2318
2350
  this._executor = _executor;
@@ -2371,7 +2403,7 @@ var init_simple_git_api = __esm({ "src/lib/simple-git-api.ts"() {
2371
2403
  return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
2372
2404
  }
2373
2405
  };
2374
- Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
2406
+ Object.assign(SimpleGitApi.prototype, checkout_default(), clone_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
2375
2407
  } });
2376
2408
  var scheduler_exports = {};
2377
2409
  __export(scheduler_exports, { Scheduler: () => Scheduler });
@@ -2640,30 +2672,6 @@ var init_check_ignore = __esm({ "src/lib/tasks/check-ignore.ts"() {
2640
2672
  "use strict";
2641
2673
  init_CheckIgnore();
2642
2674
  } });
2643
- var clone_exports = {};
2644
- __export(clone_exports, {
2645
- cloneMirrorTask: () => cloneMirrorTask,
2646
- cloneTask: () => cloneTask
2647
- });
2648
- function disallowedCommand(command) {
2649
- return /^--upload-pack(=|$)/.test(command);
2650
- }
2651
- function cloneTask(repo, directory, customArgs) {
2652
- const commands = ["clone", ...customArgs];
2653
- filterString(repo) && commands.push(repo);
2654
- filterString(directory) && commands.push(directory);
2655
- if (commands.find(disallowedCommand)) return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
2656
- return straightThroughStringTask(commands);
2657
- }
2658
- function cloneMirrorTask(repo, directory, customArgs) {
2659
- append(customArgs, "--mirror");
2660
- return cloneTask(repo, directory, customArgs);
2661
- }
2662
- var init_clone = __esm({ "src/lib/tasks/clone.ts"() {
2663
- "use strict";
2664
- init_task();
2665
- init_utils();
2666
- } });
2667
2675
  function parseFetchResult(stdOut, stdErr) {
2668
2676
  return parseStringResponse({
2669
2677
  raw: stdOut,
@@ -2709,13 +2717,13 @@ var init_parse_fetch = __esm({ "src/lib/parsers/parse-fetch.ts"() {
2709
2717
  } });
2710
2718
  var fetch_exports = {};
2711
2719
  __export(fetch_exports, { fetchTask: () => fetchTask });
2712
- function disallowedCommand2(command) {
2720
+ function disallowedCommand(command) {
2713
2721
  return /^--upload-pack(=|$)/.test(command);
2714
2722
  }
2715
2723
  function fetchTask(remote, branch, customArgs) {
2716
2724
  const commands = ["fetch", ...customArgs];
2717
2725
  if (remote && branch) commands.push(remote, branch);
2718
- if (commands.find(disallowedCommand2)) return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
2726
+ if (commands.find(disallowedCommand)) return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
2719
2727
  return {
2720
2728
  commands,
2721
2729
  format: "utf-8",
@@ -3004,13 +3012,12 @@ var require_git = __commonJS({ "src/git.js"(exports, module) {
3004
3012
  var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
3005
3013
  var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
3006
3014
  var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
3007
- var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
3015
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
3008
3016
  var { asArray: asArray2, filterArray: filterArray2, filterPrimitives: filterPrimitives2, filterString: filterString2, filterStringOrStringArray: filterStringOrStringArray2, filterType: filterType2, getTrailingOptions: getTrailingOptions2, trailingFunctionArgument: trailingFunctionArgument2, trailingOptionsArgument: trailingOptionsArgument2 } = (init_utils(), __toCommonJS(utils_exports));
3009
3017
  var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));
3010
3018
  var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports));
3011
3019
  var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
3012
3020
  var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
3013
- var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
3014
3021
  var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
3015
3022
  var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
3016
3023
  var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
@@ -3041,16 +3048,6 @@ var require_git = __commonJS({ "src/git.js"(exports, module) {
3041
3048
  Git2.prototype.stashList = function(options) {
3042
3049
  return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));
3043
3050
  };
3044
- function createCloneTask(api, task, repoPath, localPath) {
3045
- if (typeof repoPath !== "string") return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
3046
- return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
3047
- }
3048
- Git2.prototype.clone = function() {
3049
- return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));
3050
- };
3051
- Git2.prototype.mirror = function() {
3052
- return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));
3053
- };
3054
3051
  Git2.prototype.mv = function(from, to) {
3055
3052
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
3056
3053
  };
@@ -3069,8 +3066,7 @@ var require_git = __commonJS({ "src/git.js"(exports, module) {
3069
3066
  return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
3070
3067
  };
3071
3068
  Git2.prototype.silent = function(silence) {
3072
- console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3");
3073
- return this;
3069
+ return this._runTask(adhocExecTask2(() => console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")));
3074
3070
  };
3075
3071
  Git2.prototype.tags = function(options, then) {
3076
3072
  return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
@@ -3220,7 +3216,7 @@ var require_git = __commonJS({ "src/git.js"(exports, module) {
3220
3216
  });
3221
3217
  };
3222
3218
  Git2.prototype.clearQueue = function() {
3223
- return this;
3219
+ return this._runTask(adhocExecTask2(() => console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")));
3224
3220
  };
3225
3221
  Git2.prototype.checkIgnore = function(pathnames, then) {
3226
3222
  return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));
@@ -3230,7 +3226,6 @@ var require_git = __commonJS({ "src/git.js"(exports, module) {
3230
3226
  };
3231
3227
  module.exports = Git2;
3232
3228
  } });
3233
- init_pathspec();
3234
3229
  init_git_error();
3235
3230
  var GitConstructError = class extends GitError {
3236
3231
  constructor(config, message) {
@@ -3274,28 +3269,11 @@ function abortPlugin(signal) {
3274
3269
  }
3275
3270
  }];
3276
3271
  }
3277
- function isConfigSwitch(arg) {
3278
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
3279
- }
3280
- function preventProtocolOverride(arg, next) {
3281
- if (!isConfigSwitch(arg)) return;
3282
- if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) return;
3283
- throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol");
3284
- }
3285
- function preventUploadPack(arg, method) {
3286
- if (/^\s*--(upload|receive)-pack/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`);
3287
- if (method === "clone" && /^\s*-u\b/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`);
3288
- if (method === "push" && /^\s*--exec\b/.test(arg)) throw new GitPluginError(void 0, "unsafe", `Use of push with option --exec is not permitted without enabling allowUnsafePack`);
3289
- }
3290
- function blockUnsafeOperationsPlugin({ allowUnsafeProtocolOverride = false, allowUnsafePack = false } = {}) {
3272
+ function blockUnsafeOperationsPlugin(options = {}) {
3291
3273
  return {
3292
3274
  type: "spawn.args",
3293
- action(args, context) {
3294
- args.forEach((current, index) => {
3295
- const next = index < args.length ? args[index + 1] : "";
3296
- allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
3297
- allowUnsafePack || preventUploadPack(current, context.method);
3298
- });
3275
+ action(args, { env }) {
3276
+ for (const vulnerability of ne(args, env)) if (options[vulnerability.category] !== true) throw new GitPluginError(void 0, "unsafe", vulnerability.message);
3299
3277
  return args;
3300
3278
  }
3301
3279
  };
@@ -3368,7 +3346,7 @@ init_utils();
3368
3346
  var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
3369
3347
  var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
3370
3348
  function isBadArgument(arg) {
3371
- return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
3349
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
3372
3350
  }
3373
3351
  function toBinaryConfig(input, allowUnsafe) {
3374
3352
  if (input.length < 1 || input.length > 2) throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR);
@@ -3530,7 +3508,6 @@ function timeoutPlugin({ block, stdErr = true, stdOut = true }) {
3530
3508
  }
3531
3509
  };
3532
3510
  }
3533
- init_pathspec();
3534
3511
  function suffixPathsPlugin() {
3535
3512
  return {
3536
3513
  type: "spawn.args",
@@ -3542,12 +3519,12 @@ function suffixPathsPlugin() {
3542
3519
  }
3543
3520
  for (let i = 0; i < data.length; i++) {
3544
3521
  const param = data[i];
3545
- if (isPathSpec(param)) {
3546
- append2(toPaths(param));
3522
+ if (r(param)) {
3523
+ append2(o(param));
3547
3524
  continue;
3548
3525
  }
3549
3526
  if (param === "--") {
3550
- append2(data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item));
3527
+ append2(data.slice(i + 1).flatMap((item) => r(item) && o(item) || item));
3551
3528
  break;
3552
3529
  }
3553
3530
  prefix.push(param);
@@ -3568,12 +3545,12 @@ function gitInstanceFactory(baseDir, options) {
3568
3545
  if (!folderExists(config.baseDir)) throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`);
3569
3546
  if (Array.isArray(config.config)) plugins.add(commandConfigPrefixingPlugin(config.config));
3570
3547
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
3571
- plugins.add(suffixPathsPlugin());
3572
3548
  plugins.add(completionDetectionPlugin(config.completion));
3573
3549
  config.abort && plugins.add(abortPlugin(config.abort));
3574
3550
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
3575
3551
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
3576
3552
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
3553
+ plugins.add(suffixPathsPlugin());
3577
3554
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
3578
3555
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
3579
3556
  customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
@@ -3581,4 +3558,4 @@ function gitInstanceFactory(baseDir, options) {
3581
3558
  }
3582
3559
  init_git_response_error();
3583
3560
  var esm_default = gitInstanceFactory;
3584
- export { esm_default as t };
3561
+ export { esm_default };
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
9
  var __copyProps = (to, from, except, desc) => {
10
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
11
  key = keys[i];
@@ -21,4 +21,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
24
- export { __require as n, __toESM as r, __commonJSMin as t };
24
+ export { __commonJSMin, __require, __toESM };