@mcptoolshop/ai-loadout 1.0.0 → 1.0.2
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 +9 -0
- package/README.es.md +196 -0
- package/README.fr.md +196 -0
- package/README.hi.md +196 -0
- package/README.it.md +196 -0
- package/README.ja.md +196 -0
- package/README.md +17 -1
- package/README.pt-BR.md +196 -0
- package/README.zh.md +196 -0
- package/SECURITY.md +35 -0
- package/dist/types.d.ts +1 -0
- package/dist/validate.js +3 -0
- package/logo.png +0 -0
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.1 — 2026-03-06
|
|
4
|
+
|
|
5
|
+
- Add `hint` field to `ValidationIssue` (Tier 1 error shape compliance)
|
|
6
|
+
- Add hints to key validation issues (MISSING_ID, MISSING_PATH, EMPTY_KEYWORDS)
|
|
7
|
+
- Add SECURITY.md with threat model
|
|
8
|
+
- Expand README security section with threat model table
|
|
9
|
+
- Add logo
|
|
10
|
+
- Include SECURITY.md and logo.png in npm package
|
|
11
|
+
|
|
3
12
|
## 1.0.0 — 2026-03-06
|
|
4
13
|
|
|
5
14
|
Initial release.
|
package/README.es.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a> | <a href="README.ja.md">日本語</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="logo.png" width="400" alt="ai-loadout">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@mcptoolshop/ai-loadout"><img src="https://img.shields.io/npm/v/@mcptoolshop/ai-loadout" alt="npm"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="Licencia MIT"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
Enrutador de conocimiento contextual para agentes de IA.
|
|
16
|
+
|
|
17
|
+
`ai-loadout` es el formato de tabla de despacho y motor de coincidencia que permite a los agentes de IA cargar el conocimiento adecuado para la tarea en cuestión. En lugar de volcar todo en el contexto, mantienes un índice pequeño y cargas los contenidos bajo demanda.
|
|
18
|
+
|
|
19
|
+
Piensa en ello como un equipamiento de videojuego — equipas al agente con exactamente el conocimiento que necesita antes de cada misión.
|
|
20
|
+
|
|
21
|
+
## Instalación
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @mcptoolshop/ai-loadout
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Conceptos Fundamentales
|
|
28
|
+
|
|
29
|
+
### La Tabla de Despacho
|
|
30
|
+
|
|
31
|
+
Un `LoadoutIndex` es un índice estructurado de contenidos de conocimiento:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"generated": "2026-03-06T12:00:00Z",
|
|
37
|
+
"entries": [
|
|
38
|
+
{
|
|
39
|
+
"id": "github-actions",
|
|
40
|
+
"path": ".rules/github-actions.md",
|
|
41
|
+
"keywords": ["ci", "workflow", "runner"],
|
|
42
|
+
"patterns": ["ci_pipeline"],
|
|
43
|
+
"priority": "domain",
|
|
44
|
+
"summary": "CI triggers, path gating, runner cost control",
|
|
45
|
+
"triggers": { "task": true, "plan": true, "edit": false },
|
|
46
|
+
"tokens_est": 680,
|
|
47
|
+
"lines": 56
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"budget": {
|
|
51
|
+
"always_loaded_est": 320,
|
|
52
|
+
"on_demand_total_est": 8100,
|
|
53
|
+
"avg_task_load_est": 520,
|
|
54
|
+
"avg_task_load_observed": null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Niveles de Prioridad
|
|
60
|
+
|
|
61
|
+
| Nivel | Comportamiento | Ejemplo |
|
|
62
|
+
|-------|---------------|---------|
|
|
63
|
+
| `core` | Siempre cargado | "nunca omitas tests para que CI pase" |
|
|
64
|
+
| `domain` | Cargado cuando las palabras clave de la tarea coinciden | Reglas de CI al editar workflows |
|
|
65
|
+
| `manual` | Nunca se carga automáticamente, solo búsqueda explícita | Problemas oscuros de plataforma |
|
|
66
|
+
|
|
67
|
+
### Frontmatter del Contenido
|
|
68
|
+
|
|
69
|
+
Cada archivo de contenido lleva sus propios metadatos de enrutamiento:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
---
|
|
73
|
+
id: github-actions
|
|
74
|
+
keywords: [ci, workflow, runner, dependabot]
|
|
75
|
+
patterns: [ci_pipeline]
|
|
76
|
+
priority: domain
|
|
77
|
+
triggers:
|
|
78
|
+
task: true
|
|
79
|
+
plan: true
|
|
80
|
+
edit: false
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
# GitHub Actions Rules
|
|
84
|
+
CI minutes are finite...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
El frontmatter es la fuente de verdad. El índice se deriva de él.
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
### `matchLoadout(task, index)`
|
|
92
|
+
|
|
93
|
+
Compara una descripción de tarea contra un índice de loadout. Devuelve las entradas que deben cargarse, ordenadas por fuerza de coincidencia.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { matchLoadout } from "@mcptoolshop/ai-loadout";
|
|
97
|
+
|
|
98
|
+
const results = matchLoadout("fix the CI workflow", index);
|
|
99
|
+
// [{ entry: { id: "github-actions", ... }, score: 0.67, matchedKeywords: ["ci", "workflow"] }]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- Las entradas core siempre se incluyen (puntuación 1.0)
|
|
103
|
+
- Las entradas manual nunca se incluyen automáticamente
|
|
104
|
+
- Las entradas domain se puntúan por coincidencia de palabras clave + bonificación de patrón
|
|
105
|
+
- Los resultados se ordenan por puntuación descendente
|
|
106
|
+
|
|
107
|
+
### `lookupEntry(id, index)`
|
|
108
|
+
|
|
109
|
+
Busca una entrada específica por ID. Para entradas manuales o acceso explícito.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { lookupEntry } from "@mcptoolshop/ai-loadout";
|
|
113
|
+
|
|
114
|
+
const entry = lookupEntry("github-actions", index);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `parseFrontmatter(content)`
|
|
118
|
+
|
|
119
|
+
Analiza el frontmatter tipo YAML de un archivo de contenido.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { parseFrontmatter } from "@mcptoolshop/ai-loadout";
|
|
123
|
+
|
|
124
|
+
const { frontmatter, body } = parseFrontmatter(fileContent);
|
|
125
|
+
if (frontmatter) {
|
|
126
|
+
console.log(frontmatter.id, frontmatter.keywords);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `serializeFrontmatter(fm)`
|
|
131
|
+
|
|
132
|
+
Serializa un objeto `Frontmatter` de vuelta a cadena de texto.
|
|
133
|
+
|
|
134
|
+
### `validateIndex(index)`
|
|
135
|
+
|
|
136
|
+
Valida la integridad estructural de un `LoadoutIndex`. Devuelve un arreglo de problemas.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { validateIndex } from "@mcptoolshop/ai-loadout";
|
|
140
|
+
|
|
141
|
+
const issues = validateIndex(index);
|
|
142
|
+
const errors = issues.filter(i => i.severity === "error");
|
|
143
|
+
if (errors.length > 0) {
|
|
144
|
+
console.error("Index has errors:", errors);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Verifica: campos requeridos, IDs únicos, formato kebab-case, límites de resumen, presencia de palabras clave para entradas domain, prioridades válidas, presupuestos no negativos.
|
|
149
|
+
|
|
150
|
+
### `estimateTokens(text)`
|
|
151
|
+
|
|
152
|
+
Estima el conteo de tokens de un texto. Usa la heurística de caracteres/4.
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { estimateTokens } from "@mcptoolshop/ai-loadout";
|
|
156
|
+
|
|
157
|
+
const tokens = estimateTokens(fileContent); // ~250
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Tipos
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import type {
|
|
164
|
+
LoadoutEntry,
|
|
165
|
+
LoadoutIndex,
|
|
166
|
+
Frontmatter,
|
|
167
|
+
MatchResult,
|
|
168
|
+
ValidationIssue,
|
|
169
|
+
Priority, // "core" | "domain" | "manual"
|
|
170
|
+
Triggers, // { task, plan, edit }
|
|
171
|
+
Budget,
|
|
172
|
+
} from "@mcptoolshop/ai-loadout";
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Consumidores
|
|
176
|
+
|
|
177
|
+
- **[@mcptoolshop/claude-rules](https://github.com/mcp-tool-shop-org/claude-rules)** — Optimizador de CLAUDE.md para Claude Code. Usa ai-loadout para la tabla de despacho y el motor de coincidencia.
|
|
178
|
+
|
|
179
|
+
## Seguridad
|
|
180
|
+
|
|
181
|
+
Este paquete es una biblioteca de datos pura. No accede al sistema de archivos, no realiza solicitudes de red ni recopila telemetría. Todo el I/O es responsabilidad del consumidor.
|
|
182
|
+
|
|
183
|
+
### Modelo de Amenazas
|
|
184
|
+
|
|
185
|
+
| Amenaza | Mitigación |
|
|
186
|
+
|---------|------------|
|
|
187
|
+
| Entrada de frontmatter malformado | `parseFrontmatter()` devuelve `null` ante entrada inválida — sin excepciones, sin eval |
|
|
188
|
+
| Contaminación de prototipo | El parser manual usa literales de objeto planos, sin `JSON.parse` de estructuras anidadas no confiables |
|
|
189
|
+
| Índice con datos incorrectos | `validateIndex()` detecta problemas estructurales antes de que se propaguen |
|
|
190
|
+
| DoS por Regex | Sin regex proporcionado por el usuario — los patrones se comparan como búsquedas de texto plano |
|
|
191
|
+
|
|
192
|
+
Consulta [SECURITY.md](SECURITY.md) para la política de seguridad completa.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Creado por [MCP Tool Shop](https://mcp-tool-shop.github.io/)
|
package/README.fr.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a> | <a href="README.ja.md">日本語</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="logo.png" width="400" alt="ai-loadout">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@mcptoolshop/ai-loadout"><img src="https://img.shields.io/npm/v/@mcptoolshop/ai-loadout" alt="npm"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="Licence MIT"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
Routeur de connaissances contextuel pour agents IA.
|
|
16
|
+
|
|
17
|
+
`ai-loadout` est le format de table de dispatch et le moteur de correspondance qui permet aux agents IA de charger les bonnes connaissances pour la tache en cours. Au lieu de tout charger dans le contexte, vous gardez un petit index et chargez les contenus a la demande.
|
|
18
|
+
|
|
19
|
+
Pensez-y comme un equipement de jeu video — vous equipez l'agent avec exactement les connaissances dont il a besoin avant chaque mission.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @mcptoolshop/ai-loadout
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Concepts Fondamentaux
|
|
28
|
+
|
|
29
|
+
### La Table de Dispatch
|
|
30
|
+
|
|
31
|
+
Un `LoadoutIndex` est un index structure de contenus de connaissances :
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"generated": "2026-03-06T12:00:00Z",
|
|
37
|
+
"entries": [
|
|
38
|
+
{
|
|
39
|
+
"id": "github-actions",
|
|
40
|
+
"path": ".rules/github-actions.md",
|
|
41
|
+
"keywords": ["ci", "workflow", "runner"],
|
|
42
|
+
"patterns": ["ci_pipeline"],
|
|
43
|
+
"priority": "domain",
|
|
44
|
+
"summary": "CI triggers, path gating, runner cost control",
|
|
45
|
+
"triggers": { "task": true, "plan": true, "edit": false },
|
|
46
|
+
"tokens_est": 680,
|
|
47
|
+
"lines": 56
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"budget": {
|
|
51
|
+
"always_loaded_est": 320,
|
|
52
|
+
"on_demand_total_est": 8100,
|
|
53
|
+
"avg_task_load_est": 520,
|
|
54
|
+
"avg_task_load_observed": null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Niveaux de Priorite
|
|
60
|
+
|
|
61
|
+
| Niveau | Comportement | Exemple |
|
|
62
|
+
|--------|-------------|---------|
|
|
63
|
+
| `core` | Toujours charge | "ne jamais ignorer les tests pour faire passer la CI" |
|
|
64
|
+
| `domain` | Charge quand les mots-cles de la tache correspondent | Regles CI lors de l'edition de workflows |
|
|
65
|
+
| `manual` | Jamais charge automatiquement, consultation explicite uniquement | Problemes obscurs de plateforme |
|
|
66
|
+
|
|
67
|
+
### Frontmatter du Contenu
|
|
68
|
+
|
|
69
|
+
Chaque fichier de contenu porte ses propres metadonnees de routage :
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
---
|
|
73
|
+
id: github-actions
|
|
74
|
+
keywords: [ci, workflow, runner, dependabot]
|
|
75
|
+
patterns: [ci_pipeline]
|
|
76
|
+
priority: domain
|
|
77
|
+
triggers:
|
|
78
|
+
task: true
|
|
79
|
+
plan: true
|
|
80
|
+
edit: false
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
# GitHub Actions Rules
|
|
84
|
+
CI minutes are finite...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Le frontmatter est la source de verite. L'index en est derive.
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
### `matchLoadout(task, index)`
|
|
92
|
+
|
|
93
|
+
Compare une description de tache avec un index de loadout. Retourne les entrees qui doivent etre chargees, classees par force de correspondance.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { matchLoadout } from "@mcptoolshop/ai-loadout";
|
|
97
|
+
|
|
98
|
+
const results = matchLoadout("fix the CI workflow", index);
|
|
99
|
+
// [{ entry: { id: "github-actions", ... }, score: 0.67, matchedKeywords: ["ci", "workflow"] }]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- Les entrees core sont toujours incluses (score 1.0)
|
|
103
|
+
- Les entrees manual ne sont jamais incluses automatiquement
|
|
104
|
+
- Les entrees domain sont notees par chevauchement de mots-cles + bonus de patron
|
|
105
|
+
- Les resultats sont tries par score decroissant
|
|
106
|
+
|
|
107
|
+
### `lookupEntry(id, index)`
|
|
108
|
+
|
|
109
|
+
Recherche une entree specifique par ID. Pour les entrees manuelles ou l'acces explicite.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { lookupEntry } from "@mcptoolshop/ai-loadout";
|
|
113
|
+
|
|
114
|
+
const entry = lookupEntry("github-actions", index);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `parseFrontmatter(content)`
|
|
118
|
+
|
|
119
|
+
Analyse le frontmatter de type YAML d'un fichier de contenu.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { parseFrontmatter } from "@mcptoolshop/ai-loadout";
|
|
123
|
+
|
|
124
|
+
const { frontmatter, body } = parseFrontmatter(fileContent);
|
|
125
|
+
if (frontmatter) {
|
|
126
|
+
console.log(frontmatter.id, frontmatter.keywords);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `serializeFrontmatter(fm)`
|
|
131
|
+
|
|
132
|
+
Serialise un objet `Frontmatter` en chaine de caracteres.
|
|
133
|
+
|
|
134
|
+
### `validateIndex(index)`
|
|
135
|
+
|
|
136
|
+
Valide l'integrite structurelle d'un `LoadoutIndex`. Retourne un tableau de problemes.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { validateIndex } from "@mcptoolshop/ai-loadout";
|
|
140
|
+
|
|
141
|
+
const issues = validateIndex(index);
|
|
142
|
+
const errors = issues.filter(i => i.severity === "error");
|
|
143
|
+
if (errors.length > 0) {
|
|
144
|
+
console.error("Index has errors:", errors);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Verifie : champs requis, IDs uniques, format kebab-case, limites de resume, presence de mots-cles pour les entrees domain, priorites valides, budgets non negatifs.
|
|
149
|
+
|
|
150
|
+
### `estimateTokens(text)`
|
|
151
|
+
|
|
152
|
+
Estime le nombre de tokens d'un texte. Utilise l'heuristique caracteres/4.
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { estimateTokens } from "@mcptoolshop/ai-loadout";
|
|
156
|
+
|
|
157
|
+
const tokens = estimateTokens(fileContent); // ~250
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Types
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import type {
|
|
164
|
+
LoadoutEntry,
|
|
165
|
+
LoadoutIndex,
|
|
166
|
+
Frontmatter,
|
|
167
|
+
MatchResult,
|
|
168
|
+
ValidationIssue,
|
|
169
|
+
Priority, // "core" | "domain" | "manual"
|
|
170
|
+
Triggers, // { task, plan, edit }
|
|
171
|
+
Budget,
|
|
172
|
+
} from "@mcptoolshop/ai-loadout";
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Consommateurs
|
|
176
|
+
|
|
177
|
+
- **[@mcptoolshop/claude-rules](https://github.com/mcp-tool-shop-org/claude-rules)** — Optimiseur de CLAUDE.md pour Claude Code. Utilise ai-loadout pour la table de dispatch et la correspondance.
|
|
178
|
+
|
|
179
|
+
## Securite
|
|
180
|
+
|
|
181
|
+
Ce paquet est une bibliotheque de donnees pure. Il n'accede pas au systeme de fichiers, ne fait pas de requetes reseau et ne collecte pas de telemetrie. Toutes les operations d'E/S sont de la responsabilite du consommateur.
|
|
182
|
+
|
|
183
|
+
### Modele de Menaces
|
|
184
|
+
|
|
185
|
+
| Menace | Attenuation |
|
|
186
|
+
|--------|-------------|
|
|
187
|
+
| Entree de frontmatter malformee | `parseFrontmatter()` retourne `null` sur une entree invalide — pas d'exceptions, pas d'eval |
|
|
188
|
+
| Pollution de prototype | Le parser manuel utilise des litteraux d'objet simples, pas de `JSON.parse` de structures imbriquees non fiables |
|
|
189
|
+
| Index avec des donnees incorrectes | `validateIndex()` detecte les problemes structurels avant qu'ils ne se propagent |
|
|
190
|
+
| DoS par Regex | Pas de regex fournie par l'utilisateur — les patrons sont compares comme des recherches de texte brut |
|
|
191
|
+
|
|
192
|
+
Consultez [SECURITY.md](SECURITY.md) pour la politique de securite complete.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Cree par [MCP Tool Shop](https://mcp-tool-shop.github.io/)
|
package/README.hi.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a> | <a href="README.ja.md">日本語</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="logo.png" width="400" alt="ai-loadout">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/ai-loadout/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@mcptoolshop/ai-loadout"><img src="https://img.shields.io/npm/v/@mcptoolshop/ai-loadout" alt="npm"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT लाइसेंस"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
AI एजेंटों के लिए संदर्भ-जागरूक ज्ञान राउटर।
|
|
16
|
+
|
|
17
|
+
`ai-loadout` एक डिस्पैच टेबल फॉर्मैट और मैचिंग इंजन है जो AI एजेंटों को कार्य के अनुसार सही ज्ञान लोड करने देता है। सब कुछ संदर्भ में डालने के बजाय, आप एक छोटा इंडेक्स रखते हैं और आवश्यकतानुसार पेलोड लोड करते हैं।
|
|
18
|
+
|
|
19
|
+
इसे एक वीडियो गेम लोडआउट की तरह समझें — आप हर मिशन से पहले एजेंट को ठीक उतना ज्ञान देते हैं जितना उसे चाहिए।
|
|
20
|
+
|
|
21
|
+
## इंस्टॉलेशन
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @mcptoolshop/ai-loadout
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## मूल अवधारणाएं
|
|
28
|
+
|
|
29
|
+
### डिस्पैच टेबल
|
|
30
|
+
|
|
31
|
+
एक `LoadoutIndex` ज्ञान पेलोड का एक संरचित इंडेक्स है:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"generated": "2026-03-06T12:00:00Z",
|
|
37
|
+
"entries": [
|
|
38
|
+
{
|
|
39
|
+
"id": "github-actions",
|
|
40
|
+
"path": ".rules/github-actions.md",
|
|
41
|
+
"keywords": ["ci", "workflow", "runner"],
|
|
42
|
+
"patterns": ["ci_pipeline"],
|
|
43
|
+
"priority": "domain",
|
|
44
|
+
"summary": "CI triggers, path gating, runner cost control",
|
|
45
|
+
"triggers": { "task": true, "plan": true, "edit": false },
|
|
46
|
+
"tokens_est": 680,
|
|
47
|
+
"lines": 56
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"budget": {
|
|
51
|
+
"always_loaded_est": 320,
|
|
52
|
+
"on_demand_total_est": 8100,
|
|
53
|
+
"avg_task_load_est": 520,
|
|
54
|
+
"avg_task_load_observed": null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### प्राथमिकता स्तर
|
|
60
|
+
|
|
61
|
+
| स्तर | व्यवहार | उदाहरण |
|
|
62
|
+
|------|---------|--------|
|
|
63
|
+
| `core` | हमेशा लोड | "CI पास करने के लिए कभी टेस्ट न छोड़ें" |
|
|
64
|
+
| `domain` | कार्य के कीवर्ड मैच होने पर लोड | workflows संपादित करते समय CI नियम |
|
|
65
|
+
| `manual` | कभी स्वचालित लोड नहीं, केवल स्पष्ट लुकअप | अस्पष्ट प्लेटफॉर्म समस्याएं |
|
|
66
|
+
|
|
67
|
+
### पेलोड Frontmatter
|
|
68
|
+
|
|
69
|
+
प्रत्येक पेलोड फ़ाइल अपने स्वयं के राउटिंग मेटाडेटा रखती है:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
---
|
|
73
|
+
id: github-actions
|
|
74
|
+
keywords: [ci, workflow, runner, dependabot]
|
|
75
|
+
patterns: [ci_pipeline]
|
|
76
|
+
priority: domain
|
|
77
|
+
triggers:
|
|
78
|
+
task: true
|
|
79
|
+
plan: true
|
|
80
|
+
edit: false
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
# GitHub Actions Rules
|
|
84
|
+
CI minutes are finite...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Frontmatter सत्य का स्रोत है। इंडेक्स इससे व्युत्पन्न होता है।
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
### `matchLoadout(task, index)`
|
|
92
|
+
|
|
93
|
+
एक कार्य विवरण को loadout इंडेक्स से मिलाता है। वे प्रविष्टियां लौटाता है जो लोड होनी चाहिए, मैच शक्ति के अनुसार क्रमबद्ध।
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { matchLoadout } from "@mcptoolshop/ai-loadout";
|
|
97
|
+
|
|
98
|
+
const results = matchLoadout("fix the CI workflow", index);
|
|
99
|
+
// [{ entry: { id: "github-actions", ... }, score: 0.67, matchedKeywords: ["ci", "workflow"] }]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- Core प्रविष्टियां हमेशा शामिल (स्कोर 1.0)
|
|
103
|
+
- Manual प्रविष्टियां कभी स्वचालित रूप से शामिल नहीं
|
|
104
|
+
- Domain प्रविष्टियां कीवर्ड ओवरलैप + पैटर्न बोनस द्वारा स्कोर
|
|
105
|
+
- परिणाम स्कोर के अनुसार अवरोही क्रम में
|
|
106
|
+
|
|
107
|
+
### `lookupEntry(id, index)`
|
|
108
|
+
|
|
109
|
+
ID द्वारा एक विशिष्ट प्रविष्टि खोजता है। मैनुअल प्रविष्टियों या स्पष्ट पहुंच के लिए।
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { lookupEntry } from "@mcptoolshop/ai-loadout";
|
|
113
|
+
|
|
114
|
+
const entry = lookupEntry("github-actions", index);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `parseFrontmatter(content)`
|
|
118
|
+
|
|
119
|
+
एक पेलोड फ़ाइल से YAML-जैसा frontmatter पार्स करता है।
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { parseFrontmatter } from "@mcptoolshop/ai-loadout";
|
|
123
|
+
|
|
124
|
+
const { frontmatter, body } = parseFrontmatter(fileContent);
|
|
125
|
+
if (frontmatter) {
|
|
126
|
+
console.log(frontmatter.id, frontmatter.keywords);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `serializeFrontmatter(fm)`
|
|
131
|
+
|
|
132
|
+
एक `Frontmatter` ऑब्जेक्ट को वापस स्ट्रिंग में सीरियलाइज़ करता है।
|
|
133
|
+
|
|
134
|
+
### `validateIndex(index)`
|
|
135
|
+
|
|
136
|
+
एक `LoadoutIndex` की संरचनात्मक अखंडता की जांच करता है। समस्याओं की एक सूची लौटाता है।
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { validateIndex } from "@mcptoolshop/ai-loadout";
|
|
140
|
+
|
|
141
|
+
const issues = validateIndex(index);
|
|
142
|
+
const errors = issues.filter(i => i.severity === "error");
|
|
143
|
+
if (errors.length > 0) {
|
|
144
|
+
console.error("Index has errors:", errors);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
जांचता है: आवश्यक फ़ील्ड, अद्वितीय ID, kebab-case प्रारूप, सारांश सीमाएं, domain प्रविष्टियों के लिए कीवर्ड उपस्थिति, मान्य प्राथमिकताएं, गैर-नकारात्मक बजट।
|
|
149
|
+
|
|
150
|
+
### `estimateTokens(text)`
|
|
151
|
+
|
|
152
|
+
टेक्स्ट से टोकन गणना का अनुमान लगाता है। अक्षर/4 ह्यूरिस्टिक का उपयोग करता है।
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { estimateTokens } from "@mcptoolshop/ai-loadout";
|
|
156
|
+
|
|
157
|
+
const tokens = estimateTokens(fileContent); // ~250
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## टाइप्स
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import type {
|
|
164
|
+
LoadoutEntry,
|
|
165
|
+
LoadoutIndex,
|
|
166
|
+
Frontmatter,
|
|
167
|
+
MatchResult,
|
|
168
|
+
ValidationIssue,
|
|
169
|
+
Priority, // "core" | "domain" | "manual"
|
|
170
|
+
Triggers, // { task, plan, edit }
|
|
171
|
+
Budget,
|
|
172
|
+
} from "@mcptoolshop/ai-loadout";
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## उपभोक्ता
|
|
176
|
+
|
|
177
|
+
- **[@mcptoolshop/claude-rules](https://github.com/mcp-tool-shop-org/claude-rules)** — Claude Code के लिए CLAUDE.md ऑप्टिमाइज़र। डिस्पैच टेबल और मैचिंग के लिए ai-loadout का उपयोग करता है।
|
|
178
|
+
|
|
179
|
+
## सुरक्षा
|
|
180
|
+
|
|
181
|
+
यह पैकेज एक शुद्ध डेटा लाइब्रेरी है। यह फ़ाइल सिस्टम तक नहीं पहुंचता, नेटवर्क अनुरोध नहीं करता और टेलीमेट्री एकत्र नहीं करता। सभी I/O उपभोक्ता की जिम्मेदारी है।
|
|
182
|
+
|
|
183
|
+
### खतरा मॉडल
|
|
184
|
+
|
|
185
|
+
| खतरा | शमन |
|
|
186
|
+
|------|------|
|
|
187
|
+
| विकृत frontmatter इनपुट | `parseFrontmatter()` अमान्य इनपुट पर `null` लौटाता है — कोई अपवाद नहीं, कोई eval नहीं |
|
|
188
|
+
| प्रोटोटाइप प्रदूषण | मैनुअल पार्सर सादे ऑब्जेक्ट लिटरल का उपयोग करता है, अविश्वसनीय नेस्टेड संरचनाओं का `JSON.parse` नहीं |
|
|
189
|
+
| खराब डेटा वाला इंडेक्स | `validateIndex()` संरचनात्मक समस्याओं को फैलने से पहले पकड़ता है |
|
|
190
|
+
| Regex DoS | कोई उपयोगकर्ता-प्रदत्त regex नहीं — पैटर्न सादे स्ट्रिंग लुकअप के रूप में मिलाए जाते हैं |
|
|
191
|
+
|
|
192
|
+
पूर्ण सुरक्षा नीति के लिए [SECURITY.md](SECURITY.md) देखें।
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
[MCP Tool Shop](https://mcp-tool-shop.github.io/) द्वारा निर्मित
|