catence 0.2.1-beta.22 → 0.2.1-beta.23

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.
@@ -3,7 +3,7 @@
3
3
  * Keep these values synchronized with release/manifest.json; release checks
4
4
  * deliberately reject drift before a package can be published.
5
5
  */
6
- export declare const CATENCE_RUNTIME_VERSION = "0.2.1-beta.22";
6
+ export declare const CATENCE_RUNTIME_VERSION = "0.2.1-beta.23";
7
7
  export declare const CATENCE_PROTOCOL_VERSION = 1;
8
8
  export type CatenceRuntimeCapabilities = {
9
9
  mcp: true;
@@ -3,7 +3,7 @@
3
3
  * Keep these values synchronized with release/manifest.json; release checks
4
4
  * deliberately reject drift before a package can be published.
5
5
  */
6
- export const CATENCE_RUNTIME_VERSION = '0.2.1-beta.22';
6
+ export const CATENCE_RUNTIME_VERSION = '0.2.1-beta.23';
7
7
  export const CATENCE_PROTOCOL_VERSION = 1;
8
8
  export function catenceRuntimeHealth() {
9
9
  return {
@@ -36,6 +36,7 @@ function logRequestCompletion(request, response, pathname) {
36
36
  response.once('finish', () => {
37
37
  const status = response.statusCode;
38
38
  const interesting = pathname === '/mcp' ||
39
+ pathname === '/' ||
39
40
  pathname.startsWith('/oauth/') ||
40
41
  pathname.startsWith('/.well-known/oauth-') ||
41
42
  status >= 400;
@@ -51,7 +52,7 @@ function logRequestCompletion(request, response, pathname) {
51
52
  const mcpMethod = request.headers['mcp-method'];
52
53
  if (typeof mcpMethod === 'string' && mcpMethod)
53
54
  parts.push(`mcp-method=${mcpMethod}`);
54
- if (pathname === '/mcp')
55
+ if (pathname === '/mcp' || pathname === '/')
55
56
  parts.push(`auth=${bearerTokenFrom(request) !== null ? 'bearer' : 'none'}`);
56
57
  console.log(parts.join(' '));
57
58
  });
@@ -696,8 +697,9 @@ export function createCatenceHttpServer(options = {}) {
696
697
  // A hosted connector may probe server/discover before attaching the
697
698
  // bearer token. The discovery result exposes nothing athlete-scoped,
698
699
  // so that one probe is answered ahead of the 401; every other
699
- // unauthenticated /mcp request stays behind the gate.
700
- if (pathname === '/mcp' && request.method === 'POST' && await handleUnauthenticatedDiscovery(request, response, catalogPaths ?? staticPaths ?? resolveCatalogPaths())) {
700
+ // unauthenticated MCP request stays behind the gate. The root alias
701
+ // mirrors /mcp here too so bare-domain connectors see the same gate.
702
+ if ((pathname === '/mcp' || pathname === '/') && request.method === 'POST' && await handleUnauthenticatedDiscovery(request, response, catalogPaths ?? staticPaths ?? resolveCatalogPaths())) {
701
703
  return;
702
704
  }
703
705
  // A presented-but-rejected token is a bearer problem, not an OAuth
@@ -1233,7 +1235,11 @@ export function createCatenceHttpServer(options = {}) {
1233
1235
  }
1234
1236
  return;
1235
1237
  }
1236
- if (pathname === '/mcp') {
1238
+ // Hosted connectors probe the URL exactly as the operator typed it, and
1239
+ // a bare-domain connector has no /mcp path to append. Root requests are
1240
+ // served exactly like /mcp; the protected-resource metadata still
1241
+ // advertises /mcp, so issued tokens keep their /mcp audience.
1242
+ if (pathname === '/mcp' || pathname === '/') {
1237
1243
  await handleMcpRequest(request, response, catalogPaths ?? staticPaths ?? resolveCatalogPaths(), principal);
1238
1244
  return;
1239
1245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catence",
3
- "version": "0.2.1-beta.22",
3
+ "version": "0.2.1-beta.23",
4
4
  "description": "Local MCP access to normalized Garmin, Intervals.icu, and targeted Strava fitness data.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {