@tool-bridge/server 0.26.0 → 0.26.1

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/admin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BootstrapStateStore,
4
4
  package_default
5
- } from "./chunk-REAPBHVJ.js";
5
+ } from "./chunk-6F7TBJQ2.js";
6
6
  import {
7
7
  httpsReleaseUrl,
8
8
  pluginImageSchema
@@ -216,7 +216,7 @@ var BootstrapStateStore = class {
216
216
  // package.json
217
217
  var package_default = {
218
218
  name: "@tool-bridge/server",
219
- version: "0.26.0",
219
+ version: "0.26.1",
220
220
  description: "Self-hosted Tool Bridge Node server with PostgreSQL, S3 object storage and WebSocket device channels",
221
221
  type: "module",
222
222
  license: "MIT",
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  BootstrapStateStore,
12
12
  package_default
13
- } from "./chunk-REAPBHVJ.js";
13
+ } from "./chunk-6F7TBJQ2.js";
14
14
  import {
15
15
  createGuardedFetch
16
16
  } from "./chunk-NXLE6ZEK.js";
@@ -21199,7 +21199,7 @@ async function boundedText(message, limit) {
21199
21199
  reader.releaseLock();
21200
21200
  }
21201
21201
  }
21202
- function parameters(encoded, allowed) {
21202
+ function parameters(encoded, allowed, ignoreExtensions = false) {
21203
21203
  if (Buffer.byteLength(encoded) > MAX_REQUEST) throw new EndpointError("invalid_request", 413);
21204
21204
  if (encoded.startsWith("?")) throw new EndpointError("invalid_request");
21205
21205
  try {
@@ -21207,11 +21207,14 @@ function parameters(encoded, allowed) {
21207
21207
  } catch {
21208
21208
  throw new EndpointError("invalid_request");
21209
21209
  }
21210
- const params = new URLSearchParams(encoded);
21211
- const seen = /* @__PURE__ */ new Set();
21212
- for (const [name, value] of params) {
21213
- if (!allowed.includes(name) || seen.has(name) || !value && name !== "sk") throw new EndpointError("invalid_request");
21214
- seen.add(name);
21210
+ const params = new URLSearchParams();
21211
+ for (const [name, value] of new URLSearchParams(encoded)) {
21212
+ if (!allowed.includes(name)) {
21213
+ if (ignoreExtensions) continue;
21214
+ throw new EndpointError("invalid_request");
21215
+ }
21216
+ if (params.has(name) || !value && name !== "sk") throw new EndpointError("invalid_request");
21217
+ params.append(name, value);
21215
21218
  }
21216
21219
  return params;
21217
21220
  }
@@ -21311,14 +21314,14 @@ function createMcpOAuth(state, canonicalOrigin, fetchClientMetadata) {
21311
21314
  throw new EndpointError("access_denied", 403);
21312
21315
  }
21313
21316
  const search = new URL(request2.url).search;
21314
- const params = parameters(search.slice(1), authorizeFields);
21317
+ const params = parameters(search.slice(1), authorizeFields, true);
21315
21318
  checkBinding(params, resourceServerUrl.href);
21316
21319
  if (params.get("response_type") !== "code") throw new EndpointError("unsupported_response_type");
21317
21320
  if (params.get("code_challenge_method") !== "S256" || !/^[\w-]{43}$/.test(params.get("code_challenge") ?? "")) {
21318
21321
  throw new EndpointError("invalid_request");
21319
21322
  }
21320
21323
  if (params.has("state") && !/^[\x20-\x7e]+$/.test(params.get("state"))) throw new EndpointError("invalid_request");
21321
- const action = issuer + AUTHORIZE + search;
21324
+ const action = issuer + AUTHORIZE + "?" + params.toString();
21322
21325
  if (request2.method === "GET") return consentPage(action, MCP_OAUTH_REDIRECT_URI);
21323
21326
  const body = await form(request2, ["sk", "decision"]);
21324
21327
  if (body.get("decision") === "deny") return authorizationResponse(issuer, params, { error: "access_denied" });
package/dist/index.js CHANGED
@@ -19,11 +19,11 @@ import {
19
19
  createTbServer,
20
20
  probeS3ObjectStore,
21
21
  runtimeAppSettings
22
- } from "./chunk-CIPTWB3V.js";
22
+ } from "./chunk-FH7ST6SW.js";
23
23
  import "./chunk-U7PTOA3U.js";
24
24
  import {
25
25
  BootstrapStateStore
26
- } from "./chunk-REAPBHVJ.js";
26
+ } from "./chunk-6F7TBJQ2.js";
27
27
  import "./chunk-NXLE6ZEK.js";
28
28
  import "./chunk-6W5WJCKR.js";
29
29
  import "./chunk-4WDQGEOC.js";
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createManagedServer
4
- } from "./chunk-CIPTWB3V.js";
4
+ } from "./chunk-FH7ST6SW.js";
5
5
  import "./chunk-U7PTOA3U.js";
6
6
  import {
7
7
  package_default
8
- } from "./chunk-REAPBHVJ.js";
8
+ } from "./chunk-6F7TBJQ2.js";
9
9
  import "./chunk-NXLE6ZEK.js";
10
10
  import "./chunk-6W5WJCKR.js";
11
11
  import "./chunk-4WDQGEOC.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tool-bridge/server",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "Self-hosted Tool Bridge Node server with PostgreSQL, S3 object storage and WebSocket device channels",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -61,8 +61,8 @@
61
61
  "@types/proper-lockfile": "^4.1.4",
62
62
  "@types/negotiator": "^0.6.4",
63
63
  "@tool-bridge/app": "0.25.0",
64
- "@tool-bridge/plugins": "0.1.0",
65
- "@tool-bridge/core": "0.1.0"
64
+ "@tool-bridge/core": "0.1.0",
65
+ "@tool-bridge/plugins": "0.1.0"
66
66
  },
67
67
  "repository": {
68
68
  "type": "git",