@creature-ai/sdk 0.1.15 → 0.1.17
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/core/index.js +11 -11
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.js +11 -11
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.d.ts +28 -4
- package/dist/server/index.js +290 -239
- package/dist/server/index.js.map +1 -1
- package/package.json +7 -3
package/dist/server/index.d.ts
CHANGED
|
@@ -207,10 +207,10 @@ interface ToolContext {
|
|
|
207
207
|
*/
|
|
208
208
|
instanceId: string;
|
|
209
209
|
/**
|
|
210
|
-
* Creature
|
|
211
|
-
*
|
|
212
|
-
* 1.
|
|
213
|
-
* 2. Tool call
|
|
210
|
+
* Creature token for identity retrieval.
|
|
211
|
+
* Present when either:
|
|
212
|
+
* 1. Tool call originated from Creature host (injected via `_creatureToken` arg)
|
|
213
|
+
* 2. Tool call includes OAuth bearer token in Authorization header (ChatGPT/other hosts)
|
|
214
214
|
*
|
|
215
215
|
* Use `getIdentity(context.creatureToken)` to retrieve user identity
|
|
216
216
|
* for multi-tenant data access.
|
|
@@ -430,6 +430,8 @@ declare class App {
|
|
|
430
430
|
private singletonInstances;
|
|
431
431
|
/** Whether the connected host supports multiInstance. ChatGPT doesn't, Creature does. */
|
|
432
432
|
private hostSupportsMultiInstance;
|
|
433
|
+
/** OAuth discovery endpoint configuration. */
|
|
434
|
+
private oauthDiscoveryConfig;
|
|
433
435
|
constructor(config: AppConfig, callerDir?: string);
|
|
434
436
|
/**
|
|
435
437
|
* Define a UI resource.
|
|
@@ -439,6 +441,28 @@ declare class App {
|
|
|
439
441
|
* Define a tool.
|
|
440
442
|
*/
|
|
441
443
|
tool<TInput extends z.ZodType>(name: string, config: ToolConfig<TInput>, handler: ToolHandler<z.infer<TInput>>): this;
|
|
444
|
+
/**
|
|
445
|
+
* Serve an OAuth discovery endpoint.
|
|
446
|
+
* Used by OAuth clients (like ChatGPT) to discover authorization server metadata.
|
|
447
|
+
*
|
|
448
|
+
* @param config.path - The endpoint path (e.g., "/.well-known/oauth-authorization-server")
|
|
449
|
+
* @param config.[rest] - All other properties become the JSON response body
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* app.serveOAuthDiscovery({
|
|
453
|
+
* path: "/.well-known/oauth-authorization-server",
|
|
454
|
+
* issuer: "https://creature.run",
|
|
455
|
+
* authorization_endpoint: "https://creature.run/oauth/authorize",
|
|
456
|
+
* token_endpoint: "https://api.creature.run/apps/v1/oauth/token",
|
|
457
|
+
* response_types_supported: ["code"],
|
|
458
|
+
* grant_types_supported: ["authorization_code", "refresh_token"],
|
|
459
|
+
* code_challenge_methods_supported: ["S256"],
|
|
460
|
+
* });
|
|
461
|
+
*/
|
|
462
|
+
serveOAuthDiscovery(config: {
|
|
463
|
+
path: string;
|
|
464
|
+
[key: string]: unknown;
|
|
465
|
+
}): this;
|
|
442
466
|
/**
|
|
443
467
|
* Start the MCP server.
|
|
444
468
|
*/
|