ainecto 0.14.0-next.8 → 0.14.0-next.9
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/bin/ainecto.js +2435 -1817
- package/dist/bin/ainecto.js.map +1 -1
- package/dist/bin/mcp.js +17 -15
- package/dist/bin/mcp.js.map +1 -1
- package/package.json +2 -2
package/dist/bin/mcp.js
CHANGED
|
@@ -58,10 +58,11 @@ function assertEnv(value) {
|
|
|
58
58
|
|
|
59
59
|
// src/core/auth/tokenStore.ts
|
|
60
60
|
import { createHash } from "crypto";
|
|
61
|
-
import { mkdir as mkdir2, readFile, rename, rm, stat as stat2, writeFile, chmod as chmod2 } from "fs/promises";
|
|
61
|
+
import { mkdir as mkdir2, readFile, rename as rename2, rm, stat as stat2, writeFile as writeFile2, chmod as chmod2 } from "fs/promises";
|
|
62
62
|
|
|
63
63
|
// src/core/fs/privateFiles.ts
|
|
64
|
-
import { chmod, lstat, mkdir, stat } from "fs/promises";
|
|
64
|
+
import { chmod, lstat, mkdir, rename, stat, writeFile } from "fs/promises";
|
|
65
|
+
import { dirname } from "path";
|
|
65
66
|
function isNodeError(error, code) {
|
|
66
67
|
return error instanceof Error && "code" in error && error.code === code;
|
|
67
68
|
}
|
|
@@ -81,7 +82,7 @@ async function chmodIfPermissive(path, mode) {
|
|
|
81
82
|
|
|
82
83
|
// src/core/auth/tokenStore.ts
|
|
83
84
|
import { homedir } from "os";
|
|
84
|
-
import { dirname, join } from "path";
|
|
85
|
+
import { dirname as dirname2, join } from "path";
|
|
85
86
|
var FileTokenStore = class {
|
|
86
87
|
filePath;
|
|
87
88
|
constructor(rootDir = join(homedir(), ".ainecto")) {
|
|
@@ -118,17 +119,17 @@ var FileTokenStore = class {
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
async writeFile(file) {
|
|
121
|
-
await mkdir2(
|
|
122
|
-
await chmod2(
|
|
122
|
+
await mkdir2(dirname2(this.filePath), { recursive: true, mode: 448 });
|
|
123
|
+
await chmod2(dirname2(this.filePath), 448);
|
|
123
124
|
const tmpPath = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
124
|
-
await
|
|
125
|
+
await writeFile2(tmpPath, `${JSON.stringify(file, null, 2)}
|
|
125
126
|
`, { mode: 384 });
|
|
126
127
|
await chmod2(tmpPath, 384);
|
|
127
|
-
await
|
|
128
|
+
await rename2(tmpPath, this.filePath);
|
|
128
129
|
await chmod2(this.filePath, 384);
|
|
129
130
|
}
|
|
130
131
|
async hardenExistingPermissions() {
|
|
131
|
-
const dirPath =
|
|
132
|
+
const dirPath = dirname2(this.filePath);
|
|
132
133
|
await chmodIfPermissive(dirPath, 448);
|
|
133
134
|
await chmodIfPermissive(this.filePath, 384);
|
|
134
135
|
}
|
|
@@ -219,8 +220,8 @@ function legacyRoleInput(flag, envVars = process.env) {
|
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// src/core/version.ts
|
|
222
|
-
var CLI_VERSION = true ? "0.14.0-next.
|
|
223
|
-
var CLI_BUILD = true ? "
|
|
223
|
+
var CLI_VERSION = true ? "0.14.0-next.9" : UNBUNDLED_VERSION;
|
|
224
|
+
var CLI_BUILD = true ? "7e080f5" : void 0;
|
|
224
225
|
function cliVersionLabel(version, build, release) {
|
|
225
226
|
return release || build === void 0 ? version : `${version}-dev+${build}`;
|
|
226
227
|
}
|
|
@@ -933,15 +934,15 @@ ${MARKER_END}`;
|
|
|
933
934
|
|
|
934
935
|
// src/core/harness/repositoryFiles.ts
|
|
935
936
|
import { lstat as lstat2, readFile as readFile2, realpath } from "fs/promises";
|
|
936
|
-
import { dirname as
|
|
937
|
+
import { dirname as dirname3, join as join2, resolve, sep } from "path";
|
|
937
938
|
async function findGitRoot(cwd) {
|
|
938
|
-
for (let at = resolve(cwd); ; at =
|
|
939
|
+
for (let at = resolve(cwd); ; at = dirname3(at)) {
|
|
939
940
|
try {
|
|
940
941
|
await lstat2(join2(at, ".git"));
|
|
941
942
|
return at;
|
|
942
943
|
} catch {
|
|
943
944
|
}
|
|
944
|
-
if (
|
|
945
|
+
if (dirname3(at) === at) {
|
|
945
946
|
return void 0;
|
|
946
947
|
}
|
|
947
948
|
}
|
|
@@ -965,7 +966,7 @@ async function assertInsideRepository(root, relativePath) {
|
|
|
965
966
|
const realRoot = await realpath(root);
|
|
966
967
|
let realParent;
|
|
967
968
|
try {
|
|
968
|
-
realParent = await realpath(
|
|
969
|
+
realParent = await realpath(dirname3(absolutePath));
|
|
969
970
|
} catch (error) {
|
|
970
971
|
if (isNodeError2(error, "ENOENT")) {
|
|
971
972
|
return;
|
|
@@ -1027,13 +1028,14 @@ async function runConnector(options) {
|
|
|
1027
1028
|
}
|
|
1028
1029
|
|
|
1029
1030
|
// src/core/output/render.ts
|
|
1031
|
+
var ERROR_LINE_PREFIX = "Error: ";
|
|
1030
1032
|
function renderError(error, options = {}) {
|
|
1031
1033
|
const shape = toErrorShape(error);
|
|
1032
1034
|
if (options.json) {
|
|
1033
1035
|
return `${JSON.stringify(shape, null, 2)}
|
|
1034
1036
|
`;
|
|
1035
1037
|
}
|
|
1036
|
-
return
|
|
1038
|
+
return `${ERROR_LINE_PREFIX}${shape.error.message}
|
|
1037
1039
|
`;
|
|
1038
1040
|
}
|
|
1039
1041
|
function toErrorShape(error) {
|