@dcyfr/ai 1.0.2 ā 1.0.4
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/CHANGELOG.md +21 -0
- package/LICENSE +27 -1
- package/README.md +359 -23
- package/bin/cli.js +12 -0
- package/bin/tui/config-wizard.js +107 -0
- package/bin/tui/validation-dashboard.js +123 -0
- package/bin/tui.js +259 -0
- package/dist/ai/agents/agent-loader.d.ts.map +1 -1
- package/dist/ai/agents/agent-loader.js +4 -2
- package/dist/ai/agents/agent-loader.js.map +1 -1
- package/dist/ai/index.d.ts +2 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +2 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/mcp/index.d.ts +14 -2
- package/dist/ai/mcp/index.d.ts.map +1 -1
- package/dist/ai/mcp/index.js +11 -1
- package/dist/ai/mcp/index.js.map +1 -1
- package/dist/ai/mcp/servers/analytics/index.d.ts +19 -0
- package/dist/ai/mcp/servers/analytics/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/analytics/index.js +556 -0
- package/dist/ai/mcp/servers/analytics/index.js.map +1 -0
- package/dist/ai/mcp/servers/content-manager/content-provider.d.ts +61 -0
- package/dist/ai/mcp/servers/content-manager/content-provider.d.ts.map +1 -0
- package/dist/ai/mcp/servers/content-manager/content-provider.js +8 -0
- package/dist/ai/mcp/servers/content-manager/content-provider.js.map +1 -0
- package/dist/ai/mcp/servers/content-manager/index.d.ts +19 -0
- package/dist/ai/mcp/servers/content-manager/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/content-manager/index.js +236 -0
- package/dist/ai/mcp/servers/content-manager/index.js.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/index.d.ts +19 -0
- package/dist/ai/mcp/servers/design-tokens/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/index.js +422 -0
- package/dist/ai/mcp/servers/design-tokens/index.js.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/token-provider.d.ts +59 -0
- package/dist/ai/mcp/servers/design-tokens/token-provider.d.ts.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/token-provider.js +8 -0
- package/dist/ai/mcp/servers/design-tokens/token-provider.js.map +1 -0
- package/dist/ai/mcp/servers/promptintel/index.d.ts +19 -0
- package/dist/ai/mcp/servers/promptintel/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/promptintel/index.js +323 -0
- package/dist/ai/mcp/servers/promptintel/index.js.map +1 -0
- package/dist/ai/mcp/servers/shared/cache.d.ts +62 -0
- package/dist/ai/mcp/servers/shared/cache.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/cache.js +117 -0
- package/dist/ai/mcp/servers/shared/cache.js.map +1 -0
- package/dist/ai/mcp/servers/shared/promptintel-client.d.ts +53 -0
- package/dist/ai/mcp/servers/shared/promptintel-client.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/promptintel-client.js +185 -0
- package/dist/ai/mcp/servers/shared/promptintel-client.js.map +1 -0
- package/dist/ai/mcp/servers/shared/promptintel-types.d.ts +85 -0
- package/dist/ai/mcp/servers/shared/promptintel-types.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/promptintel-types.js +7 -0
- package/dist/ai/mcp/servers/shared/promptintel-types.js.map +1 -0
- package/dist/ai/mcp/servers/shared/rate-limiter.d.ts +54 -0
- package/dist/ai/mcp/servers/shared/rate-limiter.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/rate-limiter.js +122 -0
- package/dist/ai/mcp/servers/shared/rate-limiter.js.map +1 -0
- package/dist/ai/mcp/servers/shared/redis-client.d.ts +54 -0
- package/dist/ai/mcp/servers/shared/redis-client.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/redis-client.js +225 -0
- package/dist/ai/mcp/servers/shared/redis-client.js.map +1 -0
- package/dist/ai/mcp/servers/shared/types.d.ts +292 -0
- package/dist/ai/mcp/servers/shared/types.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/types.js +6 -0
- package/dist/ai/mcp/servers/shared/types.js.map +1 -0
- package/dist/ai/mcp/servers/shared/utils.d.ts +41 -0
- package/dist/ai/mcp/servers/shared/utils.d.ts.map +1 -0
- package/dist/ai/mcp/servers/shared/utils.js +183 -0
- package/dist/ai/mcp/servers/shared/utils.js.map +1 -0
- package/dist/ai/memory/config.d.ts +87 -0
- package/dist/ai/memory/config.d.ts.map +1 -0
- package/dist/ai/memory/config.js +154 -0
- package/dist/ai/memory/config.js.map +1 -0
- package/dist/ai/memory/dcyfr-memory.d.ts +63 -0
- package/dist/ai/memory/dcyfr-memory.d.ts.map +1 -0
- package/dist/ai/memory/dcyfr-memory.js +270 -0
- package/dist/ai/memory/dcyfr-memory.js.map +1 -0
- package/dist/ai/memory/index.d.ts +15 -0
- package/dist/ai/memory/index.d.ts.map +1 -0
- package/dist/ai/memory/index.js +15 -0
- package/dist/ai/memory/index.js.map +1 -0
- package/dist/ai/memory/mem0-client.d.ts +108 -0
- package/dist/ai/memory/mem0-client.d.ts.map +1 -0
- package/dist/ai/memory/mem0-client.js +166 -0
- package/dist/ai/memory/mem0-client.js.map +1 -0
- package/dist/ai/memory/types.d.ts +175 -0
- package/dist/ai/memory/types.d.ts.map +1 -0
- package/dist/ai/memory/types.js +10 -0
- package/dist/ai/memory/types.js.map +1 -0
- package/package.json +46 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1d6f12e`](https://github.com/dcyfr/dcyfr-ai/commit/1d6f12ed981054fcb0b26beac4be452926ba793f) Thanks [@dcyfr](https://github.com/dcyfr)! - Automated release management and CI improvements
|
|
8
|
+
|
|
9
|
+
- Added automated release workflows with changesets
|
|
10
|
+
- Fixed glob TypeScript compatibility issues
|
|
11
|
+
- Improved integration test handling for CI environments
|
|
12
|
+
- Added canary release workflow for pre-release testing
|
|
13
|
+
- Comprehensive CI pipeline with type checking, linting, and tests
|
|
14
|
+
|
|
3
15
|
All notable changes to @dcyfr/ai will be documented in this file.
|
|
4
16
|
|
|
5
17
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
@@ -10,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
22
|
### Added
|
|
11
23
|
|
|
12
24
|
#### Core Framework
|
|
25
|
+
|
|
13
26
|
- Configuration system with three-layer merge (defaults ā project ā env)
|
|
14
27
|
- Support for YAML, JSON, and package.json configuration formats
|
|
15
28
|
- Environment variable overrides for all configuration options
|
|
@@ -20,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
33
|
- Validation framework with parallel/serial execution modes
|
|
21
34
|
|
|
22
35
|
#### Plugin System
|
|
36
|
+
|
|
23
37
|
- Plugin manifest validation
|
|
24
38
|
- Lifecycle hooks (onLoad, onValidate, onComplete, onUnload)
|
|
25
39
|
- Error isolation and recovery
|
|
@@ -27,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
27
41
|
- Plugin timeout support
|
|
28
42
|
|
|
29
43
|
#### Telemetry
|
|
44
|
+
|
|
30
45
|
- Session management with context tracking
|
|
31
46
|
- Metric recording (compliance, test pass rate, costs)
|
|
32
47
|
- Agent statistics aggregation
|
|
@@ -35,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
35
50
|
- Memory storage adapter for testing
|
|
36
51
|
|
|
37
52
|
#### Provider Support
|
|
53
|
+
|
|
38
54
|
- Claude (Anthropic)
|
|
39
55
|
- Groq
|
|
40
56
|
- Ollama
|
|
@@ -43,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
59
|
- Generic provider interface
|
|
44
60
|
|
|
45
61
|
#### CLI Tools
|
|
62
|
+
|
|
46
63
|
- `init` - Initialize new project
|
|
47
64
|
- `config:init` - Create configuration file
|
|
48
65
|
- `config:validate` - Validate configuration
|
|
@@ -50,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
50
67
|
- `plugin:create` - Generate plugin template
|
|
51
68
|
|
|
52
69
|
#### Documentation
|
|
70
|
+
|
|
53
71
|
- Comprehensive getting started guide
|
|
54
72
|
- Complete API reference
|
|
55
73
|
- Plugin development guide
|
|
@@ -57,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
57
75
|
- Migration documentation
|
|
58
76
|
|
|
59
77
|
#### Configuration Templates
|
|
78
|
+
|
|
60
79
|
- Default YAML configuration
|
|
61
80
|
- Default JSON configuration
|
|
62
81
|
- Minimal configuration templates
|
|
@@ -70,6 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
70
89
|
- Zero breaking changes in API surface
|
|
71
90
|
|
|
72
91
|
### Developer Experience
|
|
92
|
+
|
|
73
93
|
- Type-safe configuration with Zod
|
|
74
94
|
- ESM modules with .d.ts declarations
|
|
75
95
|
- Comprehensive error messages
|
|
@@ -79,6 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
79
99
|
## [Unreleased]
|
|
80
100
|
|
|
81
101
|
### Planned
|
|
102
|
+
|
|
82
103
|
- Redis storage adapter for telemetry
|
|
83
104
|
- Database storage adapter
|
|
84
105
|
- Additional validation gates
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026
|
|
3
|
+
Copyright (c) 2025-2026 DCYFR Labs (https://www.dcyfr.ai)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -19,3 +19,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Commercial Use
|
|
26
|
+
|
|
27
|
+
This software is dual-licensed:
|
|
28
|
+
|
|
29
|
+
- **MIT License** applies to personal, educational, and non-commercial use
|
|
30
|
+
- **Commercial License** required for business and revenue-generating use
|
|
31
|
+
|
|
32
|
+
### Commercial use includes:
|
|
33
|
+
- Using @dcyfr/ai in a product or service that generates revenue
|
|
34
|
+
- Deploying in a business environment (>5 employees)
|
|
35
|
+
- Providing consulting/services using @dcyfr/ai for profit
|
|
36
|
+
- Distributing as part of a commercial offering
|
|
37
|
+
|
|
38
|
+
### To obtain a commercial license:
|
|
39
|
+
- View tiers: https://github.com/dcyfr/workspace/blob/main/SPONSORSHIP.md
|
|
40
|
+
- Contact: licensing@dcyfr.ai
|
|
41
|
+
- GitHub Sponsors: https://github.com/sponsors/dcyfr
|
|
42
|
+
|
|
43
|
+
For questions about whether your use requires a commercial license, contact licensing@dcyfr.ai.
|
|
44
|
+
|
|
45
|
+
## Trademark
|
|
46
|
+
|
|
47
|
+
"DCYFR" is a trademark of DCYFR Labs. See TRADEMARK.md for usage guidelines.
|
package/README.md
CHANGED
|
@@ -2,13 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
> Portable AI agent framework with plugin architecture for multi-provider integration, telemetry tracking, and quality validation.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@dcyfr/ai)
|
|
6
|
+
[](https://www.npmjs.com/package/@dcyfr/ai)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://bundlephobia.com/package/@dcyfr/ai)
|
|
9
10
|
|
|
10
11
|
Portable AI agent framework with plugin architecture for managing multiple AI providers, tracking telemetry, and ensuring quality compliance.
|
|
11
12
|
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary>š Table of Contents</summary>
|
|
17
|
+
|
|
18
|
+
- [Features](#features)
|
|
19
|
+
- [Installation](#installation)
|
|
20
|
+
- [Quick Start](#quick-start)
|
|
21
|
+
- [Configuration](#configuration)
|
|
22
|
+
- [File Formats](#file-formats)
|
|
23
|
+
- [Three-Layer Merge](#three-layer-merge)
|
|
24
|
+
- [Environment Overrides](#environment-overrides)
|
|
25
|
+
- [Architecture](#architecture)
|
|
26
|
+
- [Plugin System](#plugin-system)
|
|
27
|
+
- [Built-in Agents](#built-in-agents)
|
|
28
|
+
- [Custom Plugins](#custom-plugins)
|
|
29
|
+
- [CLI Commands](#cli-commands)
|
|
30
|
+
- [Examples](#examples)
|
|
31
|
+
- [Documentation](#documentation)
|
|
32
|
+
- [Contributing](#contributing)
|
|
33
|
+
- [Troubleshooting](#-troubleshooting)
|
|
34
|
+
- [Installation Issues](#installation-issues)
|
|
35
|
+
- [Configuration Issues](#configuration-issues)
|
|
36
|
+
- [Plugin Issues](#plugin-issues)
|
|
37
|
+
- [CLI Issues](#cli-issues)
|
|
38
|
+
- [FAQ](#-faq)
|
|
39
|
+
- [Performance Benchmarks](#-performance-benchmarks)
|
|
40
|
+
- [Security](#-security)
|
|
41
|
+
- [Known Limitations](#ļø-known-limitations)
|
|
42
|
+
- [License & Sponsorship](#-license--sponsorship)
|
|
43
|
+
|
|
44
|
+
</details>
|
|
45
|
+
|
|
12
46
|
## Features
|
|
13
47
|
|
|
14
48
|
- š **Plugin Architecture** - Extensible validation system with custom agents
|
|
@@ -88,6 +122,42 @@ npx @dcyfr/ai config:validate
|
|
|
88
122
|
npx @dcyfr/ai config:validate --verbose
|
|
89
123
|
```
|
|
90
124
|
|
|
125
|
+
## Architecture
|
|
126
|
+
|
|
127
|
+
The DCYFR AI framework follows a layered architecture with clear separation of concerns:
|
|
128
|
+
|
|
129
|
+
```mermaid
|
|
130
|
+
graph TB
|
|
131
|
+
A[Configuration Files] -->|Load & Merge| B[Config Loader]
|
|
132
|
+
B -->|Initialize| C[Plugin Registry]
|
|
133
|
+
C -->|Register| D[Validation Engine]
|
|
134
|
+
C -->|Register| E[Telemetry Engine]
|
|
135
|
+
D -->|Execute| F[Quality Gates]
|
|
136
|
+
E -->|Track| G[Storage Adapters]
|
|
137
|
+
B -->|Configure| H[CLI Interface]
|
|
138
|
+
H -->|Commands| I[User]
|
|
139
|
+
|
|
140
|
+
style A fill:#e1f5ff
|
|
141
|
+
style B fill:#fff3cd
|
|
142
|
+
style C fill:#d4edda
|
|
143
|
+
style D fill:#d4edda
|
|
144
|
+
style E fill:#d4edda
|
|
145
|
+
style H fill:#cfe2ff
|
|
146
|
+
style I fill:#f8d7da
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Key Components
|
|
150
|
+
|
|
151
|
+
- **Config Loader**: Three-layer merge system (defaults ā project config ā env vars)
|
|
152
|
+
- **Plugin Registry**: Manages custom and built-in validation agents
|
|
153
|
+
- **Validation Engine**: Executes quality gates in parallel or serial mode
|
|
154
|
+
- **Telemetry Engine**: Tracks usage, costs, quality metrics with pluggable storage
|
|
155
|
+
- **CLI Interface**: User-facing commands for config management and validation
|
|
156
|
+
|
|
157
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
91
161
|
## Configuration
|
|
92
162
|
|
|
93
163
|
### File Formats
|
|
@@ -154,6 +224,10 @@ const loader = new PluginLoader();
|
|
|
154
224
|
await loader.loadPlugin(customPlugin);
|
|
155
225
|
```
|
|
156
226
|
|
|
227
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
157
231
|
## CLI Commands
|
|
158
232
|
|
|
159
233
|
```bash
|
|
@@ -174,6 +248,10 @@ npx @dcyfr/ai config:schema
|
|
|
174
248
|
npx @dcyfr/ai help
|
|
175
249
|
```
|
|
176
250
|
|
|
251
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
177
255
|
## Examples
|
|
178
256
|
|
|
179
257
|
See [examples/](./examples/) directory:
|
|
@@ -187,31 +265,289 @@ See [examples/](./examples/) directory:
|
|
|
187
265
|
- [Configuration Guide](./docs/configuration.md)
|
|
188
266
|
- [Plugin Development](./docs/plugins.md)
|
|
189
267
|
- [API Reference](./docs/api.md)
|
|
268
|
+
- [Release Management](./docs/RELEASE_MANAGEMENT.md) - Publishing and versioning
|
|
269
|
+
- [Quick Release Guide](./docs/RELEASE_QUICK_START.md) - TL;DR for releases
|
|
190
270
|
|
|
191
|
-
##
|
|
271
|
+
## Contributing
|
|
272
|
+
|
|
273
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
|
|
192
274
|
|
|
275
|
+
### Release Process
|
|
276
|
+
|
|
277
|
+
We use [Changesets](https://github.com/changesets/changesets) for automated versioning and publishing.
|
|
278
|
+
|
|
279
|
+
**For contributors:**
|
|
280
|
+
```bash
|
|
281
|
+
# Add a changeset describing your changes
|
|
282
|
+
npm run changeset
|
|
283
|
+
|
|
284
|
+
# Commit the changeset with your PR
|
|
285
|
+
git add .changeset/*.md
|
|
286
|
+
git commit -m "feat: your feature"
|
|
193
287
|
```
|
|
194
|
-
@dcyfr/ai (Public Framework)
|
|
195
|
-
āāā Core
|
|
196
|
-
ā āāā TelemetryEngine - Usage tracking
|
|
197
|
-
ā āāā ProviderRegistry - Multi-provider AI
|
|
198
|
-
āāā Plugins
|
|
199
|
-
ā āāā PluginLoader - Dynamic loading
|
|
200
|
-
ā āāā ValidationFramework - Quality gates
|
|
201
|
-
āāā Config
|
|
202
|
-
ā āāā Schema (Zod) - Validation
|
|
203
|
-
ā āāā Loader - Three-layer merge
|
|
204
|
-
āāā CLI
|
|
205
|
-
āāā Config tools
|
|
206
288
|
|
|
207
|
-
|
|
208
|
-
|
|
289
|
+
**For maintainers:**
|
|
290
|
+
- Changesets automatically creates Release PRs
|
|
291
|
+
- Merging a Release PR publishes to npm
|
|
292
|
+
- See [Release Management](./docs/RELEASE_MANAGEMENT.md) for full details
|
|
293
|
+
|
|
294
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## š§ Troubleshooting
|
|
299
|
+
|
|
300
|
+
### Installation Issues
|
|
301
|
+
|
|
302
|
+
**Issue: `npm install @dcyfr/ai` fails with 404**
|
|
303
|
+
- **Cause:** Package may not be published yet or npm registry issue
|
|
304
|
+
- **Solution:** Verify package exists: `npm view @dcyfr/ai`, or install from GitHub: `npm install git+https://github.com/dcyfr/dcyfr-ai.git`
|
|
305
|
+
- **Check:** Visit https://www.npmjs.com/package/@dcyfr/ai to confirm publication status
|
|
306
|
+
|
|
307
|
+
**Issue: "Cannot find module '@dcyfr/ai'"**
|
|
308
|
+
- **Cause:** Package not in `node_modules` or incorrect import path
|
|
309
|
+
- **Solution:** Run `npm install`, verify import: `import { loadConfig } from '@dcyfr/ai'`
|
|
310
|
+
- **TypeScript:** Ensure `moduleResolution: "bundler"` or `"node16"` in tsconfig.json
|
|
311
|
+
|
|
312
|
+
### Configuration Issues
|
|
313
|
+
|
|
314
|
+
**Issue: `.dcyfr.yaml` not detected**
|
|
315
|
+
- **Cause:** File in wrong location or invalid YAML syntax
|
|
316
|
+
- **Solution:**
|
|
317
|
+
1. Place `.dcyfr.yaml` in project root (same directory as package.json)
|
|
318
|
+
2. Validate YAML syntax with `npx @dcyfr/ai config:validate`
|
|
319
|
+
3. Check for tabs (use spaces), missing colons, incorrect indentation
|
|
320
|
+
- **Alternative:** Use `.dcyfr.json` or add `dcyfr` key to `package.json`
|
|
321
|
+
|
|
322
|
+
**Issue: "Invalid configuration schema"**
|
|
323
|
+
- **Cause:** Missing required fields or incorrect types
|
|
324
|
+
- **Solution:**
|
|
325
|
+
1. Run `npx @dcyfr/ai config:schema` to see full schema
|
|
326
|
+
2. Ensure required fields present: `version`, `projectName`
|
|
327
|
+
3. Check types match (strings in quotes, booleans without quotes, arrays with brackets)
|
|
328
|
+
- **Example:** Valid config minimum:
|
|
329
|
+
```yaml
|
|
330
|
+
version: '1.0.0'
|
|
331
|
+
projectName: my-app
|
|
209
332
|
```
|
|
210
333
|
|
|
211
|
-
|
|
334
|
+
**Issue: Environment variables not overriding config**
|
|
335
|
+
- **Cause:** Incorrect env var naming or precedence
|
|
336
|
+
- **Solution:** Use `DCYFR_` prefix with nested path: `DCYFR_AGENTS_DESIGNTOKENS_COMPLIANCE=0.95`
|
|
337
|
+
- **Format:** `DCYFR_<SECTION>_<SUBSECTION>_<KEY>=<value>` (uppercase, underscores)
|
|
338
|
+
- **Debug:** Log final config to see what values are being used
|
|
339
|
+
|
|
340
|
+
### Plugin Issues
|
|
341
|
+
|
|
342
|
+
**Issue: Custom plugin not loading**
|
|
343
|
+
- **Cause:** Plugin doesn't implement required interface or missing manifest
|
|
344
|
+
- **Solution:** Ensure plugin exports:
|
|
345
|
+
1. `manifest` object with `name`, `version`, `description`
|
|
346
|
+
2. `onValidate` method (async function)
|
|
347
|
+
3. Proper TypeScript types if using TypeScript
|
|
348
|
+
- **Example:** See [examples/plugin-system.ts](./examples/plugin-system.ts)
|
|
349
|
+
|
|
350
|
+
**Issue: Validation fails with "No plugins loaded"**
|
|
351
|
+
- **Cause:** Plugins not registered with PluginLoader before validation
|
|
352
|
+
- **Solution:**
|
|
353
|
+
```typescript
|
|
354
|
+
import { PluginLoader } from '@dcyfr/ai';
|
|
355
|
+
const loader = new PluginLoader();
|
|
356
|
+
await loader.loadPlugin(myPlugin);
|
|
357
|
+
await loader.runValidation();
|
|
358
|
+
```
|
|
212
359
|
|
|
213
|
-
|
|
360
|
+
### CLI Issues
|
|
214
361
|
|
|
215
|
-
|
|
362
|
+
**Issue: `npx @dcyfr/ai` command not found**
|
|
363
|
+
- **Cause:** Package not installed or PATH issue
|
|
364
|
+
- **Solution:**
|
|
365
|
+
- Local: Add to devDependencies: `npm install --save-dev @dcyfr/ai`
|
|
366
|
+
- Global: `npm install -g @dcyfr/ai`
|
|
367
|
+
- npx: Use full package name: `npx @dcyfr/ai@latest`
|
|
216
368
|
|
|
217
|
-
|
|
369
|
+
**Issue: CLI commands hang or timeout**
|
|
370
|
+
- **Cause:** Large project or slow file system operations
|
|
371
|
+
- **Solution:**
|
|
372
|
+
1. Use `--files` flag to target specific files: `npx @dcyfr/ai validate --files "src/**/*.ts"`
|
|
373
|
+
2. Increase timeout in config: `timeout: 60000` (60 seconds)
|
|
374
|
+
3. Check for infinite loops in custom plugins
|
|
375
|
+
|
|
376
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## š FAQ
|
|
381
|
+
|
|
382
|
+
**Q: Is @dcyfr/ai published to npm?**
|
|
383
|
+
|
|
384
|
+
A: Yes, it's published as a public package on npm. Install with `npm install @dcyfr/ai`. Check https://www.npmjs.com/package/@dcyfr/ai for latest version and stats.
|
|
385
|
+
|
|
386
|
+
**Q: Can I use @dcyfr/ai with JavaScript (no TypeScript)?**
|
|
387
|
+
|
|
388
|
+
A: Yes, but TypeScript is strongly recommended for better type safety and IDE support. The framework provides full TypeScript support with Zod validation for runtime type checking. If using JavaScript, you'll miss compile-time type checking but runtime validation still works.
|
|
389
|
+
|
|
390
|
+
**Q: How do I create a custom validation plugin?**
|
|
391
|
+
|
|
392
|
+
A: Implement the `Plugin` interface with `manifest` and `onValidate` method:
|
|
393
|
+
```typescript
|
|
394
|
+
export const myPlugin = {
|
|
395
|
+
manifest: {
|
|
396
|
+
name: 'my-plugin',
|
|
397
|
+
version: '1.0.0',
|
|
398
|
+
description: 'My custom validation'
|
|
399
|
+
},
|
|
400
|
+
async onValidate(context) {
|
|
401
|
+
// Your validation logic here
|
|
402
|
+
return { passed: true, issues: [] };
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
```
|
|
406
|
+
See [docs/plugins.md](./docs/plugins.md) and [examples/plugin-system.ts](./examples/plugin-system.ts) for complete guide.
|
|
407
|
+
|
|
408
|
+
**Q: What's the difference between @dcyfr/ai and @dcyfr/agents?**
|
|
409
|
+
|
|
410
|
+
A: `@dcyfr/ai` is the **public framework** (plugin architecture, config management, telemetry engine, validation framework). `@dcyfr/agents` is a **private package** with DCYFR-specific validation agents (design tokens, barrel exports, PageLayout enforcement). Think of @dcyfr/ai as the engine, @dcyfr/agents as pre-built plugins.
|
|
411
|
+
|
|
412
|
+
**Q: Can I use this with other AI providers (non-Claude)?**
|
|
413
|
+
|
|
414
|
+
A: Yes! The framework supports multi-provider integration including Claude, GitHub Copilot, Groq, Ollama, OpenAI, Anthropic. Configure providers in `.dcyfr.yaml`:
|
|
415
|
+
```yaml
|
|
416
|
+
providers:
|
|
417
|
+
- name: openai
|
|
418
|
+
apiKey: ${OPENAI_API_KEY}
|
|
419
|
+
- name: anthropic
|
|
420
|
+
apiKey: ${ANTHROPIC_API_KEY}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Q: How do I track telemetry and costs?**
|
|
424
|
+
|
|
425
|
+
A: Use the `TelemetryEngine` with storage adapters:
|
|
426
|
+
```typescript
|
|
427
|
+
import { TelemetryEngine, FileStorageAdapter } from '@dcyfr/ai';
|
|
428
|
+
const telemetry = new TelemetryEngine({
|
|
429
|
+
storage: new FileStorageAdapter('./telemetry')
|
|
430
|
+
});
|
|
431
|
+
```
|
|
432
|
+
Telemetry tracks: API calls, token usage, costs, latency, quality scores. See [docs/configuration.md](./docs/configuration.md#telemetry) for full guide.
|
|
433
|
+
|
|
434
|
+
**Q: Is this framework production-ready?**
|
|
435
|
+
|
|
436
|
+
A: Yes! @dcyfr/ai is used in production at dcyfr-labs and other projects. It has comprehensive test coverage, semantic versioning, automated releases via Changesets, and follows best practices for package publishing.
|
|
437
|
+
|
|
438
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## š Performance Benchmarks
|
|
443
|
+
|
|
444
|
+
### Framework Performance
|
|
445
|
+
- **Config Loading:** ~10ms (cached), ~50ms (first load with file I/O)
|
|
446
|
+
- **Validation Framework:** Parallel execution 2-5x faster than serial (depends on plugin count)
|
|
447
|
+
- **Plugin System:** Minimal overhead ~5ms per plugin registration
|
|
448
|
+
- **Bundle Size:** ~200KB gzipped (includes Zod validation library)
|
|
449
|
+
|
|
450
|
+
### Recommended Usage Patterns
|
|
451
|
+
- **Use parallel validation** for independent checks (faster): `mode: 'parallel'`
|
|
452
|
+
- **Cache config loading** (use singleton pattern): Load once, reuse across app
|
|
453
|
+
- **Batch telemetry writes** (reduce I/O overhead): Buffer writes, flush periodically
|
|
454
|
+
- **Lazy load plugins** (faster startup): Only load plugins you need for current validation
|
|
455
|
+
|
|
456
|
+
### Comparison with Alternatives
|
|
457
|
+
- **vs. Custom Scripts:** 10-20x faster due to optimized plugin execution
|
|
458
|
+
- **vs. Serial Validation:** 2-5x faster with parallel execution mode
|
|
459
|
+
- **vs. LangChain:** ~10x smaller bundle size (~200KB vs 2MB+)
|
|
460
|
+
|
|
461
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## š Security
|
|
466
|
+
|
|
467
|
+
### Reporting Vulnerabilities
|
|
468
|
+
Found a security issue? Report it privately:
|
|
469
|
+
- **GitHub Security Advisories:** [dcyfr-ai/security](https://github.com/dcyfr/dcyfr-ai/security/advisories/new)
|
|
470
|
+
- **Expected Response:** Within 48 hours
|
|
471
|
+
|
|
472
|
+
### Security Considerations
|
|
473
|
+
- **No API keys stored:** Use environment variables for sensitive data (Zod validates but doesn't store)
|
|
474
|
+
- **Zod validation:** All inputs validated with schemas before processing
|
|
475
|
+
- **No remote code execution:** Plugins run in local environment only (no sandboxing yet - see limitations)
|
|
476
|
+
- **Telemetry privacy:** Optional, disable with `DCYFR_TELEMETRY_ENABLED=false`
|
|
477
|
+
- **Dependencies:** Regular Dependabot updates, npm audit on CI
|
|
478
|
+
|
|
479
|
+
### Best Practices
|
|
480
|
+
- Never commit `.env` files (use `.env.example`)
|
|
481
|
+
- Use environment variables for API keys: `${OPENAI_API_KEY}`
|
|
482
|
+
- Review plugin code before loading (plugins have full access to filesystem)
|
|
483
|
+
- Keep dependencies updated: `npm outdated`, `npm update`
|
|
484
|
+
- Enable GitHub security scanning in your repository
|
|
485
|
+
|
|
486
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## āļø Known Limitations
|
|
491
|
+
|
|
492
|
+
### Current Constraints
|
|
493
|
+
- **Plugin isolation:** Plugins run in same process (no sandboxing yet) - trust plugin code before loading
|
|
494
|
+
- **File-based telemetry only:** No database storage adapter yet (planned for v2.0)
|
|
495
|
+
- **Config caching:** Requires manual cache invalidation on config changes (no hot-reload yet)
|
|
496
|
+
- **Provider-specific features:** Some providers may have limited support (e.g., streaming not supported for all)
|
|
497
|
+
- **TypeScript required for development:** JavaScript works at runtime but TypeScript recommended for development
|
|
498
|
+
|
|
499
|
+
### Platform-Specific Issues
|
|
500
|
+
- **Windows:** Path separators handled automatically but some plugins may have issues
|
|
501
|
+
- **Node.js version:** Requires ā„18.0.0 (uses native fetch, modern APIs)
|
|
502
|
+
- **ESM-only:** Package is ESM (ECMAScript Modules) - CommonJS require() not supported
|
|
503
|
+
|
|
504
|
+
### Planned Improvements
|
|
505
|
+
- [ ] Database storage adapter for telemetry (PostgreSQL, SQLite)
|
|
506
|
+
- [ ] Plugin sandboxing for security (worker threads or VM isolation)
|
|
507
|
+
- [ ] Hot-reload config watching (auto-reload on file changes)
|
|
508
|
+
- [ ] Web UI for telemetry dashboard (view costs, usage, quality over time)
|
|
509
|
+
- [ ] Enhanced provider feature parity (streaming, function calling, vision)
|
|
510
|
+
- [ ] CommonJS compatibility mode (for legacy projects)
|
|
511
|
+
|
|
512
|
+
See [GitHub Issues](https://github.com/dcyfr/dcyfr-ai/issues) for tracked feature requests and bugs.
|
|
513
|
+
|
|
514
|
+
[ā¬ļø Back to top](#dcyfr-ai)
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## š License & Sponsorship
|
|
519
|
+
|
|
520
|
+
**License:** MIT for personal/non-commercial use. Commercial use requires a paid tier.
|
|
521
|
+
|
|
522
|
+
### Commercial Use
|
|
523
|
+
|
|
524
|
+
This package is dual-licensed:
|
|
525
|
+
- **MIT License** for personal, educational, and non-commercial use (free)
|
|
526
|
+
- **Commercial License** for business and revenue-generating use (paid)
|
|
527
|
+
|
|
528
|
+
**Commercial use includes:**
|
|
529
|
+
- Using @dcyfr/ai in SaaS products or revenue-generating services
|
|
530
|
+
- Deploying in companies with >5 employees
|
|
531
|
+
- Providing paid consulting/services using @dcyfr/ai
|
|
532
|
+
- Distributing as part of commercial products
|
|
533
|
+
|
|
534
|
+
### Sponsorship Tiers
|
|
535
|
+
|
|
536
|
+
- š **Community** ($5/mo) - Signal community access (DCYFR.NET, Quantum Flux)
|
|
537
|
+
- š **Sponsors** ($10/mo) - Bio on dcyfr.ai website + private channels
|
|
538
|
+
- šØāš» **Developer** ($20/mo) - Limited commercial license + pre-release builds + portfolio support
|
|
539
|
+
- š **Founder** ($2,400/yr) - Full commercial license + 1hr consultation/mo
|
|
540
|
+
- š¼ **Executive** ($4,800/yr) - Business license + 2hr consultation/mo + 50 employees
|
|
541
|
+
- š¢ **Enterprise** ($9,600/yr) - Enterprise license + 4hr consultation/mo + unlimited scale
|
|
542
|
+
|
|
543
|
+
**Learn more:** [SPONSORSHIP.md](https://github.com/dcyfr/workspace/blob/main/SPONSORSHIP.md)
|
|
544
|
+
**Join:** [GitHub Sponsors](https://github.com/sponsors/dcyfr)
|
|
545
|
+
**Contact:** licensing@dcyfr.ai
|
|
546
|
+
|
|
547
|
+
### Trademark
|
|
548
|
+
|
|
549
|
+
"DCYFR" is a trademark of DCYFR Labs. See [TRADEMARK.md](https://github.com/dcyfr/workspace/blob/main/TRADEMARK.md) for usage guidelines.
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
**Made with ā¤ļø by [DCYFR Labs](https://dcyfr.ai)**
|
package/bin/cli.js
CHANGED
|
@@ -176,6 +176,8 @@ Commands:
|
|
|
176
176
|
config:validate Validate configuration file
|
|
177
177
|
config:init Initialize new configuration file
|
|
178
178
|
config:schema Show configuration schema
|
|
179
|
+
tui:dashboard Interactive validation dashboard (OpenTUI)
|
|
180
|
+
tui:wizard Interactive configuration wizard (OpenTUI)
|
|
179
181
|
help Show this help message
|
|
180
182
|
|
|
181
183
|
Options:
|
|
@@ -230,6 +232,16 @@ async function main() {
|
|
|
230
232
|
await showSchema();
|
|
231
233
|
break;
|
|
232
234
|
|
|
235
|
+
case 'tui:dashboard':
|
|
236
|
+
case 'tui:wizard':
|
|
237
|
+
case 'tui':
|
|
238
|
+
// Delegate to TUI CLI
|
|
239
|
+
console.log('šØ Launching interactive TUI...\n');
|
|
240
|
+
console.log('Use: npx @dcyfr/ai-tui ' + options.command.replace('tui:', ''));
|
|
241
|
+
console.log('Or run: node bin/tui.js ' + options.command.replace('tui:', ''));
|
|
242
|
+
process.exit(0);
|
|
243
|
+
break;
|
|
244
|
+
|
|
233
245
|
case 'help':
|
|
234
246
|
case '--help':
|
|
235
247
|
case '-h':
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive Configuration Wizard
|
|
3
|
+
* Uses inquirer for interactive prompts
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import inquirer from 'inquirer';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Run configuration wizard
|
|
11
|
+
*/
|
|
12
|
+
export async function runConfigWizard() {
|
|
13
|
+
console.log(chalk.cyan.bold('\nāļø DCYFR Configuration Wizard\n'));
|
|
14
|
+
console.log(chalk.gray('Configure your AI agent framework\n'));
|
|
15
|
+
|
|
16
|
+
const answers = await inquirer.prompt([
|
|
17
|
+
{
|
|
18
|
+
type: 'input',
|
|
19
|
+
name: 'projectName',
|
|
20
|
+
message: 'Project name:',
|
|
21
|
+
default: 'my-project',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'list',
|
|
25
|
+
name: 'format',
|
|
26
|
+
message: 'Config format:',
|
|
27
|
+
choices: [
|
|
28
|
+
{ name: 'YAML (Recommended)', value: 'yaml' },
|
|
29
|
+
{ name: 'JSON', value: 'json' },
|
|
30
|
+
],
|
|
31
|
+
default: 'yaml',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'confirm',
|
|
35
|
+
name: 'telemetryEnabled',
|
|
36
|
+
message: 'Enable telemetry?',
|
|
37
|
+
default: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'confirm',
|
|
41
|
+
name: 'validationEnabled',
|
|
42
|
+
message: 'Enable validation?',
|
|
43
|
+
default: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 'confirm',
|
|
47
|
+
name: 'parallelExecution',
|
|
48
|
+
message: 'Enable parallel execution?',
|
|
49
|
+
default: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'number',
|
|
53
|
+
name: 'designTokenCompliance',
|
|
54
|
+
message: 'Design token compliance threshold (%):',
|
|
55
|
+
default: 90,
|
|
56
|
+
when: (answers) => answers.validationEnabled,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'number',
|
|
60
|
+
name: 'pageLayoutUsage',
|
|
61
|
+
message: 'PageLayout usage threshold (%):',
|
|
62
|
+
default: 90,
|
|
63
|
+
when: (answers) => answers.validationEnabled,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'checkbox',
|
|
67
|
+
name: 'agents',
|
|
68
|
+
message: 'Select agents to enable:',
|
|
69
|
+
choices: [
|
|
70
|
+
{ name: 'Design Tokens', value: 'designTokens', checked: true },
|
|
71
|
+
{ name: 'Barrel Exports', value: 'barrelExports', checked: true },
|
|
72
|
+
{ name: 'Page Layout', value: 'pageLayout', checked: true },
|
|
73
|
+
{ name: 'Test Data', value: 'testData', checked: true },
|
|
74
|
+
{ name: 'API Pattern', value: 'apiPattern', checked: false },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
projectName: answers.projectName,
|
|
81
|
+
format: answers.format,
|
|
82
|
+
telemetryEnabled: answers.telemetryEnabled,
|
|
83
|
+
validationEnabled: answers.validationEnabled,
|
|
84
|
+
parallelExecution: answers.parallelExecution,
|
|
85
|
+
designTokenCompliance: answers.designTokenCompliance || 90,
|
|
86
|
+
pageLayoutUsage: answers.pageLayoutUsage || 90,
|
|
87
|
+
agents: {
|
|
88
|
+
designTokens: {
|
|
89
|
+
enabled: answers.agents.includes('designTokens'),
|
|
90
|
+
compliance: (answers.designTokenCompliance || 90) / 100,
|
|
91
|
+
},
|
|
92
|
+
barrelExports: {
|
|
93
|
+
enabled: answers.agents.includes('barrelExports'),
|
|
94
|
+
},
|
|
95
|
+
pageLayout: {
|
|
96
|
+
enabled: answers.agents.includes('pageLayout'),
|
|
97
|
+
targetUsage: (answers.pageLayoutUsage || 90) / 100,
|
|
98
|
+
},
|
|
99
|
+
testData: {
|
|
100
|
+
enabled: answers.agents.includes('testData'),
|
|
101
|
+
},
|
|
102
|
+
apiPattern: {
|
|
103
|
+
enabled: answers.agents.includes('apiPattern'),
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|