@wayai/cli 0.3.108 → 0.3.110
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.js +55 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -648,13 +648,15 @@ var init_api_client = __esm({
|
|
|
648
648
|
/**
|
|
649
649
|
* Re-discover an MCP connection's tool/resource catalog (refreshes stale
|
|
650
650
|
* input schemas that `push` leaves untouched). `connection` is the display
|
|
651
|
-
* name or the connection UUID.
|
|
651
|
+
* name or the connection UUID. With `{ check: true }` the server compares the
|
|
652
|
+
* live catalog and returns drift WITHOUT writing anything (read-only).
|
|
652
653
|
*/
|
|
653
|
-
async syncMcp(hubId, connection, organizationId) {
|
|
654
|
+
async syncMcp(hubId, connection, organizationId, opts) {
|
|
654
655
|
return this.request("POST", "/api/ci/sync-mcp", {
|
|
655
656
|
hub_id: hubId,
|
|
656
657
|
connection,
|
|
657
|
-
...organizationId && { organization_id: organizationId }
|
|
658
|
+
...organizationId && { organization_id: organizationId },
|
|
659
|
+
...opts?.check && { check: true }
|
|
658
660
|
});
|
|
659
661
|
}
|
|
660
662
|
async lookup(path31, opts) {
|
|
@@ -6060,7 +6062,7 @@ var init_dist = __esm({
|
|
|
6060
6062
|
"gi"
|
|
6061
6063
|
);
|
|
6062
6064
|
QUERY_CREDENTIAL_RE = new RegExp(
|
|
6063
|
-
`((?:^|[
|
|
6065
|
+
`((?:^|[?&#;\\s])${SENSITIVE_KEY_PATTERN}=)[^&;\\s"']+`,
|
|
6064
6066
|
"gi"
|
|
6065
6067
|
);
|
|
6066
6068
|
REDACTED = "[REDACTED]";
|
|
@@ -8069,7 +8071,8 @@ var init_dist = __esm({
|
|
|
8069
8071
|
ciSyncMcpBody = external_exports.object({
|
|
8070
8072
|
hub_id: ciUuidSchema,
|
|
8071
8073
|
connection: external_exports.string().min(1, "connection is required"),
|
|
8072
|
-
organization_id: ciUuidSchema.optional()
|
|
8074
|
+
organization_id: ciUuidSchema.optional(),
|
|
8075
|
+
check: external_exports.boolean().optional()
|
|
8073
8076
|
});
|
|
8074
8077
|
ciOrgResourcesParam = external_exports.object({
|
|
8075
8078
|
org_id: ciUuidSchema
|
|
@@ -13858,7 +13861,8 @@ var init_contracts = __esm({
|
|
|
13858
13861
|
ciSyncMcpBody2 = external_exports.object({
|
|
13859
13862
|
hub_id: ciUuidSchema2,
|
|
13860
13863
|
connection: external_exports.string().min(1, "connection is required"),
|
|
13861
|
-
organization_id: ciUuidSchema2.optional()
|
|
13864
|
+
organization_id: ciUuidSchema2.optional(),
|
|
13865
|
+
check: external_exports.boolean().optional()
|
|
13862
13866
|
});
|
|
13863
13867
|
ciOrgResourcesParam2 = external_exports.object({
|
|
13864
13868
|
org_id: ciUuidSchema2
|
|
@@ -18179,28 +18183,70 @@ __export(sync_mcp_exports, {
|
|
|
18179
18183
|
});
|
|
18180
18184
|
function parseArgs12(args2) {
|
|
18181
18185
|
let connection;
|
|
18186
|
+
let check = false;
|
|
18182
18187
|
for (let i = 0; i < args2.length; i++) {
|
|
18183
18188
|
const arg = args2[i];
|
|
18184
18189
|
if (arg === "--connection" && args2[i + 1]) {
|
|
18185
18190
|
connection = args2[++i];
|
|
18191
|
+
} else if (arg === "--check" || arg === "--dry-run") {
|
|
18192
|
+
check = true;
|
|
18186
18193
|
}
|
|
18187
18194
|
}
|
|
18188
|
-
return { connection };
|
|
18195
|
+
return { connection, check };
|
|
18189
18196
|
}
|
|
18190
18197
|
async function syncMcpCommand(args2) {
|
|
18191
18198
|
const hubId = resolveActiveHubId(args2);
|
|
18192
|
-
const { connection } = parseArgs12(args2);
|
|
18199
|
+
const { connection, check } = parseArgs12(args2);
|
|
18193
18200
|
if (!connection) {
|
|
18194
|
-
console.error("Usage: wayai sync-mcp --connection <name> [--hub <uuid|folder-name>]");
|
|
18201
|
+
console.error("Usage: wayai sync-mcp --connection <name> [--hub <uuid|folder-name>] [--check]");
|
|
18195
18202
|
console.error("");
|
|
18196
18203
|
console.error("Re-discovers the MCP connection's tools/resources and refreshes their");
|
|
18197
18204
|
console.error("cached input schemas. `--connection` accepts the connection display name");
|
|
18198
18205
|
console.error("(as in connections[].name) or its UUID.");
|
|
18206
|
+
console.error("");
|
|
18207
|
+
console.error(" --check Report tool-schema drift (cached catalog vs live server)");
|
|
18208
|
+
console.error(" WITHOUT writing anything. Exits 1 when drift is found \u2014");
|
|
18209
|
+
console.error(" for CI. Alias: --dry-run.");
|
|
18199
18210
|
process.exit(1);
|
|
18200
18211
|
}
|
|
18201
18212
|
const { organization_id: organizationId } = requireRepoConfig();
|
|
18202
18213
|
const { config, accessToken } = await requireAuth();
|
|
18203
18214
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
18215
|
+
if (check) {
|
|
18216
|
+
console.log(`Checking MCP tool-schema drift for connection "${connection}"...`);
|
|
18217
|
+
const result2 = await client.syncMcp(hubId, connection, organizationId, { check: true });
|
|
18218
|
+
const drift = result2.drift ?? [];
|
|
18219
|
+
if (result2.reachable === false) {
|
|
18220
|
+
console.log(
|
|
18221
|
+
`Could not reach the MCP server to verify drift for "${result2.connection_name}"${result2.message ? ` (${result2.message})` : ""}. Catalog drift not verified.`
|
|
18222
|
+
);
|
|
18223
|
+
return;
|
|
18224
|
+
}
|
|
18225
|
+
if (drift.length === 0) {
|
|
18226
|
+
console.log(`No drift \u2014 connection "${result2.connection_name}" catalog matches the server \u2713`);
|
|
18227
|
+
return;
|
|
18228
|
+
}
|
|
18229
|
+
const noun = drift.length === 1 ? "tool has" : "tools have";
|
|
18230
|
+
console.log(`
|
|
18231
|
+
\u26A0 ${drift.length} ${noun} drifted on connection "${result2.connection_name}":
|
|
18232
|
+
`);
|
|
18233
|
+
for (const d of drift) {
|
|
18234
|
+
if (d.kind === "added") {
|
|
18235
|
+
console.log(` + ${d.tool_name} \u2014 advertised by the server, not in the catalog`);
|
|
18236
|
+
} else if (d.kind === "removed") {
|
|
18237
|
+
console.log(` - ${d.tool_name} \u2014 in the catalog, no longer on the server`);
|
|
18238
|
+
} else {
|
|
18239
|
+
console.log(` ~ ${d.tool_name} \u2014 ${d.detail ?? "schema changed"}`);
|
|
18240
|
+
}
|
|
18241
|
+
}
|
|
18242
|
+
console.log(
|
|
18243
|
+
// Quote the name — display names are free-form and often contain spaces,
|
|
18244
|
+
// and the CLI reads `--connection` as a single token.
|
|
18245
|
+
`
|
|
18246
|
+
Run \`wayai sync-mcp --connection "${result2.connection_name}"\` to refresh the catalog.`
|
|
18247
|
+
);
|
|
18248
|
+
process.exit(1);
|
|
18249
|
+
}
|
|
18204
18250
|
console.log(`Syncing MCP tools for connection "${connection}"...`);
|
|
18205
18251
|
const result = await client.syncMcp(hubId, connection, organizationId);
|
|
18206
18252
|
console.log(
|