@abapify/adt-mcp 0.4.32 → 0.4.34

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as startHttpServer } from "../server-9xGyx-9K.mjs";
2
+ import { n as startHttpServer } from "../server-ClzRW10R.mjs";
3
3
  import { loadConfig } from "@abapify/adt-config";
4
4
 
5
5
  // src/lib/http/adt-config-loader.ts
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as createMcpServer } from "../server-CrSNZGua.mjs";
2
+ import { t as createMcpServer } from "../server-BgM8hx8V.mjs";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
 
5
5
  // src/bin/adt-mcp.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { c as operationClassForMcpTool, i as assertMcpToolIsClassified, l as resolveObjectUri, n as registerTools, r as MCP_TOOL_SCOPE_CATALOGUE, s as isMcpToolAllowed, t as createMcpServer } from "./server-CrSNZGua.mjs";
2
- import { a as parseSafeExecutePolicy, c as createSessionRegistry, i as parseDelegatedAssistantReadPolicy, n as startHttpServer, o as parseScopedAdtInvocationPolicy, r as createMcpInvocationVerifier, s as loadMultiSystemConfig, t as createHttpMcpHandler } from "./server-9xGyx-9K.mjs";
1
+ import { c as operationClassForMcpTool, i as assertMcpToolIsClassified, l as resolveObjectUri, n as registerTools, r as MCP_TOOL_SCOPE_CATALOGUE, s as isMcpToolAllowed, t as createMcpServer } from "./server-BgM8hx8V.mjs";
2
+ import { a as parseSafeExecutePolicy, c as createSessionRegistry, i as parseDelegatedAssistantReadPolicy, n as startHttpServer, o as parseScopedAdtInvocationPolicy, r as createMcpInvocationVerifier, s as loadMultiSystemConfig, t as createHttpMcpHandler } from "./server-ClzRW10R.mjs";
3
3
 
4
4
  // src/lib/session/destination-registry.ts
5
5
  const DEFAULT_TTL_MS = 18e5;
@@ -16,7 +16,7 @@ import { AdtFlowError, createAdtFlowDependencies, createAdtFlowService, flowConf
16
16
  import { loadConfig } from "@abapify/adt-config";
17
17
  import { getFormatPlugin } from "@abapify/adt-plugin";
18
18
  import { lstat, realpath } from "node:fs/promises";
19
- import { isAbsolute, relative, resolve, sep } from "node:path";
19
+ import { isAbsolute, normalize, relative, resolve, sep } from "node:path";
20
20
  import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
21
21
 
22
22
  // src/lib/tools/shared-schemas.ts
@@ -6595,12 +6595,24 @@ function registerCtsTransportSourceManifestTool(server, ctx) {
6595
6595
 
6596
6596
  // src/lib/flow-workspace.ts
6597
6597
  function isWithin(root, candidate) {
6598
- const path = relative(root, candidate);
6598
+ const normalizedRoot = normalize(root);
6599
+ const normalizedCandidate = normalize(candidate);
6600
+ if (normalizedCandidate === normalizedRoot) return true;
6601
+ if (!normalizedCandidate.startsWith(normalizedRoot + sep)) {
6602
+ const rel = relative(normalizedRoot, normalizedCandidate);
6603
+ if (rel.startsWith("..") || isAbsolute(rel)) return false;
6604
+ return !rel.split(sep).includes("..");
6605
+ }
6606
+ const path = relative(normalizedRoot, normalizedCandidate);
6599
6607
  return path === "" || !isAbsolute(path) && !path.split(sep).filter(Boolean).includes("..");
6600
6608
  }
6601
6609
  async function resolveFlowWorkspaceRoot(requested, allowedRoots = [process.cwd()]) {
6602
- if (!isAbsolute(requested)) throw new Error("workspaceRoot must be absolute.");
6603
- const requestedPath = resolve(requested);
6610
+ if (typeof requested !== "string" || requested.length === 0) throw new Error("workspaceRoot must be a non-empty string.");
6611
+ const normalizedInput = normalize(requested);
6612
+ if (normalizedInput.split(sep).includes("..")) throw new Error("workspaceRoot must not contain path traversal sequences.");
6613
+ if (!isAbsolute(requested) && !isAbsolute(normalizedInput)) throw new Error("workspaceRoot must be absolute.");
6614
+ const requestedPath = resolve(normalizedInput);
6615
+ if (normalize(requestedPath).split(sep).includes("..")) throw new Error("workspaceRoot must not contain path traversal sequences.");
6604
6616
  const requestedStats = await lstat(requestedPath);
6605
6617
  if (!requestedStats.isDirectory() || requestedStats.isSymbolicLink()) throw new Error("workspaceRoot must be a real directory (no symlinks).");
6606
6618
  const candidate = await realpath(requestedPath);
@@ -7207,4 +7219,4 @@ function createMcpServer(options) {
7207
7219
  }
7208
7220
 
7209
7221
  export { isMcpDestinationKey as a, operationClassForMcpTool as c, assertMcpToolIsClassified as i, resolveObjectUri as l, registerTools as n, isMcpOperationClass as o, MCP_TOOL_SCOPE_CATALOGUE as r, isMcpToolAllowed as s, createMcpServer as t };
7210
- //# sourceMappingURL=server-CrSNZGua.mjs.map
7222
+ //# sourceMappingURL=server-BgM8hx8V.mjs.map