From e5a3a8275157303095bb8c6387c601481e0576dc Mon Sep 17 00:00:00 2001 From: leduclinh Date: Sat, 7 Feb 2026 10:54:08 +0900 Subject: [PATCH] chore: update package version to 2.2.3 and refactor CLI commands - Changed CLI commands to use the scoped package name `@aitytech/agentkits-memory`. - Updated README and documentation to reflect new command usage. - Added end-to-end test script for comprehensive CLI testing. - Refactored hook commands to ensure compatibility with new CLI structure. - Adjusted MCP server configuration to use the new command format. - Enhanced error handling and output messages for better user experience. --- .github/workflows/ci.yml | 52 +++- README.md | 70 +++--- hooks.json | 12 +- i18n/README.ar.md | 70 +++--- i18n/README.de.md | 70 +++--- i18n/README.es.md | 70 +++--- i18n/README.fr.md | 70 +++--- i18n/README.ja.md | 70 +++--- i18n/README.ko.md | 70 +++--- i18n/README.pt-br.md | 70 +++--- i18n/README.ru.md | 70 +++--- i18n/README.vi.md | 70 +++--- i18n/README.zh.md | 70 +++--- package-lock.json | 5 +- package.json | 5 +- plugin/.mcp.json | 2 +- plugin/hooks/hooks.json | 8 +- scripts/e2e-test.sh | 523 +++++++++++++++++++++++++++++++++++++++ src/cli/main.ts | 101 ++++++++ src/cli/save.ts | 2 +- src/cli/setup.ts | 16 +- src/cli/viewer.ts | 2 +- src/cli/web-viewer.ts | 2 +- src/hooks/cli.ts | 4 +- src/hooks/service.ts | 2 +- src/hooks/summarize.ts | 2 +- src/mcp/server.ts | 2 +- 27 files changed, 1081 insertions(+), 429 deletions(-) create mode 100755 scripts/e2e-test.sh create mode 100644 src/cli/main.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db14b38..80dbb07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,29 +32,55 @@ jobs: - name: Run tests run: npm test - publish: + e2e: needs: test - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + node-version: [20] steps: - uses: actions/checkout@v4 - - name: Setup Node.js + - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: - node-version: 20 - registry-url: 'https://registry.npmjs.org' + node-version: ${{ matrix.node-version }} cache: 'npm' - name: Install dependencies run: npm ci - - name: Build - run: npm run build + - name: Make e2e script executable + run: chmod +x scripts/e2e-test.sh + + - name: Run E2E tests + run: ./scripts/e2e-test.sh + + # publish: + # needs: [test, e2e] + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' && github.event_name == 'push' + + # steps: + # - uses: actions/checkout@v4 + + # - name: Setup Node.js + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # registry-url: 'https://registry.npmjs.org' + # cache: 'npm' + + # - name: Install dependencies + # run: npm ci + + # - name: Build + # run: npm run build - - name: Publish to npm - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - continue-on-error: true + # - name: Publish to npm + # run: npm publish --access public + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # continue-on-error: true diff --git a/README.md b/README.md index 726b83d..d29e896 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Session 1: "Use JWT for auth" Session 2: "Add login endpoint" (SQLite, 100% local) ``` -1. **Setup once** — `npx agentkits-memory-setup` configures your platform +1. **Setup once** — `npx @aitytech/agentkits-memory` configures your platform 2. **Auto-capture** — Hooks record decisions, tool usage, and summaries as you work 3. **Context injection** — Next session starts with relevant history from past sessions 4. **Background processing** — Workers enrich observations with AI, generate embeddings, compress old data @@ -116,7 +116,7 @@ Most memory tools scatter data across markdown files, require Python runtimes, o View and manage your memories through a modern web interface. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Then open **http://localhost:1905** in your browser. @@ -169,7 +169,7 @@ This installs hooks, MCP server, and memory workflow skill automatically. Restar ### Option 2: Automated Setup (All Platforms) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` This auto-detects your platform and configures everything: MCP server, hooks (Claude Code/OpenCode), rules files (Cursor/Windsurf/Cline), and downloads the embedding model. @@ -177,9 +177,9 @@ This auto-detects your platform and configures everything: MCP server, hooks (Cl **Target a specific platform:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory --platform=cursor +npx @aitytech/agentkits-memory --platform=windsurf,cline +npx @aitytech/agentkits-memory --platform=all ``` ### Option 3: Manual MCP Configuration @@ -191,7 +191,7 @@ If you prefer manual setup, add to your MCP config: "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # One-command setup (auto-detects platform) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # specific platform -npx agentkits-memory-setup --platform=all # all platforms -npx agentkits-memory-setup --force # re-install/update +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # specific platform +npx @aitytech/agentkits-memory setup --platform=all # all platforms +npx @aitytech/agentkits-memory setup --force # re-install/update # Start MCP server -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Web viewer (port 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Terminal viewer -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # database statistics -npx agentkits-memory-viewer --json # JSON output +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats +npx @aitytech/agentkits-memory viewer --json # Save from CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Settings -npx agentkits-memory-hook settings . # view current settings -npx agentkits-memory-hook settings . --reset # reset to defaults -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . +npx @aitytech/agentkits-memory hook settings . --reset +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Export / Import -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Lifecycle management -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Hooks automatically capture your AI coding sessions (Claude Code and OpenCode on Setup hooks: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **What gets captured automatically:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Saved to .claude/memory/settings.json — persists across sessions -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # View current settings -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Reset to defaults -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Priority:** Environment variables override settings.json. Settings.json overrides defaults. @@ -470,13 +470,13 @@ Manage memory growth over time: ```bash # Compress observations older than 7 days, archive sessions older than 30 days -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Also auto-delete archived sessions older than 90 days -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # View lifecycle statistics -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Stage | What Happens | @@ -493,10 +493,10 @@ Backup and restore your project memories: ```bash # Export all sessions for a project -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Import from backup (deduplicates automatically) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Export format includes sessions, observations, prompts, and summaries. diff --git a/hooks.json b/hooks.json index 22a7f82..8893fe5 100644 --- a/hooks.json +++ b/hooks.json @@ -1,6 +1,6 @@ { "_comment": "REFERENCE ONLY - These hooks are integrated into .claude/hooks/*.sh scripts", - "_usage": "The shell scripts call 'npx agentkits-memory-hook ' for database integration", + "_usage": "The shell scripts call 'npx @aitytech/agentkits-memory hook ' for database integration", "hooks": { "SessionStart": [ { @@ -8,7 +8,7 @@ "hooks": [ { "type": "command", - "command": "npx agentkits-memory-hook context", + "command": "npx @aitytech/agentkits-memory hook context", "_note": "Called by .claude/hooks/session-start.sh" } ] @@ -20,7 +20,7 @@ "hooks": [ { "type": "command", - "command": "npx agentkits-memory-hook summarize", + "command": "npx @aitytech/agentkits-memory hook summarize", "_note": "Called by .claude/hooks/on-stop.sh" } ] @@ -28,17 +28,17 @@ ] }, "cliCommands": { - "agentkits-memory-hook": { + "hook": { "context": "Load context from database on session start", "session-init": "Initialize session in database", "observation": "Save tool observations to database", "summarize": "Create session summary on stop" }, - "agentkits-memory-save": { + "save": { "description": "Save entry to database", "usage": "--content=X --category=X --tags=X --importance=X --project-dir=X" }, - "agentkits-memory-viewer": { + "viewer": { "description": "View database contents", "usage": "--stats | --list | --namespace=X | --json | --export" } diff --git a/i18n/README.ar.md b/i18n/README.ar.md index feafd75..8babc69 100644 --- a/i18n/README.ar.md +++ b/i18n/README.ar.md @@ -82,7 +82,7 @@ (SQLite، محلي 100%) ``` -1. **إعداد لمرة واحدة** — `npx agentkits-memory-setup` يقوم بإعداد منصتك +1. **إعداد لمرة واحدة** — `npx @aitytech/agentkits-memory` يقوم بإعداد منصتك 2. **التقاط تلقائي** — الخطافات تسجل القرارات واستخدام الأدوات والملخصات أثناء العمل 3. **حقن السياق** — الجلسة التالية تبدأ بالتاريخ ذي الصلة من الجلسات السابقة 4. **معالجة الخلفية** — العمال يثرون الملاحظات بالذكاء الاصطناعي، ويولدون التضمينات، ويضغطون البيانات القديمة @@ -116,7 +116,7 @@ اعرض وأدر ذكرياتك من خلال واجهة ويب حديثة. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` ثم افتح **http://localhost:1905** في متصفحك. @@ -169,7 +169,7 @@ npx agentkits-memory-web ### الخيار 2: إعداد تلقائي (جميع المنصات) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` هذا يكتشف منصتك تلقائيًا ويكوّن كل شيء: خادم MCP، الخطافات (Claude Code/OpenCode)، ملفات القواعد (Cursor/Windsurf/Cline)، ويُنزل نموذج التضمين. @@ -177,9 +177,9 @@ npx agentkits-memory-setup **استهدف منصة معينة:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### الخيار 3: إعداد MCP يدوي @@ -191,7 +191,7 @@ npx agentkits-memory-setup --platform=all "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # إعداد بأمر واحد (يكتشف المنصة تلقائيًا) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # منصة محددة -npx agentkits-memory-setup --platform=all # جميع المنصات -npx agentkits-memory-setup --force # إعادة التثبيت/التحديث +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # منصة محددة +npx @aitytech/agentkits-memory setup --platform=all # جميع المنصات +npx @aitytech/agentkits-memory setup --force # إعادة التثبيت/التحديث # بدء خادم MCP -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # عارض الويب (منفذ 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # عارض الطرفية -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # إحصائيات قاعدة البيانات -npx agentkits-memory-viewer --json # إخراج JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # إحصائيات قاعدة البيانات +npx @aitytech/agentkits-memory viewer --json # إخراج JSON # حفظ من CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # الإعدادات -npx agentkits-memory-hook settings . # عرض الإعدادات الحالية -npx agentkits-memory-hook settings . --reset # إعادة التعيين إلى الافتراضيات -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # عرض الإعدادات الحالية +npx @aitytech/agentkits-memory hook settings . --reset # إعادة التعيين إلى الافتراضيات +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # تصدير / استيراد -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # إدارة دورة الحياة -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ const entry = await memory.getByKey('patterns', 'auth-pattern'); إعداد الخطافات: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **ما يُلتقط تلقائيًا:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # محفوظ في .claude/memory/settings.json — يستمر عبر الجلسات -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # عرض الإعدادات الحالية -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # إعادة التعيين إلى الافتراضيات -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **الأولوية:** متغيرات البيئة تتجاوز settings.json. settings.json يتجاوز الافتراضيات. @@ -470,13 +470,13 @@ npx agentkits-memory-hook settings . --reset ```bash # ضغط الملاحظات الأقدم من 7 أيام، أرشفة الجلسات الأقدم من 30 يومًا -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # أيضًا حذف تلقائي للجلسات المؤرشفة الأقدم من 90 يومًا -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # عرض إحصائيات دورة الحياة -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | المرحلة | ما يحدث | @@ -493,10 +493,10 @@ npx agentkits-memory-hook lifecycle-stats . ```bash # تصدير جميع الجلسات لمشروع -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # استيراد من النسخة الاحتياطية (يزيل التكرار تلقائيًا) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` تنسيق التصدير يتضمن الجلسات والملاحظات والمطالبات والملخصات. diff --git a/i18n/README.de.md b/i18n/README.de.md index 5e5fb90..fa18764 100644 --- a/i18n/README.de.md +++ b/i18n/README.de.md @@ -82,7 +82,7 @@ Session 1: "Use JWT for auth" Session 2: "Add login endpoint" (SQLite, 100% lokal) ``` -1. **Einmal einrichten** — `npx agentkits-memory-setup` konfiguriert Ihre Plattform +1. **Einmal einrichten** — `npx @aitytech/agentkits-memory` konfiguriert Ihre Plattform 2. **Auto-Capture** — Hooks zeichnen Entscheidungen, Tool-Nutzung und Zusammenfassungen während der Arbeit auf 3. **Kontext-Injektion** — Nächste Session startet mit relevantem Verlauf aus vergangenen Sessions 4. **Hintergrundverarbeitung** — Worker reichern Beobachtungen mit KI an, generieren Embeddings, komprimieren alte Daten @@ -116,7 +116,7 @@ Die meisten Memory-Tools verstreuen Daten über Markdown-Dateien, benötigen Pyt Zeigen Sie Ihre Erinnerungen über eine moderne Web-Oberfläche an und verwalten Sie sie. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Öffnen Sie dann **http://localhost:1905** in Ihrem Browser. @@ -169,7 +169,7 @@ Dies installiert Hooks, MCP-Server und Memory-Workflow-Skill automatisch. Starte ### Option 2: Automatisches Setup (Alle Plattformen) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Dies erkennt Ihre Plattform automatisch und konfiguriert alles: MCP-Server, Hooks (Claude Code/OpenCode), Rules-Dateien (Cursor/Windsurf/Cline) und lädt das Embedding-Modell herunter. @@ -177,9 +177,9 @@ Dies erkennt Ihre Plattform automatisch und konfiguriert alles: MCP-Server, Hook **Spezifische Plattform auswählen:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Option 3: Manuelle MCP-Konfiguration @@ -191,7 +191,7 @@ Wenn Sie manuelle Einrichtung bevorzugen, fügen Sie zu Ihrer MCP-Konfiguration "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Ein-Befehl-Setup (erkennt Plattform automatisch) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # spezifische Plattform -npx agentkits-memory-setup --platform=all # alle Plattformen -npx agentkits-memory-setup --force # neu installieren/aktualisieren +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # spezifische Plattform +npx @aitytech/agentkits-memory setup --platform=all # alle Plattformen +npx @aitytech/agentkits-memory setup --force # neu installieren/aktualisieren # MCP-Server starten -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Web Viewer (Port 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Terminal-Viewer -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # Datenbankstatistiken -npx agentkits-memory-viewer --json # JSON-Ausgabe +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # Datenbankstatistiken +npx @aitytech/agentkits-memory viewer --json # JSON-Ausgabe # Aus CLI speichern -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Einstellungen -npx agentkits-memory-hook settings . # aktuelle Einstellungen anzeigen -npx agentkits-memory-hook settings . --reset # auf Standard zurücksetzen -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # aktuelle Einstellungen anzeigen +npx @aitytech/agentkits-memory hook settings . --reset # auf Standard zurücksetzen +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Export / Import -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Lifecycle-Management -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Hooks erfassen Ihre KI-Coding-Sessions automatisch (nur Claude Code und OpenCode Hooks einrichten: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **Was automatisch erfasst wird:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # In .claude/memory/settings.json gespeichert — bleibt über Sessions bestehen -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Aktuelle Einstellungen anzeigen -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Auf Standard zurücksetzen -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Priorität:** Umgebungsvariablen überschreiben settings.json. Settings.json überschreibt Standardwerte. @@ -470,13 +470,13 @@ Memory-Wachstum im Laufe der Zeit verwalten: ```bash # Beobachtungen älter als 7 Tage komprimieren, Sessions älter als 30 Tage archivieren -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Zusätzlich archivierte Sessions älter als 90 Tage automatisch löschen -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Lifecycle-Statistiken anzeigen -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Phase | Was passiert | @@ -493,10 +493,10 @@ Backup und Wiederherstellung Ihrer Projekt-Erinnerungen: ```bash # Alle Sessions für ein Projekt exportieren -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Aus Backup importieren (dedupliziert automatisch) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Export-Format enthält Sessions, Beobachtungen, Prompts und Zusammenfassungen. diff --git a/i18n/README.es.md b/i18n/README.es.md index e395dfe..5e7d7cb 100644 --- a/i18n/README.es.md +++ b/i18n/README.es.md @@ -82,7 +82,7 @@ Sesión 1: "Usar JWT para auth" Sesión 2: "Agregar endpoint de login" (SQLite, 100% local) ``` -1. **Configura una vez** — `npx agentkits-memory-setup` configura tu plataforma +1. **Configura una vez** — `npx @aitytech/agentkits-memory` configura tu plataforma 2. **Captura automática** — Los hooks registran decisiones, uso de herramientas y resúmenes mientras trabajas 3. **Inyección de contexto** — La siguiente sesión comienza con historial relevante de sesiones pasadas 4. **Procesamiento en segundo plano** — Los workers enriquecen observaciones con IA, generan embeddings, comprimen datos antiguos @@ -116,7 +116,7 @@ La mayoría de las herramientas de memoria dispersan datos en archivos markdown, Ver y gestionar tus memorias a través de una interfaz web moderna. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Luego abre **http://localhost:1905** en tu navegador. @@ -169,7 +169,7 @@ Esto instala hooks, servidor MCP y skill de flujo de trabajo de memoria automát ### Opción 2: Configuración Automática (Todas las Plataformas) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Esto detecta automáticamente tu plataforma y configura todo: servidor MCP, hooks (Claude Code/OpenCode), archivos de reglas (Cursor/Windsurf/Cline), y descarga el modelo de embedding. @@ -177,9 +177,9 @@ Esto detecta automáticamente tu plataforma y configura todo: servidor MCP, hook **Apuntar a una plataforma específica:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Opción 3: Configuración Manual de MCP @@ -191,7 +191,7 @@ Si prefieres la configuración manual, agrega a tu configuración MCP: "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Configuración con un comando (detecta automáticamente la plataforma) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # plataforma específica -npx agentkits-memory-setup --platform=all # todas las plataformas -npx agentkits-memory-setup --force # reinstalar/actualizar +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # plataforma específica +npx @aitytech/agentkits-memory setup --platform=all # todas las plataformas +npx @aitytech/agentkits-memory setup --force # reinstalar/actualizar # Iniciar servidor MCP -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Visor web (puerto 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Visor de terminal -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # estadísticas de base de datos -npx agentkits-memory-viewer --json # salida JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # estadísticas de base de datos +npx @aitytech/agentkits-memory viewer --json # salida JSON # Guardar desde CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Configuración -npx agentkits-memory-hook settings . # ver configuración actual -npx agentkits-memory-hook settings . --reset # restablecer a valores predeterminados -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # ver configuración actual +npx @aitytech/agentkits-memory hook settings . --reset # restablecer a valores predeterminados +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Exportar / Importar -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Gestión del ciclo de vida -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Los hooks capturan automáticamente tus sesiones de codificación con IA (solo C Configurar hooks: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **Lo que se captura automáticamente:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Guardado en .claude/memory/settings.json — persiste entre sesiones -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Ver configuración actual -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Restablecer a valores predeterminados -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Prioridad:** Las variables de entorno anulan settings.json. Settings.json anula los valores predeterminados. @@ -470,13 +470,13 @@ Gestiona el crecimiento de la memoria a lo largo del tiempo: ```bash # Comprimir observaciones más antiguas de 7 días, archivar sesiones más antiguas de 30 días -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # También eliminar automáticamente sesiones archivadas más antiguas de 90 días -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Ver estadísticas del ciclo de vida -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Etapa | Qué Sucede | @@ -493,10 +493,10 @@ Respalda y restaura las memorias de tu proyecto: ```bash # Exportar todas las sesiones para un proyecto -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Importar desde respaldo (deduplica automáticamente) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` El formato de exportación incluye sesiones, observaciones, prompts y resúmenes. diff --git a/i18n/README.fr.md b/i18n/README.fr.md index 60c08b5..6f43160 100644 --- a/i18n/README.fr.md +++ b/i18n/README.fr.md @@ -82,7 +82,7 @@ Session 1: "Use JWT for auth" Session 2: "Add login endpoint" (SQLite, 100% local) ``` -1. **Configuration unique** — `npx agentkits-memory-setup` configure votre plateforme +1. **Configuration unique** — `npx @aitytech/agentkits-memory` configure votre plateforme 2. **Capture automatique** — Les hooks enregistrent les décisions, l'utilisation des outils et les résumés pendant votre travail 3. **Injection de contexte** — La prochaine session démarre avec l'historique pertinent des sessions passées 4. **Traitement en arrière-plan** — Les workers enrichissent les observations avec l'IA, génèrent des embeddings, compressent les anciennes données @@ -116,7 +116,7 @@ La plupart des outils de mémoire dispersent les données dans des fichiers mark Visualisez et gérez vos mémoires via une interface web moderne. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Puis ouvrez **http://localhost:1905** dans votre navigateur. @@ -169,7 +169,7 @@ Cela installe automatiquement les hooks, le serveur MCP et le skill de workflow ### Option 2 : Installation Automatique (Toutes les Plateformes) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Cela détecte automatiquement votre plateforme et configure tout : serveur MCP, hooks (Claude Code/OpenCode), fichiers de règles (Cursor/Windsurf/Cline) et télécharge le modèle d'embedding. @@ -177,9 +177,9 @@ Cela détecte automatiquement votre plateforme et configure tout : serveur MCP, **Cibler une plateforme spécifique :** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Option 3 : Configuration Manuelle MCP @@ -191,7 +191,7 @@ Si vous préférez la configuration manuelle, ajoutez à votre configuration MCP "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Installation en une commande (détecte automatiquement la plateforme) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # plateforme spécifique -npx agentkits-memory-setup --platform=all # toutes les plateformes -npx agentkits-memory-setup --force # réinstaller/mettre à jour +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # plateforme spécifique +npx @aitytech/agentkits-memory setup --platform=all # toutes les plateformes +npx @aitytech/agentkits-memory setup --force # réinstaller/mettre à jour # Démarrer le serveur MCP -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Interface web (port 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Visualiseur terminal -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # statistiques de la base de données -npx agentkits-memory-viewer --json # sortie JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # statistiques de la base de données +npx @aitytech/agentkits-memory viewer --json # sortie JSON # Sauvegarder depuis CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Paramètres -npx agentkits-memory-hook settings . # voir les paramètres actuels -npx agentkits-memory-hook settings . --reset # réinitialiser aux valeurs par défaut -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # voir les paramètres actuels +npx @aitytech/agentkits-memory hook settings . --reset # réinitialiser aux valeurs par défaut +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Export / Import -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Gestion du cycle de vie -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Les hooks capturent automatiquement vos sessions de codage IA (Claude Code et Op Installer les hooks : ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **Ce qui est capturé automatiquement :** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Sauvegardé dans .claude/memory/settings.json — persiste entre les sessions -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Voir les paramètres actuels -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Réinitialiser aux valeurs par défaut -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Priorité :** Les variables d'environnement remplacent settings.json. Settings.json remplace les valeurs par défaut. @@ -470,13 +470,13 @@ Gérez la croissance de la mémoire au fil du temps : ```bash # Compresser les observations de plus de 7 jours, archiver les sessions de plus de 30 jours -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Aussi auto-supprimer les sessions archivées de plus de 90 jours -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Voir les statistiques du cycle de vie -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Étape | Que Se Passe-t-il | @@ -493,10 +493,10 @@ Sauvegardez et restaurez vos mémoires de projet : ```bash # Exporter toutes les sessions d'un projet -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Importer depuis une sauvegarde (déduplique automatiquement) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Le format d'export inclut les sessions, observations, prompts et résumés. diff --git a/i18n/README.ja.md b/i18n/README.ja.md index ac775b7..ca2a3ea 100644 --- a/i18n/README.ja.md +++ b/i18n/README.ja.md @@ -82,7 +82,7 @@ (SQLite、100%ローカル) ``` -1. **1回セットアップ** — `npx agentkits-memory-setup`でプラットフォームを設定 +1. **1回セットアップ** — `npx @aitytech/agentkits-memory`でプラットフォームを設定 2. **自動キャプチャ** — 作業中に決定事項、ツール使用状況、サマリーをフックが記録 3. **コンテキスト注入** — 次のセッションは過去のセッションの関連履歴から始まります 4. **バックグラウンド処理** — ワーカーがAIで観測データをエンリッチし、埋め込みを生成し、古いデータを圧縮 @@ -116,7 +116,7 @@ モダンなWebインターフェースでメモリを表示および管理します。 ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` その後、ブラウザで**http://localhost:1905**を開きます。 @@ -169,7 +169,7 @@ npx agentkits-memory-web ### オプション2: 自動セットアップ (全プラットフォーム) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` これにより、プラットフォームを自動検出し、すべてを設定します: MCPサーバー、フック(Claude Code/OpenCode)、rulesファイル(Cursor/Windsurf/Cline)、および埋め込みモデルのダウンロード。 @@ -177,9 +177,9 @@ npx agentkits-memory-setup **特定のプラットフォームをターゲットにする:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### オプション3: 手動MCP設定 @@ -191,7 +191,7 @@ npx agentkits-memory-setup --platform=all "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # 1コマンドセットアップ(プラットフォームを自動検出) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # 特定のプラットフォーム -npx agentkits-memory-setup --platform=all # すべてのプラットフォーム -npx agentkits-memory-setup --force # 再インストール/更新 +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # 特定のプラットフォーム +npx @aitytech/agentkits-memory setup --platform=all # すべてのプラットフォーム +npx @aitytech/agentkits-memory setup --force # 再インストール/更新 # MCPサーバーを起動 -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Webビューア(ポート1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # ターミナルビューア -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # データベース統計 -npx agentkits-memory-viewer --json # JSON出力 +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # データベース統計 +npx @aitytech/agentkits-memory viewer --json # JSON出力 # CLIから保存 -npx agentkits-memory-save "リフレッシュトークン付きJWTを使用" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "リフレッシュトークン付きJWTを使用" --category pattern --tags auth,security # 設定 -npx agentkits-memory-hook settings . # 現在の設定を表示 -npx agentkits-memory-hook settings . --reset # デフォルトにリセット -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # 現在の設定を表示 +npx @aitytech/agentkits-memory hook settings . --reset # デフォルトにリセット +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # エクスポート/インポート -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # ライフサイクル管理 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ const entry = await memory.getByKey('patterns', 'auth-pattern'); フックのセットアップ: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **自動的にキャプチャされるもの:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # .claude/memory/settings.jsonに保存 — セッション間で永続化 -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # 現在の設定を表示 -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # デフォルトにリセット -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **優先順位:** 環境変数がsettings.jsonをオーバーライドします。settings.jsonがデフォルトをオーバーライドします。 @@ -470,13 +470,13 @@ npx agentkits-memory-hook settings . --reset ```bash # 7日以上前の観測データを圧縮し、30日以上前のセッションをアーカイブ -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # 90日以上前のアーカイブされたセッションも自動削除 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # ライフサイクル統計を表示 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | ステージ | 何が起こるか | @@ -493,10 +493,10 @@ npx agentkits-memory-hook lifecycle-stats . ```bash # プロジェクトのすべてのセッションをエクスポート -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # バックアップからインポート(自動的に重複排除) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` エクスポート形式にはセッション、観測、プロンプト、サマリーが含まれます。 diff --git a/i18n/README.ko.md b/i18n/README.ko.md index 227fe40..ccbdedf 100644 --- a/i18n/README.ko.md +++ b/i18n/README.ko.md @@ -82,7 +82,7 @@ (SQLite, 100% 로컬) ``` -1. **한 번만 설정** — `npx agentkits-memory-setup`이 플랫폼을 구성합니다 +1. **한 번만 설정** — `npx @aitytech/agentkits-memory`이 플랫폼을 구성합니다 2. **자동 캡처** — 작업하는 동안 훅이 결정사항, 도구 사용, 요약을 기록합니다 3. **컨텍스트 주입** — 다음 세션이 이전 세션의 관련 이력으로 시작됩니다 4. **백그라운드 처리** — 워커가 AI로 관찰 데이터를 강화하고, 임베딩을 생성하며, 이전 데이터를 압축합니다 @@ -116,7 +116,7 @@ 최신 웹 인터페이스를 통해 메모리를 보고 관리하세요. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` 그런 다음 브라우저에서 **http://localhost:1905**를 엽니다. @@ -169,7 +169,7 @@ npx agentkits-memory-web ### 옵션 2: 자동 설정 (모든 플랫폼) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` 플랫폼을 자동 감지하고 모든 것을 구성합니다: MCP 서버, 훅(Claude Code/OpenCode), 규칙 파일(Cursor/Windsurf/Cline), 임베딩 모델 다운로드. @@ -177,9 +177,9 @@ npx agentkits-memory-setup **특정 플랫폼 대상 지정:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### 옵션 3: 수동 MCP 구성 @@ -191,7 +191,7 @@ npx agentkits-memory-setup --platform=all "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # 한 번의 명령으로 설정 (플랫폼 자동 감지) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # 특정 플랫폼 -npx agentkits-memory-setup --platform=all # 모든 플랫폼 -npx agentkits-memory-setup --force # 재설치/업데이트 +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # 특정 플랫폼 +npx @aitytech/agentkits-memory setup --platform=all # 모든 플랫폼 +npx @aitytech/agentkits-memory setup --force # 재설치/업데이트 # MCP 서버 시작 -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # 웹 뷰어 (포트 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # 터미널 뷰어 -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # 데이터베이스 통계 -npx agentkits-memory-viewer --json # JSON 출력 +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # 데이터베이스 통계 +npx @aitytech/agentkits-memory viewer --json # JSON 출력 # CLI에서 저장 -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # 설정 -npx agentkits-memory-hook settings . # 현재 설정 보기 -npx agentkits-memory-hook settings . --reset # 기본값으로 재설정 -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # 현재 설정 보기 +npx @aitytech/agentkits-memory hook settings . --reset # 기본값으로 재설정 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # 내보내기 / 가져오기 -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # 라이프사이클 관리 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ const entry = await memory.getByKey('patterns', 'auth-pattern'); 훅 설정: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **자동으로 캡처되는 내용:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # .claude/memory/settings.json에 저장됨 — 세션 간 유지 -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # 현재 설정 보기 -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # 기본값으로 재설정 -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **우선순위:** 환경 변수가 settings.json을 재정의합니다. settings.json이 기본값을 재정의합니다. @@ -470,13 +470,13 @@ npx agentkits-memory-hook settings . --reset ```bash # 7일 이상 된 관찰 압축, 30일 이상 된 세션 아카이브 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # 90일 이상 된 아카이브된 세션도 자동 삭제 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # 라이프사이클 통계 보기 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | 단계 | 수행되는 작업 | @@ -493,10 +493,10 @@ npx agentkits-memory-hook lifecycle-stats . ```bash # 프로젝트의 모든 세션 내보내기 -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # 백업에서 가져오기 (자동 중복 제거) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` 내보내기 형식에는 세션, 관찰, 프롬프트, 요약이 포함됩니다. diff --git a/i18n/README.pt-br.md b/i18n/README.pt-br.md index 89770d4..3e1f413 100644 --- a/i18n/README.pt-br.md +++ b/i18n/README.pt-br.md @@ -82,7 +82,7 @@ Sessão 1: "Usar JWT para autenticação" Sessão 2: "Adicionar endpoint de l (SQLite, 100% local) ``` -1. **Configure uma vez** — `npx agentkits-memory-setup` configura sua plataforma +1. **Configure uma vez** — `npx @aitytech/agentkits-memory` configura sua plataforma 2. **Captura automática** — Hooks registram decisões, uso de ferramentas e resumos enquanto você trabalha 3. **Injeção de contexto** — Próxima sessão começa com histórico relevante de sessões passadas 4. **Processamento em segundo plano** — Workers enriquecem observações com IA, geram embeddings, compactam dados antigos @@ -116,7 +116,7 @@ A maioria das ferramentas de memória espalha dados em arquivos markdown, requer Visualize e gerencie suas memórias através de uma interface web moderna. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Depois abra **http://localhost:1905** no seu navegador. @@ -169,7 +169,7 @@ Isso instala hooks, servidor MCP e skill de workflow de memória automaticamente ### Opção 2: Configuração Automática (Todas as Plataformas) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Isso detecta automaticamente sua plataforma e configura tudo: servidor MCP, hooks (Claude Code/OpenCode), arquivos de regras (Cursor/Windsurf/Cline) e baixa o modelo de embedding. @@ -177,9 +177,9 @@ Isso detecta automaticamente sua plataforma e configura tudo: servidor MCP, hook **Direcionar para uma plataforma específica:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Opção 3: Configuração Manual do MCP @@ -191,7 +191,7 @@ Se preferir configuração manual, adicione ao seu arquivo de configuração MCP "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Configuração com um comando (detecta plataforma automaticamente) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # plataforma específica -npx agentkits-memory-setup --platform=all # todas as plataformas -npx agentkits-memory-setup --force # reinstalar/atualizar +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # plataforma específica +npx @aitytech/agentkits-memory setup --platform=all # todas as plataformas +npx @aitytech/agentkits-memory setup --force # reinstalar/atualizar # Iniciar servidor MCP -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Visualizador web (porta 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Visualizador de terminal -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # estatísticas do banco de dados -npx agentkits-memory-viewer --json # saída JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # estatísticas do banco de dados +npx @aitytech/agentkits-memory viewer --json # saída JSON # Salvar via CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Configurações -npx agentkits-memory-hook settings . # ver configurações atuais -npx agentkits-memory-hook settings . --reset # resetar para padrões -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # ver configurações atuais +npx @aitytech/agentkits-memory hook settings . --reset # resetar para padrões +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Exportar / Importar -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Gerenciamento de ciclo de vida -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Hooks capturam automaticamente suas sessões de codificação com IA (Claude Cod Configurar hooks: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **O que é capturado automaticamente:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Salvo em .claude/memory/settings.json — persiste entre sessões -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Ver configurações atuais -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Resetar para padrões -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Prioridade:** Variáveis de ambiente sobrepõem settings.json. Settings.json sobrepõe padrões. @@ -470,13 +470,13 @@ Gerencie o crescimento da memória ao longo do tempo: ```bash # Compactar observações com mais de 7 dias, arquivar sessões com mais de 30 dias -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Também auto-deletar sessões arquivadas com mais de 90 dias -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Ver estatísticas de ciclo de vida -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Estágio | O que Acontece | @@ -493,10 +493,10 @@ Faça backup e restaure suas memórias de projeto: ```bash # Exportar todas as sessões de um projeto -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Importar do backup (deduplica automaticamente) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Formato de exportação inclui sessões, observações, prompts e resumos. diff --git a/i18n/README.ru.md b/i18n/README.ru.md index fed4574..0d5c161 100644 --- a/i18n/README.ru.md +++ b/i18n/README.ru.md @@ -82,7 +82,7 @@ (SQLite, 100% локально) ``` -1. **Настройка один раз** — `npx agentkits-memory-setup` настраивает вашу платформу +1. **Настройка один раз** — `npx @aitytech/agentkits-memory` настраивает вашу платформу 2. **Автозахват** — Хуки записывают решения, использование инструментов и сводки во время работы 3. **Внедрение контекста** — Следующий сеанс начинается с релевантной историей из прошлых сеансов 4. **Фоновая обработка** — Процессы обогащают наблюдения с помощью AI, генерируют эмбеддинги, сжимают старые данные @@ -116,7 +116,7 @@ Просматривайте и управляйте своими воспоминаниями через современный веб-интерфейс. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Затем откройте **http://localhost:1905** в браузере. @@ -169,7 +169,7 @@ npx agentkits-memory-web ### Вариант 2: Автоматическая установка (все платформы) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Это автоматически определяет вашу платформу и настраивает всё: MCP-сервер, хуки (Claude Code/OpenCode), файлы правил (Cursor/Windsurf/Cline) и загружает модель эмбеддингов. @@ -177,9 +177,9 @@ npx agentkits-memory-setup **Настройка для конкретной платформы:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Вариант 3: Ручная настройка MCP @@ -191,7 +191,7 @@ npx agentkits-memory-setup --platform=all "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Установка одной командой (автоопределение платформы) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # конкретная платформа -npx agentkits-memory-setup --platform=all # все платформы -npx agentkits-memory-setup --force # переустановка/обновление +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # конкретная платформа +npx @aitytech/agentkits-memory setup --platform=all # все платформы +npx @aitytech/agentkits-memory setup --force # переустановка/обновление # Запуск MCP-сервера -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Веб-интерфейс (порт 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Терминальный просмотрщик -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # статистика базы данных -npx agentkits-memory-viewer --json # вывод в JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # статистика базы данных +npx @aitytech/agentkits-memory viewer --json # вывод в JSON # Сохранение из CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Настройки -npx agentkits-memory-hook settings . # просмотр текущих настроек -npx agentkits-memory-hook settings . --reset # сброс до значений по умолчанию -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # просмотр текущих настроек +npx @aitytech/agentkits-memory hook settings . --reset # сброс до значений по умолчанию +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Экспорт / Импорт -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Управление жизненным циклом -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ const entry = await memory.getByKey('patterns', 'auth-pattern'); Установка хуков: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **Что фиксируется автоматически:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Сохраняется в .claude/memory/settings.json — сохраняется между сеансами -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Просмотр текущих настроек -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Сброс до значений по умолчанию -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Приоритет:** Переменные окружения переопределяют settings.json. Settings.json переопределяет значения по умолчанию. @@ -470,13 +470,13 @@ npx agentkits-memory-hook settings . --reset ```bash # Сжать наблюдения старше 7 дней, архивировать сеансы старше 30 дней -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Также автоудаление архивированных сеансов старше 90 дней -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Просмотр статистики жизненного цикла -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Стадия | Что происходит | @@ -493,10 +493,10 @@ npx agentkits-memory-hook lifecycle-stats . ```bash # Экспорт всех сеансов для проекта -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Импорт из резервной копии (автоматическая дедупликация) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Формат экспорта включает сеансы, наблюдения, запросы и сводки. diff --git a/i18n/README.vi.md b/i18n/README.vi.md index 3fb7cf3..7274e5c 100644 --- a/i18n/README.vi.md +++ b/i18n/README.vi.md @@ -82,7 +82,7 @@ Phiên 1: "Dùng JWT cho auth" Phiên 2: "Thêm login endpoint" (SQLite, 100% cục bộ) ``` -1. **Thiết lập một lần** — `npx agentkits-memory-setup` cấu hình nền tảng của bạn +1. **Thiết lập một lần** — `npx @aitytech/agentkits-memory` cấu hình nền tảng của bạn 2. **Tự động thu thập** — Hooks ghi lại quyết định, sử dụng công cụ và tóm tắt khi bạn làm việc 3. **Chèn ngữ cảnh** — Phiên tiếp theo bắt đầu với lịch sử liên quan từ các phiên trước 4. **Xử lý nền** — Workers làm giàu quan sát bằng AI, tạo embeddings, nén dữ liệu cũ @@ -116,7 +116,7 @@ Hầu hết các công cụ bộ nhớ phân tán dữ liệu qua các file mark Xem và quản lý bộ nhớ của bạn qua giao diện web hiện đại. ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` Sau đó mở **http://localhost:1905** trong trình duyệt. @@ -169,7 +169,7 @@ Lệnh này tự động cài đặt hooks, MCP server và skill quy trình bộ ### Cách 2: Thiết lập Tự động (Tất cả Nền tảng) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` Lệnh này tự động phát hiện nền tảng của bạn và cấu hình mọi thứ: MCP server, hooks (Claude Code/OpenCode), rules files (Cursor/Windsurf/Cline), và tải xuống mô hình embedding. @@ -177,9 +177,9 @@ Lệnh này tự động phát hiện nền tảng của bạn và cấu hình m **Chỉ định nền tảng cụ thể:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### Cách 3: Cấu hình MCP Thủ công @@ -191,7 +191,7 @@ Nếu bạn muốn thiết lập thủ công, thêm vào cấu hình MCP của b "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # Thiết lập một lệnh (tự động phát hiện nền tảng) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # nền tảng cụ thể -npx agentkits-memory-setup --platform=all # tất cả nền tảng -npx agentkits-memory-setup --force # cài đặt lại/cập nhật +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # nền tảng cụ thể +npx @aitytech/agentkits-memory setup --platform=all # tất cả nền tảng +npx @aitytech/agentkits-memory setup --force # cài đặt lại/cập nhật # Khởi động MCP server -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Giao diện web (cổng 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # Giao diện terminal -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # thống kê database -npx agentkits-memory-viewer --json # đầu ra JSON +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # thống kê database +npx @aitytech/agentkits-memory viewer --json # đầu ra JSON # Lưu từ CLI -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # Cài đặt -npx agentkits-memory-hook settings . # xem cài đặt hiện tại -npx agentkits-memory-hook settings . --reset # đặt lại về mặc định -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # xem cài đặt hiện tại +npx @aitytech/agentkits-memory hook settings . --reset # đặt lại về mặc định +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # Export / Import -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # Quản lý vòng đời -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ Hooks tự động ghi lại các phiên code AI của bạn (chỉ Claude Code Thiết lập hooks: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **Những gì được tự động ghi lại:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # Lưu vào .claude/memory/settings.json — tồn tại qua các phiên -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # Xem cài đặt hiện tại -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # Đặt lại về mặc định -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **Ưu tiên:** Biến môi trường ghi đè settings.json. Settings.json ghi đè mặc định. @@ -470,13 +470,13 @@ Quản lý tăng trưởng bộ nhớ theo thời gian: ```bash # Nén quan sát cũ hơn 7 ngày, lưu trữ phiên cũ hơn 30 ngày -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # Cũng tự động xóa các phiên đã lưu trữ cũ hơn 90 ngày -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # Xem thống kê vòng đời -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | Giai đoạn | Điều gì Xảy ra | @@ -493,10 +493,10 @@ Sao lưu và khôi phục bộ nhớ project của bạn: ```bash # Export tất cả phiên cho một project -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # Import từ backup (tự động khử trùng) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` Định dạng export bao gồm phiên, quan sát, prompts và tóm tắt. diff --git a/i18n/README.zh.md b/i18n/README.zh.md index e08d035..cb37f3d 100644 --- a/i18n/README.zh.md +++ b/i18n/README.zh.md @@ -82,7 +82,7 @@ (SQLite, 100% 本地) ``` -1. **一次设置** — `npx agentkits-memory-setup` 配置你的平台 +1. **一次设置** — `npx @aitytech/agentkits-memory` 配置你的平台 2. **自动捕获** — 钩子在你工作时记录决策、工具使用和摘要 3. **上下文注入** — 下一个会话开始时包含过去会话的相关历史记录 4. **后台处理** — 工作进程使用 AI 增强观察记录、生成嵌入、压缩旧数据 @@ -116,7 +116,7 @@ 通过现代 Web 界面查看和管理你的记忆。 ```bash -npx agentkits-memory-web +npx @aitytech/agentkits-memory web ``` 然后在浏览器中打开 **http://localhost:1905**。 @@ -169,7 +169,7 @@ npx agentkits-memory-web ### 方式二:自动设置(所有平台) ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` 这会自动检测你的平台并配置所有内容:MCP 服务器、钩子(Claude Code/OpenCode)、规则文件(Cursor/Windsurf/Cline),并下载嵌入模型。 @@ -177,9 +177,9 @@ npx agentkits-memory-setup **针对特定平台:** ```bash -npx agentkits-memory-setup --platform=cursor -npx agentkits-memory-setup --platform=windsurf,cline -npx agentkits-memory-setup --platform=all +npx @aitytech/agentkits-memory setup --platform=cursor +npx @aitytech/agentkits-memory setup --platform=windsurf,cline +npx @aitytech/agentkits-memory setup --platform=all ``` ### 方式三:手动 MCP 配置 @@ -191,7 +191,7 @@ npx agentkits-memory-setup --platform=all "mcpServers": { "memory": { "command": "npx", - "args": ["-y", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } @@ -277,37 +277,37 @@ memory_details({ ids: ["abc"] }) ```bash # 一键设置(自动检测平台) -npx agentkits-memory-setup -npx agentkits-memory-setup --platform=cursor # 特定平台 -npx agentkits-memory-setup --platform=all # 所有平台 -npx agentkits-memory-setup --force # 重新安装/更新 +npx @aitytech/agentkits-memory +npx @aitytech/agentkits-memory setup --platform=cursor # 特定平台 +npx @aitytech/agentkits-memory setup --platform=all # 所有平台 +npx @aitytech/agentkits-memory setup --force # 重新安装/更新 # 启动 MCP 服务器 -npx agentkits-memory-server +npx @aitytech/agentkits-memory server # Web 查看器(端口 1905) -npx agentkits-memory-web +npx @aitytech/agentkits-memory web # 终端查看器 -npx agentkits-memory-viewer -npx agentkits-memory-viewer --stats # 数据库统计 -npx agentkits-memory-viewer --json # JSON 输出 +npx @aitytech/agentkits-memory viewer +npx @aitytech/agentkits-memory viewer --stats # 数据库统计 +npx @aitytech/agentkits-memory viewer --json # JSON 输出 # 从 CLI 保存 -npx agentkits-memory-save "Use JWT with refresh tokens" --category pattern --tags auth,security +npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security # 设置 -npx agentkits-memory-hook settings . # 查看当前设置 -npx agentkits-memory-hook settings . --reset # 重置为默认值 -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . # 查看当前设置 +npx @aitytech/agentkits-memory hook settings . --reset # 重置为默认值 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... # 导出 / 导入 -npx agentkits-memory-hook export . my-project ./backup.json -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json # 生命周期管理 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` --- @@ -359,7 +359,7 @@ const entry = await memory.getByKey('patterns', 'auth-pattern'); 设置钩子: ```bash -npx agentkits-memory-setup +npx @aitytech/agentkits-memory ``` **自动捕获的内容:** @@ -449,15 +449,15 @@ export AGENTKITS_AI_ENRICHMENT=false ```bash # 保存到 .claude/memory/settings.json — 跨会话持久化 -npx agentkits-memory-hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... -npx agentkits-memory-hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... -npx agentkits-memory-hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-... +npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza... +npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1 # 查看当前设置 -npx agentkits-memory-hook settings . +npx @aitytech/agentkits-memory hook settings . # 重置为默认值 -npx agentkits-memory-hook settings . --reset +npx @aitytech/agentkits-memory hook settings . --reset ``` > **优先级:** 环境变量覆盖 settings.json。settings.json 覆盖默认值。 @@ -470,13 +470,13 @@ npx agentkits-memory-hook settings . --reset ```bash # 压缩 7 天前的观察记录,归档 30 天前的会话 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 # 同时自动删除 90 天前的已归档会话 -npx agentkits-memory-hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 +npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90 # 查看生命周期统计 -npx agentkits-memory-hook lifecycle-stats . +npx @aitytech/agentkits-memory hook lifecycle-stats . ``` | 阶段 | 发生的事情 | @@ -493,10 +493,10 @@ npx agentkits-memory-hook lifecycle-stats . ```bash # 导出项目的所有会话 -npx agentkits-memory-hook export . my-project ./backup.json +npx @aitytech/agentkits-memory hook export . my-project ./backup.json # 从备份导入(自动去重) -npx agentkits-memory-hook import . ./backup.json +npx @aitytech/agentkits-memory hook import . ./backup.json ``` 导出格式包括会话、观察记录、提示和摘要。 diff --git a/package-lock.json b/package-lock.json index 15d3fdb..0f98e30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,19 @@ { "name": "@aitytech/agentkits-memory", - "version": "2.2.2", + "version": "2.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aitytech/agentkits-memory", - "version": "2.2.2", + "version": "2.2.3", "license": "MIT", "dependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.29", "better-sqlite3": "^11.0.0" }, "bin": { + "agentkits-memory": "dist/cli/main.js", "agentkits-memory-hook": "dist/hooks/cli.js", "agentkits-memory-save": "dist/cli/save.js", "agentkits-memory-server": "dist/mcp/server.js", diff --git a/package.json b/package.json index 2a42081..8faca1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aitytech/agentkits-memory", - "version": "2.2.2", + "version": "2.2.3", "type": "module", "description": "Persistent memory system for AI coding assistants via MCP. Works with Claude Code, Cursor, Copilot, Windsurf, Cline.", "main": "dist/index.js", @@ -14,6 +14,7 @@ "./*": "./dist/*.js" }, "bin": { + "agentkits-memory": "./dist/cli/main.js", "agentkits-memory-hook": "./dist/hooks/cli.js", "agentkits-memory-server": "./dist/mcp/server.js", "agentkits-memory-viewer": "./dist/cli/viewer.js", @@ -22,7 +23,7 @@ "agentkits-memory-setup": "./dist/cli/setup.js" }, "scripts": { - "build": "tsc && chmod +x dist/hooks/cli.js dist/mcp/server.js dist/cli/viewer.js dist/cli/web-viewer.js dist/cli/save.js dist/cli/setup.js", + "build": "tsc && chmod +x dist/cli/main.js dist/hooks/cli.js dist/mcp/server.js dist/cli/viewer.js dist/cli/web-viewer.js dist/cli/save.js dist/cli/setup.js", "test": "vitest run", "test:coverage": "vitest run --coverage", "typecheck": "tsc --noEmit", diff --git a/plugin/.mcp.json b/plugin/.mcp.json index c8307ad..2959ae8 100644 --- a/plugin/.mcp.json +++ b/plugin/.mcp.json @@ -3,7 +3,7 @@ "memory": { "type": "stdio", "command": "npx", - "args": ["-y", "-p", "@aitytech/agentkits-memory", "agentkits-memory-server"] + "args": ["-y", "@aitytech/agentkits-memory", "server"] } } } diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index d433b37..bd654de 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -12,7 +12,7 @@ }, { "type": "command", - "command": "npx -y -p @aitytech/agentkits-memory agentkits-memory-hook context", + "command": "npx --yes @aitytech/agentkits-memory hook context", "timeout": 10 } ] @@ -23,7 +23,7 @@ "hooks": [ { "type": "command", - "command": "npx -y -p @aitytech/agentkits-memory agentkits-memory-hook session-init", + "command": "npx --yes @aitytech/agentkits-memory hook session-init", "timeout": 10 } ] @@ -35,7 +35,7 @@ "hooks": [ { "type": "command", - "command": "npx -y -p @aitytech/agentkits-memory agentkits-memory-hook observation", + "command": "npx --yes @aitytech/agentkits-memory hook observation", "timeout": 30 } ] @@ -46,7 +46,7 @@ "hooks": [ { "type": "command", - "command": "npx -y -p @aitytech/agentkits-memory agentkits-memory-hook summarize", + "command": "npx --yes @aitytech/agentkits-memory hook summarize", "timeout": 10 } ] diff --git a/scripts/e2e-test.sh b/scripts/e2e-test.sh new file mode 100755 index 0000000..d0f2aec --- /dev/null +++ b/scripts/e2e-test.sh @@ -0,0 +1,523 @@ +#!/usr/bin/env bash +# ============================================================================== +# AgentKits Memory — E2E Test Script +# +# Simulates a fresh user installing and using the package from a clean directory. +# Tests all CLI subcommands via the unified router. +# +# Usage: +# ./scripts/e2e-test.sh # test with npm link (fast, for dev) +# ./scripts/e2e-test.sh --pack # test with npm pack + install (real publish sim) +# +# CI auto-detects: uses --pack when CI=true (GitHub Actions, etc.) +# +# Exit codes: +# 0 = all tests passed +# 1 = one or more tests failed +# ============================================================================== + +set -euo pipefail + +# Colors (disable in non-interactive / CI) +if [ -t 1 ] && [ "${NO_COLOR:-}" = "" ]; then + RED='\033[0;31m' + GREEN='\033[0;32m' + YELLOW='\033[1;33m' + CYAN='\033[0;36m' + NC='\033[0m' +else + RED='' GREEN='' YELLOW='' CYAN='' NC='' +fi + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +TEST_DIR="" +PASS=0 +FAIL=0 +SKIP=0 +USE_PACK=false + +# Parse args +for arg in "$@"; do + case $arg in + --pack) USE_PACK=true ;; + esac +done + +# Auto-detect CI: always use --pack in CI for real install simulation +if [ "${CI:-}" = "true" ]; then + USE_PACK=true +fi + +# ============================================================================== +# Helpers +# ============================================================================== + +cleanup() { + # Kill any background processes we started + jobs -p 2>/dev/null | xargs kill 2>/dev/null || true + if [ -n "$TEST_DIR" ] && [ -d "$TEST_DIR" ]; then + rm -rf "$TEST_DIR" + fi +} +trap cleanup EXIT + +log_header() { + echo "" + echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo -e "${CYAN} $1${NC}" + echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +} + +log_test() { + echo -e "\n${YELLOW}TEST:${NC} $1" +} + +pass() { + echo -e " ${GREEN}PASS${NC} $1" + PASS=$((PASS + 1)) +} + +fail() { + echo -e " ${RED}FAIL${NC} $1" + if [ -n "${2:-}" ]; then + echo -e " ${RED} → $2${NC}" + fi + FAIL=$((FAIL + 1)) +} + +skip() { + echo -e " ${YELLOW}SKIP${NC} $1" + SKIP=$((SKIP + 1)) +} + +# Portable timeout for macOS + Linux +# Linux has `timeout`, macOS needs gtimeout (coreutils) or perl fallback +_timeout() { + local secs="$1" + shift + if command -v timeout &>/dev/null; then + timeout "$secs" "$@" + elif command -v gtimeout &>/dev/null; then + gtimeout "$secs" "$@" + else + # Perl fallback for macOS without coreutils + perl -e ' + alarm shift @ARGV; + $SIG{ALRM} = sub { kill 9, $pid; exit 124 }; + $pid = fork; + if ($pid == 0) { exec @ARGV; exit 127 } + waitpid $pid, 0; + exit ($? >> 8); + ' "$secs" "$@" + fi +} + +# Run a command with timeout, capture stdout+stderr, check exit code +# Usage: run_cmd +# Sets: CMD_OUT, CMD_EXIT +run_cmd() { + local timeout_sec="$1" + local expected_exit="$2" + shift 2 + CMD_OUT="" + CMD_EXIT=0 + + CMD_OUT=$(_timeout "$timeout_sec" "$@" 2>&1) || CMD_EXIT=$? + + # timeout returns 124 on timeout + if [ "$CMD_EXIT" -eq 124 ]; then + if [ "$expected_exit" -eq 124 ]; then + return 0 + fi + fail "Command timed out after ${timeout_sec}s: $*" + return 1 + fi + + if [ "$CMD_EXIT" -ne "$expected_exit" ]; then + fail "Exit code $CMD_EXIT (expected $expected_exit): $*" "$CMD_OUT" + return 1 + fi + return 0 +} + +# Check if output contains a string +assert_contains() { + local label="$1" + local needle="$2" + # Use grep without -q and redirect to /dev/null to avoid SIGPIPE with pipefail + if echo "$CMD_OUT" | grep "$needle" >/dev/null 2>&1; then + pass "$label" + else + fail "$label — expected output to contain: $needle" + fi +} + +# Check if file exists +assert_file_exists() { + local label="$1" + local filepath="$2" + if [ -f "$filepath" ]; then + pass "$label" + else + fail "$label — file not found: $filepath" + fi +} + +# Check if file contains string +assert_file_contains() { + local label="$1" + local filepath="$2" + local needle="$3" + if [ -f "$filepath" ] && grep -q "$needle" "$filepath"; then + pass "$label" + else + fail "$label — file $filepath missing or doesn't contain: $needle" + fi +} + +# ============================================================================== +# Setup +# ============================================================================== + +log_header "E2E Test — AgentKits Memory CLI" +echo -e " Project: ${PROJECT_DIR}" +echo -e " Mode: $([ "$USE_PACK" = true ] && echo 'npm pack (publish sim)' || echo 'npm link (fast dev)')" +echo -e " CI: ${CI:-false}" + +# Build first +echo -e "\n${YELLOW}Building...${NC}" +(cd "$PROJECT_DIR" && npm run build) || { fail "Build failed"; exit 1; } + +# Create temp test directory +TEST_DIR=$(mktemp -d) +echo -e " Test dir: ${TEST_DIR}" + +# Initialize a fake project in test dir +mkdir -p "$TEST_DIR/.claude" +cd "$TEST_DIR" +echo '{}' > package.json + +if [ "$USE_PACK" = true ]; then + # Pack and install (simulates real npm install — used in CI) + echo -e "\n${YELLOW}Packing...${NC}" + TARBALL=$(cd "$PROJECT_DIR" && npm pack --pack-destination "$TEST_DIR" 2>/dev/null | tail -1) + echo -e " Tarball: ${TARBALL}" + + echo -e "${YELLOW}Installing from tarball...${NC}" + npm install "$TEST_DIR/$TARBALL" --save 2>&1 | tail -5 + NPX="npx" +else + # Link for fast local dev testing + echo -e "\n${YELLOW}Linking...${NC}" + (cd "$PROJECT_DIR" && npm link 2>&1 | tail -1) + npm link @aitytech/agentkits-memory 2>&1 | tail -1 + NPX="npx" +fi + +# Verify binary is accessible +if ! command -v agentkits-memory &>/dev/null && ! [ -x "$TEST_DIR/node_modules/.bin/agentkits-memory" ]; then + echo -e "${RED}ERROR: agentkits-memory binary not found in PATH or node_modules/.bin${NC}" + exit 1 +fi +echo -e " ${GREEN}Binary found${NC}" + +# ============================================================================== +# Test 1: help +# ============================================================================== + +log_test "1. help" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory help; then + assert_contains "Shows usage info" "Usage:" + assert_contains "Lists setup subcommand" "setup" + assert_contains "Lists server subcommand" "server" + assert_contains "Lists hook subcommand" "hook" +fi + +# ============================================================================== +# Test 2: setup (default command) +# ============================================================================== + +log_test "2. setup (default — auto-detect platform)" +if run_cmd 30 0 $NPX @aitytech/agentkits-memory --skip-model --json; then + assert_contains "Returns JSON" '"success"' + assert_contains "Has platforms" '"platforms"' +fi + +# Verify files created by setup +assert_file_exists "settings.json created" "$TEST_DIR/.claude/settings.json" +assert_file_exists "memory dir created" "$TEST_DIR/.claude/memory/settings.json" +assert_file_contains "hooks configured" "$TEST_DIR/.claude/settings.json" "agentkits-memory" +assert_file_contains "MCP server configured" "$TEST_DIR/.claude/settings.json" "mcpServers" + +# ============================================================================== +# Test 3: setup --show-hooks +# ============================================================================== + +log_test "3. setup --show-hooks" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory setup --show-hooks; then + assert_contains "Shows SessionStart hook" "SessionStart" + assert_contains "Shows Stop hook" "Stop" + assert_contains "Shows PostToolUse hook" "PostToolUse" + assert_contains "Uses new npx syntax" "@aitytech/agentkits-memory" +fi + +# ============================================================================== +# Test 4: setup --force --json +# ============================================================================== + +log_test "4. setup --force --json (re-install)" +if run_cmd 30 0 $NPX @aitytech/agentkits-memory setup --force --skip-model --json; then + assert_contains "Returns success" '"success": true' +fi + +# ============================================================================== +# Test 5: viewer --stats +# ============================================================================== + +log_test "5. viewer --stats (empty DB)" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory viewer --stats; then + # Empty DB shows "No database" message; populated DB shows "Statistics" + if echo "$CMD_OUT" | grep -i "database\|Statistics" >/dev/null 2>&1; then + pass "Shows database info or empty message" + else + fail "Unexpected viewer output" + fi +fi + +# ============================================================================== +# Test 6: viewer --json +# ============================================================================== + +log_test "6. viewer --json" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory viewer --json; then + assert_contains "Returns JSON" "entries" +fi + +# ============================================================================== +# Test 7: save +# ============================================================================== + +log_test "7. save" +if run_cmd 15 0 $NPX @aitytech/agentkits-memory save --content="E2E test memory entry" --category=pattern --tags=e2e,test; then + assert_contains "Save returns success" "success" +fi + +# ============================================================================== +# Test 8: viewer after save (verify entry exists) +# ============================================================================== + +log_test "8. viewer after save (verify entry persisted)" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory viewer --list; then + assert_contains "Entry visible in viewer" "E2E test" +fi + +# ============================================================================== +# Test 9: hook context (simulates SessionStart hook) +# ============================================================================== + +log_test "9. hook context (SessionStart)" +HOOK_INPUT='{"session_id":"e2e-test-001","cwd":"'"$TEST_DIR"'"}' +CMD_OUT=$(echo "$HOOK_INPUT" | $NPX @aitytech/agentkits-memory hook context 2>&1) && CMD_EXIT=0 || CMD_EXIT=$? +if [ "$CMD_EXIT" -eq 0 ]; then + pass "hook context exits cleanly" + # Check last JSON line is valid + LAST_LINE=$(echo "$CMD_OUT" | grep -E '^\{' | tail -1) + if [ -n "$LAST_LINE" ] && echo "$LAST_LINE" | python3 -c "import sys,json; json.load(sys.stdin)" 2>/dev/null; then + pass "hook context returns valid JSON" + else + fail "hook context does not return valid JSON" + fi +else + fail "hook context exit code $CMD_EXIT (expected 0)" +fi + +# ============================================================================== +# Test 10: hook session-init (simulates UserPromptSubmit hook) +# ============================================================================== + +log_test "10. hook session-init (UserPromptSubmit)" +HOOK_INPUT='{"session_id":"e2e-test-001","cwd":"'"$TEST_DIR"'","user_prompt":"test prompt"}' +CMD_OUT=$(echo "$HOOK_INPUT" | $NPX @aitytech/agentkits-memory hook session-init 2>&1) && CMD_EXIT=0 || CMD_EXIT=$? +if [ "$CMD_EXIT" -eq 0 ]; then + pass "hook session-init exits cleanly" +else + fail "hook session-init exit code $CMD_EXIT" +fi + +# ============================================================================== +# Test 11: hook observation (simulates PostToolUse hook) +# ============================================================================== + +log_test "11. hook observation (PostToolUse)" +HOOK_INPUT='{"session_id":"e2e-test-001","cwd":"'"$TEST_DIR"'","tool_name":"Edit","tool_input":{"file_path":"test.ts","old_string":"a","new_string":"b"}}' +CMD_OUT=$(echo "$HOOK_INPUT" | $NPX @aitytech/agentkits-memory hook observation 2>&1) && CMD_EXIT=0 || CMD_EXIT=$? +if [ "$CMD_EXIT" -eq 0 ]; then + pass "hook observation exits cleanly" +else + fail "hook observation exit code $CMD_EXIT" +fi + +# ============================================================================== +# Test 12: hook summarize (simulates Stop hook) +# ============================================================================== + +log_test "12. hook summarize (Stop)" +HOOK_INPUT='{"session_id":"e2e-test-001","cwd":"'"$TEST_DIR"'"}' +CMD_OUT=$(echo "$HOOK_INPUT" | $NPX @aitytech/agentkits-memory hook summarize 2>&1) && CMD_EXIT=0 || CMD_EXIT=$? +if [ "$CMD_EXIT" -eq 0 ]; then + pass "hook summarize exits cleanly" +else + fail "hook summarize exit code $CMD_EXIT" +fi + +# ============================================================================== +# Test 13: hook settings +# ============================================================================== + +log_test "13. hook settings (view)" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory hook settings "$TEST_DIR"; then + assert_contains "Returns settings JSON" "context" +fi + +# ============================================================================== +# Test 14: hook settings (update) +# ============================================================================== + +log_test "14. hook settings (update)" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory hook settings "$TEST_DIR" maxSummaries=5; then + assert_contains "Updated setting" "maxSummaries" +fi + +# ============================================================================== +# Test 15: hook lifecycle-stats +# ============================================================================== + +log_test "15. hook lifecycle-stats" +if run_cmd 10 0 $NPX @aitytech/agentkits-memory hook lifecycle-stats "$TEST_DIR"; then + assert_contains "Returns lifecycle stats" "totalSessions" +fi + +# ============================================================================== +# Test 16: hook export +# ============================================================================== + +log_test "16. hook export" +EXPORT_FILE="$TEST_DIR/backup.json" +if run_cmd 15 0 $NPX @aitytech/agentkits-memory hook export "$TEST_DIR" e2e-test "$EXPORT_FILE"; then + assert_file_exists "Export file created" "$EXPORT_FILE" + assert_file_contains "Export has sessions" "$EXPORT_FILE" "sessions" +fi + +# ============================================================================== +# Test 17: hook import +# ============================================================================== + +log_test "17. hook import" +if [ -f "$EXPORT_FILE" ]; then + if run_cmd 15 0 $NPX @aitytech/agentkits-memory hook import "$TEST_DIR" "$EXPORT_FILE"; then + pass "hook import completes" + fi +else + skip "hook import (no export file)" +fi + +# ============================================================================== +# Test 18: server (MCP — send initialize request, verify response) +# ============================================================================== + +log_test "18. server (MCP protocol)" +# Send a JSON-RPC initialize request; server reads stdin, responds, then exits when stdin closes +MCP_REQUEST='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"e2e-test","version":"1.0"}}}' +CMD_OUT=$(echo "$MCP_REQUEST" | $NPX @aitytech/agentkits-memory server 2>/dev/null) && CMD_EXIT=0 || CMD_EXIT=$? + +if echo "$CMD_OUT" | grep '"result"' >/dev/null 2>&1; then + pass "MCP server responds to initialize" + if echo "$CMD_OUT" | grep '"tools"' >/dev/null 2>&1; then + pass "MCP server lists tools" + elif echo "$CMD_OUT" | grep '"capabilities"' >/dev/null 2>&1; then + pass "MCP server returns capabilities" + else + fail "MCP server response missing tools/capabilities" + fi +else + if [ "$CMD_EXIT" -eq 124 ]; then + skip "MCP server timed out (expected for stdin-based server)" + else + fail "MCP server did not respond to initialize (exit=$CMD_EXIT)" "${CMD_OUT:0:200}" + fi +fi + +# ============================================================================== +# Test 19: web (start and verify HTTP response) +# ============================================================================== + +log_test "19. web viewer (HTTP server)" +WEB_PORT=19051 +$NPX @aitytech/agentkits-memory web --port=$WEB_PORT & +WEB_PID=$! +sleep 3 + +if kill -0 $WEB_PID 2>/dev/null; then + if CMD_OUT=$(curl -s --max-time 5 "http://localhost:$WEB_PORT/" 2>&1); then + # Use bash pattern match to avoid pipefail + grep -q SIGPIPE issue + if [[ "$CMD_OUT" == *html* ]] || [[ "$CMD_OUT" == *memory* ]] || [[ "$CMD_OUT" == *agentkits* ]]; then + pass "Web viewer serves HTML" + else + fail "Web viewer response doesn't contain expected content" "${CMD_OUT:0:120}" + fi + else + fail "Web viewer not responding on port $WEB_PORT" + fi + kill $WEB_PID 2>/dev/null || true + wait $WEB_PID 2>/dev/null || true +else + fail "Web viewer process died" +fi + +# ============================================================================== +# Test 20: unknown command +# ============================================================================== + +log_test "20. unknown command (error handling)" +if run_cmd 10 1 $NPX @aitytech/agentkits-memory foobar; then + pass "Unknown command exits with error" +fi +CMD_OUT=$(_timeout 10 $NPX @aitytech/agentkits-memory foobar 2>&1) || true +if echo "$CMD_OUT" | grep -i "unknown\|error\|help" >/dev/null 2>&1; then + pass "Unknown command shows helpful message" +else + fail "Unknown command doesn't show helpful message" +fi + +# ============================================================================== +# Test 21: verify settings.json has new npx syntax (not old pattern) +# ============================================================================== + +log_test "21. verify settings.json uses new npx syntax" +if [ -f "$TEST_DIR/.claude/settings.json" ]; then + assert_file_contains "settings has scoped package name" "$TEST_DIR/.claude/settings.json" "@aitytech/agentkits-memory" + + if grep -q 'npx.*agentkits-memory-hook' "$TEST_DIR/.claude/settings.json" 2>/dev/null; then + fail "settings.json still has old 'agentkits-memory-hook' pattern" + else + pass "No old bare binary patterns in settings.json" + fi +else + fail "settings.json not found" +fi + +# ============================================================================== +# Summary +# ============================================================================== + +TOTAL=$((PASS + FAIL + SKIP)) +log_header "Results: $PASS passed, $FAIL failed, $SKIP skipped (total: $TOTAL)" + +if [ "$FAIL" -gt 0 ]; then + echo -e "\n${RED}E2E TESTS FAILED${NC}\n" + exit 1 +else + echo -e "\n${GREEN}ALL E2E TESTS PASSED${NC}\n" + exit 0 +fi diff --git a/src/cli/main.ts b/src/cli/main.ts new file mode 100644 index 0000000..b917453 --- /dev/null +++ b/src/cli/main.ts @@ -0,0 +1,101 @@ +#!/usr/bin/env node +/** + * AgentKits Memory — Unified CLI Router + * + * Routes subcommands to the appropriate handler module. + * Enables clean `npx @aitytech/agentkits-memory ` usage. + * + * Subcommands: + * setup Setup memory for your project (default) + * server Start the MCP server + * web Start the web viewer + * viewer Terminal viewer + * save Save a memory entry + * hook Run a hook event (context, session-init, observation, summarize, etc.) + * + * Examples: + * npx @aitytech/agentkits-memory # setup (default) + * npx @aitytech/agentkits-memory setup --force # setup with options + * npx @aitytech/agentkits-memory server # start MCP server + * npx @aitytech/agentkits-memory web # start web viewer + * npx @aitytech/agentkits-memory hook context # run hook + * npx @aitytech/agentkits-memory save "..." --tags x # save entry + * + * @module @aitytech/agentkits-memory/cli/main + */ + +const subcommand = process.argv[2]; +const restArgs = process.argv.slice(3); + +// Rewrite process.argv so submodules see correct args via process.argv.slice(2) +function rewriteArgv(args: string[]): void { + process.argv = [process.argv[0], process.argv[1], ...args]; +} + +// If no subcommand or subcommand starts with '--', treat as setup +const isSetupDefault = !subcommand || subcommand.startsWith('--'); + +switch (isSetupDefault ? 'setup' : subcommand) { + case 'setup': + rewriteArgv(isSetupDefault && subcommand ? [subcommand, ...restArgs] : restArgs); + await import('./setup.js'); + break; + + case 'server': + rewriteArgv(restArgs); + await import('../mcp/server.js'); + break; + + case 'web': + rewriteArgv(restArgs); + await import('./web-viewer.js'); + break; + + case 'viewer': + rewriteArgv(restArgs); + await import('./viewer.js'); + break; + + case 'save': + rewriteArgv(restArgs); + await import('./save.js'); + break; + + case 'hook': + rewriteArgv(restArgs); + await import('../hooks/cli.js'); + break; + + case 'help': + case '--help': + case '-h': + console.log(` +AgentKits Memory — Persistent memory for AI coding assistants + +Usage: npx @aitytech/agentkits-memory [options] + +Commands: + setup Configure memory for your project (default) + server Start the MCP server + web Start the web viewer (port 1905) + viewer Terminal viewer for memory database + save Save a memory entry from CLI + hook Run a hook event + +Examples: + npx @aitytech/agentkits-memory # setup + npx @aitytech/agentkits-memory setup --platform=all # setup all platforms + npx @aitytech/agentkits-memory server # start MCP server + npx @aitytech/agentkits-memory web # web viewer + npx @aitytech/agentkits-memory hook context # run context hook + npx @aitytech/agentkits-memory save "Use JWT" --tags auth + +Docs: https://agentkits.net/memory +`); + break; + + default: + console.error(`Unknown command: ${subcommand}`); + console.error('Run "npx @aitytech/agentkits-memory help" for usage.'); + process.exit(1); +} diff --git a/src/cli/save.ts b/src/cli/save.ts index a3cdf29..2a40868 100644 --- a/src/cli/save.ts +++ b/src/cli/save.ts @@ -5,7 +5,7 @@ * Simple CLI to save entries to the memory database. * * Usage: - * npx agentkits-memory-save --content "..." [options] + * npx @aitytech/agentkits-memory save --content "..." [options] * * Options: * --content=X Content to save (required) diff --git a/src/cli/setup.ts b/src/cli/setup.ts index a8bb641..9c64118 100644 --- a/src/cli/setup.ts +++ b/src/cli/setup.ts @@ -6,7 +6,7 @@ * Supports multiple AI tools: Claude Code, Cursor, Windsurf, Cline, OpenCode. * * Usage: - * npx agentkits-memory-setup [options] + * npx @aitytech/agentkits-memory [setup] [options] * * Options: * --project-dir=X Project directory (default: cwd) @@ -61,7 +61,7 @@ interface McpConfig { const MEMORY_MCP_SERVER: McpServerConfig = { command: 'npx', - args: ['-y', 'agentkits-memory-server'], + args: ['-y', '@aitytech/agentkits-memory', 'server'], }; /** @@ -81,7 +81,7 @@ const MEMORY_HOOKS: HooksConfig = { hooks: [ { type: 'command', - command: 'npx --yes agentkits-memory-hook context', + command: 'npx --yes @aitytech/agentkits-memory hook context', timeout: 15, }, ], @@ -95,7 +95,7 @@ const MEMORY_HOOKS: HooksConfig = { hooks: [ { type: 'command', - command: 'npx --yes agentkits-memory-hook session-init', + command: 'npx --yes @aitytech/agentkits-memory hook session-init', timeout: 10, }, ], @@ -110,7 +110,7 @@ const MEMORY_HOOKS: HooksConfig = { hooks: [ { type: 'command', - command: 'npx --yes agentkits-memory-hook observation', + command: 'npx --yes @aitytech/agentkits-memory hook observation', timeout: 15, }, ], @@ -124,7 +124,7 @@ const MEMORY_HOOKS: HooksConfig = { hooks: [ { type: 'command', - command: 'npx --yes agentkits-memory-hook summarize', + command: 'npx --yes @aitytech/agentkits-memory hook summarize', timeout: 15, }, ], @@ -618,8 +618,8 @@ async function main() { } console.log('\n👉 Restart your AI tool to activate.'); - console.log('💡 Open web viewer: npx agentkits-memory-web'); - console.log('📋 Show hooks config: npx agentkits-memory-setup --show-hooks\n'); + console.log('💡 Open web viewer: npx @aitytech/agentkits-memory web'); + console.log('📋 Show hooks config: npx @aitytech/agentkits-memory setup --show-hooks\n'); // Show manual hook instructions if some hooks couldn't be added if (targetPlatforms.includes('claude-code')) { diff --git a/src/cli/viewer.ts b/src/cli/viewer.ts index 5ba55a2..db44f2e 100644 --- a/src/cli/viewer.ts +++ b/src/cli/viewer.ts @@ -5,7 +5,7 @@ * Simple CLI to view memory database contents. * * Usage: - * npx agentkits-memory-viewer [options] + * npx @aitytech/agentkits-memory viewer [options] * * Options: * --stats Show database statistics diff --git a/src/cli/web-viewer.ts b/src/cli/web-viewer.ts index 0d58482..3d9e45c 100644 --- a/src/cli/web-viewer.ts +++ b/src/cli/web-viewer.ts @@ -6,7 +6,7 @@ * Uses ProjectMemoryService for vector + text search. * * Usage: - * npx agentkits-memory-web [--port=1905] + * npx @aitytech/agentkits-memory web [--port=1905] * * @module @aitytech/agentkits-memory/cli/web-viewer */ diff --git a/src/hooks/cli.ts b/src/hooks/cli.ts index ef6e721..e0afc2f 100644 --- a/src/hooks/cli.ts +++ b/src/hooks/cli.ts @@ -6,7 +6,7 @@ * Reads stdin, executes appropriate hook, outputs response. * * Usage: - * echo '{"session_id":"..."}' | npx agentkits-memory-hook + * echo '{"session_id":"..."}' | npx @aitytech/agentkits-memory hook * * Events: * context - SessionStart: inject memory context @@ -72,7 +72,7 @@ async function main(): Promise { const event = process.argv[2]; if (!event) { - console.error('Usage: agentkits-memory-hook '); + console.error('Usage: npx @aitytech/agentkits-memory hook '); console.error('Events: context, session-init, observation, summarize, user-message, enrich, enrich-summary, embed-session, enrich-session, compress-session, lifecycle, lifecycle-stats, export, import, settings'); process.exit(1); } diff --git a/src/hooks/service.ts b/src/hooks/service.ts index 78573d9..7d2eb3b 100644 --- a/src/hooks/service.ts +++ b/src/hooks/service.ts @@ -671,7 +671,7 @@ export class MemoryHookService { // Spawn detached worker (worker writes its own PID to lock file on start) try { - const cliPath = path.resolve(cwd, 'dist/hooks/cli.js'); + const cliPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), 'cli.js'); const child = spawn('node', [cliPath, workerType, cwd], { detached: true, stdio: 'ignore', diff --git a/src/hooks/summarize.ts b/src/hooks/summarize.ts index b58d109..08f7b9e 100644 --- a/src/hooks/summarize.ts +++ b/src/hooks/summarize.ts @@ -82,7 +82,7 @@ export class SummarizeHook implements EventHandler { // Summary enrichment needs transcript path — handled separately (not via queue) if (isAIEnrichmentEnabled() && input.transcriptPath) { try { - const cliPath = path.resolve(input.cwd, 'dist/hooks/cli.js'); + const cliPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), 'cli.js'); const child = spawn('node', [ cliPath, 'enrich-summary', input.sessionId, input.cwd, input.transcriptPath, ], { diff --git a/src/mcp/server.ts b/src/mcp/server.ts index b0ad815..e3daf1b 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -12,7 +12,7 @@ * "mcpServers": { * "memory": { * "command": "npx", - * "args": ["agentkits-memory-server"] + * "args": ["-y", "@aitytech/agentkits-memory", "server"] * } * } * }