@moxt-ai/cli 0.12.1 → 0.12.2
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/index.cjs +30 -8
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9335,6 +9335,15 @@ var require_ignore = __commonJS({
|
|
|
9335
9335
|
});
|
|
9336
9336
|
|
|
9337
9337
|
// ../machine-connector/dist/runtime/local-codex-runtime/local-file-source.js
|
|
9338
|
+
function isPathWithin(path4, directory) {
|
|
9339
|
+
return path4 === directory || path4.startsWith(`${directory}/`);
|
|
9340
|
+
}
|
|
9341
|
+
function isStrictAncestorPath(path4, child) {
|
|
9342
|
+
if (child === void 0)
|
|
9343
|
+
return false;
|
|
9344
|
+
const normalizedPath = path4 === "." ? "" : path4;
|
|
9345
|
+
return normalizedPath === "" ? child !== "" : child.startsWith(`${normalizedPath}/`);
|
|
9346
|
+
}
|
|
9338
9347
|
function resolveWithin(root, input) {
|
|
9339
9348
|
if (input.length === 0 || input.includes("\0") || (0, import_node_path9.isAbsolute)(input) || import_node_path9.win32.isAbsolute(input) || /^[A-Za-z]:/.test(input) || input.split(/[\\/]/).includes("..")) {
|
|
9340
9349
|
throw new Error("Local file path escapes its root");
|
|
@@ -9548,6 +9557,8 @@ var init_local_file_source = __esm({
|
|
|
9548
9557
|
const matchers = [{ base: "", matcher: (0, import_ignore.default)().add(".git/").add(".git/**") }];
|
|
9549
9558
|
const relativeThrough = (0, import_node_path9.relative)(this.pairedRoot, throughDirectory);
|
|
9550
9559
|
const segments = relativeThrough === "" ? [] : relativeThrough.split(import_node_path9.sep);
|
|
9560
|
+
const workingDirectoryRootPath = portable((0, import_node_path9.relative)(this.pairedRoot, this.workingDirectory));
|
|
9561
|
+
const workingDirectorySegments = workingDirectoryRootPath === "." ? [] : workingDirectoryRootPath.split("/");
|
|
9551
9562
|
let directory = this.pairedRoot;
|
|
9552
9563
|
for (let index2 = 0; index2 <= segments.length; index2 += 1) {
|
|
9553
9564
|
const matcher = (0, import_ignore.default)();
|
|
@@ -9565,17 +9576,28 @@ var init_local_file_source = __esm({
|
|
|
9565
9576
|
if (segment !== void 0)
|
|
9566
9577
|
directory = (0, import_node_path9.join)(directory, segment);
|
|
9567
9578
|
}
|
|
9568
|
-
|
|
9579
|
+
if (workingDirectorySegments.length === 0) {
|
|
9580
|
+
return new ScopedIgnoreMatcher(matchers);
|
|
9581
|
+
}
|
|
9582
|
+
const inheritedMatchers = matchers.slice(0, workingDirectorySegments.length + 1);
|
|
9583
|
+
const workingDirectoryIsIgnored = new ScopedIgnoreMatcher(inheritedMatchers).ignores(workingDirectoryRootPath);
|
|
9584
|
+
return new ScopedIgnoreMatcher(matchers, workingDirectoryIsIgnored ? workingDirectoryRootPath : void 0);
|
|
9569
9585
|
}
|
|
9570
9586
|
};
|
|
9571
9587
|
ScopedIgnoreMatcher = class {
|
|
9572
9588
|
rules;
|
|
9573
|
-
|
|
9589
|
+
ignoredWorkingDirectory;
|
|
9590
|
+
constructor(rules, ignoredWorkingDirectory) {
|
|
9574
9591
|
this.rules = rules;
|
|
9592
|
+
this.ignoredWorkingDirectory = ignoredWorkingDirectory;
|
|
9575
9593
|
}
|
|
9576
9594
|
ignores(rootPath) {
|
|
9577
9595
|
let ignored = false;
|
|
9596
|
+
const skipInheritedRules = this.ignoredWorkingDirectory !== void 0 && isPathWithin(rootPath, this.ignoredWorkingDirectory);
|
|
9578
9597
|
for (const rule of this.rules) {
|
|
9598
|
+
if (skipInheritedRules && isStrictAncestorPath(rule.base, this.ignoredWorkingDirectory)) {
|
|
9599
|
+
continue;
|
|
9600
|
+
}
|
|
9579
9601
|
const localPath = relativePortable(rule.base, rootPath);
|
|
9580
9602
|
if (localPath === void 0 || localPath === ".")
|
|
9581
9603
|
continue;
|
|
@@ -16607,7 +16629,7 @@ function getApiKeyOrUndefined() {
|
|
|
16607
16629
|
|
|
16608
16630
|
// src/utils/http.ts
|
|
16609
16631
|
function getUserAgent() {
|
|
16610
|
-
return `moxt-cli/${"0.12.
|
|
16632
|
+
return `moxt-cli/${"0.12.2"} (${(0, import_os.platform)()}/${(0, import_os.arch)()}) node/${process.versions.node}`;
|
|
16611
16633
|
}
|
|
16612
16634
|
async function sendRequest(method, path4, init) {
|
|
16613
16635
|
return await fetch(`${getApiBaseUrl()}${path4}`, {
|
|
@@ -31193,7 +31215,7 @@ var FLUSH_TIMEOUT_MS = 3e3;
|
|
|
31193
31215
|
var MAX_BATCH_SIZE = 100;
|
|
31194
31216
|
function commonLabels() {
|
|
31195
31217
|
return {
|
|
31196
|
-
cli_version: "0.12.
|
|
31218
|
+
cli_version: "0.12.2",
|
|
31197
31219
|
node_version: process.versions.node,
|
|
31198
31220
|
os: (0, import_node_os11.platform)(),
|
|
31199
31221
|
arch: (0, import_node_os11.arch)(),
|
|
@@ -31239,7 +31261,7 @@ async function flush() {
|
|
|
31239
31261
|
}
|
|
31240
31262
|
const batch = buffer.splice(0, MAX_BATCH_SIZE);
|
|
31241
31263
|
const payload = {
|
|
31242
|
-
release_id: "0.12.
|
|
31264
|
+
release_id: "0.12.2",
|
|
31243
31265
|
client_type: "cli",
|
|
31244
31266
|
metric_data_list: batch.map((m) => ({
|
|
31245
31267
|
profile: "cli",
|
|
@@ -31622,9 +31644,9 @@ function commandPath3(command) {
|
|
|
31622
31644
|
}
|
|
31623
31645
|
|
|
31624
31646
|
// src/index.ts
|
|
31625
|
-
var program2 = createProgram("0.12.
|
|
31626
|
-
installDaemonReconcileHook(program2, "0.12.
|
|
31627
|
-
installUpdateHook(program2, "0.12.
|
|
31647
|
+
var program2 = createProgram("0.12.2");
|
|
31648
|
+
installDaemonReconcileHook(program2, "0.12.2");
|
|
31649
|
+
installUpdateHook(program2, "0.12.2");
|
|
31628
31650
|
instrumentProgram(program2);
|
|
31629
31651
|
installExitHandler();
|
|
31630
31652
|
program2.parseAsync(process.argv).then(async () => {
|