@ainecto/mcp 0.13.1 → 0.14.0-next.10
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/README.md +23 -9
- package/dist/bin/ainecto.js +4393 -392
- package/dist/bin/ainecto.js.map +1 -1
- package/dist/bin/mcp.js +22 -14
- package/dist/bin/mcp.js.map +1 -1
- package/package.json +3 -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,7 +220,13 @@ function legacyRoleInput(flag, envVars = process.env) {
|
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
// src/core/version.ts
|
|
222
|
-
var CLI_VERSION = true ? "0.
|
|
223
|
+
var CLI_VERSION = true ? "0.14.0-next.10" : UNBUNDLED_VERSION;
|
|
224
|
+
var CLI_BUILD = true ? "f5e52e5" : void 0;
|
|
225
|
+
function cliVersionLabel(version, build, release) {
|
|
226
|
+
return release || build === void 0 ? version : `${version}-dev+${build}`;
|
|
227
|
+
}
|
|
228
|
+
var CLI_RELEASE = true;
|
|
229
|
+
var CLI_VERSION_LABEL = cliVersionLabel(CLI_VERSION, CLI_BUILD, CLI_RELEASE);
|
|
223
230
|
var PACKAGE_NAME = "@ainecto/mcp";
|
|
224
231
|
var CLI_USER_AGENT = `${PACKAGE_NAME} ${CLI_VERSION}`;
|
|
225
232
|
|
|
@@ -924,15 +931,15 @@ ${MARKER_END}`;
|
|
|
924
931
|
|
|
925
932
|
// src/core/harness/repositoryFiles.ts
|
|
926
933
|
import { lstat as lstat2, readFile as readFile2, realpath } from "fs/promises";
|
|
927
|
-
import { dirname as
|
|
934
|
+
import { dirname as dirname3, join as join2, resolve, sep } from "path";
|
|
928
935
|
async function findGitRoot(cwd) {
|
|
929
|
-
for (let at = resolve(cwd); ; at =
|
|
936
|
+
for (let at = resolve(cwd); ; at = dirname3(at)) {
|
|
930
937
|
try {
|
|
931
938
|
await lstat2(join2(at, ".git"));
|
|
932
939
|
return at;
|
|
933
940
|
} catch {
|
|
934
941
|
}
|
|
935
|
-
if (
|
|
942
|
+
if (dirname3(at) === at) {
|
|
936
943
|
return void 0;
|
|
937
944
|
}
|
|
938
945
|
}
|
|
@@ -956,7 +963,7 @@ async function assertInsideRepository(root, relativePath) {
|
|
|
956
963
|
const realRoot = await realpath(root);
|
|
957
964
|
let realParent;
|
|
958
965
|
try {
|
|
959
|
-
realParent = await realpath(
|
|
966
|
+
realParent = await realpath(dirname3(absolutePath));
|
|
960
967
|
} catch (error) {
|
|
961
968
|
if (isNodeError2(error, "ENOENT")) {
|
|
962
969
|
return;
|
|
@@ -1018,13 +1025,14 @@ async function runConnector(options) {
|
|
|
1018
1025
|
}
|
|
1019
1026
|
|
|
1020
1027
|
// src/core/output/render.ts
|
|
1028
|
+
var ERROR_LINE_PREFIX = "Error: ";
|
|
1021
1029
|
function renderError(error, options = {}) {
|
|
1022
1030
|
const shape = toErrorShape(error);
|
|
1023
1031
|
if (options.json) {
|
|
1024
1032
|
return `${JSON.stringify(shape, null, 2)}
|
|
1025
1033
|
`;
|
|
1026
1034
|
}
|
|
1027
|
-
return
|
|
1035
|
+
return `${ERROR_LINE_PREFIX}${shape.error.message}
|
|
1028
1036
|
`;
|
|
1029
1037
|
}
|
|
1030
1038
|
function toErrorShape(error) {
|