diff --git a/bridges/nodejs/src/sdk/leon.ts b/bridges/nodejs/src/sdk/leon.ts index 0d2f26d4..539d05f4 100644 --- a/bridges/nodejs/src/sdk/leon.ts +++ b/bridges/nodejs/src/sdk/leon.ts @@ -1,9 +1,15 @@ -import type { AnswerData, AnswerInput, AnswerOutput } from '@sdk/types' +import type { + AnswerData, + AnswerInput, + AnswerOutput, + Versions +} from '@sdk/types' import { INTENT_OBJECT, SKILL_CONFIG, SKILL_SRC_CONFIG } from '@bridge/constants' +import { VERSION } from '@bridge/version' class Leon { private static instance: Leon @@ -107,6 +113,16 @@ class Leon { console.error('Error while creating answer:', e) } } + + /** + * Get the versions of the core and the bridge. + */ + public async getVersions(): Promise { + return { + core: process.env['npm_package_version'] ?? 'unknown', + 'nodejs-bridge': VERSION + } + } } export const leon = new Leon() diff --git a/bridges/nodejs/src/sdk/types.ts b/bridges/nodejs/src/sdk/types.ts index ad4df61e..4fa3b27b 100644 --- a/bridges/nodejs/src/sdk/types.ts +++ b/bridges/nodejs/src/sdk/types.ts @@ -7,6 +7,11 @@ export type { ActionParams, IntentObject } export type ActionFunction = (params: ActionParams) => Promise +export interface Versions { + core: string + 'nodejs-bridge': string +} + /** * Answer types */