@breadstone/archipel-mcp 0.0.10 → 0.0.13
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/guides/ai-text-generation.md +361 -0
- package/data/guides/analytics-and-error-tracking.md +189 -0
- package/data/guides/authentication-and-authorization.md +657 -0
- package/data/guides/blob-storage.md +242 -0
- package/data/guides/caching.md +255 -0
- package/data/guides/cryptography-and-otp.md +240 -0
- package/data/guides/database-setup.md +546 -0
- package/data/guides/document-generation.md +174 -0
- package/data/guides/email-delivery.md +196 -0
- package/data/guides/esigning-integration.md +231 -0
- package/data/guides/getting-started.md +351 -0
- package/data/guides/implementing-ports.md +317 -0
- package/data/guides/index.md +62 -0
- package/data/guides/mcp-server.md +222 -0
- package/data/guides/openapi-and-feature-discovery.md +266 -0
- package/data/guides/payments-and-feature-gating.md +244 -0
- package/data/guides/resource-management.md +352 -0
- package/data/guides/telemetry-and-observability.md +190 -0
- package/data/guides/testing.md +319 -0
- package/data/guides/tsdoc-guidelines.md +45 -0
- package/data/packages/platform-database/api/Class.DatabaseModule.md +3 -5
- package/data/packages/platform-database/api/Class.DatabaseService.md +5 -4
- package/data/packages/platform-database/api/Class.PrismaService.md +8 -7
- package/data/packages/platform-database/api/Interface.IDatabaseModuleConfig.md +13 -1
- package/data/packages/platform-database/api/Interface.IPrismaServiceOptions.md +22 -0
- package/data/packages/platform-database/api/Variable.DATABASE_MODULE_CONFIG.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_ACCELERATE_URL.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_AUTO_CONNECTION.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_OPTIMIZE.md +14 -0
- package/data/packages/platform-database/api/Variable.DB_OPTIMIZE_API_KEY.md +14 -0
- package/data/packages/platform-database/api/Variable.PLATFORM_DATABASE_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-database/api/index.md +13 -1
- package/data/packages/platform-database/index.md +41 -18
- package/data/packages/platform-openapi/api/Class.SwaggerFeatureDiscovery.md +10 -6
- package/data/packages/platform-telemetry/api/Class.NoopTelemetryFacade.md +10 -10
- package/data/packages/platform-telemetry/api/Interface.ITelemetryFacade.md +1 -1
- package/package.json +1 -1
- package/src/GuidesLoader.d.ts +13 -0
- package/src/GuidesLoader.js +81 -0
- package/src/main.js +36 -198
- package/src/models/IGuideDoc.d.ts +15 -0
- package/src/models/IGuideDoc.js +3 -0
- package/src/tools/registerGetConfigPatternTool.d.ts +5 -0
- package/src/tools/registerGetConfigPatternTool.js +15 -0
- package/src/tools/registerGetDtoPatternTool.d.ts +5 -0
- package/src/tools/registerGetDtoPatternTool.js +15 -0
- package/src/tools/registerGetErrorHandlingPatternTool.d.ts +5 -0
- package/src/tools/registerGetErrorHandlingPatternTool.js +15 -0
- package/src/tools/registerGetGuardPatternTool.d.ts +5 -0
- package/src/tools/registerGetGuardPatternTool.js +15 -0
- package/src/tools/registerGetGuideTool.d.ts +6 -0
- package/src/tools/registerGetGuideTool.js +32 -0
- package/src/tools/registerGetMappingPatternTool.d.ts +5 -0
- package/src/tools/registerGetMappingPatternTool.js +34 -0
- package/src/tools/registerGetModulePatternTool.d.ts +5 -0
- package/src/tools/registerGetModulePatternTool.js +29 -0
- package/src/tools/registerGetPackageDocTool.d.ts +6 -0
- package/src/tools/registerGetPackageDocTool.js +43 -0
- package/src/tools/registerGetQueryPatternTool.d.ts +5 -0
- package/src/tools/registerGetQueryPatternTool.js +29 -0
- package/src/tools/registerGetRepositoryPatternTool.d.ts +5 -0
- package/src/tools/registerGetRepositoryPatternTool.js +29 -0
- package/src/tools/registerGetTestingPatternTool.d.ts +5 -0
- package/src/tools/registerGetTestingPatternTool.js +15 -0
- package/src/tools/registerListGuidesTool.d.ts +6 -0
- package/src/tools/registerListGuidesTool.js +22 -0
- package/src/tools/registerListPackagesTool.d.ts +6 -0
- package/src/tools/registerListPackagesTool.js +20 -0
- package/src/tools/registerSearchDocsTool.d.ts +6 -0
- package/src/tools/registerSearchDocsTool.js +35 -0
- package/src/tools/registerSearchGuidesTool.d.ts +6 -0
- package/src/tools/registerSearchGuidesTool.js +28 -0
|
@@ -11,12 +11,24 @@ Represents the database module configuration.
|
|
|
11
11
|
|
|
12
12
|
## Properties
|
|
13
13
|
|
|
14
|
+
### accelerateUrl?
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
optional accelerateUrl?: string;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Defined in: [DatabaseModule.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/DatabaseModule.ts#L19)
|
|
21
|
+
|
|
22
|
+
Prisma Accelerate URL allowing the client to connect through Accelerate.
|
|
23
|
+
|
|
24
|
+
***
|
|
25
|
+
|
|
14
26
|
### middlewares?
|
|
15
27
|
|
|
16
28
|
```ts
|
|
17
29
|
optional middlewares?: unknown[];
|
|
18
30
|
```
|
|
19
31
|
|
|
20
|
-
Defined in: [DatabaseModule.ts:
|
|
32
|
+
Defined in: [DatabaseModule.ts:21](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/DatabaseModule.ts#L21)
|
|
21
33
|
|
|
22
34
|
Future extension point for Prisma middlewares
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Interface: IPrismaServiceOptions'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Interface: IPrismaServiceOptions
|
|
7
|
+
|
|
8
|
+
Defined in: [services/PrismaService.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/services/PrismaService.ts#L16)
|
|
9
|
+
|
|
10
|
+
Represents the options for the PrismaService.
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### accelerateUrl?
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
optional accelerateUrl?: string;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Defined in: [services/PrismaService.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/services/PrismaService.ts#L18)
|
|
21
|
+
|
|
22
|
+
Prisma Accelerate URL allowing the client to connect through Accelerate. Takes priority over the `DB_ACCELERATE_URL` config key.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: DATABASE\_MODULE\_CONFIG'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: DATABASE\_MODULE\_CONFIG
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const DATABASE_MODULE_CONFIG: "DATABASE_MODULE_CONFIG" = 'DATABASE_MODULE_CONFIG';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [DatabaseModule.ts:29](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/DatabaseModule.ts#L29)
|
|
13
|
+
|
|
14
|
+
Represents the database module.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: DB\_ACCELERATE\_URL'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: DB\_ACCELERATE\_URL
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const DB_ACCELERATE_URL: IConfigKey<string>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [configKeys.ts:11](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/configKeys.ts#L11)
|
|
13
|
+
|
|
14
|
+
Prisma Accelerate URL for managed connection pooling.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: DB\_AUTO\_CONNECTION'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: DB\_AUTO\_CONNECTION
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const DB_AUTO_CONNECTION: IConfigKey<boolean>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [configKeys.ts:8](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/configKeys.ts#L8)
|
|
13
|
+
|
|
14
|
+
Whether to skip the automatic database connection on module init.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: DB\_OPTIMIZE'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: DB\_OPTIMIZE
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const DB_OPTIMIZE: IConfigKey<boolean>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [configKeys.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/configKeys.ts#L14)
|
|
13
|
+
|
|
14
|
+
Whether Prisma Optimize query analysis is enabled.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: DB\_OPTIMIZE\_API\_KEY'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: DB\_OPTIMIZE\_API\_KEY
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const DB_OPTIMIZE_API_KEY: IConfigKey<string>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [configKeys.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/configKeys.ts#L17)
|
|
13
|
+
|
|
14
|
+
API key for the Prisma Optimize dashboard.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: PLATFORM\_DATABASE\_CONFIG\_ENTRIES'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: PLATFORM\_DATABASE\_CONFIG\_ENTRIES
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const PLATFORM_DATABASE_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [configKeys.ts:20](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-database/src/configKeys.ts#L20)
|
|
13
|
+
|
|
14
|
+
Core configuration entries required by `platform-database`.
|
|
@@ -10,7 +10,7 @@ editUrl: false
|
|
|
10
10
|
| Class | Description |
|
|
11
11
|
| ------ | ------ |
|
|
12
12
|
| [DatabaseHealthIndicator](Class.DatabaseHealthIndicator) | Health indicator for database connectivity. |
|
|
13
|
-
| [DatabaseModule](Class.DatabaseModule) |
|
|
13
|
+
| [DatabaseModule](Class.DatabaseModule) | - |
|
|
14
14
|
| [DatabaseService](Class.DatabaseService) | Represents the database service. |
|
|
15
15
|
| [PrismaService](Class.PrismaService) | Represents the prisma service. |
|
|
16
16
|
| [RepositoryBase](Class.RepositoryBase) | The base class for all repositories. |
|
|
@@ -23,6 +23,7 @@ editUrl: false
|
|
|
23
23
|
| [IDatabaseModuleConfig](Interface.IDatabaseModuleConfig) | Represents the database module configuration. |
|
|
24
24
|
| [IPaginatedResult](Interface.IPaginatedResult) | - |
|
|
25
25
|
| [IPaginateOptions](Interface.IPaginateOptions) | - |
|
|
26
|
+
| [IPrismaServiceOptions](Interface.IPrismaServiceOptions) | Represents the options for the PrismaService. |
|
|
26
27
|
| [IRepositoryQuery](Interface.IRepositoryQuery) | Represents a reusable query definition for repositories. |
|
|
27
28
|
| [ITransactionalRepositoryQuery](Interface.ITransactionalRepositoryQuery) | Represents a repository query that requires a Prisma TransactionClient to access multiple delegates. |
|
|
28
29
|
|
|
@@ -36,6 +37,17 @@ editUrl: false
|
|
|
36
37
|
| [QueryResultType](TypeAlias.QueryResultType) | Extracts the result type from a repository query. Useful for type-safe mapping without duplicating query result types. |
|
|
37
38
|
| [TransactionalQueryResultType](TypeAlias.TransactionalQueryResultType) | Extracts the result type from a transactional repository query. |
|
|
38
39
|
|
|
40
|
+
## Variables
|
|
41
|
+
|
|
42
|
+
| Variable | Description |
|
|
43
|
+
| ------ | ------ |
|
|
44
|
+
| [DATABASE\_MODULE\_CONFIG](Variable.DATABASE_MODULE_CONFIG) | Represents the database module. |
|
|
45
|
+
| [DB\_ACCELERATE\_URL](Variable.DB_ACCELERATE_URL) | Prisma Accelerate URL for managed connection pooling. |
|
|
46
|
+
| [DB\_AUTO\_CONNECTION](Variable.DB_AUTO_CONNECTION) | Whether to skip the automatic database connection on module init. |
|
|
47
|
+
| [DB\_OPTIMIZE](Variable.DB_OPTIMIZE) | Whether Prisma Optimize query analysis is enabled. |
|
|
48
|
+
| [DB\_OPTIMIZE\_API\_KEY](Variable.DB_OPTIMIZE_API_KEY) | API key for the Prisma Optimize dashboard. |
|
|
49
|
+
| [PLATFORM\_DATABASE\_CONFIG\_ENTRIES](Variable.PLATFORM_DATABASE_CONFIG_ENTRIES) | Core configuration entries required by `platform-database`. |
|
|
50
|
+
|
|
39
51
|
## Functions
|
|
40
52
|
|
|
41
53
|
| Function | Description |
|
|
@@ -16,10 +16,13 @@ Prisma ORM integration with PostgreSQL featuring a repository base class, type-s
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { Module } from '@nestjs/common';
|
|
19
|
-
import {
|
|
19
|
+
import { ConfigModule } from '@breadstone/archipel-platform-core';
|
|
20
|
+
import { DatabaseModule, PLATFORM_DATABASE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-database';
|
|
20
21
|
|
|
21
22
|
@Module({
|
|
22
23
|
imports: [
|
|
24
|
+
ConfigModule.register('database', PLATFORM_DATABASE_CONFIG_ENTRIES),
|
|
25
|
+
|
|
23
26
|
// Global registration (recommended)
|
|
24
27
|
DatabaseModule.forRoot(),
|
|
25
28
|
|
|
@@ -36,6 +39,7 @@ export class AppModule {}
|
|
|
36
39
|
|
|
37
40
|
```typescript
|
|
38
41
|
interface IDatabaseModuleConfig {
|
|
42
|
+
accelerateUrl?: string; // Prisma Accelerate URL (overrides DB_ACCELERATE_URL env var)
|
|
39
43
|
middlewares?: Array<unknown>; // Future extension point
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -46,14 +50,28 @@ DatabaseModule.forRoot(config?: IDatabaseModuleConfig): DynamicModule
|
|
|
46
50
|
DatabaseModule.register(config?: IDatabaseModuleConfig): DynamicModule
|
|
47
51
|
```
|
|
48
52
|
|
|
53
|
+
### Config Keys
|
|
54
|
+
|
|
55
|
+
Register all database config keys with `PLATFORM_DATABASE_CONFIG_ENTRIES`:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { ConfigModule } from '@breadstone/archipel-platform-core';
|
|
59
|
+
import { PLATFORM_DATABASE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-database';
|
|
60
|
+
|
|
61
|
+
ConfigModule.register('database', PLATFORM_DATABASE_CONFIG_ENTRIES);
|
|
62
|
+
```
|
|
63
|
+
|
|
49
64
|
### Environment Variables
|
|
50
65
|
|
|
51
|
-
| Variable | Description
|
|
52
|
-
| --------------------- |
|
|
53
|
-
| `DATABASE_URL` | PostgreSQL connection string
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
66
|
+
| Variable | Description | Required | Default |
|
|
67
|
+
| --------------------- | ----------------------------------------- | ------------------- | ------- |
|
|
68
|
+
| `DATABASE_URL` | PostgreSQL connection string | Yes | — |
|
|
69
|
+
| `DB_ACCELERATE_URL` | Prisma Accelerate proxy URL | No | `''` |
|
|
70
|
+
| `DB_AUTO_CONNECTION` | Auto-connect on module init | No | `true` |
|
|
71
|
+
| `DB_OPTIMIZE` | Enable Prisma Optimize query analysis | No | `true` |
|
|
72
|
+
| `DB_OPTIMIZE_API_KEY` | API key for the Prisma Optimize dashboard | If optimize enabled | `''` |
|
|
73
|
+
|
|
74
|
+
> **Accelerate resolution order:** `accelerateUrl` module parameter → `DB_ACCELERATE_URL` environment variable → no Accelerate.
|
|
57
75
|
|
|
58
76
|
---
|
|
59
77
|
|
|
@@ -287,14 +305,19 @@ import { DatabaseHealthIndicator } from '@breadstone/archipel-platform-database'
|
|
|
287
305
|
|
|
288
306
|
## Exports Summary
|
|
289
307
|
|
|
290
|
-
| Export
|
|
291
|
-
|
|
|
292
|
-
| `DatabaseModule`
|
|
293
|
-
| `DatabaseService`
|
|
294
|
-
| `PrismaService`
|
|
295
|
-
| `RepositoryBase`
|
|
296
|
-
| `query()`
|
|
297
|
-
| `transactionalQuery()`
|
|
298
|
-
| `paginator()`
|
|
299
|
-
| `DatabaseHealthIndicator`
|
|
300
|
-
| `
|
|
308
|
+
| Export | Type | Description |
|
|
309
|
+
| ---------------------------------- | -------------- | ---------------------------------------- |
|
|
310
|
+
| `DatabaseModule` | NestJS Module | `forRoot()` / `register()` |
|
|
311
|
+
| `DatabaseService` | Service | Extended Prisma client with transactions |
|
|
312
|
+
| `PrismaService` | Service | Prisma client with extensions |
|
|
313
|
+
| `RepositoryBase` | Abstract class | Base class for repositories |
|
|
314
|
+
| `query()` | Factory | Create typed query objects |
|
|
315
|
+
| `transactionalQuery()` | Factory | Create transactional query objects |
|
|
316
|
+
| `paginator()` | Factory | Create pagination helper |
|
|
317
|
+
| `DatabaseHealthIndicator` | Health | PostgreSQL health check |
|
|
318
|
+
| `PLATFORM_DATABASE_CONFIG_ENTRIES` | Constant | Config entries for `ConfigModule` |
|
|
319
|
+
| `DB_ACCELERATE_URL` | Config Key | Prisma Accelerate URL |
|
|
320
|
+
| `DB_AUTO_CONNECTION` | Config Key | Auto-connect toggle |
|
|
321
|
+
| `DB_OPTIMIZE` | Config Key | Prisma Optimize toggle |
|
|
322
|
+
| `DB_OPTIMIZE_API_KEY` | Config Key | Prisma Optimize API key |
|
|
323
|
+
| `DB` (Prisma) | Namespace | Re-exported Prisma types |
|
|
@@ -26,10 +26,10 @@ new SwaggerFeatureDiscovery(): SwaggerFeatureDiscovery;
|
|
|
26
26
|
### registerDefaultFeatures()
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
|
-
registerDefaultFeatures(featureRegistry):
|
|
29
|
+
registerDefaultFeatures(featureRegistry): this;
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Defined in: [discovery/SwaggerFeatureDiscovery.ts:
|
|
32
|
+
Defined in: [discovery/SwaggerFeatureDiscovery.ts:45](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-openapi/src/discovery/SwaggerFeatureDiscovery.ts#L45)
|
|
33
33
|
|
|
34
34
|
Registers the default composite Swagger documents that aggregate the complete API.
|
|
35
35
|
|
|
@@ -41,17 +41,19 @@ Registers the default composite Swagger documents that aggregate the complete AP
|
|
|
41
41
|
|
|
42
42
|
#### Returns
|
|
43
43
|
|
|
44
|
-
`
|
|
44
|
+
`this`
|
|
45
|
+
|
|
46
|
+
The discovery instance for chaining.
|
|
45
47
|
|
|
46
48
|
***
|
|
47
49
|
|
|
48
50
|
### registerDiscoveredFeatures()
|
|
49
51
|
|
|
50
52
|
```ts
|
|
51
|
-
registerDiscoveredFeatures(featureRegistry):
|
|
53
|
+
registerDiscoveredFeatures(featureRegistry): this;
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
Defined in: [discovery/SwaggerFeatureDiscovery.ts:
|
|
56
|
+
Defined in: [discovery/SwaggerFeatureDiscovery.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-openapi/src/discovery/SwaggerFeatureDiscovery.ts#L23)
|
|
55
57
|
|
|
56
58
|
Registers all discovered feature modules in the provided Swagger registry.
|
|
57
59
|
|
|
@@ -63,4 +65,6 @@ Registers all discovered feature modules in the provided Swagger registry.
|
|
|
63
65
|
|
|
64
66
|
#### Returns
|
|
65
67
|
|
|
66
|
-
`
|
|
68
|
+
`this`
|
|
69
|
+
|
|
70
|
+
The discovery instance for chaining.
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: NoopTelemetryFacade
|
|
7
7
|
|
|
8
|
-
Defined in: [core/NoopTelemetryFacade.ts:
|
|
8
|
+
Defined in: [core/NoopTelemetryFacade.ts:7](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-telemetry/src/core/NoopTelemetryFacade.ts#L7)
|
|
9
9
|
|
|
10
10
|
## Implements
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ new NoopTelemetryFacade(): NoopTelemetryFacade;
|
|
|
31
31
|
optional recordCacheEvent(_): void;
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Defined in: [core/NoopTelemetryFacade.ts:
|
|
34
|
+
Defined in: [core/NoopTelemetryFacade.ts:11](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-telemetry/src/core/NoopTelemetryFacade.ts#L11)
|
|
35
35
|
|
|
36
36
|
#### Parameters
|
|
37
37
|
|
|
@@ -56,21 +56,21 @@ Defined in: [core/NoopTelemetryFacade.ts:14](https://github.com/RueDeRennes/arch
|
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
58
|
optional recordClientMetric(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
_name,
|
|
60
|
+
_type,
|
|
61
|
+
_value,
|
|
62
62
|
_labels?): void;
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
Defined in: [core/NoopTelemetryFacade.ts:
|
|
65
|
+
Defined in: [core/NoopTelemetryFacade.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-telemetry/src/core/NoopTelemetryFacade.ts#L14)
|
|
66
66
|
|
|
67
67
|
#### Parameters
|
|
68
68
|
|
|
69
69
|
| Parameter | Type |
|
|
70
70
|
| ------ | ------ |
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
71
|
+
| `_name` | `string` |
|
|
72
|
+
| `_type` | `string` |
|
|
73
|
+
| `_value` | `number` |
|
|
74
74
|
| `_labels?` | `Record`\<`string`, `string`\> |
|
|
75
75
|
|
|
76
76
|
#### Returns
|
|
@@ -89,7 +89,7 @@ Defined in: [core/NoopTelemetryFacade.ts:19](https://github.com/RueDeRennes/arch
|
|
|
89
89
|
runOperation<T>(_, fn): Promise<T>;
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
Defined in: [core/NoopTelemetryFacade.ts:
|
|
92
|
+
Defined in: [core/NoopTelemetryFacade.ts:8](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-telemetry/src/core/NoopTelemetryFacade.ts#L8)
|
|
93
93
|
|
|
94
94
|
#### Type Parameters
|
|
95
95
|
|
|
@@ -42,7 +42,7 @@ optional recordClientMetric(
|
|
|
42
42
|
labels?): void;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [core/NoopTelemetryFacade.ts:
|
|
45
|
+
Defined in: [core/NoopTelemetryFacade.ts:4](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-telemetry/src/core/NoopTelemetryFacade.ts#L4)
|
|
46
46
|
|
|
47
47
|
#### Parameters
|
|
48
48
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone/archipel-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "MCP server providing Archipel platform knowledge — documentation, query patterns, and coding conventions — to AI development tools.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/main.js",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IGuideDoc } from './models/IGuideDoc';
|
|
2
|
+
/**
|
|
3
|
+
* Loads and indexes Archipel platform guides from the `.docs/guides/`
|
|
4
|
+
* directory (monorepo dev) or from the bundled `data/guides/` directory
|
|
5
|
+
* (published npm package).
|
|
6
|
+
*/
|
|
7
|
+
export declare class GuidesLoader {
|
|
8
|
+
private readonly _guides;
|
|
9
|
+
get guides(): ReadonlyMap<string, IGuideDoc>;
|
|
10
|
+
load(): void;
|
|
11
|
+
search(query: string): IGuideDoc[];
|
|
12
|
+
private resolveGuidesDirectory;
|
|
13
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuidesLoader = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const gray_matter_1 = tslib_1.__importDefault(require("gray-matter"));
|
|
6
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
7
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
8
|
+
/**
|
|
9
|
+
* Loads and indexes Archipel platform guides from the `.docs/guides/`
|
|
10
|
+
* directory (monorepo dev) or from the bundled `data/guides/` directory
|
|
11
|
+
* (published npm package).
|
|
12
|
+
*/
|
|
13
|
+
class GuidesLoader {
|
|
14
|
+
constructor() {
|
|
15
|
+
// #region Fields
|
|
16
|
+
this._guides = new Map();
|
|
17
|
+
// #endregion
|
|
18
|
+
}
|
|
19
|
+
// #endregion
|
|
20
|
+
// #region Properties
|
|
21
|
+
get guides() {
|
|
22
|
+
return this._guides;
|
|
23
|
+
}
|
|
24
|
+
// #endregion
|
|
25
|
+
// #region Methods
|
|
26
|
+
load() {
|
|
27
|
+
const guidesDirectory = this.resolveGuidesDirectory();
|
|
28
|
+
if (!guidesDirectory) {
|
|
29
|
+
process.stderr.write('[archipel-mcp] Warning: Could not locate guides directory.\n');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const files = fs.readdirSync(guidesDirectory).filter((file) => file.endsWith('.md') && file !== 'index.md');
|
|
33
|
+
for (const file of files) {
|
|
34
|
+
const filePath = path.join(guidesDirectory, file);
|
|
35
|
+
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
36
|
+
const parsed = (0, gray_matter_1.default)(raw);
|
|
37
|
+
const name = path.basename(file, '.md');
|
|
38
|
+
this._guides.set(name, {
|
|
39
|
+
name,
|
|
40
|
+
title: parsed.data['title'] || name,
|
|
41
|
+
description: parsed.data['description'] || '',
|
|
42
|
+
order: parsed.data['order'] || 999,
|
|
43
|
+
content: parsed.content.trim(),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
process.stderr.write(`[archipel-mcp] Loaded ${this._guides.size} guide(s)\n`);
|
|
47
|
+
}
|
|
48
|
+
search(query) {
|
|
49
|
+
const lowerQuery = query.toLowerCase();
|
|
50
|
+
const results = [];
|
|
51
|
+
for (const guide of this._guides.values()) {
|
|
52
|
+
if (guide.name.toLowerCase().includes(lowerQuery) ||
|
|
53
|
+
guide.title.toLowerCase().includes(lowerQuery) ||
|
|
54
|
+
guide.description.toLowerCase().includes(lowerQuery) ||
|
|
55
|
+
guide.content.toLowerCase().includes(lowerQuery)) {
|
|
56
|
+
results.push(guide);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return results.sort((a, b) => a.order - b.order);
|
|
60
|
+
}
|
|
61
|
+
resolveGuidesDirectory() {
|
|
62
|
+
// 1. Bundled data (published npm package)
|
|
63
|
+
const bundledPath = path.resolve(__dirname, '..', 'data', 'guides');
|
|
64
|
+
if (fs.existsSync(bundledPath)) {
|
|
65
|
+
return bundledPath;
|
|
66
|
+
}
|
|
67
|
+
// 2. Workspace root (monorepo dev)
|
|
68
|
+
const cwdPath = path.resolve(process.cwd(), '.docs', 'guides');
|
|
69
|
+
if (fs.existsSync(cwdPath)) {
|
|
70
|
+
return cwdPath;
|
|
71
|
+
}
|
|
72
|
+
// 3. Relative from compiled source (dist/tools/mcp/src/)
|
|
73
|
+
const relativePath = path.resolve(__dirname, '..', '..', '..', '..', '.docs', 'guides');
|
|
74
|
+
if (fs.existsSync(relativePath)) {
|
|
75
|
+
return relativePath;
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.GuidesLoader = GuidesLoader;
|
|
81
|
+
//# sourceMappingURL=GuidesLoader.js.map
|