Skip to content

feat: add ai-armor module#1436

Open
billymaulana wants to merge 3 commits intonuxt:mainfrom
billymaulana:feat/add-ai-armor
Open

feat: add ai-armor module#1436
billymaulana wants to merge 3 commits intonuxt:mainfrom
billymaulana:feat/add-ai-armor

Conversation

@billymaulana
Copy link
Contributor

Module Information

Description

Production AI toolkit for Nuxt with:

  • Rate Limiting — Sliding window, fixed window, or token bucket per IP/user/key
  • Cost Tracking — Real-time daily/monthly spend with budget alerts
  • Safety Guardrails — Prompt injection detection, PII filtering
  • Auto-Imported ComposablesuseArmorCost(), useArmorStatus(), useArmorSafety()
  • Server API Routes — Admin endpoints for monitoring
  • TypeScript First — Full type safety

Works with OpenAI, Google, Anthropic, Mistral, and 15+ AI providers.

Quick Setup

npx nuxi module add @ai-armor/nuxt
export default defineNuxtConfig({
  modules: ['@ai-armor/nuxt'],
  aiArmor: {
    rateLimit: { strategy: 'sliding-window', rules: [{ key: 'ip', limit: 30, window: '1m' }] },
    budget: { daily: 50, monthly: 500, onExceeded: 'warn' },
    safety: { promptInjection: true, piiDetection: true },
  },
})

Checklist

  • Published on npm (@ai-armor/nuxt@0.1.6)
  • MIT License
  • TypeScript support with exported types
  • Documentation site live
  • Tests passing (392 tests, 99.6% coverage)
  • ESM only
  • defineNuxtModule with proper meta

@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 651c66ad-f24f-45db-84ef-36f9dcc151be

📥 Commits

Reviewing files that changed from the base of the PR and between b9974d5 and 130b063.

📒 Files selected for processing (1)
  • modules/ai-armor.yml
✅ Files skipped from review due to trivial changes (1)
  • modules/ai-armor.yml

📝 Walkthrough

Walkthrough

A new module manifest file modules/ai-armor.yml was added describing the ai-armor Nuxt module. The manifest provides package metadata (name, description), entry points (repo, npm), links (icon, github, website, learn_more), classification fields (category, type), maintainer info, and a Nuxt compatibility constraint set to >=3.0.0. No runtime code or exported API changes were made.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add ai-armor module' clearly and directly describes the main change: adding a new Nuxt module manifest file for the ai-armor module.
Description check ✅ Passed The description is highly detailed and relevant, providing comprehensive information about the ai-armor module including features, setup, configuration, compatibility, and verification checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
modules/ai-armor.yml (1)

16-16: Consider omitting the empty requires field.

In YAML, an empty object can be omitted entirely. If there are no Nuxt-specific module dependencies, the requires field can be removed for cleaner syntax. However, keeping it explicit is also acceptable.

♻️ Optional cleanup
 compatibility:
   nuxt: '>=3.0.0'
-  requires: {}

Based on learnings: In YAML manifests within Nuxt modules, the requires field is for Nuxt-specific module/build-time dependencies and bridge compatibility, not npm dependencies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@modules/ai-armor.yml` at line 16, Remove the empty top-level "requires" field
from the module YAML manifest: since it contains an empty object (requires: {}),
delete that key entirely from the module manifest root to produce cleaner YAML;
if you prefer to keep it explicit you can leave it, but otherwise remove the
"requires" entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@modules/ai-armor.yml`:
- Line 16: Remove the empty top-level "requires" field from the module YAML
manifest: since it contains an empty object (requires: {}), delete that key
entirely from the module manifest root to produce cleaner YAML; if you prefer to
keep it explicit you can leave it, but otherwise remove the "requires" entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1072aafe-65cf-4001-8ba9-5fb24e6f8641

📥 Commits

Reviewing files that changed from the base of the PR and between da52820 and b9974d5.

⛔ Files ignored due to path filters (1)
  • icons/ai-armor.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • modules/ai-armor.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant