@breadstone/archipel-mcp 0.0.7 → 0.0.8
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/data/packages/index.md +13 -6
- package/data/packages/platform-authentication/api/Class.AppleStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.AuthModule.md +3 -3
- package/data/packages/platform-authentication/api/Class.GithubStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.GoogleStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.MicrosoftStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Interface.IAuthModuleOptions.md +9 -9
- package/data/packages/{platform-core → platform-caching}/api/Class.MemoryLayeredCache.md +41 -33
- package/data/packages/platform-caching/api/Class.NoopCacheMetricsRecorder.md +158 -0
- package/data/packages/platform-caching/api/Class.RedisLayeredCache.md +296 -0
- package/data/packages/platform-caching/api/Interface.ICacheMetricsRecorder.md +122 -0
- package/data/packages/platform-caching/api/Interface.ICacheStats.md +71 -0
- package/data/packages/platform-caching/api/Interface.ILayeredCache.md +199 -0
- package/data/packages/platform-caching/api/Interface.ILayeredCacheOptions.md +76 -0
- package/data/packages/platform-caching/api/Interface.IRedisLayeredCacheOptions.md +122 -0
- package/data/packages/platform-caching/api/index.md +25 -0
- package/data/packages/platform-caching/index.md +116 -0
- package/data/packages/platform-core/api/index.md +104 -150
- package/data/packages/platform-core/index.md +5 -3
- package/data/packages/platform-cryptography/api/Class.BcryptService.md +73 -0
- package/data/packages/platform-cryptography/api/Class.CryptoService.md +52 -0
- package/data/packages/{platform-core → platform-cryptography}/api/Class.OtpService.md +8 -4
- package/data/packages/{platform-core → platform-cryptography}/api/Interface.IOtpService.md +8 -4
- package/data/packages/platform-cryptography/api/Interface.IOtpUriOptions.md +47 -0
- package/data/packages/{platform-core → platform-cryptography}/api/Variable.OTP_SERVICE_TOKEN.md +1 -1
- package/data/packages/{platform-core → platform-cryptography}/api/Variable.TOTP_EPOCH_TOLERANCE.md +1 -1
- package/data/packages/platform-cryptography/api/index.md +29 -0
- package/data/packages/platform-cryptography/index.md +132 -0
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceCapabilityRegistrarBase.md +7 -5
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceCapabilityRegistry.md +19 -15
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceModule.md +1 -1
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceTextGenerator.md +7 -7
- package/data/packages/platform-intelligence/api/Function.createProviderOptions.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadAnthropicLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadGoogleLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadGrokLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadOpenAILanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadProviderFactory.md +32 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceArtifact.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapability.md +72 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityMetadata.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityPayload.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityRegistry.md +79 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityResult.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCompletionUsage.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceContext.md +73 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceContextBuilder.md +36 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceConversationMessageSnapshot.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceConversationSnapshot.md +59 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFollowUpQuestion.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceIntent.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceIntentEntity.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceMessageModel.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceMessagePayload.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePrompt.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptMessage.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderConfiguration.md +95 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceResponseMessage.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextCompletion.md +61 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerationOptions.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerator.md +54 -0
- package/data/packages/{platform-core → platform-intelligence}/api/TypeAlias.IntelligenceConversationMessageRole.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoader.md +25 -0
- package/data/packages/{platform-core → platform-intelligence}/api/TypeAlias.IntelligenceProviderName.md +1 -1
- package/data/packages/{platform-core → platform-intelligence}/api/Variable.IntelligenceConversationMessageRoles.md +6 -6
- package/data/packages/platform-intelligence/api/Variable.IntelligenceProviderNames.md +29 -0
- package/data/packages/platform-intelligence/api/index.md +70 -0
- package/data/packages/platform-intelligence/index.md +131 -0
- package/data/packages/platform-telemetry/api/Class.TelemetryCacheMetricsRecorder.md +15 -15
- package/package.json +1 -1
- package/data/packages/platform-core/api/Class.BcryptService.md +0 -69
- package/data/packages/platform-core/api/Class.CryptoService.md +0 -50
- package/data/packages/platform-core/api/Class.NoopCacheMetricsRecorder.md +0 -157
- package/data/packages/platform-core/api/Class.RedisLayeredCache.md +0 -275
- package/data/packages/platform-core/api/Interface.ICacheMetricsRecorder.md +0 -121
- package/data/packages/platform-core/api/Interface.ICacheStats.md +0 -71
- package/data/packages/platform-core/api/Interface.IIntelligenceArtifact.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceCapability.md +0 -62
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityMetadata.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityPayload.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityRegistry.md +0 -69
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityResult.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceCompletionUsage.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceContext.md +0 -63
- package/data/packages/platform-core/api/Interface.IIntelligenceContextBuilder.md +0 -32
- package/data/packages/platform-core/api/Interface.IIntelligenceConversationMessageSnapshot.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceConversationSnapshot.md +0 -51
- package/data/packages/platform-core/api/Interface.IIntelligenceFollowUpQuestion.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceIntent.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceIntentEntity.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceMessageModel.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceMessagePayload.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligencePrompt.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligencePromptMessage.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceProviderConfiguration.md +0 -81
- package/data/packages/platform-core/api/Interface.IIntelligenceResponseMessage.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceTextCompletion.md +0 -53
- package/data/packages/platform-core/api/Interface.IIntelligenceTextGenerationOptions.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceTextGenerator.md +0 -46
- package/data/packages/platform-core/api/Interface.ILayeredCache.md +0 -194
- package/data/packages/platform-core/api/Interface.ILayeredCacheOptions.md +0 -71
- package/data/packages/platform-core/api/Interface.IOtpUriOptions.md +0 -47
- package/data/packages/platform-core/api/Interface.IRedisLayeredCacheOptions.md +0 -108
- package/data/packages/platform-core/api/Variable.IntelligenceProviderNames.md +0 -29
|
@@ -6,7 +6,7 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Interface: IOtpService
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [IOtpService.ts:39](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L39)
|
|
10
10
|
|
|
11
11
|
Abstraction over OTP (One-Time Password) operations.
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@ without changing consumer code.
|
|
|
22
22
|
generateSecret(): string;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [
|
|
25
|
+
Defined in: [IOtpService.ts:47](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L47)
|
|
26
26
|
|
|
27
27
|
Generates a cryptographically random secret suitable for TOTP.
|
|
28
28
|
|
|
@@ -30,6 +30,8 @@ Generates a cryptographically random secret suitable for TOTP.
|
|
|
30
30
|
|
|
31
31
|
`string`
|
|
32
32
|
|
|
33
|
+
The generated secret string.
|
|
34
|
+
|
|
33
35
|
---
|
|
34
36
|
|
|
35
37
|
### generateUri()
|
|
@@ -38,7 +40,7 @@ Generates a cryptographically random secret suitable for TOTP.
|
|
|
38
40
|
generateUri(options): string;
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
Defined in: [
|
|
43
|
+
Defined in: [IOtpService.ts:56](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L56)
|
|
42
44
|
|
|
43
45
|
Generates an `otpauth://` URI for QR code enrollment.
|
|
44
46
|
|
|
@@ -52,6 +54,8 @@ Generates an `otpauth://` URI for QR code enrollment.
|
|
|
52
54
|
|
|
53
55
|
`string`
|
|
54
56
|
|
|
57
|
+
The formatted `otpauth://` URI.
|
|
58
|
+
|
|
55
59
|
---
|
|
56
60
|
|
|
57
61
|
### verify()
|
|
@@ -60,7 +64,7 @@ Generates an `otpauth://` URI for QR code enrollment.
|
|
|
60
64
|
verify(token, secret): boolean;
|
|
61
65
|
```
|
|
62
66
|
|
|
63
|
-
Defined in: [
|
|
67
|
+
Defined in: [IOtpService.ts:66](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L66)
|
|
64
68
|
|
|
65
69
|
Verifies a TOTP token against the given secret.
|
|
66
70
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Interface: IOtpUriOptions'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Interface: IOtpUriOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [IOtpService.ts:6](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L6)
|
|
10
|
+
|
|
11
|
+
Options for generating an OTP authentication URI (otpauth://).
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### issuer
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
readonly issuer: string;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [IOtpService.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L13)
|
|
22
|
+
|
|
23
|
+
The issuer name displayed in the authenticator app.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### label
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
readonly label: string;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [IOtpService.ts:20](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L20)
|
|
34
|
+
|
|
35
|
+
The account label (e.g. email or username) shown in the authenticator app.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### secret
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
readonly secret: string;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Defined in: [IOtpService.ts:27](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/IOtpService.ts#L27)
|
|
46
|
+
|
|
47
|
+
The shared secret used for TOTP generation.
|
package/data/packages/{platform-core → platform-cryptography}/api/Variable.OTP_SERVICE_TOKEN.md
RENAMED
|
@@ -10,6 +10,6 @@ editUrl: false
|
|
|
10
10
|
const OTP_SERVICE_TOKEN: typeof OTP_SERVICE_TOKEN;
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Defined in: [
|
|
13
|
+
Defined in: [OtpService.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/OtpService.ts#L14)
|
|
14
14
|
|
|
15
15
|
Injection token for [IOtpService](Interface.IOtpService).
|
package/data/packages/{platform-core → platform-cryptography}/api/Variable.TOTP_EPOCH_TOLERANCE.md
RENAMED
|
@@ -10,7 +10,7 @@ editUrl: false
|
|
|
10
10
|
const TOTP_EPOCH_TOLERANCE: 30 = 30;
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Defined in: [
|
|
13
|
+
Defined in: [OtpService.ts:30](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-cryptography/src/OtpService.ts#L30)
|
|
14
14
|
|
|
15
15
|
TOTP verification tolerance expressed in **seconds** (otplib v13 `epochTolerance`).
|
|
16
16
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '@breadstone/archipel-platform-cryptography'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# @breadstone/archipel-platform-cryptography
|
|
8
|
+
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
| Class | Description |
|
|
12
|
+
| ------------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
13
|
+
| [BcryptService](Class.BcryptService) | The `BcryptService` class. Represents the service that provides bcrypt operations. |
|
|
14
|
+
| [CryptoService](Class.CryptoService) | The `CryptoService` class. Represents the service that provides cryptographic operations. |
|
|
15
|
+
| [OtpService](Class.OtpService) | OTP service implementation backed by otplib v13. |
|
|
16
|
+
|
|
17
|
+
## Interfaces
|
|
18
|
+
|
|
19
|
+
| Interface | Description |
|
|
20
|
+
| ------------------------------------------ | -------------------------------------------------------------- |
|
|
21
|
+
| [IOtpService](Interface.IOtpService) | Abstraction over OTP (One-Time Password) operations. |
|
|
22
|
+
| [IOtpUriOptions](Interface.IOtpUriOptions) | Options for generating an OTP authentication URI (otpauth://). |
|
|
23
|
+
|
|
24
|
+
## Variables
|
|
25
|
+
|
|
26
|
+
| Variable | Description |
|
|
27
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
28
|
+
| [OTP_SERVICE_TOKEN](Variable.OTP_SERVICE_TOKEN) | Injection token for [IOtpService](Interface.IOtpService). |
|
|
29
|
+
| [TOTP_EPOCH_TOLERANCE](Variable.TOTP_EPOCH_TOLERANCE) | TOTP verification tolerance expressed in **seconds** (otplib v13 `epochTolerance`). |
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: platform-cryptography
|
|
3
|
+
description: Bcrypt password hashing, prefixed UUID generation, and TOTP multi-factor authentication.
|
|
4
|
+
order: 17
|
|
5
|
+
tags: [cryptography, bcrypt, uuid, totp, otp, mfa, hashing]
|
|
6
|
+
package: '@breadstone/archipel-platform-cryptography'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# platform-cryptography
|
|
10
|
+
|
|
11
|
+
Cryptographic building blocks for NestJS applications: bcrypt password hashing, prefixed UUID generation, and TOTP-based multi-factor authentication. All services are `@Injectable()` and ready for constructor injection.
|
|
12
|
+
|
|
13
|
+
**Package:** `@breadstone/archipel-platform-cryptography`
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {
|
|
19
|
+
BcryptService,
|
|
20
|
+
CryptoService,
|
|
21
|
+
OtpService,
|
|
22
|
+
OTP_SERVICE_TOKEN,
|
|
23
|
+
} from '@breadstone/archipel-platform-cryptography';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Password Hashing (BcryptService)
|
|
29
|
+
|
|
30
|
+
Secure password hashing with auto-generated salts.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { Injectable } from '@nestjs/common';
|
|
34
|
+
import { BcryptService } from '@breadstone/archipel-platform-cryptography';
|
|
35
|
+
|
|
36
|
+
@Injectable()
|
|
37
|
+
export class AccountService {
|
|
38
|
+
constructor(private readonly _bcrypt: BcryptService) {}
|
|
39
|
+
|
|
40
|
+
async createAccount(password: string): Promise<void> {
|
|
41
|
+
const hashed = await this._bcrypt.hash(password);
|
|
42
|
+
// store hashed password
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async verifyPassword(password: string, hash: string): Promise<boolean> {
|
|
46
|
+
return this._bcrypt.compare(password, hash);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Method | Description |
|
|
52
|
+
| -------------------------- | --------------------------------------------- |
|
|
53
|
+
| `hash(data)` | Hashes a string with a generated bcrypt salt. |
|
|
54
|
+
| `compare(data, encrypted)` | Compares plain text against a bcrypt hash. |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Prefixed UUIDs (CryptoService)
|
|
59
|
+
|
|
60
|
+
Generates random UUIDs prefixed with a domain identifier for readable, collision-free identifiers.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { CryptoService } from '@breadstone/archipel-platform-cryptography';
|
|
64
|
+
|
|
65
|
+
const crypto = new CryptoService();
|
|
66
|
+
|
|
67
|
+
crypto.getRandomGuid('usr'); // → 'usr-a1b2c3d4-...'
|
|
68
|
+
crypto.getRandomGuid('ord'); // → 'ord-e5f6a7b8-...'
|
|
69
|
+
crypto.getRandomGuid('inv'); // → 'inv-c9d0e1f2-...'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
| Method | Description |
|
|
73
|
+
| ----------------------- | ----------------------------------------------------- |
|
|
74
|
+
| `getRandomGuid(prefix)` | Returns `{prefix}-{uuid}`. Throws if prefix is empty. |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## TOTP Multi-Factor Authentication (OtpService)
|
|
79
|
+
|
|
80
|
+
TOTP enrollment and verification backed by otplib v13, injected via the `OTP_SERVICE_TOKEN` symbol.
|
|
81
|
+
|
|
82
|
+
### Injection Setup
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { Module } from '@nestjs/common';
|
|
86
|
+
import { OtpService, OTP_SERVICE_TOKEN } from '@breadstone/archipel-platform-cryptography';
|
|
87
|
+
|
|
88
|
+
@Module({
|
|
89
|
+
providers: [{ provide: OTP_SERVICE_TOKEN, useClass: OtpService }],
|
|
90
|
+
exports: [OTP_SERVICE_TOKEN],
|
|
91
|
+
})
|
|
92
|
+
export class SecurityModule {}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Usage
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { Inject, Injectable } from '@nestjs/common';
|
|
99
|
+
import { OTP_SERVICE_TOKEN, IOtpService } from '@breadstone/archipel-platform-cryptography';
|
|
100
|
+
|
|
101
|
+
@Injectable()
|
|
102
|
+
export class MfaService {
|
|
103
|
+
constructor(@Inject(OTP_SERVICE_TOKEN) private readonly _otp: IOtpService) {}
|
|
104
|
+
|
|
105
|
+
enroll(issuer: string, label: string) {
|
|
106
|
+
const secret = this._otp.generateSecret();
|
|
107
|
+
const uri = this._otp.generateUri({ issuer, label, secret });
|
|
108
|
+
return { secret, uri }; // uri → QR code
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
verify(token: string, secret: string): boolean {
|
|
112
|
+
return this._otp.verify(token, secret);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Tolerance
|
|
118
|
+
|
|
119
|
+
The default `TOTP_EPOCH_TOLERANCE` is 30 seconds (±1 time step):
|
|
120
|
+
|
|
121
|
+
| `epochTolerance` | Accepted range |
|
|
122
|
+
| ---------------- | ----------------- |
|
|
123
|
+
| 0 | Current step only |
|
|
124
|
+
| 30 | ±1 step (±30 s) |
|
|
125
|
+
| 60 | ±2 steps (±60 s) |
|
|
126
|
+
| 90 | ±3 steps (±90 s) |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## API Reference
|
|
131
|
+
|
|
132
|
+
See the full [API documentation](./api/) for all exported types and classes.
|
|
@@ -6,7 +6,7 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: IntelligenceCapabilityRegistrarBase
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [abstracts/IntelligenceCapabilityRegistrarBase.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/abstracts/IntelligenceCapabilityRegistrarBase.ts#L15)
|
|
10
10
|
|
|
11
11
|
Provides a reusable registration flow that allows feature modules to contribute
|
|
12
12
|
capabilities to the global intelligence registry while keeping their implementation details private.
|
|
@@ -23,7 +23,7 @@ capabilities to the global intelligence registry while keeping their implementat
|
|
|
23
23
|
protected new IntelligenceCapabilityRegistrarBase(registry): IntelligenceCapabilityRegistrarBase;
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Defined in: [
|
|
26
|
+
Defined in: [abstracts/IntelligenceCapabilityRegistrarBase.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/abstracts/IntelligenceCapabilityRegistrarBase.ts#L31)
|
|
27
27
|
|
|
28
28
|
Initializes a new instance of the IntelligenceCapabilityRegistrarBase class.
|
|
29
29
|
|
|
@@ -47,7 +47,9 @@ Initializes a new instance of the IntelligenceCapabilityRegistrarBase class.
|
|
|
47
47
|
get protected registry(): IntelligenceCapabilityRegistry;
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Defined in: [
|
|
50
|
+
Defined in: [abstracts/IntelligenceCapabilityRegistrarBase.ts:45](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/abstracts/IntelligenceCapabilityRegistrarBase.ts#L45)
|
|
51
|
+
|
|
52
|
+
Gets the registry instance that should be used to register capabilities.
|
|
51
53
|
|
|
52
54
|
##### Returns
|
|
53
55
|
|
|
@@ -61,7 +63,7 @@ Defined in: [intelligence/abstracts/IntelligenceCapabilityRegistrarBase.ts:38](h
|
|
|
61
63
|
abstract protected getCapabilities(): readonly IIntelligenceCapability[];
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
Defined in: [
|
|
66
|
+
Defined in: [abstracts/IntelligenceCapabilityRegistrarBase.ts:75](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/abstracts/IntelligenceCapabilityRegistrarBase.ts#L75)
|
|
65
67
|
|
|
66
68
|
Returns the capabilities that should be registered for the module.
|
|
67
69
|
|
|
@@ -77,7 +79,7 @@ readonly [`IIntelligenceCapability`](Interface.IIntelligenceCapability)[]
|
|
|
77
79
|
onModuleInit(): void;
|
|
78
80
|
```
|
|
79
81
|
|
|
80
|
-
Defined in: [
|
|
82
|
+
Defined in: [abstracts/IntelligenceCapabilityRegistrarBase.ts:59](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/abstracts/IntelligenceCapabilityRegistrarBase.ts#L59)
|
|
81
83
|
|
|
82
84
|
Template method invoked by NestJS once the provider has been instantiated.
|
|
83
85
|
Registers all capabilities returned by [getCapabilities](#getcapabilities).
|
|
@@ -6,7 +6,7 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Class: IntelligenceCapabilityRegistry
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [IntelligenceCapabilityRegistry.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceCapabilityRegistry.ts#L15)
|
|
10
10
|
|
|
11
11
|
Central registry responsible for resolving intelligence capabilities based on intent metadata.
|
|
12
12
|
|
|
@@ -34,13 +34,15 @@ new IntelligenceCapabilityRegistry(): IntelligenceCapabilityRegistry;
|
|
|
34
34
|
list(): readonly IIntelligenceCapability[];
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Defined in: [
|
|
37
|
+
Defined in: [IntelligenceCapabilityRegistry.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceCapabilityRegistry.ts#L37)
|
|
38
|
+
|
|
39
|
+
Returns a read-only snapshot of all registered capabilities.
|
|
38
40
|
|
|
39
41
|
#### Returns
|
|
40
42
|
|
|
41
43
|
readonly [`IIntelligenceCapability`](Interface.IIntelligenceCapability)[]
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
A defensive copy of the registered capabilities.
|
|
44
46
|
|
|
45
47
|
#### Implementation of
|
|
46
48
|
|
|
@@ -54,20 +56,20 @@ readonly [`IIntelligenceCapability`](Interface.IIntelligenceCapability)[]
|
|
|
54
56
|
register(capability): void;
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
Defined in: [
|
|
59
|
+
Defined in: [IntelligenceCapabilityRegistry.ts:26](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceCapabilityRegistry.ts#L26)
|
|
60
|
+
|
|
61
|
+
Registers a capability in the registry.
|
|
58
62
|
|
|
59
63
|
#### Parameters
|
|
60
64
|
|
|
61
|
-
| Parameter | Type |
|
|
62
|
-
| ------------ | -------------------------------------------------------------- |
|
|
63
|
-
| `capability` | [`IIntelligenceCapability`](Interface.IIntelligenceCapability) |
|
|
65
|
+
| Parameter | Type | Description |
|
|
66
|
+
| ------------ | -------------------------------------------------------------- | --------------------------- |
|
|
67
|
+
| `capability` | [`IIntelligenceCapability`](Interface.IIntelligenceCapability) | The capability to register. |
|
|
64
68
|
|
|
65
69
|
#### Returns
|
|
66
70
|
|
|
67
71
|
`void`
|
|
68
72
|
|
|
69
|
-
#### Inherit Doc
|
|
70
|
-
|
|
71
73
|
#### Implementation of
|
|
72
74
|
|
|
73
75
|
[`IIntelligenceCapabilityRegistry`](Interface.IIntelligenceCapabilityRegistry).[`register`](Interface.IIntelligenceCapabilityRegistry#register)
|
|
@@ -82,21 +84,23 @@ resolve(intent, context):
|
|
|
82
84
|
| null;
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
Defined in: [
|
|
87
|
+
Defined in: [IntelligenceCapabilityRegistry.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceCapabilityRegistry.ts#L32)
|
|
88
|
+
|
|
89
|
+
Resolves the most suitable capability for the given intent and context.
|
|
86
90
|
|
|
87
91
|
#### Parameters
|
|
88
92
|
|
|
89
|
-
| Parameter | Type |
|
|
90
|
-
| --------- | -------------------------------------------------------- |
|
|
91
|
-
| `intent` | [`IIntelligenceIntent`](Interface.IIntelligenceIntent) |
|
|
92
|
-
| `context` | [`IIntelligenceContext`](Interface.IIntelligenceContext) |
|
|
93
|
+
| Parameter | Type | Description |
|
|
94
|
+
| --------- | -------------------------------------------------------- | --------------------------------------- |
|
|
95
|
+
| `intent` | [`IIntelligenceIntent`](Interface.IIntelligenceIntent) | The structured intent to match against. |
|
|
96
|
+
| `context` | [`IIntelligenceContext`](Interface.IIntelligenceContext) | The aggregated context for the request. |
|
|
93
97
|
|
|
94
98
|
#### Returns
|
|
95
99
|
|
|
96
100
|
\| [`IIntelligenceCapability`](Interface.IIntelligenceCapability)
|
|
97
101
|
\| `null`
|
|
98
102
|
|
|
99
|
-
|
|
103
|
+
The matching capability, or `null` if none qualifies.
|
|
100
104
|
|
|
101
105
|
#### Implementation of
|
|
102
106
|
|
package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceModule.md
RENAMED
|
@@ -6,7 +6,7 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Class: IntelligenceModule
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [IntelligenceModule.ts:24](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceModule.ts#L24)
|
|
10
10
|
|
|
11
11
|
Core module exposing the shared intelligence infrastructure to feature modules.
|
|
12
12
|
|
package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceTextGenerator.md
RENAMED
|
@@ -6,7 +6,7 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Class: IntelligenceTextGenerator
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [IntelligenceTextGenerator.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceTextGenerator.ts#L23)
|
|
10
10
|
|
|
11
11
|
Executes text completions using the configured intelligence provider.
|
|
12
12
|
|
|
@@ -22,13 +22,13 @@ Executes text completions using the configured intelligence provider.
|
|
|
22
22
|
new IntelligenceTextGenerator(configService): IntelligenceTextGenerator;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [
|
|
25
|
+
Defined in: [IntelligenceTextGenerator.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceTextGenerator.ts#L37)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
29
|
-
| Parameter | Type
|
|
30
|
-
| --------------- |
|
|
31
|
-
| `configService` |
|
|
29
|
+
| Parameter | Type |
|
|
30
|
+
| --------------- | --------------- |
|
|
31
|
+
| `configService` | `ConfigService` |
|
|
32
32
|
|
|
33
33
|
#### Returns
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ Defined in: [intelligence/IntelligenceTextGenerator.ts:37](https://github.com/Ru
|
|
|
42
42
|
generateText(prompt, options?): Promise<IIntelligenceTextCompletion>;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [
|
|
45
|
+
Defined in: [IntelligenceTextGenerator.ts:57](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceTextGenerator.ts#L57)
|
|
46
46
|
|
|
47
47
|
Generates a completion using the configured provider.
|
|
48
48
|
|
|
@@ -69,7 +69,7 @@ Generates a completion using the configured provider.
|
|
|
69
69
|
getConfiguration(): IIntelligenceProviderConfiguration;
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Defined in: [
|
|
72
|
+
Defined in: [IntelligenceTextGenerator.ts:90](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/IntelligenceTextGenerator.ts#L90)
|
|
73
73
|
|
|
74
74
|
Returns the resolved provider configuration.
|
|
75
75
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: createProviderOptions()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: createProviderOptions()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function createProviderOptions(configuration): Record<string, unknown>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/createProviderOptions.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/createProviderOptions.ts#L14)
|
|
14
|
+
|
|
15
|
+
Creates the provider options object consumed by the AI SDK model factories.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
21
|
+
| `configuration` | [`IIntelligenceProviderConfiguration`](Interface.IIntelligenceProviderConfiguration) | The resolved provider configuration. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Record`\<`string`, `unknown`\>
|
|
26
|
+
|
|
27
|
+
The options record containing `apiKey` and optionally `baseURL`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: loadAnthropicLanguageModel()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: loadAnthropicLanguageModel()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function loadAnthropicLanguageModel(configuration): Promise<LanguageModelV2>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/loadAnthropicLanguageModel.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/loadAnthropicLanguageModel.ts#L17)
|
|
14
|
+
|
|
15
|
+
Loads the Anthropic language model based on the resolved provider configuration.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
21
|
+
| `configuration` | [`IIntelligenceProviderConfiguration`](Interface.IIntelligenceProviderConfiguration) | The resolved provider configuration. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`LanguageModelV2`\>
|
|
26
|
+
|
|
27
|
+
The configured language model instance.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: loadGoogleLanguageModel()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: loadGoogleLanguageModel()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function loadGoogleLanguageModel(configuration): Promise<LanguageModelV2>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/loadGoogleLanguageModel.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/loadGoogleLanguageModel.ts#L17)
|
|
14
|
+
|
|
15
|
+
Loads the Google (Gemini) language model based on the resolved provider configuration.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
21
|
+
| `configuration` | [`IIntelligenceProviderConfiguration`](Interface.IIntelligenceProviderConfiguration) | The resolved provider configuration. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`LanguageModelV2`\>
|
|
26
|
+
|
|
27
|
+
The configured language model instance.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: loadGrokLanguageModel()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: loadGrokLanguageModel()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function loadGrokLanguageModel(configuration): Promise<LanguageModelV2>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/loadGrokLanguageModel.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/loadGrokLanguageModel.ts#L17)
|
|
14
|
+
|
|
15
|
+
Loads the Grok (xAI) language model based on the resolved provider configuration.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
21
|
+
| `configuration` | [`IIntelligenceProviderConfiguration`](Interface.IIntelligenceProviderConfiguration) | The resolved provider configuration. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`LanguageModelV2`\>
|
|
26
|
+
|
|
27
|
+
The configured language model instance.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: loadOpenAILanguageModel()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: loadOpenAILanguageModel()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function loadOpenAILanguageModel(configuration): Promise<LanguageModelV2>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/loadOpenAILanguageModel.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/loadOpenAILanguageModel.ts#L17)
|
|
14
|
+
|
|
15
|
+
Loads the OpenAI compatible language model based on the resolved provider configuration.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
21
|
+
| `configuration` | [`IIntelligenceProviderConfiguration`](Interface.IIntelligenceProviderConfiguration) | The resolved provider configuration. |
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`LanguageModelV2`\>
|
|
26
|
+
|
|
27
|
+
The configured language model instance.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Function: loadProviderFactory()'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Function: loadProviderFactory()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function loadProviderFactory(moduleName, exportName): Promise<(model, options) => LanguageModelV2>;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [providers/ProviderFactoryLoader.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-intelligence/src/providers/ProviderFactoryLoader.ts#L16)
|
|
14
|
+
|
|
15
|
+
Dynamically loads an AI SDK provider factory and returns the exported function reference.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ------------ | -------- | ------------------------------------------------- |
|
|
21
|
+
| `moduleName` | `string` | The module that exports the factory function. |
|
|
22
|
+
| `exportName` | `string` | The named export containing the factory function. |
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`Promise`\<(`model`, `options`) => `LanguageModelV2`\>
|
|
27
|
+
|
|
28
|
+
The resolved factory function.
|
|
29
|
+
|
|
30
|
+
## Throws
|
|
31
|
+
|
|
32
|
+
When the module cannot be imported or the export is not a function.
|