Skip to content

Пример: 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 tools

Manifest

Расширяет:

  • app.sidebar, app.routes, app.widgets
  • app.artifactTypes → key notes-doc
  • ai.artifactTypes, ai.artifactDrivers → key notes-doc

Backend

  1. Migration 001_init — таблица ext.project_notes с FK на Project.id
  2. Service notes — project-scoped Feathers CRUD

Frontend widget вызывает API через notesApi.ts.

Frontend

RegistryKeyЧто делает
app.sidebarproject-notesПункт меню → /ext/project-notes
app.routesproject-notesStandalone page
app.widgetsproject-notesWidget в project workspace
app.artifactTypesnotes-docEditor NotesDocEditor, default { text: '' }

Content shape: { text: string }.

AI

  • ai.artifactTypes — generation metadata, schema parse
  • ai.artifactDriversnotesTextDriver с explicit createTools (readText, replaceText, …)

Contrast с registry-test, где tools пустые и работает plain-text fallback.

Сборка

bash
pnpm build:extensions
pnpm install:extensions

Проверка:

  1. Sidebar «Project Notes»
  2. Widget на project workspace
  3. Создание Template/Artifact с типом notes-doc
  4. AI generation + save

С чего начать свой extension

Скопируйте project-notes, замените:

  1. id в manifest и package name
  2. Все keys (project-notesmy-feature, notes-docmy-doc)
  3. Backend table/service names
  4. Vue components

См. Быстрый старт.

AI workspace для командных материалов и знаний