pantheon-cli 0.2.19 → 0.2.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/pantheon.mjs +37 -18
- package/package.json +1 -1
package/dist/pantheon.mjs
CHANGED
|
@@ -2986,7 +2986,7 @@ var require_compile = __commonJS({
|
|
|
2986
2986
|
const schOrFunc = root.refs[ref];
|
|
2987
2987
|
if (schOrFunc)
|
|
2988
2988
|
return schOrFunc;
|
|
2989
|
-
let _sch =
|
|
2989
|
+
let _sch = resolve3.call(this, root, ref);
|
|
2990
2990
|
if (_sch === void 0) {
|
|
2991
2991
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
2992
2992
|
const { schemaId } = this.opts;
|
|
@@ -3013,7 +3013,7 @@ var require_compile = __commonJS({
|
|
|
3013
3013
|
function sameSchemaEnv(s1, s2) {
|
|
3014
3014
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3016
|
+
function resolve3(root, ref) {
|
|
3017
3017
|
let sch;
|
|
3018
3018
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
3019
3019
|
ref = sch;
|
|
@@ -3644,7 +3644,7 @@ var require_fast_uri = __commonJS({
|
|
|
3644
3644
|
}
|
|
3645
3645
|
return uri;
|
|
3646
3646
|
}
|
|
3647
|
-
function
|
|
3647
|
+
function resolve3(baseURI, relativeURI, options) {
|
|
3648
3648
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3649
3649
|
const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
|
|
3650
3650
|
const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
|
|
@@ -3928,7 +3928,7 @@ var require_fast_uri = __commonJS({
|
|
|
3928
3928
|
var fastUri = {
|
|
3929
3929
|
SCHEMES,
|
|
3930
3930
|
normalize,
|
|
3931
|
-
resolve:
|
|
3931
|
+
resolve: resolve3,
|
|
3932
3932
|
resolveComponent,
|
|
3933
3933
|
equal,
|
|
3934
3934
|
serialize: serialize2,
|
|
@@ -19128,7 +19128,7 @@ var Protocol = class {
|
|
|
19128
19128
|
return;
|
|
19129
19129
|
}
|
|
19130
19130
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
19131
|
-
await new Promise((
|
|
19131
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
19132
19132
|
options?.signal?.throwIfAborted();
|
|
19133
19133
|
}
|
|
19134
19134
|
} catch (error2) {
|
|
@@ -19145,7 +19145,7 @@ var Protocol = class {
|
|
|
19145
19145
|
*/
|
|
19146
19146
|
request(request, resultSchema, options) {
|
|
19147
19147
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
19148
|
-
return new Promise((
|
|
19148
|
+
return new Promise((resolve3, reject) => {
|
|
19149
19149
|
const earlyReject = (error2) => {
|
|
19150
19150
|
reject(error2);
|
|
19151
19151
|
};
|
|
@@ -19223,7 +19223,7 @@ var Protocol = class {
|
|
|
19223
19223
|
if (!parseResult.success) {
|
|
19224
19224
|
reject(parseResult.error);
|
|
19225
19225
|
} else {
|
|
19226
|
-
|
|
19226
|
+
resolve3(parseResult.data);
|
|
19227
19227
|
}
|
|
19228
19228
|
} catch (error2) {
|
|
19229
19229
|
reject(error2);
|
|
@@ -19484,12 +19484,12 @@ var Protocol = class {
|
|
|
19484
19484
|
}
|
|
19485
19485
|
} catch {
|
|
19486
19486
|
}
|
|
19487
|
-
return new Promise((
|
|
19487
|
+
return new Promise((resolve3, reject) => {
|
|
19488
19488
|
if (signal.aborted) {
|
|
19489
19489
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
19490
19490
|
return;
|
|
19491
19491
|
}
|
|
19492
|
-
const timeoutId = setTimeout(
|
|
19492
|
+
const timeoutId = setTimeout(resolve3, interval);
|
|
19493
19493
|
signal.addEventListener("abort", () => {
|
|
19494
19494
|
clearTimeout(timeoutId);
|
|
19495
19495
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -20580,7 +20580,7 @@ var McpServer = class {
|
|
|
20580
20580
|
let task = createTaskResult.task;
|
|
20581
20581
|
const pollInterval = task.pollInterval ?? 5e3;
|
|
20582
20582
|
while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
|
|
20583
|
-
await new Promise((
|
|
20583
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
20584
20584
|
const updatedTask = await extra.taskStore.getTask(taskId);
|
|
20585
20585
|
if (!updatedTask) {
|
|
20586
20586
|
throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
|
|
@@ -21244,12 +21244,12 @@ var StdioServerTransport = class {
|
|
|
21244
21244
|
this.onclose?.();
|
|
21245
21245
|
}
|
|
21246
21246
|
send(message) {
|
|
21247
|
-
return new Promise((
|
|
21247
|
+
return new Promise((resolve3) => {
|
|
21248
21248
|
const json = serializeMessage(message);
|
|
21249
21249
|
if (this._stdout.write(json)) {
|
|
21250
|
-
|
|
21250
|
+
resolve3();
|
|
21251
21251
|
} else {
|
|
21252
|
-
this._stdout.once("drain",
|
|
21252
|
+
this._stdout.once("drain", resolve3);
|
|
21253
21253
|
}
|
|
21254
21254
|
});
|
|
21255
21255
|
}
|
|
@@ -23192,7 +23192,7 @@ function saveMachineConfig(config2, credentials) {
|
|
|
23192
23192
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
23193
23193
|
import { existsSync as existsSync5, mkdirSync as mkdirSync4, unlinkSync, writeFileSync as writeFileSync4 } from "node:fs";
|
|
23194
23194
|
import { homedir as homedir4, tmpdir } from "node:os";
|
|
23195
|
-
import { dirname, join as join5 } from "node:path";
|
|
23195
|
+
import { dirname, join as join5, resolve as resolve2 } from "node:path";
|
|
23196
23196
|
function gitEnv(extra = {}) {
|
|
23197
23197
|
return {
|
|
23198
23198
|
...process.env,
|
|
@@ -23268,12 +23268,23 @@ esac
|
|
|
23268
23268
|
}
|
|
23269
23269
|
}
|
|
23270
23270
|
}
|
|
23271
|
+
function retarget(home) {
|
|
23272
|
+
try {
|
|
23273
|
+
const stored = loadMachineConfig();
|
|
23274
|
+
if (!stored?.config.cloneUrl) return;
|
|
23275
|
+
if (resolve2(stored.config.home) !== resolve2(home)) return;
|
|
23276
|
+
if (git(home, ["remote", "get-url", "origin"]) === stored.config.cloneUrl) return;
|
|
23277
|
+
git(home, ["remote", "set-url", "origin", stored.config.cloneUrl]);
|
|
23278
|
+
} catch {
|
|
23279
|
+
}
|
|
23280
|
+
}
|
|
23271
23281
|
function syncVaultWithToken(home, token, opts = {}) {
|
|
23272
23282
|
const result = { ok: false, committed: false, pulled: false, pushed: false };
|
|
23273
23283
|
if (!existsSync5(join5(home, ".git"))) {
|
|
23274
23284
|
result.error = "Vault is not a git repo.";
|
|
23275
23285
|
return result;
|
|
23276
23286
|
}
|
|
23287
|
+
retarget(home);
|
|
23277
23288
|
try {
|
|
23278
23289
|
return withGitAuth(token, (env) => {
|
|
23279
23290
|
const auth = [
|
|
@@ -24420,6 +24431,7 @@ async function connect(opts) {
|
|
|
24420
24431
|
}
|
|
24421
24432
|
function syncVault2(home, cloneUrl, helper, quiet) {
|
|
24422
24433
|
const git2 = (...args) => execFileSync3("git", ["-c", `credential.helper=${helper}`, "-C", home, ...args], quiet);
|
|
24434
|
+
retarget2(home, cloneUrl, quiet);
|
|
24423
24435
|
try {
|
|
24424
24436
|
git2("pull", "--ff-only");
|
|
24425
24437
|
return "";
|
|
@@ -24433,11 +24445,18 @@ function syncVault2(home, cloneUrl, helper, quiet) {
|
|
|
24433
24445
|
}
|
|
24434
24446
|
const stamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
24435
24447
|
const archive = `${home}-${stamp2}`;
|
|
24436
|
-
process.stdout.write(" Vault belongs to a
|
|
24448
|
+
process.stdout.write(" Vault belongs to a different repo; setting it aside\u2026\n");
|
|
24437
24449
|
renameSync2(home, archive);
|
|
24438
24450
|
execFileSync3("git", ["-c", `credential.helper=${helper}`, "clone", cloneUrl, home], quiet);
|
|
24439
24451
|
return archive;
|
|
24440
24452
|
}
|
|
24453
|
+
function retarget2(home, cloneUrl, quiet) {
|
|
24454
|
+
try {
|
|
24455
|
+
execFileSync3("git", ["-C", home, "remote", "set-url", "origin", cloneUrl], quiet);
|
|
24456
|
+
} catch {
|
|
24457
|
+
execFileSync3("git", ["-C", home, "remote", "add", "origin", cloneUrl], quiet);
|
|
24458
|
+
}
|
|
24459
|
+
}
|
|
24441
24460
|
function sharesHistory(home) {
|
|
24442
24461
|
try {
|
|
24443
24462
|
const upstream = execFileSync3("git", ["-C", home, "rev-parse", "@{u}"], {
|
|
@@ -24544,14 +24563,14 @@ password=${body.token}
|
|
|
24544
24563
|
`);
|
|
24545
24564
|
}
|
|
24546
24565
|
function readStdin() {
|
|
24547
|
-
return new Promise((
|
|
24566
|
+
return new Promise((resolve3) => {
|
|
24548
24567
|
let data = "";
|
|
24549
24568
|
process.stdin.setEncoding("utf8");
|
|
24550
24569
|
process.stdin.on("data", (chunk) => {
|
|
24551
24570
|
data += chunk;
|
|
24552
24571
|
});
|
|
24553
|
-
process.stdin.on("end", () =>
|
|
24554
|
-
setTimeout(() =>
|
|
24572
|
+
process.stdin.on("end", () => resolve3(data));
|
|
24573
|
+
setTimeout(() => resolve3(data), 50);
|
|
24555
24574
|
});
|
|
24556
24575
|
}
|
|
24557
24576
|
|
package/package.json
CHANGED