@atlassian/mcp-compressor 0.33.2 → 0.34.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.
@@ -29,15 +29,21 @@ export function createJustBashCommandRegistrations(sources) {
29
29
  }
30
30
  const source = bySubcommand.get(subcommand);
31
31
  if (source === undefined) {
32
- throw new Error(`Unknown ${providerName} subcommand: ${subcommand}`);
32
+ return usageFailure(`parse error: unknown subcommand: ${subcommand}`, providerName);
33
33
  }
34
34
  // Per-subcommand help must match the generated CLI's rich `--help`
35
35
  // output, so render it from the shared Rust renderer.
36
36
  if (toolArgs.includes("--help") || toolArgs.includes("-h")) {
37
37
  return output(renderCliSubcommandHelp(providerName, source.tool));
38
38
  }
39
- const parsedInput = parseToolArgv(source.tool, toolArgs);
40
- const toolInput = normalizeStructuredArgValues(source.tool.inputSchema, parsedInput);
39
+ let toolInput;
40
+ try {
41
+ const parsedInput = parseToolArgv(source.tool, toolArgs);
42
+ toolInput = normalizeStructuredArgValues(source.tool.inputSchema, parsedInput);
43
+ }
44
+ catch (error) {
45
+ return usageFailure(errorMessage(error), `${providerName} ${subcommand}`);
46
+ }
41
47
  return output(await source.invoke(toolInput));
42
48
  }
43
49
  catch (error) {
@@ -63,7 +69,21 @@ export function installJustBashRegistrations(bash, registrations) {
63
69
  function output(stdout) {
64
70
  return { stdout: `${stdout}\n`, stderr: "", exitCode: 0 };
65
71
  }
72
+ function errorMessage(error) {
73
+ return error instanceof Error ? error.message : String(error);
74
+ }
75
+ /** A failed tool call: the tool's own message, exit 1. */
66
76
  function failure(error) {
67
- const message = error instanceof Error ? error.message : String(error);
68
- return { stdout: "", stderr: `${message}\n`, exitCode: 1 };
77
+ return { stdout: "", stderr: `${errorMessage(error)}\n`, exitCode: 1 };
78
+ }
79
+ /**
80
+ * A malformed invocation, reported exactly like the generated CLI script:
81
+ * the parser's message, a pointer to `--help`, and exit 2.
82
+ */
83
+ function usageFailure(message, helpCommand) {
84
+ return {
85
+ stdout: "",
86
+ stderr: `${message}\nRun '${helpCommand} --help' for usage.\n`,
87
+ exitCode: 2,
88
+ };
69
89
  }
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/mcp-compressor",
3
- "version": "0.33.2",
3
+ "version": "0.34.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",