toolcraft 0.0.352 → 0.0.353

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/composition.json CHANGED
@@ -98,7 +98,7 @@
98
98
  },
99
99
  {
100
100
  "name": "tiny-http-mcp-server",
101
- "version": "0.1.82",
101
+ "version": "0.1.84",
102
102
  "license": "MIT"
103
103
  },
104
104
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.352",
116
+ "version": "0.0.353",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.352",
126
+ "version": "0.0.353",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -98,7 +98,7 @@
98
98
  },
99
99
  {
100
100
  "name": "tiny-http-mcp-server",
101
- "version": "0.1.82",
101
+ "version": "0.1.84",
102
102
  "license": "MIT"
103
103
  },
104
104
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.352",
116
+ "version": "0.0.353",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.352",
126
+ "version": "0.0.353",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "name": "tiny-http-mcp-server",
21
- "version": "0.1.82",
21
+ "version": "0.1.84",
22
22
  "license": "MIT"
23
23
  },
24
24
  {
@@ -47,6 +47,7 @@ alone do not establish either native error type.
47
47
 
48
48
  - `client`
49
49
  - `mode: "dynamic"` with optional `metadata`
50
+ and optional existing `clientId`/`clientSecret`
50
51
  - `mode: "static"` with `clientId`, optional `clientSecret`, optional `metadata`
51
52
  - `allowInteractive: false` prevents interactive login while retaining cached tokens and silent refresh
52
53
  - `sessionLockTimeoutMs` limits acquisition waits for a session transaction lock (default 30,000 ms; integer from 1 to 2147483647)
@@ -266,6 +267,10 @@ Static clients and dynamic initial-grant imports require cached grants to match
266
267
  the original normalized client ID and secret. A different client configuration
267
268
  fails before attaching or refreshing credentials and retains the stored record;
268
269
  select separate persistence or explicitly reset the session to change apps.
270
+ An explicitly supplied client ID is used for consent in either mode, including
271
+ when discovery advertises a registrar. Dynamic registration creates a client
272
+ only when no existing app identity is supplied; URL client IDs stay opaque and
273
+ do not trigger client-metadata fetching or registration fallback.
269
274
  Use `persistenceNamespace: "personal"` or `"work"` to keep separate native
270
275
  profiles for the same resource/issuer. `createAuthStoreSessionStore(options,
271
276
  namespace)` addresses the same profile when seeding or inspecting credentials.
@@ -396,7 +396,7 @@ export function createDefaultOAuthClientProvider(options) {
396
396
  }
397
397
  async function resolveClient(existingSession, discovery, redirectUri, fetch, parentSignal) {
398
398
  parentSignal?.throwIfAborted();
399
- if (clientMode === "static" || configuredClient?.registration !== undefined) {
399
+ if (clientMode === "static" || configuredClient !== null) {
400
400
  if (configuredClient === null) {
401
401
  throw new Error("OAuth client_id must not be blank");
402
402
  }
@@ -410,13 +410,6 @@ export function createDefaultOAuthClientProvider(options) {
410
410
  };
411
411
  }
412
412
  const registrationEndpoint = getOwnString(discovery.authorizationServerMetadata, "registration_endpoint");
413
- if (registrationEndpoint === undefined && configuredClient !== null) {
414
- return {
415
- kind: "static",
416
- fromStoredRegistration: false,
417
- client: configuredClient
418
- };
419
- }
420
413
  let storedClient = await loadRegisteredClient(discovery.authorizationServer);
421
414
  const importedClient = existingSession?.client.registrationOwnership === "caller" ? existingSession.client :
422
415
  storedClient?.registrationOwnership === "caller" ? storedClient : undefined;
@@ -453,17 +446,12 @@ export function createDefaultOAuthClientProvider(options) {
453
446
  throw new Error("Authorization server metadata is missing registration_endpoint");
454
447
  }
455
448
  if (existingSession !== null && existingSession.client.clientId.length > 0 && !hasExpiredClientSecret(existingSession.client, now) && registrationMatchesRedirect(existingSession.client, redirectUri)) {
456
- const isConfiguredStaticFallback = configuredClient !== null &&
457
- existingSession.client.clientId === configuredClient.clientId &&
458
- existingSession.client.clientSecret === configuredClient.clientSecret;
459
- if (!isConfiguredStaticFallback) {
460
- await saveRegisteredClient(discovery.authorizationServer, existingSession.client);
461
- return {
462
- kind: "dynamic",
463
- fromStoredRegistration: true,
464
- client: existingSession.client
465
- };
466
- }
449
+ await saveRegisteredClient(discovery.authorizationServer, existingSession.client);
450
+ return {
451
+ kind: "dynamic",
452
+ fromStoredRegistration: true,
453
+ client: existingSession.client
454
+ };
467
455
  }
468
456
  const supported = getSupportedTokenAuthMethods(discovery.authorizationServerMetadata);
469
457
  const registrationMethod = requestedTokenMethod ?? (supported === undefined ? "none" :
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-http-mcp-server",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "description": "Minimal MCP server over HTTP built on tiny-stdio-mcp-server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -5691,7 +5691,7 @@ function createDefaultOAuthClientProvider(options) {
5691
5691
  }
5692
5692
  async function resolveClient(existingSession, discovery, redirectUri, fetch2, parentSignal) {
5693
5693
  parentSignal?.throwIfAborted();
5694
- if (clientMode === "static" || configuredClient?.registration !== void 0) {
5694
+ if (clientMode === "static" || configuredClient !== null) {
5695
5695
  if (configuredClient === null) {
5696
5696
  throw new Error("OAuth client_id must not be blank");
5697
5697
  }
@@ -5705,13 +5705,6 @@ function createDefaultOAuthClientProvider(options) {
5705
5705
  };
5706
5706
  }
5707
5707
  const registrationEndpoint = getOwnString2(discovery.authorizationServerMetadata, "registration_endpoint");
5708
- if (registrationEndpoint === void 0 && configuredClient !== null) {
5709
- return {
5710
- kind: "static",
5711
- fromStoredRegistration: false,
5712
- client: configuredClient
5713
- };
5714
- }
5715
5708
  let storedClient = await loadRegisteredClient(discovery.authorizationServer);
5716
5709
  const importedClient = existingSession?.client.registrationOwnership === "caller" ? existingSession.client : storedClient?.registrationOwnership === "caller" ? storedClient : void 0;
5717
5710
  if (importedClient !== void 0) {
@@ -5747,15 +5740,12 @@ function createDefaultOAuthClientProvider(options) {
5747
5740
  throw new Error("Authorization server metadata is missing registration_endpoint");
5748
5741
  }
5749
5742
  if (existingSession !== null && existingSession.client.clientId.length > 0 && !hasExpiredClientSecret(existingSession.client, now) && registrationMatchesRedirect(existingSession.client, redirectUri)) {
5750
- const isConfiguredStaticFallback = configuredClient !== null && existingSession.client.clientId === configuredClient.clientId && existingSession.client.clientSecret === configuredClient.clientSecret;
5751
- if (!isConfiguredStaticFallback) {
5752
- await saveRegisteredClient(discovery.authorizationServer, existingSession.client);
5753
- return {
5754
- kind: "dynamic",
5755
- fromStoredRegistration: true,
5756
- client: existingSession.client
5757
- };
5758
- }
5743
+ await saveRegisteredClient(discovery.authorizationServer, existingSession.client);
5744
+ return {
5745
+ kind: "dynamic",
5746
+ fromStoredRegistration: true,
5747
+ client: existingSession.client
5748
+ };
5759
5749
  }
5760
5750
  const supported = getSupportedTokenAuthMethods(discovery.authorizationServerMetadata);
5761
5751
  const registrationMethod = requestedTokenMethod ?? (supported === void 0 ? "none" : ["none", "client_secret_basic", "client_secret_post"].find((method) => supported.includes(method)));
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "toolcraft-schema",
11
- "version": "0.0.352",
11
+ "version": "0.0.353",
12
12
  "license": "MIT"
13
13
  }
14
14
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.352",
3
+ "version": "0.0.353",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.352",
3
+ "version": "0.0.353",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -158,7 +158,7 @@
158
158
  "yaml"
159
159
  ],
160
160
  "optionalDependencies": {
161
- "toolcraft-schema": "0.0.352",
161
+ "toolcraft-schema": "0.0.353",
162
162
  "toolcraft-design": "*",
163
163
  "@poe-code/frontmatter": "*",
164
164
  "@poe-code/agent-mcp-config": "*",