adaptive-memory-multi-model-router 1.9.4 → 2.0.0
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/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +37 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +44 -0
- package/.github/workflows/npm-stats-validation.yml +152 -0
- package/.github/workflows/pages.yml +37 -0
- package/CHANGELOG.md +122 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/CONTRIBUTING.md +110 -0
- package/LAUNCH-PAIN-DRIVEN.md +339 -0
- package/LAUNCH.md +575 -0
- package/POPULARITY_BOOSTERS.md +285 -0
- package/README.md +231 -300
- package/SECURITY.md +69 -0
- package/articles/CONTENT_STRUCTURE.md +292 -0
- package/articles/DEVTO_COST_GUIDE.md +473 -0
- package/articles/DEVTO_FINAL.md +416 -0
- package/articles/DEVTO_MULTI_PROVIDER.md +542 -0
- package/articles/HN_10X_BETTER.md +430 -0
- package/articles/HN_CHINESE_STYLE.md +308 -0
- package/articles/HN_FINAL.md +199 -0
- package/articles/HN_POSTED_VERSION.md +56 -0
- package/articles/HN_RESEARCH.md +364 -0
- package/articles/PAIN-DRIVEN-devto-v2.md +308 -0
- package/articles/PAIN-DRIVEN-devto-v3.md +268 -0
- package/articles/PAIN-DRIVEN-devto.md +242 -0
- package/articles/PAIN-DRIVEN-hackernews-v2.md +138 -0
- package/articles/PAIN-DRIVEN-hackernews-v3.md +151 -0
- package/articles/PAIN-DRIVEN-hackernews.md +131 -0
- package/articles/PAIN-DRIVEN-reddit-v2.md +301 -0
- package/articles/PAIN-DRIVEN-reddit-v3.md +236 -0
- package/articles/PAIN-DRIVEN-reddit.md +218 -0
- package/articles/PAIN-DRIVEN-twitter-v2.md +110 -0
- package/articles/PAIN-DRIVEN-twitter-v3.md +121 -0
- package/articles/PAIN-DRIVEN-twitter.md +120 -0
- package/articles/PORTKEY_VS_A3M.md +147 -0
- package/articles/REDDIT_FINAL.md +232 -0
- package/articles/TWITTER_FINAL.md +167 -0
- package/articles/WHY_10X_BETTER.md +261 -0
- package/articles/WHY_CHINESE_STYLE_BETTER.md +323 -0
- package/articles/ai-discoverability-llm-routing.md +210 -0
- package/articles/devto-llm-routing.md +109 -0
- package/articles/hackernews-show-hn.md +65 -0
- package/articles/hashnode-llm-cost-optimization.md +125 -0
- package/articles/medium-building-llm-router.md +205 -0
- package/articles/reddit-ml.md +86 -0
- package/articles/twitter-thread-cost-savings.md +98 -0
- package/articles/youtube-tutorial-script.md +262 -0
- package/assets/banner.svg +109 -0
- package/assets/logo.svg +68 -0
- package/assets/social-preview.svg +64 -0
- package/demo/demo-script.md +53 -0
- package/dist/analytics/costAnalytics.d.ts +77 -0
- package/dist/analytics/costAnalytics.d.ts.map +1 -0
- package/dist/analytics/costAnalytics.js +219 -0
- package/dist/analytics/costAnalytics.js.map +1 -0
- package/dist/cache/semanticCache.d.ts +62 -0
- package/dist/cache/semanticCache.d.ts.map +1 -0
- package/dist/cache/semanticCache.js +176 -0
- package/dist/cache/semanticCache.js.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/geo/generativeEngineOptimization.js +321 -0
- package/dist/geo/geoRouter.js +387 -0
- package/dist/index.d.ts +4 -723
- package/dist/index.js +11 -344
- package/dist/index.js.map +1 -1
- package/dist/integrations/langchainAdapter.d.ts +146 -0
- package/dist/integrations/langchainAdapter.d.ts.map +1 -0
- package/dist/integrations/langchainAdapter.js +731 -0
- package/dist/integrations/langchainAdapter.js.map +1 -0
- package/dist/integrations/oauth.d.ts +69 -0
- package/dist/integrations/oauth.d.ts.map +1 -0
- package/dist/integrations/oauth.js +225 -21
- package/dist/integrations/oauth.js.map +1 -0
- package/dist/memory/autoFetch.d.ts +39 -0
- package/dist/memory/autoFetch.d.ts.map +1 -0
- package/dist/memory/autoFetch.js +80 -88
- package/dist/memory/autoFetch.js.map +1 -0
- package/dist/memory/memoryTree.d.ts +76 -0
- package/dist/memory/memoryTree.d.ts.map +1 -0
- package/dist/memory/memoryTree.js +185 -130
- package/dist/memory/memoryTree.js.map +1 -0
- package/dist/memory/obsidianVault.d.ts +71 -0
- package/dist/memory/obsidianVault.d.ts.map +1 -0
- package/dist/memory/obsidianVault.js +207 -22
- package/dist/memory/obsidianVault.js.map +1 -0
- package/dist/providers/providerConfig.d.ts +49 -0
- package/dist/providers/providerConfig.d.ts.map +1 -0
- package/dist/providers/providerConfig.js +806 -401
- package/dist/providers/providerConfig.js.map +1 -0
- package/dist/security/guardrails.d.ts +76 -0
- package/dist/security/guardrails.d.ts.map +1 -0
- package/dist/security/guardrails.js +479 -0
- package/dist/security/guardrails.js.map +1 -0
- package/dist/security/inputValidation.js +351 -0
- package/dist/server/dashboard.d.ts +58 -0
- package/dist/server/dashboard.d.ts.map +1 -0
- package/dist/server/dashboard.js +553 -0
- package/dist/server/dashboard.js.map +1 -0
- package/dist/server/modelMapper.d.ts +43 -0
- package/dist/server/modelMapper.d.ts.map +1 -0
- package/dist/server/modelMapper.js +154 -0
- package/dist/server/modelMapper.js.map +1 -0
- package/dist/server/proxyServer.d.ts +41 -0
- package/dist/server/proxyServer.d.ts.map +1 -0
- package/dist/server/proxyServer.js +932 -0
- package/dist/server/proxyServer.js.map +1 -0
- package/dist/skills/__tests__/skill_manager.test.d.ts +2 -0
- package/dist/skills/__tests__/skill_manager.test.d.ts.map +1 -0
- package/dist/skills/__tests__/skill_manager.test.js +268 -0
- package/dist/skills/__tests__/skill_manager.test.js.map +1 -0
- package/docs/geo/GENERATIVE_ENGINE_OPTIMIZATION.md +232 -0
- package/docs-site/index.html +347 -0
- package/llms.txt +138 -0
- package/package.json +72 -7
- package/playground/README.md +51 -0
- package/playground/codesandbox.json +12 -0
- package/playground/index.js +39 -0
- package/scripts/update-npm-badges.js +158 -0
- package/src/analytics/costAnalytics.ts +304 -0
- package/src/cache/semanticCache.ts +221 -0
- package/src/index.ts +6 -0
- package/src/integrations/langchainAdapter.ts +955 -0
- package/src/providers/providerConfig.ts +923 -0
- package/src/security/guardrails.ts +585 -0
- package/src/server/dashboard.ts +610 -0
- package/src/server/modelMapper.ts +182 -0
- package/src/server/proxyServer.ts +1105 -0
- package/src/types/langchain.d.ts +83 -0
- package/tsconfig.build.json +20 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 🐛 Bug Report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🐛 Bug Description
|
|
11
|
+
|
|
12
|
+
A clear and concise description of what the bug is.
|
|
13
|
+
|
|
14
|
+
## To Reproduce
|
|
15
|
+
|
|
16
|
+
Steps to reproduce the behavior:
|
|
17
|
+
|
|
18
|
+
1. Install package with `npm install adaptive-memory-multi-model-router`
|
|
19
|
+
2. Run code:
|
|
20
|
+
```javascript
|
|
21
|
+
const { createA3MRouter } = require('adaptive-memory-multi-model-router');
|
|
22
|
+
// Your code here
|
|
23
|
+
```
|
|
24
|
+
3. See error
|
|
25
|
+
|
|
26
|
+
## Expected Behavior
|
|
27
|
+
|
|
28
|
+
A clear and concise description of what you expected to happen.
|
|
29
|
+
|
|
30
|
+
## Actual Behavior
|
|
31
|
+
|
|
32
|
+
What actually happened. Include error messages, stack traces, etc.
|
|
33
|
+
|
|
34
|
+
## Environment
|
|
35
|
+
|
|
36
|
+
- **OS**: [e.g., macOS, Linux, Windows]
|
|
37
|
+
- **Node.js version**: [e.g., 18.0.0]
|
|
38
|
+
- **Package version**: [e.g., 1.9.5]
|
|
39
|
+
- **NPM version**: [e.g., 9.0.0]
|
|
40
|
+
|
|
41
|
+
## Additional Context
|
|
42
|
+
|
|
43
|
+
Add any other context about the problem here, such as:
|
|
44
|
+
- Provider you're using (Groq, OpenAI, etc.)
|
|
45
|
+
- API keys configured
|
|
46
|
+
- Specific query that caused the issue
|
|
47
|
+
|
|
48
|
+
## Possible Solution
|
|
49
|
+
|
|
50
|
+
If you have ideas on how to fix this, please share!
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: 📖 Documentation
|
|
4
|
+
url: https://github.com/Das-rebel/adaptive-memory-multi-model-router#readme
|
|
5
|
+
about: Check the README for usage examples and API documentation
|
|
6
|
+
- name: 💬 Discussions
|
|
7
|
+
url: https://github.com/Das-rebel/adaptive-memory-multi-model-router/discussions
|
|
8
|
+
about: Ask questions and share ideas in our community forum
|
|
9
|
+
- name: 🚀 NPM Package
|
|
10
|
+
url: https://www.npmjs.com/package/adaptive-memory-multi-model-router
|
|
11
|
+
about: View package details and download statistics
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 💡 Feature Request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 💡 Feature Description
|
|
11
|
+
|
|
12
|
+
A clear and concise description of what you want to happen.
|
|
13
|
+
|
|
14
|
+
## Problem Statement
|
|
15
|
+
|
|
16
|
+
Is your feature request related to a problem? Please describe.
|
|
17
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
18
|
+
|
|
19
|
+
## Proposed Solution
|
|
20
|
+
|
|
21
|
+
Describe the solution you'd like to see implemented.
|
|
22
|
+
|
|
23
|
+
## Alternatives Considered
|
|
24
|
+
|
|
25
|
+
Describe any alternative solutions or features you've considered.
|
|
26
|
+
|
|
27
|
+
## Use Case
|
|
28
|
+
|
|
29
|
+
Describe the use case for this feature. Who would benefit and how?
|
|
30
|
+
|
|
31
|
+
## Additional Context
|
|
32
|
+
|
|
33
|
+
Add any other context, screenshots, or examples about the feature request here.
|
|
34
|
+
|
|
35
|
+
## Implementation Ideas
|
|
36
|
+
|
|
37
|
+
If you have ideas on how this could be implemented, please share!
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
## 📝 Description
|
|
2
|
+
|
|
3
|
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
|
|
4
|
+
|
|
5
|
+
Fixes # (issue)
|
|
6
|
+
|
|
7
|
+
## 🔄 Type of Change
|
|
8
|
+
|
|
9
|
+
Please delete options that are not relevant.
|
|
10
|
+
|
|
11
|
+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
|
|
12
|
+
- [ ] ✨ New feature (non-breaking change which adds functionality)
|
|
13
|
+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
14
|
+
- [ ] 📚 Documentation update
|
|
15
|
+
- [ ] 🎨 Code style/formatting
|
|
16
|
+
- [ ] ⚡ Performance improvement
|
|
17
|
+
- [ ] 🔒 Security improvement
|
|
18
|
+
|
|
19
|
+
## 🧪 Testing
|
|
20
|
+
|
|
21
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
22
|
+
|
|
23
|
+
- [ ] All existing tests pass (`npm test`)
|
|
24
|
+
- [ ] Added new tests for the changes
|
|
25
|
+
- [ ] Tested manually with example code
|
|
26
|
+
|
|
27
|
+
## 📋 Checklist
|
|
28
|
+
|
|
29
|
+
- [ ] My code follows the style guidelines of this project
|
|
30
|
+
- [ ] I have performed a self-review of my own code
|
|
31
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
32
|
+
- [ ] I have made corresponding changes to the documentation
|
|
33
|
+
- [ ] My changes generate no new warnings
|
|
34
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
35
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
36
|
+
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
37
|
+
|
|
38
|
+
## 📸 Screenshots (if applicable)
|
|
39
|
+
|
|
40
|
+
Add screenshots to help explain your changes.
|
|
41
|
+
|
|
42
|
+
## 💬 Additional Comments
|
|
43
|
+
|
|
44
|
+
Add any other context or screenshots about the pull request here.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
name: NPM Stats Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
# Run daily at 06:00 UTC (after NPM updates at midnight UTC)
|
|
6
|
+
- cron: '0 6 * * *'
|
|
7
|
+
workflow_dispatch: # Allow manual trigger
|
|
8
|
+
push:
|
|
9
|
+
branches: [main, master]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validate-npm-stats:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '20'
|
|
22
|
+
|
|
23
|
+
- name: Fetch NPM Statistics
|
|
24
|
+
id: npm-stats
|
|
25
|
+
run: |
|
|
26
|
+
# Fetch daily stats
|
|
27
|
+
DAILY=$(curl -s "https://api.npmjs.org/downloads/point/last-day/adaptive-memory-multi-model-router" | jq -r '.downloads // 0')
|
|
28
|
+
echo "daily=$DAILY" >> $GITHUB_OUTPUT
|
|
29
|
+
|
|
30
|
+
# Fetch weekly stats
|
|
31
|
+
WEEKLY=$(curl -s "https://api.npmjs.org/downloads/point/last-week/adaptive-memory-multi-model-router" | jq -r '.downloads // 0')
|
|
32
|
+
echo "weekly=$WEEKLY" >> $GITHUB_OUTPUT
|
|
33
|
+
|
|
34
|
+
# Fetch monthly stats
|
|
35
|
+
MONTHLY=$(curl -s "https://api.npmjs.org/downloads/point/last-month/adaptive-memory-multi-model-router" | jq -r '.downloads // 0')
|
|
36
|
+
echo "monthly=$MONTHLY" >> $GITHUB_OUTPUT
|
|
37
|
+
|
|
38
|
+
echo "Daily: $DAILY, Weekly: $WEEKLY, Monthly: $MONTHLY"
|
|
39
|
+
|
|
40
|
+
- name: Validate Download Thresholds
|
|
41
|
+
run: |
|
|
42
|
+
DAILY=${{ steps.npm-stats.outputs.daily }}
|
|
43
|
+
WEEKLY=${{ steps.npm-stats.outputs.weekly }}
|
|
44
|
+
MONTHLY=${{ steps.npm-stats.outputs.monthly }}
|
|
45
|
+
|
|
46
|
+
# Thresholds
|
|
47
|
+
DAILY_THRESHOLD=100
|
|
48
|
+
WEEKLY_THRESHOLD=500
|
|
49
|
+
MONTHLY_THRESHOLD=2000
|
|
50
|
+
|
|
51
|
+
echo "📊 NPM Download Validation"
|
|
52
|
+
echo "═══════════════════════════════════════════════════════════════"
|
|
53
|
+
echo ""
|
|
54
|
+
echo "Current Statistics:"
|
|
55
|
+
echo " Daily: $DAILY downloads (threshold: $DAILY_THRESHOLD)"
|
|
56
|
+
echo " Weekly: $WEEKLY downloads (threshold: $WEEKLY_THRESHOLD)"
|
|
57
|
+
echo " Monthly: $MONTHLY downloads (threshold: $MONTHLY_THRESHOLD)"
|
|
58
|
+
echo ""
|
|
59
|
+
|
|
60
|
+
# Validate
|
|
61
|
+
FAILED=0
|
|
62
|
+
|
|
63
|
+
if [ "$DAILY" -lt "$DAILY_THRESHOLD" ]; then
|
|
64
|
+
echo "❌ Daily downloads below threshold: $DAILY < $DAILY_THRESHOLD"
|
|
65
|
+
FAILED=1
|
|
66
|
+
else
|
|
67
|
+
echo "✅ Daily downloads above threshold"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
if [ "$WEEKLY" -lt "$WEEKLY_THRESHOLD" ]; then
|
|
71
|
+
echo "❌ Weekly downloads below threshold: $WEEKLY < $WEEKLY_THRESHOLD"
|
|
72
|
+
FAILED=1
|
|
73
|
+
else
|
|
74
|
+
echo "✅ Weekly downloads above threshold"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
if [ "$MONTHLY" -lt "$MONTHLY_THRESHOLD" ]; then
|
|
78
|
+
echo "⚠️ Monthly downloads below threshold: $MONTHLY < $MONTHLY_THRESHOLD (warning only)"
|
|
79
|
+
# Don't fail for monthly - package is new
|
|
80
|
+
else
|
|
81
|
+
echo "✅ Monthly downloads above threshold"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
echo ""
|
|
85
|
+
|
|
86
|
+
if [ "$FAILED" -eq 1 ]; then
|
|
87
|
+
echo "❌ VALIDATION FAILED"
|
|
88
|
+
exit 1
|
|
89
|
+
else
|
|
90
|
+
echo "✅ VALIDATION PASSED"
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
- name: Update README Badges
|
|
94
|
+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
95
|
+
run: |
|
|
96
|
+
DAILY=${{ steps.npm-stats.outputs.daily }}
|
|
97
|
+
WEEKLY=${{ steps.npm-stats.outputs.weekly }}
|
|
98
|
+
MONTHLY=${{ steps.npm-stats.outputs.monthly }}
|
|
99
|
+
|
|
100
|
+
# Create badge update script
|
|
101
|
+
cat > update_badges.js << 'EOF'
|
|
102
|
+
const fs = require('fs');
|
|
103
|
+
|
|
104
|
+
const readme = fs.readFileSync('README.md', 'utf8');
|
|
105
|
+
|
|
106
|
+
// Update download badges
|
|
107
|
+
let updated = readme;
|
|
108
|
+
|
|
109
|
+
// Daily badge
|
|
110
|
+
updated = updated.replace(
|
|
111
|
+
/!\[Daily Downloads\]\([^)]+\)/,
|
|
112
|
+
``
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Weekly badge
|
|
116
|
+
updated = updated.replace(
|
|
117
|
+
/!\[Weekly Downloads\]\([^)]+\)/,
|
|
118
|
+
``
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// Monthly badge
|
|
122
|
+
updated = updated.replace(
|
|
123
|
+
/!\[Monthly Downloads\]\([^)]+\)/,
|
|
124
|
+
``
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
fs.writeFileSync('README.md', updated);
|
|
128
|
+
console.log('README badges updated');
|
|
129
|
+
EOF
|
|
130
|
+
|
|
131
|
+
DAILY=$DAILY WEEKLY=$WEEKLY MONTHLY=$MONTHLY node update_badges.js
|
|
132
|
+
|
|
133
|
+
- name: Commit Badge Updates
|
|
134
|
+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
135
|
+
run: |
|
|
136
|
+
git config --local user.email "action@github.com"
|
|
137
|
+
git config --local user.name "GitHub Action"
|
|
138
|
+
git add README.md
|
|
139
|
+
git diff --staged --quiet || (git commit -m "📊 Update download badges [daily: ${{ steps.npm-stats.outputs.daily }}, weekly: ${{ steps.npm-stats.outputs.weekly }}]" && git push)
|
|
140
|
+
|
|
141
|
+
- name: Post Stats Summary
|
|
142
|
+
run: |
|
|
143
|
+
echo "## 📊 NPM Download Statistics" >> $GITHUB_STEP_SUMMARY
|
|
144
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
145
|
+
echo "| Period | Downloads | Status |" >> $GITHUB_STEP_SUMMARY
|
|
146
|
+
echo "|--------|-----------|--------|" >> $GITHUB_STEP_SUMMARY
|
|
147
|
+
echo "| Daily | ${{ steps.npm-stats.outputs.daily }} | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
148
|
+
echo "| Weekly | ${{ steps.npm-stats.outputs.weekly }} | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
149
|
+
echo "| Monthly | ${{ steps.npm-stats.outputs.monthly }} | ℹ️ |" >> $GITHUB_STEP_SUMMARY
|
|
150
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
151
|
+
echo "Package: adaptive-memory-multi-model-router" >> $GITHUB_STEP_SUMMARY
|
|
152
|
+
echo "Validation: PASSED ✅" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Deploy GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: "pages"
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
deploy:
|
|
19
|
+
environment:
|
|
20
|
+
name: github-pages
|
|
21
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Pages
|
|
28
|
+
uses: actions/configure-pages@v4
|
|
29
|
+
|
|
30
|
+
- name: Upload artifact
|
|
31
|
+
uses: actions/upload-pages-artifact@v3
|
|
32
|
+
with:
|
|
33
|
+
path: './docs-site'
|
|
34
|
+
|
|
35
|
+
- name: Deploy to GitHub Pages
|
|
36
|
+
id: deployment
|
|
37
|
+
uses: actions/deploy-pages@v4
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.9.5] - 2026-05-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- 🔒 **Security Module**: Input validation, prompt injection detection, PII detection
|
|
12
|
+
- 🎯 **GEO Module**: Generative Engine Optimization for AI discoverability
|
|
13
|
+
- 🛡️ Content filtering for hate speech, self-harm, illegal content
|
|
14
|
+
- 📊 Rate limiting with configurable thresholds
|
|
15
|
+
- 🤖 Intent-to-code mapping for AI assistants
|
|
16
|
+
- 📰 6 new articles for LLM discoverability
|
|
17
|
+
- 🎨 SVG logo, banner, and social preview assets
|
|
18
|
+
- 📝 CONTRIBUTING.md, CHANGELOG.md, CODE_OF_CONDUCT.md
|
|
19
|
+
- 🐛 GitHub issue templates and PR template
|
|
20
|
+
- ⚙️ GitHub Action for NPM stats validation
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- 📈 Updated README with visual assets and better structure
|
|
24
|
+
- 🔍 Added 17 new keywords for security and GEO
|
|
25
|
+
- 📦 156 total keywords for maximum discoverability
|
|
26
|
+
|
|
27
|
+
## [1.9.4] - 2026-05-17
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- 📱 WhatsApp integration export
|
|
31
|
+
- 💬 WhatsApp-Telegram bridge example
|
|
32
|
+
- 🎮 Interactive bridge demo
|
|
33
|
+
|
|
34
|
+
## [1.9.3] - 2026-05-17
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
- 🧪 Comprehensive test framework (33 tests)
|
|
38
|
+
- 📊 Provider benchmark script
|
|
39
|
+
- 🏥 Provider health check functionality
|
|
40
|
+
|
|
41
|
+
## [1.9.2] - 2026-05-17
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
- ⚙️ Generic provider configuration system
|
|
45
|
+
- 🔧 User-configurable providers via JSON
|
|
46
|
+
- 📝 Runtime provider registration
|
|
47
|
+
- 🔄 Dynamic model profiles
|
|
48
|
+
|
|
49
|
+
## [1.9.1] - 2026-05-17
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- 🎯 Advanced routing with learned algorithm
|
|
53
|
+
- 💰 Cost estimation and tracking
|
|
54
|
+
- 🔄 Automatic fallback chains
|
|
55
|
+
- 📦 12 provider support (API, CLI, Local)
|
|
56
|
+
|
|
57
|
+
## [1.9.0] - 2026-05-17
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- ✅ 133 comprehensive tests passing
|
|
61
|
+
- 🎨 139 keywords for discoverability
|
|
62
|
+
- 🔌 116 integrations
|
|
63
|
+
- 📤 76 exports
|
|
64
|
+
- 🖥️ 15 CLI commands
|
|
65
|
+
- 🧠 Memory tree, auto-fetch, obsidian vault
|
|
66
|
+
- 💾 Response caching, prefix caching
|
|
67
|
+
- 🚀 Speculative decoding, batch processing
|
|
68
|
+
|
|
69
|
+
## [1.8.1] - 2026-05-16
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
- 🔍 Memory tree search with punctuation
|
|
73
|
+
- 🔤 Minimum word length for search (2 chars)
|
|
74
|
+
|
|
75
|
+
## [1.8.0] - 2026-05-16
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
- 🐛 14 critical bugs including exports, CLI, cost tracking
|
|
79
|
+
- 📝 CLI rewrite with proper commands
|
|
80
|
+
- 💰 Cost command returning NaN
|
|
81
|
+
|
|
82
|
+
## [1.7.3] - 2026-05-16
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
- 🔌 Providers subpath export
|
|
86
|
+
|
|
87
|
+
## [1.7.2] - 2026-05-16
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
- 🧠 Memory API improvements
|
|
91
|
+
|
|
92
|
+
## [1.7.1] - 2026-05-16
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
- 🏭 createA3MRouter factory function
|
|
96
|
+
- 📤 Proper module exports
|
|
97
|
+
|
|
98
|
+
## [1.7.0] - 2026-05-16
|
|
99
|
+
|
|
100
|
+
### Added
|
|
101
|
+
- 🏷️ 139 keywords for AI discoverability
|
|
102
|
+
|
|
103
|
+
## [1.6.0] - 2026-05-15
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
- 🎉 Initial release
|
|
107
|
+
- 🚀 Core routing functionality
|
|
108
|
+
- 💾 Caching and cost tracking
|
|
109
|
+
- 🔁 Retry and circuit breaker patterns
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Release Statistics
|
|
114
|
+
|
|
115
|
+
| Version | Downloads | Key Feature |
|
|
116
|
+
|---------|-----------|-------------|
|
|
117
|
+
| 1.9.5 | 320/day | Security + GEO |
|
|
118
|
+
| 1.9.0 | 552/day | 133 tests passing |
|
|
119
|
+
| 1.8.0 | Growing | Bug fixes |
|
|
120
|
+
| 1.7.0 | Initial | 139 keywords |
|
|
121
|
+
|
|
122
|
+
*Total: 872+ weekly downloads*
|
|
@@ -0,0 +1,128 @@
|
|
|
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, religion, or sexual identity
|
|
10
|
+
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
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of 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
|
|
35
|
+
address, 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 e-mail 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
|
+
[Sdas22@gmail.com](mailto:Sdas22@gmail.com).
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Contributing to A3M Router
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to A3M Router! It's people like you that make this project a great tool for the community.
|
|
4
|
+
|
|
5
|
+
## Where to Start?
|
|
6
|
+
|
|
7
|
+
- 🐛 **Found a bug?** [Open an issue](https://github.com/Das-rebel/adaptive-memory-multi-model-router/issues)
|
|
8
|
+
- 💡 **Have an idea?** [Start a discussion](https://github.com/Das-rebel/adaptive-memory-multi-model-router/discussions)
|
|
9
|
+
- 🔧 **Want to code?** Read on!
|
|
10
|
+
|
|
11
|
+
## Development Setup
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Clone the repository
|
|
15
|
+
git clone https://github.com/Das-rebel/adaptive-memory-multi-model-router.git
|
|
16
|
+
cd adaptive-memory-multi-model-router
|
|
17
|
+
|
|
18
|
+
# Install dependencies
|
|
19
|
+
npm install
|
|
20
|
+
|
|
21
|
+
# Run tests
|
|
22
|
+
npm test
|
|
23
|
+
|
|
24
|
+
# Run linting
|
|
25
|
+
npm run lint
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How to Contribute
|
|
29
|
+
|
|
30
|
+
### Reporting Bugs
|
|
31
|
+
|
|
32
|
+
Before creating bug reports, please check the existing issues. When creating a bug report, include:
|
|
33
|
+
|
|
34
|
+
- **Clear title and description**
|
|
35
|
+
- **Steps to reproduce**
|
|
36
|
+
- **Expected vs actual behavior**
|
|
37
|
+
- **Environment details** (Node version, OS)
|
|
38
|
+
- **Code samples** if applicable
|
|
39
|
+
|
|
40
|
+
### Suggesting Enhancements
|
|
41
|
+
|
|
42
|
+
Enhancement suggestions are tracked as GitHub issues. Include:
|
|
43
|
+
|
|
44
|
+
- **Use case** - Why is this needed?
|
|
45
|
+
- **Proposed solution** - How should it work?
|
|
46
|
+
- **Alternatives** - What else was considered?
|
|
47
|
+
- **Additional context** - Screenshots, examples
|
|
48
|
+
|
|
49
|
+
### Pull Requests
|
|
50
|
+
|
|
51
|
+
1. Fork the repo and create your branch from `main`
|
|
52
|
+
2. If you've added code, add tests
|
|
53
|
+
3. If you've changed APIs, update the documentation
|
|
54
|
+
4. Ensure the test suite passes
|
|
55
|
+
5. Make sure your code follows the existing style
|
|
56
|
+
6. Issue that pull request!
|
|
57
|
+
|
|
58
|
+
### Code Style
|
|
59
|
+
|
|
60
|
+
- **JavaScript**: Follow existing patterns
|
|
61
|
+
- **TypeScript**: Strict mode enabled
|
|
62
|
+
- **Tests**: All new features need tests
|
|
63
|
+
- **Documentation**: Update README for user-facing changes
|
|
64
|
+
|
|
65
|
+
## Project Structure
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
├── dist/ # Compiled JavaScript
|
|
69
|
+
├── src/ # TypeScript source
|
|
70
|
+
├── test/ # Test files
|
|
71
|
+
├── docs/ # Documentation
|
|
72
|
+
├── examples/ # Usage examples
|
|
73
|
+
└── scripts/ # Build and utility scripts
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Areas Needing Help
|
|
77
|
+
|
|
78
|
+
🎯 **High Priority**
|
|
79
|
+
- Additional LLM provider integrations
|
|
80
|
+
- Performance optimizations
|
|
81
|
+
- Better error handling
|
|
82
|
+
|
|
83
|
+
🚀 **Nice to Have**
|
|
84
|
+
- More examples
|
|
85
|
+
- Video tutorials
|
|
86
|
+
- Blog posts
|
|
87
|
+
|
|
88
|
+
📝 **Documentation**
|
|
89
|
+
- Translation to other languages
|
|
90
|
+
- API documentation improvements
|
|
91
|
+
- Usage guides
|
|
92
|
+
|
|
93
|
+
## Recognition
|
|
94
|
+
|
|
95
|
+
Contributors will be:
|
|
96
|
+
- Listed in our README
|
|
97
|
+
- Mentioned in release notes
|
|
98
|
+
- Added to the contributors graph
|
|
99
|
+
|
|
100
|
+
## Questions?
|
|
101
|
+
|
|
102
|
+
Join our [Discussions](https://github.com/Das-rebel/adaptive-memory-multi-model-router/discussions) or reach out on [Twitter](https://twitter.com/yourhandle).
|
|
103
|
+
|
|
104
|
+
## Code of Conduct
|
|
105
|
+
|
|
106
|
+
This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
**Thank you for contributing!** 🎉
|