Пример: project-notes
Reference-расширение @artiroute/project-notes — полный E2E: backend CRUD, frontend artifact type, AI generation.
Путь: packages/extensions/project-notes/
Дерево файлов
project-notes/
extension.manifest.mjs
package.json
vite.config.ts
src/
backend/index.ts # migration + Feathers service
frontend/
index.ts # sidebar, routes, widget, artifact type
api/notesApi.ts
components/
ProjectNotesWidget.vue
NotesDocEditor.vue
ai/
index.ts # artifactTypes + artifactDrivers
text-driver.ts # explicit AI toolsManifest
Расширяет:
app.sidebar,app.routes,app.widgetsapp.artifactTypes→ keynotes-docai.artifactTypes,ai.artifactDrivers→ keynotes-doc
Backend
- Migration
001_init— таблицаext.project_notesс FK наProject.id - Service
notes— project-scoped Feathers CRUD
Frontend widget вызывает API через notesApi.ts.
Frontend
| Registry | Key | Что делает |
|---|---|---|
app.sidebar | project-notes | Пункт меню → /ext/project-notes |
app.routes | project-notes | Standalone page |
app.widgets | project-notes | Widget в project workspace |
app.artifactTypes | notes-doc | Editor NotesDocEditor, default { text: '' } |
Content shape: { text: string }.
AI
ai.artifactTypes— generation metadata, schema parseai.artifactDrivers—notesTextDriverс explicitcreateTools(readText,replaceText, …)
Contrast с registry-test, где tools пустые и работает plain-text fallback.
Сборка
bash
pnpm build:extensions
pnpm install:extensionsПроверка:
- Sidebar «Project Notes»
- Widget на project workspace
- Создание Template/Artifact с типом
notes-doc - AI generation + save
С чего начать свой extension
Скопируйте project-notes, замените:
idв manifest и package name- Все keys (
project-notes→my-feature,notes-doc→my-doc) - Backend table/service names
- Vue components
См. Быстрый старт.