@defai.digital/automatosx 8.5.4 → 9.0.1
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 +115 -0
- package/CODE_OF_CONDUCT.md +133 -0
- package/CONTRIBUTING.md +427 -0
- package/FAQ.md +895 -0
- package/MIGRATION.md +263 -0
- package/README.md +8 -1
- package/SECURITY.md +175 -0
- package/TROUBLESHOOTING.md +1027 -0
- package/dist/index.js +3334 -851
- package/examples/abilities/code-generation.md +238 -0
- package/examples/abilities/our-coding-standards.md +99 -0
- package/examples/abilities/typescript-zod-validation.md +830 -0
- package/examples/providers/grok-enhanced.yaml +154 -0
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,121 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [9.0.1] - 2025-11-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **🐛 Critical Stability Fixes** - Multiple crash and hang prevention improvements
|
|
9
|
+
- **MCP Server Infinite Loop** - Added iteration limit (100/chunk), buffer size check (10MB), message size validation (5MB)
|
|
10
|
+
- **Memory Leaks** - Fixed AbortSignal listener cleanup in database connection pool
|
|
11
|
+
- **Stack Overflow** - Converted recursive `processWaitQueue()` to iterative (max 1000 iterations)
|
|
12
|
+
- **Resource Leaks** - Enhanced health check interval cleanup with multiple fallback handlers
|
|
13
|
+
- **Shutdown Hangs** - Added timeout protection (30s default) to all graceful shutdown handlers
|
|
14
|
+
- **Race Conditions** - Added mutex protection to MCP server initialization
|
|
15
|
+
|
|
16
|
+
### Technical Details
|
|
17
|
+
- **MCP Server (src/mcp/server.ts)** - Prevents infinite loops from malformed JSON-RPC messages
|
|
18
|
+
- **Connection Pool (src/core/db-connection-pool.ts)** - Eliminates memory leaks in high-concurrency scenarios
|
|
19
|
+
- **Graceful Shutdown (src/utils/graceful-shutdown.ts)** - Prevents process hanging on SIGTERM/SIGINT
|
|
20
|
+
- **Performance** - All fixes have < 1ms overhead, zero performance impact
|
|
21
|
+
|
|
22
|
+
### Testing
|
|
23
|
+
- ✅ All 1000+ unit tests passing
|
|
24
|
+
- ✅ TypeScript strict mode validation
|
|
25
|
+
- ✅ Build verification successful
|
|
26
|
+
- ✅ Zero breaking changes
|
|
27
|
+
|
|
28
|
+
## [9.0.0] - 2025-11-18
|
|
29
|
+
|
|
30
|
+
### Breaking Changes
|
|
31
|
+
- **🚨 Cost-Based Budget Tracking Removed** - Token-based limits only
|
|
32
|
+
- Removed `--iterate-max-cost` CLI flag (use `--iterate-max-tokens`)
|
|
33
|
+
- Removed `maxEstimatedCostUsd` from configuration
|
|
34
|
+
- Removed `totalCost` from IterateStats (now optional/deprecated field)
|
|
35
|
+
- Removed `cost_limit_exceeded` pause reason (use `token_limit_exceeded`)
|
|
36
|
+
- Removed `enableCostTracking` from SafetyConfig
|
|
37
|
+
- Removed `warnAtCostPercent` from NotificationConfig
|
|
38
|
+
- Removed CostTracker class (~1,200 lines of code)
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
- **CostTracker System** - Full removal of unreliable cost estimation
|
|
42
|
+
- Deleted `src/core/cost-tracker.ts` (597 lines)
|
|
43
|
+
- Deleted `src/core/cost-tracker-schemas.ts` (~100 lines)
|
|
44
|
+
- Deleted `src/types/cost.ts` (~150 lines)
|
|
45
|
+
- Deleted cost-related test files (~341 lines)
|
|
46
|
+
- Total reduction: ~1,200 lines of code
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
- **Iterate Mode Budget System** - Token-only tracking
|
|
50
|
+
- Token limits are stable and accurate (never change)
|
|
51
|
+
- Budgets enforced via `maxTotalTokens` and `maxTokensPerIteration`
|
|
52
|
+
- Stats show token usage instead of cost estimates
|
|
53
|
+
- Status renderer displays tokens instead of dollars
|
|
54
|
+
|
|
55
|
+
### Migration
|
|
56
|
+
- See `docs/migration/v9-cost-to-tokens.md` for complete migration guide
|
|
57
|
+
- Replace `--iterate-max-cost 5.0` with `--iterate-max-tokens 1000000`
|
|
58
|
+
- Update config: `maxEstimatedCostUsd` → `maxTotalTokens`
|
|
59
|
+
- Track costs manually if needed: `tokens * price_per_1M_tokens`
|
|
60
|
+
|
|
61
|
+
### Why This Change
|
|
62
|
+
- Provider pricing changes frequently without notice
|
|
63
|
+
- Cost estimates were unreliable and caused user confusion
|
|
64
|
+
- Token counts are stable and accurately tracked
|
|
65
|
+
- Simpler codebase (~1,200 lines removed)
|
|
66
|
+
- Zero maintenance burden for pricing updates
|
|
67
|
+
|
|
68
|
+
## [8.6.0] - 2025-11-18
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
- **🎯 Token-Based Budget Limits for Iterate Mode** - More reliable than cost-based limits
|
|
72
|
+
- `--iterate-max-tokens` flag (default: 1,000,000 tokens)
|
|
73
|
+
- `--iterate-max-tokens-per-iteration` flag (default: 100,000 tokens)
|
|
74
|
+
- Progressive warnings at 75% and 90% of token budget
|
|
75
|
+
- Accurate tracking from provider API responses
|
|
76
|
+
- Token metrics in iterate stats (`totalTokens`, `avgTokensPerIteration`)
|
|
77
|
+
|
|
78
|
+
- **📊 Token Budget Enforcement**
|
|
79
|
+
- Automatic pause when token limit exceeded
|
|
80
|
+
- Real-time token usage tracking
|
|
81
|
+
- Per-stage and total token counters
|
|
82
|
+
- New pause reason: `token_limit_exceeded`
|
|
83
|
+
|
|
84
|
+
- **📖 Migration Guide** - Complete guide for migrating from cost to token limits
|
|
85
|
+
- `docs/migration/v9-cost-to-tokens.md`
|
|
86
|
+
- Conversion formulas and examples
|
|
87
|
+
- Timeline and breaking changes documented
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
- **Better Budget Control** - Token limits more reliable than cost estimates
|
|
91
|
+
- Token counts never change (unlike provider pricing)
|
|
92
|
+
- Accurate usage from API responses (not estimates)
|
|
93
|
+
- No maintenance needed for pricing updates
|
|
94
|
+
|
|
95
|
+
### Deprecated
|
|
96
|
+
- **⚠️ Cost-Based Limits** - Will be removed in v9.0.0
|
|
97
|
+
- `--iterate-max-cost` flag (use `--iterate-max-tokens` instead)
|
|
98
|
+
- `maxEstimatedCostUsd` config field (use `maxTotalTokens` instead)
|
|
99
|
+
- Shows clear deprecation warnings with migration guidance
|
|
100
|
+
- Still functional in v8.6.0-v8.7.x for backward compatibility
|
|
101
|
+
|
|
102
|
+
### Performance
|
|
103
|
+
- Token tracking overhead: < 1ms per iteration
|
|
104
|
+
- No performance regression
|
|
105
|
+
- Build time: 650ms (unchanged)
|
|
106
|
+
- Test suite: 25s (unchanged)
|
|
107
|
+
|
|
108
|
+
### Testing
|
|
109
|
+
- 34 new comprehensive token tracking tests
|
|
110
|
+
- All 2,441 tests passing
|
|
111
|
+
- Edge cases covered (zero limit, large limit, warnings)
|
|
112
|
+
- Backward compatibility verified
|
|
113
|
+
|
|
114
|
+
### Migration
|
|
115
|
+
- Fully backward compatible (zero breaking changes)
|
|
116
|
+
- Both cost and token flags work in v8.6.0-v8.7.x
|
|
117
|
+
- Migration guide provides clear upgrade path
|
|
118
|
+
- Breaking change deferred to v9.0.0
|
|
119
|
+
|
|
5
120
|
## [8.5.2] - 2025-11-18
|
|
6
121
|
|
|
7
122
|
### Added
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official email address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
[support@defai.digital](mailto:support@defai.digital).
|
|
64
|
+
|
|
65
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
66
|
+
|
|
67
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
68
|
+
reporter of any incident.
|
|
69
|
+
|
|
70
|
+
## Enforcement Guidelines
|
|
71
|
+
|
|
72
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
73
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
74
|
+
|
|
75
|
+
### 1. Correction
|
|
76
|
+
|
|
77
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
78
|
+
unprofessional or unwelcome in the community.
|
|
79
|
+
|
|
80
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
81
|
+
clarity around the nature of the violation and an explanation of why the
|
|
82
|
+
behavior was inappropriate. A public apology may be requested.
|
|
83
|
+
|
|
84
|
+
### 2. Warning
|
|
85
|
+
|
|
86
|
+
**Community Impact**: A violation through a single incident or series of
|
|
87
|
+
actions.
|
|
88
|
+
|
|
89
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
90
|
+
interaction with the people involved, including unsolicited interaction with
|
|
91
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
92
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
93
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
94
|
+
ban.
|
|
95
|
+
|
|
96
|
+
### 3. Temporary Ban
|
|
97
|
+
|
|
98
|
+
**Community Impact**: A serious violation of community standards, including
|
|
99
|
+
sustained inappropriate behavior.
|
|
100
|
+
|
|
101
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
102
|
+
communication with the community for a specified period of time. No public or
|
|
103
|
+
private interaction with the people involved, including unsolicited interaction
|
|
104
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
105
|
+
Violating these terms may lead to a permanent ban.
|
|
106
|
+
|
|
107
|
+
### 4. Permanent Ban
|
|
108
|
+
|
|
109
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
110
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
111
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
112
|
+
|
|
113
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
114
|
+
community.
|
|
115
|
+
|
|
116
|
+
## Attribution
|
|
117
|
+
|
|
118
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
119
|
+
version 2.1, available at
|
|
120
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
121
|
+
|
|
122
|
+
Community Impact Guidelines were inspired by
|
|
123
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
124
|
+
|
|
125
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
126
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
127
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
128
|
+
|
|
129
|
+
[homepage]: https://www.contributor-covenant.org
|
|
130
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
131
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
132
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
133
|
+
[translations]: https://www.contributor-covenant.org/translations
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
# Contributing to AutomatosX
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to AutomatosX! This document provides guidelines for contributing to the project.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [Getting Started](#getting-started)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [Making Changes](#making-changes)
|
|
11
|
+
- [Testing](#testing)
|
|
12
|
+
- [Submitting Changes](#submitting-changes)
|
|
13
|
+
- [Coding Standards](#coding-standards)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
This project follows a Code of Conduct (see [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)). By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
|
|
18
|
+
|
|
19
|
+
## Project Status & Contribution Policy
|
|
20
|
+
|
|
21
|
+
AutomatosX is an **open source project** published for **transparency and community benefit**. While the entire codebase is public for review and learning:
|
|
22
|
+
|
|
23
|
+
### What We Welcome ✅
|
|
24
|
+
|
|
25
|
+
- **Bug Reports** - Please report issues via GitHub Issues
|
|
26
|
+
- **Feature Suggestions** - Share your ideas for discussion
|
|
27
|
+
- **Documentation Improvements** - Typos, clarifications, examples
|
|
28
|
+
- **Security Reports** - See [SECURITY.md](SECURITY.md) for responsible disclosure
|
|
29
|
+
- **Questions & Discussions** - Use GitHub Discussions
|
|
30
|
+
- **Sharing & Using** - Use AutomatosX in your projects!
|
|
31
|
+
|
|
32
|
+
### Current Development Model 🔧
|
|
33
|
+
|
|
34
|
+
- This is **not actively seeking code contributions** at this time
|
|
35
|
+
- The codebase is **fully transparent** for trust and verification
|
|
36
|
+
- Development is primarily done by the core team
|
|
37
|
+
- We may accept PRs on a case-by-case basis
|
|
38
|
+
|
|
39
|
+
### Why This Approach?
|
|
40
|
+
|
|
41
|
+
We believe in **radical transparency** - you should be able to:
|
|
42
|
+
- ✅ Verify the code does what it claims
|
|
43
|
+
- ✅ Audit security and privacy practices
|
|
44
|
+
- ✅ Learn from the implementation
|
|
45
|
+
- ✅ Trust that nothing harmful is hidden
|
|
46
|
+
- ✅ Fork and modify for your own use (within license terms)
|
|
47
|
+
|
|
48
|
+
This doesn't mean we don't value the community! Issues, discussions, and feedback are **highly appreciated** and help make AutomatosX better.
|
|
49
|
+
|
|
50
|
+
## Getting Started
|
|
51
|
+
|
|
52
|
+
1. Fork the repository
|
|
53
|
+
2. Clone your fork: `git clone https://github.com/yourusername/automatosx.git`
|
|
54
|
+
3. Add upstream remote: `git remote add upstream https://github.com/automatosx/automatosx.git`
|
|
55
|
+
|
|
56
|
+
## Development Setup
|
|
57
|
+
|
|
58
|
+
### Prerequisites
|
|
59
|
+
|
|
60
|
+
- Node.js 20.0.0 or later
|
|
61
|
+
- npm, pnpm, or yarn
|
|
62
|
+
|
|
63
|
+
### Installation
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Install dependencies
|
|
67
|
+
npm install
|
|
68
|
+
|
|
69
|
+
# Run tests
|
|
70
|
+
npm test
|
|
71
|
+
|
|
72
|
+
# Build the project
|
|
73
|
+
npm run build
|
|
74
|
+
|
|
75
|
+
# Run in development mode
|
|
76
|
+
npm run dev -- <command>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Making Changes
|
|
80
|
+
|
|
81
|
+
### Creating a Branch
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Update your main branch
|
|
85
|
+
git checkout main
|
|
86
|
+
git pull upstream main
|
|
87
|
+
|
|
88
|
+
# Create a feature branch
|
|
89
|
+
git checkout -b feature/your-feature-name
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Branch Naming Convention
|
|
93
|
+
|
|
94
|
+
- `feature/` - New features
|
|
95
|
+
- `fix/` - Bug fixes
|
|
96
|
+
- `docs/` - Documentation changes
|
|
97
|
+
- `test/` - Test improvements
|
|
98
|
+
- `refactor/` - Code refactoring
|
|
99
|
+
- `perf/` - Performance improvements
|
|
100
|
+
|
|
101
|
+
## Testing
|
|
102
|
+
|
|
103
|
+
### Running Tests
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Run all tests
|
|
107
|
+
npm test
|
|
108
|
+
|
|
109
|
+
# Run unit tests only
|
|
110
|
+
npm run test:unit
|
|
111
|
+
|
|
112
|
+
# Run integration tests only
|
|
113
|
+
npm run test:integration
|
|
114
|
+
|
|
115
|
+
# Run tests in watch mode
|
|
116
|
+
npm run test:watch
|
|
117
|
+
|
|
118
|
+
# Run tests with coverage
|
|
119
|
+
npm run test:coverage
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Writing Tests
|
|
123
|
+
|
|
124
|
+
- Write tests for all new features
|
|
125
|
+
- Maintain or improve test coverage (current: ~85%)
|
|
126
|
+
- Place unit tests in `tests/unit/`
|
|
127
|
+
- Place integration tests in `tests/integration/`
|
|
128
|
+
- Use descriptive test names
|
|
129
|
+
- Follow existing test patterns
|
|
130
|
+
|
|
131
|
+
### Test Requirements
|
|
132
|
+
|
|
133
|
+
- All tests must pass before submitting PR
|
|
134
|
+
- Coverage should not decrease
|
|
135
|
+
- Add tests for bug fixes to prevent regression
|
|
136
|
+
|
|
137
|
+
## Submitting Changes
|
|
138
|
+
|
|
139
|
+
### Before Submitting
|
|
140
|
+
|
|
141
|
+
1. **Run tests**: `npm test`
|
|
142
|
+
2. **Type check**: `npm run typecheck`
|
|
143
|
+
3. **Build**: `npm run build`
|
|
144
|
+
4. **Update documentation** if needed
|
|
145
|
+
5. **Update CHANGELOG.md** with your changes
|
|
146
|
+
|
|
147
|
+
### Commit Messages
|
|
148
|
+
|
|
149
|
+
We follow [Conventional Commits](https://www.conventionalcommits.org/) specification. This enables automated changelog generation and semantic versioning.
|
|
150
|
+
|
|
151
|
+
#### Quick Start
|
|
152
|
+
|
|
153
|
+
Use the interactive commit tool:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm run commit
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Or write manually:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git commit -m "feat(agents): add delegation depth validation"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### Format
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
<type>(<scope>): <subject>
|
|
169
|
+
|
|
170
|
+
<body>
|
|
171
|
+
|
|
172
|
+
<footer>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Required**:
|
|
176
|
+
- `type`: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert
|
|
177
|
+
- `subject`: Short description (max 100 chars, lowercase, no period)
|
|
178
|
+
|
|
179
|
+
**Optional**:
|
|
180
|
+
- `scope`: Module affected (agents, cli, memory, router, providers, etc.)
|
|
181
|
+
- `body`: Detailed explanation
|
|
182
|
+
- `footer`: Issue references, breaking changes
|
|
183
|
+
|
|
184
|
+
#### Examples
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Feature
|
|
188
|
+
feat(agents): add delegation depth validation
|
|
189
|
+
|
|
190
|
+
# Bug fix
|
|
191
|
+
fix(cli): resolve path resolution bug in Windows
|
|
192
|
+
|
|
193
|
+
# Documentation
|
|
194
|
+
docs: update release process guide
|
|
195
|
+
|
|
196
|
+
# Breaking change
|
|
197
|
+
feat(router)!: remove deprecated fallback option
|
|
198
|
+
|
|
199
|
+
BREAKING CHANGE: The `enableFallback` option has been removed.
|
|
200
|
+
Use `fallbackChain` instead.
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Commit Hooks
|
|
204
|
+
|
|
205
|
+
Git hooks will validate your commit messages:
|
|
206
|
+
- Invalid commits will be rejected
|
|
207
|
+
- Use `npm run commit` for guided input
|
|
208
|
+
- See [docs/conventional-commits.md](./docs/conventional-commits.md) for full guide
|
|
209
|
+
|
|
210
|
+
#### Benefits
|
|
211
|
+
|
|
212
|
+
- 📝 Automated CHANGELOG generation
|
|
213
|
+
- 🏷️ Semantic version automation
|
|
214
|
+
- 📊 Clear commit history
|
|
215
|
+
- 🤝 Better collaboration
|
|
216
|
+
|
|
217
|
+
### Pull Request Process
|
|
218
|
+
|
|
219
|
+
1. **Update your branch**:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
git checkout main
|
|
223
|
+
git pull upstream main
|
|
224
|
+
git checkout your-branch
|
|
225
|
+
git rebase main
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
2. **Push to your fork**:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
git push origin your-branch
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
3. **Create Pull Request**:
|
|
235
|
+
- Use a clear, descriptive title
|
|
236
|
+
- Reference related issues
|
|
237
|
+
- Describe what changed and why
|
|
238
|
+
- Include screenshots for UI changes
|
|
239
|
+
- List breaking changes if any
|
|
240
|
+
|
|
241
|
+
4. **PR Template**:
|
|
242
|
+
|
|
243
|
+
```markdown
|
|
244
|
+
## Description
|
|
245
|
+
Brief description of changes
|
|
246
|
+
|
|
247
|
+
## Type of Change
|
|
248
|
+
- [ ] Bug fix
|
|
249
|
+
- [ ] New feature
|
|
250
|
+
- [ ] Breaking change
|
|
251
|
+
- [ ] Documentation update
|
|
252
|
+
|
|
253
|
+
## Testing
|
|
254
|
+
- [ ] Tests pass locally
|
|
255
|
+
- [ ] Added/updated tests
|
|
256
|
+
- [ ] Manual testing completed
|
|
257
|
+
|
|
258
|
+
## Checklist
|
|
259
|
+
- [ ] Code follows project style
|
|
260
|
+
- [ ] Documentation updated
|
|
261
|
+
- [ ] CHANGELOG.md updated
|
|
262
|
+
- [ ] No breaking changes (or documented)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
5. **Review Process**:
|
|
266
|
+
- Address reviewer feedback
|
|
267
|
+
- Make requested changes
|
|
268
|
+
- Push updates to your branch
|
|
269
|
+
- Re-request review when ready
|
|
270
|
+
|
|
271
|
+
## Coding Standards
|
|
272
|
+
|
|
273
|
+
### TypeScript
|
|
274
|
+
|
|
275
|
+
- Use TypeScript strict mode
|
|
276
|
+
- Provide type annotations for all public APIs
|
|
277
|
+
- Avoid `any` type unless absolutely necessary
|
|
278
|
+
- Use meaningful variable and function names
|
|
279
|
+
- Keep functions small and focused
|
|
280
|
+
|
|
281
|
+
### Code Style
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
// Good
|
|
285
|
+
export async function loadProfile(
|
|
286
|
+
profilePath: string,
|
|
287
|
+
options: LoadOptions = {}
|
|
288
|
+
): Promise<AgentProfile> {
|
|
289
|
+
// Implementation
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Bad
|
|
293
|
+
export async function load(p: string, o: any) {
|
|
294
|
+
// Implementation
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Documentation
|
|
299
|
+
|
|
300
|
+
- Add JSDoc comments for all public APIs
|
|
301
|
+
- Include parameter descriptions
|
|
302
|
+
- Document return types
|
|
303
|
+
- Provide usage examples
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
/**
|
|
307
|
+
* Load an agent profile from a YAML file.
|
|
308
|
+
*
|
|
309
|
+
* @param profilePath - Absolute path to the profile file
|
|
310
|
+
* @param options - Optional loading configuration
|
|
311
|
+
* @returns Parsed agent profile
|
|
312
|
+
* @throws {PathTraversalError} If path is outside allowed directory
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const profile = await loadProfile('/path/to/agent.yaml');
|
|
317
|
+
* console.log(profile.name); // 'my-agent'
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
export async function loadProfile(
|
|
321
|
+
profilePath: string,
|
|
322
|
+
options: LoadOptions = {}
|
|
323
|
+
): Promise<AgentProfile> {
|
|
324
|
+
// Implementation
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### File Organization
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
src/
|
|
332
|
+
├── core/ # Core modules
|
|
333
|
+
├── agents/ # Agent system
|
|
334
|
+
├── providers/ # AI provider integrations
|
|
335
|
+
├── cli/ # CLI commands
|
|
336
|
+
├── types/ # TypeScript types
|
|
337
|
+
└── utils/ # Utility functions
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Error Handling
|
|
341
|
+
|
|
342
|
+
- Use custom error classes
|
|
343
|
+
- Provide meaningful error messages
|
|
344
|
+
- Include error context
|
|
345
|
+
- Handle errors gracefully
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
// Good
|
|
349
|
+
if (!isValidPath(path)) {
|
|
350
|
+
throw new PathTraversalError(
|
|
351
|
+
`Invalid path: ${path}`,
|
|
352
|
+
{ path, allowedDir }
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Bad
|
|
357
|
+
if (!isValidPath(path)) {
|
|
358
|
+
throw new Error('bad path');
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Performance
|
|
363
|
+
|
|
364
|
+
- Avoid unnecessary computations
|
|
365
|
+
- Use caching where appropriate
|
|
366
|
+
- Lazy load when possible
|
|
367
|
+
- Profile performance-critical code
|
|
368
|
+
|
|
369
|
+
## Project Structure
|
|
370
|
+
|
|
371
|
+
### Important Files
|
|
372
|
+
|
|
373
|
+
- `src/` - Source code
|
|
374
|
+
- `tests/` - Test suites
|
|
375
|
+
- `docs/` - Documentation
|
|
376
|
+
- `PRD/` - Product requirements
|
|
377
|
+
- `examples/` - Example configurations
|
|
378
|
+
|
|
379
|
+
### Key Modules
|
|
380
|
+
|
|
381
|
+
1. **Core** (`src/core/`)
|
|
382
|
+
- `config.ts` - Configuration management
|
|
383
|
+
- `logger.ts` - Logging system
|
|
384
|
+
- `path-resolver.ts` - Path resolution
|
|
385
|
+
- `memory-manager.ts` - Memory persistence
|
|
386
|
+
- `router.ts` - Provider routing
|
|
387
|
+
|
|
388
|
+
2. **Agents** (`src/agents/`)
|
|
389
|
+
- `profile-loader.ts` - Profile loading
|
|
390
|
+
- `abilities-manager.ts` - Abilities management
|
|
391
|
+
- `context-manager.ts` - Execution context
|
|
392
|
+
|
|
393
|
+
3. **CLI** (`src/cli/`)
|
|
394
|
+
- Command implementations
|
|
395
|
+
- User interface
|
|
396
|
+
|
|
397
|
+
## Release Process
|
|
398
|
+
|
|
399
|
+
See [docs/release-process.md](./docs/release-process.md) for detailed release instructions.
|
|
400
|
+
|
|
401
|
+
Quick summary:
|
|
402
|
+
1. Update version: `npm run version:patch`
|
|
403
|
+
2. Push: `git push && git push --tags`
|
|
404
|
+
3. GitHub Actions handles the rest automatically
|
|
405
|
+
|
|
406
|
+
## Getting Help
|
|
407
|
+
|
|
408
|
+
- Check existing [documentation](docs/)
|
|
409
|
+
- Search [existing issues](https://github.com/defai-digital/automatosx/issues)
|
|
410
|
+
- Open a new issue for questions, bugs, or feature requests
|
|
411
|
+
- Use "bug" label for bugs
|
|
412
|
+
- Use "enhancement" label for feature requests/wishlist
|
|
413
|
+
- Use "question" label for questions
|
|
414
|
+
|
|
415
|
+
## License
|
|
416
|
+
|
|
417
|
+
By contributing, you agree that your contributions will be licensed under the Elastic License 2.0.
|
|
418
|
+
|
|
419
|
+
## Recognition
|
|
420
|
+
|
|
421
|
+
Contributors will be recognized in:
|
|
422
|
+
|
|
423
|
+
- CHANGELOG.md
|
|
424
|
+
- GitHub contributors page
|
|
425
|
+
- Release notes (for significant contributions)
|
|
426
|
+
|
|
427
|
+
Thank you for contributing to AutomatosX! 🚀
|