@atxp/common 0.2.21 → 0.3.0
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/commonTestHelpers.d.ts +16 -14
- package/dist/commonTestHelpers.js +16 -13
- package/dist/commonTestHelpers.js.map +1 -1
- package/dist/index.cjs +930 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +242 -12
- package/dist/index.js +887 -12
- package/dist/index.js.map +1 -1
- package/dist/jwt.js +5 -2
- package/dist/jwt.js.map +1 -1
- package/dist/logger.js +6 -3
- package/dist/logger.js.map +1 -1
- package/dist/mcpJson.js +6 -3
- package/dist/mcpJson.js.map +1 -1
- package/dist/memoryOAuthDb.js +5 -2
- package/dist/memoryOAuthDb.js.map +1 -1
- package/dist/oAuthResource.js +6 -3
- package/dist/oAuthResource.js.map +1 -1
- package/dist/paymentRequiredError.js +8 -5
- package/dist/paymentRequiredError.js.map +1 -1
- package/dist/platform/index.js +10 -8
- package/dist/platform/index.js.map +1 -1
- package/dist/servers.js +4 -2
- package/dist/servers.js.map +1 -1
- package/dist/sseParser.js +6 -4
- package/dist/sseParser.js.map +1 -1
- package/dist/types.js +5 -3
- package/dist/types.js.map +1 -1
- package/dist/utils.js +5 -3
- package/dist/utils.js.map +1 -1
- package/package.json +25 -4
- package/dist/commonTestHelpers.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jwt.d.ts +0 -9
- package/dist/jwt.d.ts.map +0 -1
- package/dist/logger.d.ts +0 -18
- package/dist/logger.d.ts.map +0 -1
- package/dist/mcpJson.d.ts +0 -9
- package/dist/mcpJson.d.ts.map +0 -1
- package/dist/memoryOAuthDb.d.ts +0 -25
- package/dist/memoryOAuthDb.d.ts.map +0 -1
- package/dist/oAuthResource.d.ts +0 -35
- package/dist/oAuthResource.d.ts.map +0 -1
- package/dist/paymentRequiredError.d.ts +0 -6
- package/dist/paymentRequiredError.d.ts.map +0 -1
- package/dist/platform/index.d.ts +0 -14
- package/dist/platform/index.d.ts.map +0 -1
- package/dist/servers.d.ts +0 -14
- package/dist/servers.d.ts.map +0 -1
- package/dist/sseParser.d.ts +0 -27
- package/dist/sseParser.d.ts.map +0 -1
- package/dist/types.d.ts +0 -72
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -19
- package/dist/utils.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atxp/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "ATXP Core - Shared utilities and types for Authorization Token Exchange Protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -9,19 +9,40 @@
|
|
|
9
9
|
"directory": "packages/atxp-common"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
|
-
"
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
13
15
|
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./dist/platform/index.js": {
|
|
23
|
+
"types": "./dist/platform/index.d.ts",
|
|
24
|
+
"import": "./dist/platform/index.js",
|
|
25
|
+
"require": "./dist/platform/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./src/commonTestHelpers.js": {
|
|
28
|
+
"types": "./dist/commonTestHelpers.d.ts",
|
|
29
|
+
"import": "./dist/commonTestHelpers.js",
|
|
30
|
+
"require": "./dist/commonTestHelpers.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
14
33
|
"files": [
|
|
15
34
|
"dist"
|
|
16
35
|
],
|
|
17
36
|
"scripts": {
|
|
18
|
-
"build": "
|
|
37
|
+
"build": "rollup -c",
|
|
19
38
|
"typecheck": "tsc --noEmit",
|
|
20
39
|
"lint": "eslint . --ext .ts",
|
|
21
40
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
22
41
|
"test": "vitest run",
|
|
23
42
|
"test:integration": "vitest run --testTimeout=120000 src/**/*.integration.test.ts",
|
|
24
|
-
"test:package-managers": "vitest run --testTimeout=120000 src/platform/packageManager.integration.test.ts"
|
|
43
|
+
"test:package-managers": "vitest run --testTimeout=120000 src/platform/packageManager.integration.test.ts",
|
|
44
|
+
"prepack": "npm run build && npm run typecheck",
|
|
45
|
+
"pack:dry": "npm pack --dry-run"
|
|
25
46
|
},
|
|
26
47
|
"dependencies": {
|
|
27
48
|
"bignumber.js": "^9.3.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commonTestHelpers.d.ts","sourceRoot":"","sources":["../src/commonTestHelpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGzH,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AAGnC,wBAAgB,WAAW,CAAC,EAAC,EAAM,EAAE,MAAwB,EAAC,GAAE;IAC9D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CACX,GAAG,eAAe,CAEvB;AAED,wBAAgB,aAAa,CAAC,EAC1B,OAA+C,EAC/C,iBAA6B,EAC7B,OAAe,EAChB,GAAE;IACD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,GAAG,cAAc,CAExB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,OAA8C,EAC9C,iBAA6B,G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ceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
package/dist/jwt.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate a JWT using the jose library and EdDSA (Ed25519) private key.
|
|
3
|
-
* @param walletId - The subject (public key, wallet address, etc.)
|
|
4
|
-
* @param privateKey - Ed25519 private key as a CryptoKey or Uint8Array
|
|
5
|
-
* @param paymentIds - Optional array of payment IDs to include in the payload
|
|
6
|
-
* @returns JWT string
|
|
7
|
-
*/
|
|
8
|
-
export declare const generateJWT: (walletId: string, privateKey: CryptoKey | Uint8Array, paymentRequestId: string, codeChallenge: string) => Promise<string>;
|
|
9
|
-
//# sourceMappingURL=jwt.d.ts.map
|
package/dist/jwt.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../src/jwt.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,YAAY,SAAS,GAAG,UAAU,EAClC,kBAAkB,MAAM,EACxB,eAAe,MAAM,KACpB,OAAO,CAAC,MAAM,CAehB,CAAC"}
|
package/dist/logger.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Logger, LogLevel } from './types.js';
|
|
2
|
-
export declare class ConsoleLogger implements Logger {
|
|
3
|
-
private readonly prefix;
|
|
4
|
-
private _level;
|
|
5
|
-
constructor({ prefix, level }?: Partial<{
|
|
6
|
-
prefix: string;
|
|
7
|
-
level: LogLevel;
|
|
8
|
-
}>);
|
|
9
|
-
get level(): LogLevel;
|
|
10
|
-
set level(level: LogLevel);
|
|
11
|
-
private log;
|
|
12
|
-
private getConsoleMethod;
|
|
13
|
-
debug: (message: string) => void;
|
|
14
|
-
info: (message: string) => void;
|
|
15
|
-
warn: (message: string) => void;
|
|
16
|
-
error: (message: string) => void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=logger.d.ts.map
|
package/dist/logger.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9C,qBAAa,aAAc,YAAW,MAAM;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,MAAM,CAAW;gBAEb,EAAC,MAAiB,EAAE,KAAqB,EAAC,GAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,QAAQ,CAAA;KAAC,CAAM;IAKvG,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,EAExB;IAED,OAAO,CAAC,GAAG;IAOX,OAAO,CAAC,gBAAgB;IAUxB,KAAK,GAAI,SAAS,MAAM,UAEvB;IACD,IAAI,GAAI,SAAS,MAAM,UAEtB;IACD,IAAI,GAAI,SAAS,MAAM,UAEtB;IACD,KAAK,GAAI,SAAS,MAAM,UAEvB;CACF"}
|
package/dist/mcpJson.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AuthorizationServerUrl } from './types.js';
|
|
2
|
-
import { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import { Logger } from './types.js';
|
|
4
|
-
export declare function parsePaymentRequests(message: JSONRPCMessage): {
|
|
5
|
-
url: AuthorizationServerUrl;
|
|
6
|
-
id: string;
|
|
7
|
-
}[];
|
|
8
|
-
export declare function parseMcpMessages(json: unknown, logger?: Logger): Promise<JSONRPCMessage[]>;
|
|
9
|
-
//# sourceMappingURL=mcpJson.d.ts.map
|
package/dist/mcpJson.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpJson.d.ts","sourceRoot":"","sources":["../src/mcpJson.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAmE,cAAc,EAAwB,MAAM,oCAAoC,CAAC;AAC3J,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG;IAAC,GAAG,EAAE,sBAAsB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,EAAE,CAsDzG;AAeD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAiDhG"}
|
package/dist/memoryOAuthDb.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OAuthDb, ClientCredentials, PKCEValues, AccessToken, Logger } from './types.js';
|
|
2
|
-
export interface MemoryOAuthDbConfig {
|
|
3
|
-
logger?: Logger;
|
|
4
|
-
}
|
|
5
|
-
export declare class MemoryOAuthDb implements OAuthDb {
|
|
6
|
-
private clientCredentials;
|
|
7
|
-
private pkceValues;
|
|
8
|
-
private accessTokens;
|
|
9
|
-
private logger;
|
|
10
|
-
constructor(config?: MemoryOAuthDbConfig);
|
|
11
|
-
getClientCredentials(serverUrl: string): Promise<ClientCredentials | null>;
|
|
12
|
-
saveClientCredentials(serverUrl: string, credentials: ClientCredentials): Promise<void>;
|
|
13
|
-
getPKCEValues(userId: string, state: string): Promise<PKCEValues | null>;
|
|
14
|
-
savePKCEValues(userId: string, state: string, values: PKCEValues): Promise<void>;
|
|
15
|
-
getAccessToken(userId: string, url: string): Promise<AccessToken | null>;
|
|
16
|
-
saveAccessToken(userId: string, url: string, token: AccessToken): Promise<void>;
|
|
17
|
-
close(): Promise<void>;
|
|
18
|
-
getStats(): {
|
|
19
|
-
clientCredentials: number;
|
|
20
|
-
pkceValues: number;
|
|
21
|
-
accessTokens: number;
|
|
22
|
-
};
|
|
23
|
-
cleanupExpiredTokens(): number;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=memoryOAuthDb.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memoryOAuthDb.d.ts","sourceRoot":"","sources":["../src/memoryOAuthDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAY,MAAM,YAAY,CAAC;AAGnG,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,aAAc,YAAW,OAAO;IAC3C,OAAO,CAAC,iBAAiB,CAAwC;IACjE,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,GAAE,mBAAwB;IAMtC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAW1E,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvF,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMxE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhF,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAqBxE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAW/E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B,QAAQ;;;;;IASR,oBAAoB,IAAI,MAAM;CAiB/B"}
|
package/dist/oAuthResource.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as oauth from 'oauth4webapi';
|
|
2
|
-
import { ClientCredentials, FetchLike, OAuthResourceDb, OAuthDb, TokenData, Logger } from './types.js';
|
|
3
|
-
export interface OAuthResourceClientConfig {
|
|
4
|
-
db: OAuthDb;
|
|
5
|
-
callbackUrl?: string;
|
|
6
|
-
isPublic?: boolean;
|
|
7
|
-
sideChannelFetch?: FetchLike;
|
|
8
|
-
strict?: boolean;
|
|
9
|
-
allowInsecureRequests?: boolean;
|
|
10
|
-
clientName?: string;
|
|
11
|
-
logger?: Logger;
|
|
12
|
-
}
|
|
13
|
-
export declare class OAuthResourceClient {
|
|
14
|
-
protected db: OAuthResourceDb;
|
|
15
|
-
protected allowInsecureRequests: boolean;
|
|
16
|
-
protected callbackUrl: string;
|
|
17
|
-
protected sideChannelFetch: FetchLike;
|
|
18
|
-
protected strict: boolean;
|
|
19
|
-
protected clientName: string;
|
|
20
|
-
protected isPublic: boolean;
|
|
21
|
-
protected logger: Logger;
|
|
22
|
-
private registrationLocks;
|
|
23
|
-
constructor({ db, callbackUrl, isPublic, sideChannelFetch, strict, allowInsecureRequests, clientName, logger }: OAuthResourceClientConfig);
|
|
24
|
-
static trimToPath: (url: string) => string;
|
|
25
|
-
static getParentPath: (url: string) => string | null;
|
|
26
|
-
introspectToken: (authorizationServerUrl: string, token: string, additionalParameters?: Record<string, string>) => Promise<TokenData>;
|
|
27
|
-
getAuthorizationServer: (resourceServerUrl: string) => Promise<oauth.AuthorizationServer>;
|
|
28
|
-
authorizationServerFromUrl: (authServerUrl: URL) => Promise<oauth.AuthorizationServer>;
|
|
29
|
-
protected normalizeResourceServerUrl: (resourceServerUrl: string) => string;
|
|
30
|
-
protected getRegistrationMetadata: () => Promise<Partial<oauth.OmitSymbolProperties<oauth.Client>>>;
|
|
31
|
-
protected registerClient: (authorizationServer: oauth.AuthorizationServer) => Promise<ClientCredentials>;
|
|
32
|
-
protected getClientCredentials: (authorizationServer: oauth.AuthorizationServer) => Promise<ClientCredentials>;
|
|
33
|
-
protected makeOAuthClientAndAuth: (credentials: ClientCredentials) => [oauth.Client, oauth.ClientAuth];
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=oAuthResource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oAuthResource.d.ts","sourceRoot":"","sources":["../src/oAuthResource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGvG,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,mBAAmB;IAK9B,SAAS,CAAC,EAAE,EAAE,eAAe,CAAC;IAC9B,SAAS,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACzC,SAAS,CAAC,WAAW,EAAE,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;IAED,SAAS,CAAC,sBAAsB,GAC9B,aAAa,iBAAiB,KAC7B,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAkBlC;CACF"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { AuthorizationServerUrl } from "./types.js";
|
|
3
|
-
export declare const PAYMENT_REQUIRED_ERROR_CODE = -30402;
|
|
4
|
-
export declare const PAYMENT_REQUIRED_PREAMBLE = "Payment via ATXP is required. ";
|
|
5
|
-
export declare function paymentRequiredError(server: AuthorizationServerUrl, paymentRequestId: string, chargeAmount?: BigNumber): McpError;
|
|
6
|
-
//# sourceMappingURL=paymentRequiredError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paymentRequiredError.d.ts","sourceRoot":"","sources":["../src/paymentRequiredError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGpD,eAAO,MAAM,2BAA2B,SAAS,CAAC;AAGlD,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AAE1E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,SAAS,GAAG,QAAQ,CAQjI"}
|
package/dist/platform/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FetchLike } from '../types.js';
|
|
2
|
-
export interface PlatformCrypto {
|
|
3
|
-
digest: (data: Uint8Array) => Promise<Uint8Array>;
|
|
4
|
-
randomUUID: () => string;
|
|
5
|
-
toHex: (data: Uint8Array) => string;
|
|
6
|
-
}
|
|
7
|
-
export declare function getIsReactNative(): boolean;
|
|
8
|
-
export declare const isNode: boolean;
|
|
9
|
-
export declare const isBrowser: boolean;
|
|
10
|
-
export declare const isNextJS: boolean;
|
|
11
|
-
export declare const isWebEnvironment: boolean;
|
|
12
|
-
export declare const createReactNativeSafeFetch: (originalFetch: FetchLike) => FetchLike;
|
|
13
|
-
export declare let crypto: PlatformCrypto;
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;CACrC;AAID,wBAAgB,gBAAgB,YAG/B;AACD,eAAO,MAAM,MAAM,SAA6D,CAAC;AACjF,eAAO,MAAM,SAAS,SAAmE,CAAC;AAC1F,eAAO,MAAM,QAAQ,SAA2E,CAAC;AACjG,eAAO,MAAM,gBAAgB,SAAwB,CAAC;AAmDtD,eAAO,MAAM,0BAA0B,GAAI,eAAe,SAAS,KAAG,SA4BrE,CAAC;AA6GF,eAAO,IAAI,MAAM,EAAE,cAAc,CAAC"}
|
package/dist/servers.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const Servers: {
|
|
2
|
-
readonly browse: "https://browse.mcp.novellum.ai";
|
|
3
|
-
readonly filestore: "https://filestore.mcp.novellum.ai";
|
|
4
|
-
readonly database: "https://database.mcp.novellum.ai";
|
|
5
|
-
readonly code: "https://code.mcp.novellum.ai";
|
|
6
|
-
readonly search: "https://search.mcp.novellum.ai";
|
|
7
|
-
readonly crawl: "https://crawl.mcp.novellum.ai";
|
|
8
|
-
readonly video: "https://video.mcp.novellum.ai";
|
|
9
|
-
readonly image: "https://image.mcp.novellum.ai";
|
|
10
|
-
readonly music: "https://music.mcp.novellum.ai";
|
|
11
|
-
readonly research: "https://research.mcp.novellum.ai";
|
|
12
|
-
readonly shop: "https://shop.mcp.novellum.ai";
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=servers.d.ts.map
|
package/dist/servers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../src/servers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYV,CAAC"}
|
package/dist/sseParser.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Logger } from './types.js';
|
|
2
|
-
export interface SSEMessage {
|
|
3
|
-
event?: string;
|
|
4
|
-
data: string;
|
|
5
|
-
id?: string;
|
|
6
|
-
retry?: number;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Parses SSE (Server-Sent Events) formatted text into individual messages
|
|
10
|
-
* @param sseText - The raw SSE text to parse
|
|
11
|
-
* @returns Array of parsed SSE messages
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseSSEMessages(sseText: string): SSEMessage[];
|
|
14
|
-
/**
|
|
15
|
-
* Extracts JSON-RPC messages from SSE data fields
|
|
16
|
-
* @param sseMessages - Array of SSE messages
|
|
17
|
-
* @param logger - Optional logger for debugging
|
|
18
|
-
* @returns Array of parsed JSON objects from SSE data fields
|
|
19
|
-
*/
|
|
20
|
-
export declare function extractJSONFromSSE(sseMessages: SSEMessage[], logger?: Logger): unknown[];
|
|
21
|
-
/**
|
|
22
|
-
* Determines if a response body appears to be SSE formatted
|
|
23
|
-
* @param body - The response body to check
|
|
24
|
-
* @returns true if the body appears to be SSE formatted
|
|
25
|
-
*/
|
|
26
|
-
export declare function isSSEResponse(body: unknown): boolean;
|
|
27
|
-
//# sourceMappingURL=sseParser.d.ts.map
|
package/dist/sseParser.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sseParser.d.ts","sourceRoot":"","sources":["../src/sseParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAsD9D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,CAgBxF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAqBpD"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_AUTHORIZATION_SERVER = "https://auth.atxp.ai";
|
|
2
|
-
export declare enum LogLevel {
|
|
3
|
-
DEBUG = 0,
|
|
4
|
-
INFO = 1,
|
|
5
|
-
WARN = 2,
|
|
6
|
-
ERROR = 3
|
|
7
|
-
}
|
|
8
|
-
export type Logger = {
|
|
9
|
-
debug: (message: string) => void;
|
|
10
|
-
info: (message: string) => void;
|
|
11
|
-
warn: (message: string) => void;
|
|
12
|
-
error: (message: string) => void;
|
|
13
|
-
};
|
|
14
|
-
export type UrlString = `http://${string}` | `https://${string}`;
|
|
15
|
-
export type AuthorizationServerUrl = UrlString;
|
|
16
|
-
export type Currency = 'USDC';
|
|
17
|
-
export type Network = 'solana' | 'base';
|
|
18
|
-
export type PaymentRequestData = {
|
|
19
|
-
amount: BigNumber;
|
|
20
|
-
currency: Currency;
|
|
21
|
-
network: Network;
|
|
22
|
-
destination: string;
|
|
23
|
-
source: string;
|
|
24
|
-
resource: URL;
|
|
25
|
-
resourceName: string;
|
|
26
|
-
payeeName?: string | null;
|
|
27
|
-
iss: string;
|
|
28
|
-
};
|
|
29
|
-
export type CustomJWTPayload = {
|
|
30
|
-
code_challenge?: string;
|
|
31
|
-
payment_request_id?: string;
|
|
32
|
-
};
|
|
33
|
-
export type ClientCredentials = {
|
|
34
|
-
clientId: string;
|
|
35
|
-
clientSecret: string;
|
|
36
|
-
redirectUri: string;
|
|
37
|
-
};
|
|
38
|
-
export type PKCEValues = {
|
|
39
|
-
codeVerifier: string;
|
|
40
|
-
codeChallenge: string;
|
|
41
|
-
resourceUrl: string;
|
|
42
|
-
url: string;
|
|
43
|
-
};
|
|
44
|
-
export type AccessToken = {
|
|
45
|
-
accessToken: string;
|
|
46
|
-
refreshToken?: string;
|
|
47
|
-
expiresAt?: number;
|
|
48
|
-
resourceUrl: string;
|
|
49
|
-
};
|
|
50
|
-
export interface OAuthResourceDb {
|
|
51
|
-
getClientCredentials(serverUrl: string): Promise<ClientCredentials | null>;
|
|
52
|
-
saveClientCredentials(serverUrl: string, credentials: ClientCredentials): Promise<void>;
|
|
53
|
-
close(): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
export interface OAuthDb extends OAuthResourceDb {
|
|
56
|
-
getPKCEValues(userId: string, state: string): Promise<PKCEValues | null>;
|
|
57
|
-
savePKCEValues(userId: string, state: string, values: PKCEValues): Promise<void>;
|
|
58
|
-
getAccessToken(userId: string, url: string): Promise<AccessToken | null>;
|
|
59
|
-
saveAccessToken(userId: string, url: string, token: AccessToken): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export type TokenData = {
|
|
62
|
-
active: boolean;
|
|
63
|
-
scope?: string;
|
|
64
|
-
sub?: string;
|
|
65
|
-
aud?: string | string[];
|
|
66
|
-
};
|
|
67
|
-
export type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
68
|
-
export type RequirePaymentConfig = {
|
|
69
|
-
price: BigNumber;
|
|
70
|
-
getExistingPaymentId?: () => Promise<string | null>;
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AAEnE,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,MAAM,EAAE,GAAG,WAAW,MAAM,EAAE,CAAC;AACjE,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB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KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAC,MAAM,EAAE,CAAC;CACvB,CAAA;AAGD,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACrD,CAAA"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exhaustiveness check for switch statements.
|
|
3
|
-
* This function should never be called at runtime.
|
|
4
|
-
* It's used to ensure all cases of a union type or enum are handled.
|
|
5
|
-
*
|
|
6
|
-
* @param value - The value that should have been handled by all cases
|
|
7
|
-
* @param message - Optional error message
|
|
8
|
-
* @throws {Error} Always throws an error indicating unhandled case
|
|
9
|
-
*/
|
|
10
|
-
export declare function assertNever(value: never, message?: string): never;
|
|
11
|
-
/**
|
|
12
|
-
* Type-safe way to check if a value is one of the enum values.
|
|
13
|
-
*
|
|
14
|
-
* @param enumObj - The enum object
|
|
15
|
-
* @param value - The value to check
|
|
16
|
-
* @returns True if the value is a valid enum value
|
|
17
|
-
*/
|
|
18
|
-
export declare function isEnumValue<T extends Record<string, string | number>>(enumObj: T, value: unknown): value is T[keyof T];
|
|
19
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACnE,OAAO,EAAE,CAAC,EACV,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAErB"}
|