Итерируемые реестры
Хост: artiroute frontend + ai-agent-service.
Каждый реестр — Map записей. Хост перебирает .entries() (с учётом order) и рендерит UI или подключает AI-логику.
Каталог
| Registry ID | Payload (SDK type) | Consumer | Пример key |
|---|---|---|---|
app.sidebar | { label, icon, to, order? } | AppSidebar.vue | project-notes |
app.routes | ExtensionRouteItem | bootstrap.ts, router | project-notes |
app.widgets | ExtensionWidgetItem | WidgetRenderer.vue, project workspace | project-notes |
app.dashboardWidgets | ExtensionDashboardWidgetItem | DashboardWidgetRenderer.vue | registry-test-dashboard |
app.projectTabs | ExtensionTabItem | ProjectWorkspaceScreen.vue | registry-test-tab |
app.settingsTabs | ExtensionSettingsTabItem | SettingsScreen.vue | registry-test-settings |
app.artifactTypes | ArtifactTypeDefinition | artifact editor, templates | notes-doc |
app.formBuilderNodeTypes | FormNodeTypeDefinition | BPMN / dynamic form designer & renderer | registry-test-note |
app.dialogs | programmatic dialog entries | global dialog host | registry-test-dialog |
ai.artifactTypes | ArtifactTypeGeneration | ai-agent-service generation | notes-doc |
ai.artifactDrivers | ArtifactDriver | ai-agent-service tools/session | notes-doc |
ai.fileExtractors | FileTextExtractor | ai-agent-service file RAG indexing | my-pdf |
app.aiTaskKinds | ExtensionAiTaskKindItem | SettingsAiPanel.vue | transcription |
ai.taskKinds | ExtensionAiTaskKindItem | ai-agent-service license / host API | transcription |
backend.artifactTypes | ArtifactTypeBackend | backend artifact import/export | notes-doc |
app.sidebar
Пункт бокового меню:
ts
getExtensionRegistry('app.sidebar').register(
'project-notes',
{
label: 'Project Notes',
icon: 'pi pi-book',
to: '/ext/project-notes',
},
50
);to должен соответствовать route, зарегистрированному в app.routes.
app.routes
Маршрут SPA:
ts
getExtensionRegistry<ExtensionRouteItem>('app.routes').register(
'project-notes',
{
path: '/ext/project-notes',
name: 'ext:project-notes',
component: ProjectNotesPage,
layout: 'default',
meta: { title: 'Project Notes' },
},
50
);Рекомендуется префикс /ext/ и name: 'ext:…' для изоляции от core routes.
app.widgets
Виджет project workspace:
ts
getExtensionRegistry<ExtensionWidgetItem>('app.widgets').register(
'project-notes',
{
id: 'project-notes',
title: 'Project Notes',
icon: 'pi-book',
defaultWidth: 2,
order: 60,
component: ProjectNotesWidget,
resolveProps: (ctx) => ({
projectId: ctx.projectId,
user: ctx.user,
}),
},
60
);Layout виджетов сохраняется в UserPreferences.widgetLayout.
app.dashboardWidgets
Виджет главного дашборда — аналогично app.widgets, но контекст DashboardWidgetContext. Layout: UserPreferences.dashboardLayout.
app.projectTabs
Дополнительная вкладка в project workspace (рядом с widgets/phases).
app.settingsTabs
Вкладка на экране Settings.
app.artifactTypes
Новый тип артефакта:
ts
getExtensionRegistry('app.artifactTypes').register(
'notes-doc',
{
name: 'notes-doc',
label: 'Notes',
labelKey: 'artifactType.document',
editorComponent: NotesDocEditor,
configuratorComponent: NotesDocEditor,
serializeToText: (content) => {
/* … */
},
createDefaultTemplate: () => ({ text: '' }),
},
50
);Тип notes-doc должен быть допустим в Template (artifactType — text field в Keystone).
app.formBuilderNodeTypes
Кастомные поля для конструктора форм (BPMN и др.):
ts
import type { FormNodeTypeDefinition } from '@artiroute/extension-sdk/host';
getExtensionRegistry<FormNodeTypeDefinition>('app.formBuilderNodeTypes').register(
'my-ext-color-picker',
{
type: 'my-ext-color-picker',
category: 'field',
labelKey: 'myExt.formBuilder.colorPicker',
icon: 'pi pi-palette',
isValueNode: true,
rendererComponent: ColorPickerField,
defaultValue: () => null,
},
50,
);Ключ рекомендуется в формате {extensionId}-{type}. Layout-контейнеры (row, tabs, subForm) регистрирует только host.
Параллельно регистрируйте AI-реестры с тем же key.
app.dialogs
Программные диалоги — запись с open(ctx) callback.
ai.artifactTypes
Метаданные для LLM-генерации: schema, describeGeneration, parseGenerationResult и т.д. См. AI.
ai.artifactDrivers
Runtime driver: session content, tools, validate, finalize. См. Artifact drivers.
ai.fileExtractors
Извлечение текста из файлов проекта для RAG. См. File extractors.
User preferences
| Preference | Назначение |
|---|---|
widgetLayout | Сетка виджетов project workspace |
dashboardLayout | Порядок и grid виджетов дashboard (UserPreferences v2) |