@atlassian/mcp-compressor 0.15.0 → 0.17.0
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 +1 -1
- package/dist/generated_clients.d.ts +17 -0
- package/dist/generated_clients.js +23 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/just_bash_commands.d.ts +19 -0
- package/dist/just_bash_commands.js +41 -0
- package/dist/just_bash_host.d.ts +1 -8
- package/dist/just_bash_host.js +10 -37
- package/dist/local_tool_bridge.d.ts +7 -0
- package/dist/local_tool_bridge.js +52 -0
- package/dist/local_tools.js +2 -3
- package/dist/native.d.ts +1 -0
- package/dist/native_client.js +6 -5
- package/dist/rust_core.d.ts +1 -0
- package/dist/rust_core.js +3 -0
- package/dist/tool_specs.d.ts +7 -0
- package/dist/tool_specs.js +52 -0
- package/dist/transforms.d.ts +28 -0
- package/dist/transforms.js +78 -0
- package/native/index.d.ts +2 -0
- package/native/index.js +53 -52
- package/native/index.linux-x64-gnu.node +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -277,7 +277,7 @@ try {
|
|
|
277
277
|
|
|
278
278
|
The package root now exposes the Rust-backed `CompressorClient` as the primary SDK surface on the migration trunk.
|
|
279
279
|
|
|
280
|
-
Just Bash mode
|
|
280
|
+
Just Bash mode lets language hosts register backend MCP tools as Just Bash commands:
|
|
281
281
|
|
|
282
282
|
```ts
|
|
283
283
|
const proxy = await new CompressorClient({ servers, mode: "bash" }).connect();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ClientArtifactKind, type ToolSpec } from "./rust_core.js";
|
|
2
|
+
export interface GeneratedClientArtifactsResult {
|
|
3
|
+
paths: string[];
|
|
4
|
+
files: Record<string, string>;
|
|
5
|
+
environment: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface GenerateClientFromBridgeOptions {
|
|
8
|
+
kind: ClientArtifactKind;
|
|
9
|
+
name: string;
|
|
10
|
+
bridgeUrl: string;
|
|
11
|
+
token: string;
|
|
12
|
+
tools: ToolSpec[];
|
|
13
|
+
outputDir: string;
|
|
14
|
+
sessionPid?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function generateClientFromBridge(options: GenerateClientFromBridgeOptions): GeneratedClientArtifactsResult;
|
|
17
|
+
export declare function generatedClientEnvironment(kind: ClientArtifactKind, outputDir: string): Record<string, string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { generateClientArtifactFiles, generateClientArtifacts, } from "./rust_core.js";
|
|
2
|
+
export function generateClientFromBridge(options) {
|
|
3
|
+
const config = {
|
|
4
|
+
cliName: options.name,
|
|
5
|
+
bridgeUrl: options.bridgeUrl,
|
|
6
|
+
token: options.token,
|
|
7
|
+
tools: options.tools,
|
|
8
|
+
outputDir: options.outputDir,
|
|
9
|
+
sessionPid: options.sessionPid ?? 0,
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
paths: generateClientArtifacts(options.kind, config),
|
|
13
|
+
files: generateClientArtifactFiles(options.kind, config),
|
|
14
|
+
environment: generatedClientEnvironment(options.kind, options.outputDir),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function generatedClientEnvironment(kind, outputDir) {
|
|
18
|
+
if (kind === "python")
|
|
19
|
+
return { PYTHONPATH: outputDir };
|
|
20
|
+
if (kind === "cli")
|
|
21
|
+
return { PATH: `${outputDir}:$PATH` };
|
|
22
|
+
return {};
|
|
23
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ export * from "./rust_core.js";
|
|
|
4
4
|
export * from "./just_bash_host.js";
|
|
5
5
|
export * from "./adapters.js";
|
|
6
6
|
export * from "./local_tools.js";
|
|
7
|
+
export * from "./generated_clients.js";
|
|
8
|
+
export * from "./just_bash_commands.js";
|
|
9
|
+
export * from "./local_tool_bridge.js";
|
|
10
|
+
export * from "./tool_specs.js";
|
|
11
|
+
export * from "./transforms.js";
|
|
7
12
|
export { interpolateString, interpolateRecord, interpolateMCPConfig, parseServerConfigJson, normalizeConfigServer, } from "./config.js";
|
|
8
13
|
export type { BackendConfig, HttpBackendConfig, JsonConfigServerEntry, MCPConfigShape, SseBackendConfig, StdioBackendConfig, } from "./types.js";
|
|
9
14
|
export { type GeneratedClientKind, type GeneratedCodeClient, type JustBashCommand, type JustBashProvider, type CompressorClientOptions, type NativeCompressorMode as CompressorMode, type NativeServersInput as ServersInput, CompressorClient, CompressorProxy, type NormalizedBackendConfig, type ProxyResponse, type ProxyTool, normalizeServers, } from "./native_client.js";
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,10 @@ export * from "./rust_core.js";
|
|
|
4
4
|
export * from "./just_bash_host.js";
|
|
5
5
|
export * from "./adapters.js";
|
|
6
6
|
export * from "./local_tools.js";
|
|
7
|
+
export * from "./generated_clients.js";
|
|
8
|
+
export * from "./just_bash_commands.js";
|
|
9
|
+
export * from "./local_tool_bridge.js";
|
|
10
|
+
export * from "./tool_specs.js";
|
|
11
|
+
export * from "./transforms.js";
|
|
7
12
|
export { interpolateString, interpolateRecord, interpolateMCPConfig, parseServerConfigJson, normalizeConfigServer, } from "./config.js";
|
|
8
13
|
export { CompressorClient, CompressorProxy, normalizeServers, } from "./native_client.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Command } from "just-bash";
|
|
2
|
+
import { type ToolSpec } from "./rust_core.js";
|
|
3
|
+
export interface JustBashCommandRegistration {
|
|
4
|
+
providerName: string;
|
|
5
|
+
commandName: string;
|
|
6
|
+
backendToolName: string;
|
|
7
|
+
helpToolName: string;
|
|
8
|
+
command: Command;
|
|
9
|
+
}
|
|
10
|
+
export interface JustBashCommandSource {
|
|
11
|
+
providerName: string;
|
|
12
|
+
commandName: string;
|
|
13
|
+
backendToolName: string;
|
|
14
|
+
helpToolName: string;
|
|
15
|
+
tool: ToolSpec;
|
|
16
|
+
invoke(input: Record<string, unknown>): Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createJustBashCommandRegistrations(sources: JustBashCommandSource[]): JustBashCommandRegistration[];
|
|
19
|
+
export declare function installJustBashRegistrations(bash: unknown, registrations: JustBashCommandRegistration[]): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineCommand } from "just-bash";
|
|
2
|
+
import { parseToolArgv } from "./rust_core.js";
|
|
3
|
+
import { normalizeStructuredArgValues } from "./tool_specs.js";
|
|
4
|
+
export function createJustBashCommandRegistrations(sources) {
|
|
5
|
+
return sources.map((source) => ({
|
|
6
|
+
providerName: source.providerName,
|
|
7
|
+
commandName: source.commandName,
|
|
8
|
+
backendToolName: source.backendToolName,
|
|
9
|
+
helpToolName: source.helpToolName,
|
|
10
|
+
command: defineCommand(source.commandName, async (args) => {
|
|
11
|
+
try {
|
|
12
|
+
const parsedInput = parseToolArgv(source.tool, args);
|
|
13
|
+
const toolInput = normalizeStructuredArgValues(source.tool.inputSchema, parsedInput);
|
|
14
|
+
return output(await source.invoke(toolInput));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return failure(error);
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
export function installJustBashRegistrations(bash, registrations) {
|
|
23
|
+
const host = bash;
|
|
24
|
+
if (typeof host.registerCommand === "function") {
|
|
25
|
+
for (const registration of registrations)
|
|
26
|
+
host.registerCommand(registration.command);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
host.customCommands = [
|
|
30
|
+
...(host.customCommands ?? []),
|
|
31
|
+
...registrations.map((registration) => registration.command),
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function output(stdout) {
|
|
36
|
+
return { stdout: `${stdout}\n`, stderr: "", exitCode: 0 };
|
|
37
|
+
}
|
|
38
|
+
function failure(error) {
|
|
39
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
40
|
+
return { stdout: "", stderr: `${message}\n`, exitCode: 1 };
|
|
41
|
+
}
|
package/dist/just_bash_host.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type { Command } from "just-bash";
|
|
2
1
|
import type { CompressorProxy } from "./native_client.js";
|
|
3
|
-
|
|
4
|
-
providerName: string;
|
|
5
|
-
commandName: string;
|
|
6
|
-
backendToolName: string;
|
|
7
|
-
helpToolName: string;
|
|
8
|
-
command: Command;
|
|
9
|
-
}
|
|
2
|
+
import { type JustBashCommandRegistration } from "./just_bash_commands.js";
|
|
10
3
|
export declare function installJustBashCommands(bash: unknown, proxy: CompressorProxy): JustBashCommandRegistration[];
|
|
11
4
|
export declare function createJustBashCommands(proxy: CompressorProxy): JustBashCommandRegistration[];
|
package/dist/just_bash_host.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { parseToolArgv } from "./rust_core.js";
|
|
1
|
+
import { createJustBashCommandRegistrations, installJustBashRegistrations, } from "./just_bash_commands.js";
|
|
3
2
|
function commandToToolSpec(command) {
|
|
4
3
|
return {
|
|
5
4
|
name: command.backendToolName,
|
|
@@ -7,57 +6,31 @@ function commandToToolSpec(command) {
|
|
|
7
6
|
inputSchema: command.inputSchema,
|
|
8
7
|
};
|
|
9
8
|
}
|
|
10
|
-
function output(text) {
|
|
11
|
-
return { stdout: text, stderr: "", exitCode: 0 };
|
|
12
|
-
}
|
|
13
|
-
function failure(error) {
|
|
14
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
15
|
-
return { stdout: "", stderr: `${message}\n`, exitCode: 1 };
|
|
16
|
-
}
|
|
17
9
|
export function installJustBashCommands(bash, proxy) {
|
|
18
10
|
const registrations = createJustBashCommands(proxy);
|
|
19
|
-
|
|
20
|
-
if (typeof host.registerCommand === "function") {
|
|
21
|
-
for (const registration of registrations) {
|
|
22
|
-
host.registerCommand(registration.command);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
host.customCommands = [
|
|
27
|
-
...(host.customCommands ?? []),
|
|
28
|
-
...registrations.map((item) => item.command),
|
|
29
|
-
];
|
|
30
|
-
}
|
|
11
|
+
installJustBashRegistrations(bash, registrations);
|
|
31
12
|
return registrations;
|
|
32
13
|
}
|
|
33
14
|
export function createJustBashCommands(proxy) {
|
|
34
15
|
const rawNames = proxy.justBashProviders.flatMap((provider) => provider.tools.map((tool) => tool.commandName));
|
|
35
16
|
const duplicateNames = new Set(rawNames.filter((name, index) => rawNames.indexOf(name) !== index));
|
|
36
|
-
const
|
|
17
|
+
const sources = [];
|
|
37
18
|
for (const provider of proxy.justBashProviders) {
|
|
38
19
|
for (const tool of provider.tools) {
|
|
39
|
-
const
|
|
40
|
-
const registeredCommandName = duplicateNames.has(tool.commandName)
|
|
20
|
+
const commandName = duplicateNames.has(tool.commandName)
|
|
41
21
|
? `${provider.providerName}_${tool.commandName}`
|
|
42
22
|
: tool.commandName;
|
|
43
|
-
|
|
23
|
+
sources.push({
|
|
44
24
|
providerName: provider.providerName,
|
|
45
|
-
commandName
|
|
25
|
+
commandName,
|
|
46
26
|
backendToolName: tool.backendToolName,
|
|
47
27
|
helpToolName: provider.helpToolName,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return output(await proxy.invoke(tool.backendToolName, toolInput, {
|
|
52
|
-
server: provider.providerName,
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return failure(error);
|
|
57
|
-
}
|
|
28
|
+
tool: commandToToolSpec(tool),
|
|
29
|
+
invoke: (toolInput) => proxy.invoke(tool.backendToolName, toolInput, {
|
|
30
|
+
server: provider.providerName,
|
|
58
31
|
}),
|
|
59
32
|
});
|
|
60
33
|
}
|
|
61
34
|
}
|
|
62
|
-
return
|
|
35
|
+
return createJustBashCommandRegistrations(sources);
|
|
63
36
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { stringifyToolResult } from "./tool_specs.js";
|
|
2
|
+
export async function startLocalToolBridge(tools) {
|
|
3
|
+
const http = await import("node:http");
|
|
4
|
+
const token = crypto.randomUUID();
|
|
5
|
+
const server = http.createServer(async (request, response) => {
|
|
6
|
+
try {
|
|
7
|
+
if (request.method !== "POST" || request.url !== "/exec") {
|
|
8
|
+
response.writeHead(404).end("not found");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (request.headers.authorization !== `Bearer ${token}`) {
|
|
12
|
+
response.writeHead(401).end("unauthorized");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const body = JSON.parse(await readRequestBody(request));
|
|
16
|
+
const toolName = String(body.tool_name ?? "");
|
|
17
|
+
const tool = tools[toolName];
|
|
18
|
+
if (!tool) {
|
|
19
|
+
response
|
|
20
|
+
.writeHead(404, { "content-type": "application/json" })
|
|
21
|
+
.end(JSON.stringify({ error: `Tool not found: ${toolName}` }));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const result = await tool.execute(body.tool_input ?? {});
|
|
25
|
+
response
|
|
26
|
+
.writeHead(200, { "content-type": "application/json" })
|
|
27
|
+
.end(JSON.stringify({ result: stringifyToolResult(result) }));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
response
|
|
31
|
+
.writeHead(500, { "content-type": "application/json" })
|
|
32
|
+
.end(JSON.stringify({ error: error instanceof Error ? error.message : String(error) }));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
36
|
+
const address = server.address();
|
|
37
|
+
if (!address || typeof address === "string")
|
|
38
|
+
throw new Error("Failed to bind local tool bridge");
|
|
39
|
+
return {
|
|
40
|
+
bridgeUrl: `http://127.0.0.1:${address.port}`,
|
|
41
|
+
token,
|
|
42
|
+
close: () => server.close(),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function readRequestBody(request) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
const chunks = [];
|
|
48
|
+
request.on("data", (chunk) => chunks.push(chunk));
|
|
49
|
+
request.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
50
|
+
request.on("error", reject);
|
|
51
|
+
});
|
|
52
|
+
}
|
package/dist/local_tools.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { compressToolListing, formatToolSchemaResponse } from "./rust_core.js";
|
|
2
|
+
import { stringifyToolResult } from "./tool_specs.js";
|
|
2
3
|
function wrapperName(prefix, name) {
|
|
3
4
|
return prefix ? `${prefix}_${name}` : name;
|
|
4
5
|
}
|
|
@@ -12,9 +13,7 @@ function asJsonSchema(schema, adapter) {
|
|
|
12
13
|
throw new Error("Tool inputSchema must be a JSON schema object or schemaAdapter must be provided");
|
|
13
14
|
}
|
|
14
15
|
function normalizeResult(value, toonify) {
|
|
15
|
-
|
|
16
|
-
return value;
|
|
17
|
-
const json = JSON.stringify(value);
|
|
16
|
+
const json = stringifyToolResult(value);
|
|
18
17
|
if (!toonify)
|
|
19
18
|
return json;
|
|
20
19
|
// Keep local compression dependency-light for now. Runtime MCP proxy paths use
|
package/dist/native.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface NativeCore {
|
|
|
8
8
|
formatToolSchemaResponseJson(toolJson: string): string;
|
|
9
9
|
parseToolArgvJson(toolJson: string, argvJson: string): string;
|
|
10
10
|
generateClientArtifactsJson(kind: string, configJson: string): string;
|
|
11
|
+
generateClientArtifactFilesJson(kind: string, configJson: string): string;
|
|
11
12
|
normalizeServersJson(serversJson: string): string;
|
|
12
13
|
parseMcpConfigJson(configJson: string): string;
|
|
13
14
|
rememberOauthBackendJson(backendUri: string, backendName: string, storeDir: string): void;
|
package/dist/native_client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { generateClientFromBridge } from "./generated_clients.js";
|
|
2
|
+
import { normalizeSdkServers, startCompressedSession, startCompressedSessionWithAuthProviders, startCompressedSessionFromMcpConfig, } from "./rust_core.js";
|
|
2
3
|
function providerFromConfig(config) {
|
|
3
4
|
const provider = config.authProvider ?? config.auth_provider;
|
|
4
5
|
if (provider === undefined) {
|
|
@@ -258,8 +259,9 @@ export class CompressorProxy {
|
|
|
258
259
|
}
|
|
259
260
|
writeClient(kind, outputDir, options = {}) {
|
|
260
261
|
const info = this.info();
|
|
261
|
-
return
|
|
262
|
-
|
|
262
|
+
return generateClientFromBridge({
|
|
263
|
+
kind,
|
|
264
|
+
name: options.name ?? this.defaultServer ?? "mcp",
|
|
263
265
|
bridgeUrl: info.bridge_url,
|
|
264
266
|
token: info.token,
|
|
265
267
|
tools: info.backend_tools.map((tool) => ({
|
|
@@ -268,8 +270,7 @@ export class CompressorProxy {
|
|
|
268
270
|
inputSchema: tool.input_schema,
|
|
269
271
|
})),
|
|
270
272
|
outputDir,
|
|
271
|
-
|
|
272
|
-
});
|
|
273
|
+
}).paths;
|
|
273
274
|
}
|
|
274
275
|
writeCodeClient(options) {
|
|
275
276
|
const files = this.writeClient(options.language, options.outputDir, { name: options.name });
|
package/dist/rust_core.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface ClientGeneratorConfig {
|
|
|
17
17
|
outputDir: string;
|
|
18
18
|
}
|
|
19
19
|
export declare function generateClientArtifacts(kind: ClientArtifactKind, config: ClientGeneratorConfig): string[];
|
|
20
|
+
export declare function generateClientArtifactFiles(kind: ClientArtifactKind, config: ClientGeneratorConfig): Record<string, string>;
|
|
20
21
|
export interface BackendConfig {
|
|
21
22
|
name: string;
|
|
22
23
|
commandOrUrl: string;
|
package/dist/rust_core.js
CHANGED
|
@@ -31,6 +31,9 @@ function toNativeGeneratorConfig(config) {
|
|
|
31
31
|
export function generateClientArtifacts(kind, config) {
|
|
32
32
|
return JSON.parse(loadNativeCore().generateClientArtifactsJson(kind, stringify(toNativeGeneratorConfig(config))));
|
|
33
33
|
}
|
|
34
|
+
export function generateClientArtifactFiles(kind, config) {
|
|
35
|
+
return JSON.parse(loadNativeCore().generateClientArtifactFilesJson(kind, stringify(toNativeGeneratorConfig(config))));
|
|
36
|
+
}
|
|
34
37
|
export class CompressedSession {
|
|
35
38
|
nativeSession;
|
|
36
39
|
constructor(nativeSession) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutableTool } from "./adapters.js";
|
|
2
|
+
import type { ToolSpec } from "./rust_core.js";
|
|
3
|
+
export declare function executableToolToSpec(name: string, tool: ExecutableTool): ToolSpec;
|
|
4
|
+
export declare function executableToolsToSpecs(tools: Record<string, ExecutableTool>): ToolSpec[];
|
|
5
|
+
export declare function normalizeServerName(name: string | undefined): string;
|
|
6
|
+
export declare function stringifyToolResult(value: unknown): string;
|
|
7
|
+
export declare function normalizeStructuredArgValues(schema: Record<string, unknown>, input: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function executableToolToSpec(name, tool) {
|
|
2
|
+
return {
|
|
3
|
+
name,
|
|
4
|
+
description: tool.description,
|
|
5
|
+
inputSchema: tool.inputSchema,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function executableToolsToSpecs(tools) {
|
|
9
|
+
return Object.entries(tools).map(([name, tool]) => executableToolToSpec(name, tool));
|
|
10
|
+
}
|
|
11
|
+
export function normalizeServerName(name) {
|
|
12
|
+
const value = name ?? "tools";
|
|
13
|
+
const normalized = value
|
|
14
|
+
.replace(/[^A-Za-z0-9_]+/gu, "_")
|
|
15
|
+
.replace(/^_+|_+$/gu, "")
|
|
16
|
+
.toLowerCase();
|
|
17
|
+
return normalized || "tools";
|
|
18
|
+
}
|
|
19
|
+
export function stringifyToolResult(value) {
|
|
20
|
+
return typeof value === "string" ? value : JSON.stringify(value);
|
|
21
|
+
}
|
|
22
|
+
export function normalizeStructuredArgValues(schema, input) {
|
|
23
|
+
const properties = schema.properties;
|
|
24
|
+
if (!properties || typeof properties !== "object" || Array.isArray(properties))
|
|
25
|
+
return input;
|
|
26
|
+
const normalized = { ...input };
|
|
27
|
+
for (const [key, propertySchema] of Object.entries(properties)) {
|
|
28
|
+
const value = normalized[key];
|
|
29
|
+
if (typeof value !== "string")
|
|
30
|
+
continue;
|
|
31
|
+
if (!expectsStructuredValue(propertySchema))
|
|
32
|
+
continue;
|
|
33
|
+
const trimmed = value.trim();
|
|
34
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("["))
|
|
35
|
+
continue;
|
|
36
|
+
try {
|
|
37
|
+
normalized[key] = JSON.parse(trimmed);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Leave the original string so downstream validation/error handling can report it.
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return normalized;
|
|
44
|
+
}
|
|
45
|
+
function expectsStructuredValue(schema) {
|
|
46
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema))
|
|
47
|
+
return false;
|
|
48
|
+
const type = schema.type;
|
|
49
|
+
if (type === "object" || type === "array")
|
|
50
|
+
return true;
|
|
51
|
+
return Array.isArray(type) && (type.includes("object") || type.includes("array"));
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExecutableTool } from "./adapters.js";
|
|
2
|
+
import { type GeneratedClientArtifactsResult } from "./generated_clients.js";
|
|
3
|
+
import { type JustBashCommandRegistration } from "./just_bash_commands.js";
|
|
4
|
+
export interface TransformToolOptions {
|
|
5
|
+
serverName?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TransformToolsForJustBashOptions extends TransformToolOptions {
|
|
8
|
+
bash: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface JustBashTransformResult {
|
|
11
|
+
tools: Record<string, ExecutableTool>;
|
|
12
|
+
registrations: JustBashCommandRegistration[];
|
|
13
|
+
}
|
|
14
|
+
export type CodeTransformLanguage = "python" | "typescript";
|
|
15
|
+
export interface TransformToolsForCodeModeOptions extends TransformToolOptions {
|
|
16
|
+
language: CodeTransformLanguage;
|
|
17
|
+
outputDir?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TransformToolsForCliModeOptions extends TransformToolOptions {
|
|
20
|
+
outputDir?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GeneratedToolTransformResult extends GeneratedClientArtifactsResult {
|
|
23
|
+
tools: Record<string, ExecutableTool>;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function transformToolsForJustBash(tools: Record<string, ExecutableTool>, options: TransformToolsForJustBashOptions): JustBashTransformResult;
|
|
27
|
+
export declare function transformToolsForCodeMode(tools: Record<string, ExecutableTool>, options: TransformToolsForCodeModeOptions): Promise<GeneratedToolTransformResult>;
|
|
28
|
+
export declare function transformToolsForCliMode(tools: Record<string, ExecutableTool>, options?: TransformToolsForCliModeOptions): Promise<GeneratedToolTransformResult>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { generateClientFromBridge, } from "./generated_clients.js";
|
|
2
|
+
import { createJustBashCommandRegistrations, installJustBashRegistrations, } from "./just_bash_commands.js";
|
|
3
|
+
import { startLocalToolBridge } from "./local_tool_bridge.js";
|
|
4
|
+
import { executableToolToSpec, executableToolsToSpecs, normalizeServerName, stringifyToolResult, } from "./tool_specs.js";
|
|
5
|
+
export function transformToolsForJustBash(tools, options) {
|
|
6
|
+
const serverName = normalizeServerName(options.serverName);
|
|
7
|
+
const registrations = createJustBashCommandRegistrations(Object.entries(tools).map(([name, tool]) => justBashSource(serverName, name, tool)));
|
|
8
|
+
installJustBashRegistrations(options.bash, registrations);
|
|
9
|
+
return {
|
|
10
|
+
registrations,
|
|
11
|
+
tools: helpTools({
|
|
12
|
+
serverName,
|
|
13
|
+
mode: "Just Bash",
|
|
14
|
+
summary: `Backend tools have been installed as Just Bash commands for ${serverName}.`,
|
|
15
|
+
lines: registrations.map((registration) => `- ${registration.commandName}`),
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export async function transformToolsForCodeMode(tools, options) {
|
|
20
|
+
const serverName = normalizeServerName(options.serverName);
|
|
21
|
+
return generatedTransform(tools, {
|
|
22
|
+
kind: options.language,
|
|
23
|
+
serverName,
|
|
24
|
+
outputDir: options.outputDir ?? "./dist",
|
|
25
|
+
modeLabel: options.language === "python" ? "Python Code Mode" : "TypeScript Code Mode",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export async function transformToolsForCliMode(tools, options = {}) {
|
|
29
|
+
const serverName = normalizeServerName(options.serverName);
|
|
30
|
+
return generatedTransform(tools, {
|
|
31
|
+
kind: "cli",
|
|
32
|
+
serverName,
|
|
33
|
+
outputDir: options.outputDir ?? "./dist",
|
|
34
|
+
modeLabel: "CLI Mode",
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function justBashSource(serverName, name, tool) {
|
|
38
|
+
return {
|
|
39
|
+
providerName: serverName,
|
|
40
|
+
commandName: `${serverName}_${name}`,
|
|
41
|
+
backendToolName: name,
|
|
42
|
+
helpToolName: `${serverName}_help`,
|
|
43
|
+
tool: executableToolToSpec(name, tool),
|
|
44
|
+
invoke: async (input) => stringifyToolResult(await tool.execute(input)),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function generatedTransform(tools, options) {
|
|
48
|
+
const bridge = await startLocalToolBridge(tools);
|
|
49
|
+
const generated = generateClientFromBridge({
|
|
50
|
+
kind: options.kind,
|
|
51
|
+
name: options.serverName,
|
|
52
|
+
bridgeUrl: bridge.bridgeUrl,
|
|
53
|
+
token: bridge.token,
|
|
54
|
+
tools: executableToolsToSpecs(tools),
|
|
55
|
+
outputDir: options.outputDir,
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
...generated,
|
|
59
|
+
tools: helpTools({
|
|
60
|
+
serverName: options.serverName,
|
|
61
|
+
mode: options.modeLabel,
|
|
62
|
+
summary: `${options.modeLabel} generated client files for ${options.serverName}.`,
|
|
63
|
+
lines: Object.keys(generated.files).map((file) => `- ${options.outputDir}/${file}`),
|
|
64
|
+
}),
|
|
65
|
+
close: () => bridge.close(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function helpTools(options) {
|
|
69
|
+
const name = `${options.serverName}_help`;
|
|
70
|
+
return {
|
|
71
|
+
[name]: {
|
|
72
|
+
name,
|
|
73
|
+
description: `Show help for ${options.mode} tools generated from ${options.serverName}.`,
|
|
74
|
+
inputSchema: { type: "object", properties: {} },
|
|
75
|
+
execute: async () => [options.summary, "", ...options.lines].join("\n"),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
package/native/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare function compressToolListingJson(level: string, toolsJson: string
|
|
|
12
12
|
|
|
13
13
|
export declare function formatToolSchemaResponseJson(toolJson: string): string
|
|
14
14
|
|
|
15
|
+
export declare function generateClientArtifactFilesJson(kind: string, configJson: string): string
|
|
16
|
+
|
|
15
17
|
export declare function generateClientArtifactsJson(kind: string, configJson: string): string
|
|
16
18
|
|
|
17
19
|
export declare function listOauthCredentialsJson(): string
|
package/native/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@atlassian/mcp-compressor-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@atlassian/mcp-compressor-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@atlassian/mcp-compressor-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@atlassian/mcp-compressor-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@atlassian/mcp-compressor-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@atlassian/mcp-compressor-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@atlassian/mcp-compressor-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@atlassian/mcp-compressor-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@atlassian/mcp-compressor-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@atlassian/mcp-compressor-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@atlassian/mcp-compressor-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@atlassian/mcp-compressor-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@atlassian/mcp-compressor-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@atlassian/mcp-compressor-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@atlassian/mcp-compressor-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@atlassian/mcp-compressor-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@atlassian/mcp-compressor-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@atlassian/mcp-compressor-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@atlassian/mcp-compressor-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@atlassian/mcp-compressor-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@atlassian/mcp-compressor-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@atlassian/mcp-compressor-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@atlassian/mcp-compressor-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@atlassian/mcp-compressor-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@atlassian/mcp-compressor-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@atlassian/mcp-compressor-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@atlassian/mcp-compressor-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.17.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.17.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -580,6 +580,7 @@ module.exports.NativeCompressedSession = nativeBinding.NativeCompressedSession
|
|
|
580
580
|
module.exports.clearOauthCredentialsJson = nativeBinding.clearOauthCredentialsJson
|
|
581
581
|
module.exports.compressToolListingJson = nativeBinding.compressToolListingJson
|
|
582
582
|
module.exports.formatToolSchemaResponseJson = nativeBinding.formatToolSchemaResponseJson
|
|
583
|
+
module.exports.generateClientArtifactFilesJson = nativeBinding.generateClientArtifactFilesJson
|
|
583
584
|
module.exports.generateClientArtifactsJson = nativeBinding.generateClientArtifactsJson
|
|
584
585
|
module.exports.listOauthCredentialsJson = nativeBinding.listOauthCredentialsJson
|
|
585
586
|
module.exports.normalizeServersJson = nativeBinding.normalizeServersJson
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/mcp-compressor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "TypeScript MCP server wrapper for reducing tokens consumed by MCP tools.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/atlassian-labs/mcp-compressor",
|