2026-06-12 01:58:46 +02:00
|
|
|
// retoor <retoor@molodetz.nl>
|
|
|
|
|
|
feat: add project file system with CRUD, upload, inline editing, and video attachment support
- Add new `/projects/{slug}/files` endpoint group for per-project filesystem operations including directory and file CRUD, upload, and inline editing with public read and owner write access
- Extend attachment system to support video formats (webm, ogv, mov, m4v) with proper file icons and MIME types
- Implement configurable allowed file types via `allowed_file_types` site setting, replacing hardcoded `ALLOWED_UPLOAD_TYPES` with dynamic `allowed_extensions()` and `is_extension_allowed()` functions
- Add `delete_all_project_files()` call in `delete_content_item()` to clean up project files when a project is deleted
- Create database indexes on `project_files` table for `(project_uid, path)` and `(project_uid, parent_path)` to optimize file lookups
- Introduce `docs_prose.py` module with `render_prose()` function that renders Markdown content inside `data-render` divs using mistune, enabling dynamic prose rendering in documentation pages
- Enhance docs search with Markdown-aware text stripping (`_demarkdown()`) and improved HTML/script/style sanitization for better search indexing
- Update documentation API samples to reflect new attachment response fields (`is_image`, `is_video`, `mime_type`) and note video format support
- Update README to document the new project files endpoint and clarify AI gateway attribution for guest Devii sessions
2026-06-08 22:51:09 +02:00
|
|
|
import "./components/index.js";
|
2026-05-23 01:50:31 +02:00
|
|
|
import { ModalManager } from "./ModalManager.js";
|
|
|
|
|
import { FormManager } from "./FormManager.js";
|
|
|
|
|
import { VoteManager } from "./VoteManager.js";
|
2026-05-25 16:16:53 +02:00
|
|
|
import { NotificationManager } from "./NotificationManager.js";
|
2026-05-23 01:50:31 +02:00
|
|
|
import { MessageSearch } from "./MessageSearch.js";
|
2026-06-11 15:14:13 +02:00
|
|
|
import { MessagesLayout } from "./MessagesLayout.js";
|
2026-05-23 01:50:31 +02:00
|
|
|
import { ProfileEditor } from "./ProfileEditor.js";
|
|
|
|
|
import { MobileNav } from "./MobileNav.js";
|
|
|
|
|
import { CommentManager } from "./CommentManager.js";
|
|
|
|
|
import { ContentEnhancer } from "./ContentEnhancer.js";
|
|
|
|
|
import { DomUtils } from "./DomUtils.js";
|
2026-05-23 10:03:27 +02:00
|
|
|
import { PushManager } from "./PushManager.js";
|
2026-06-06 16:31:42 +02:00
|
|
|
import { CounterManager } from "./CounterManager.js";
|
|
|
|
|
import { ReactionBar } from "./ReactionBar.js";
|
|
|
|
|
import { BookmarkManager } from "./BookmarkManager.js";
|
|
|
|
|
import { PollManager } from "./PollManager.js";
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
import { ApiKeyManager } from "./ApiKeyManager.js";
|
2026-06-09 22:52:51 +02:00
|
|
|
import { CustomizationToggle } from "./CustomizationToggle.js";
|
2026-06-13 12:09:48 +02:00
|
|
|
import { NotificationPrefs } from "./NotificationPrefs.js";
|
2026-06-16 05:32:19 +02:00
|
|
|
import { AiCorrection } from "./AiCorrection.js";
|
|
|
|
|
import { AiModifier } from "./AiModifier.js";
|
2026-06-19 00:09:34 +02:00
|
|
|
import { TelegramPairing } from "./TelegramPairing.js";
|
2026-06-13 12:09:48 +02:00
|
|
|
import { AdminNotificationDefaults } from "./AdminNotificationDefaults.js";
|
feat: add project file system with CRUD, upload, inline editing, and video attachment support
- Add new `/projects/{slug}/files` endpoint group for per-project filesystem operations including directory and file CRUD, upload, and inline editing with public read and owner write access
- Extend attachment system to support video formats (webm, ogv, mov, m4v) with proper file icons and MIME types
- Implement configurable allowed file types via `allowed_file_types` site setting, replacing hardcoded `ALLOWED_UPLOAD_TYPES` with dynamic `allowed_extensions()` and `is_extension_allowed()` functions
- Add `delete_all_project_files()` call in `delete_content_item()` to clean up project files when a project is deleted
- Create database indexes on `project_files` table for `(project_uid, path)` and `(project_uid, parent_path)` to optimize file lookups
- Introduce `docs_prose.py` module with `render_prose()` function that renders Markdown content inside `data-render` divs using mistune, enabling dynamic prose rendering in documentation pages
- Enhance docs search with Markdown-aware text stripping (`_demarkdown()`) and improved HTML/script/style sanitization for better search indexing
- Update documentation API samples to reflect new attachment response fields (`is_image`, `is_video`, `mime_type`) and note video format support
- Update README to document the new project files endpoint and clarify AI gateway attribution for guest Devii sessions
2026-06-08 22:51:09 +02:00
|
|
|
import { UserAiUsage } from "./UserAiUsage.js";
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
import { Tabs } from "./Tabs.js";
|
|
|
|
|
import { DeviiTerminal } from "./DeviiTerminal.js";
|
2026-06-09 01:32:57 +02:00
|
|
|
import { ZipDownloader } from "./ZipDownloader.js";
|
2026-06-09 16:06:02 +02:00
|
|
|
import { ProjectForker } from "./ProjectForker.js";
|
2026-06-14 09:48:10 +02:00
|
|
|
import { IssueReporter } from "./IssueReporter.js";
|
2026-06-19 13:22:05 +02:00
|
|
|
import { IssueAttachments } from "./IssueAttachments.js";
|
feat: enforce hard test-tier requirement across all DevPlace workflow agents and feature-builder docs
Update the feature-builder agent prompt, test-maintainer agent, and all four workflow JS files (devii-tool, endpoint, feature, job-service) to codify the DevPlace test standard as a non-optional project requirement: one test file per endpoint, directory tree mirroring the URL/source path, split into three tiers (unit, api, e2e). Add explicit Test phases to devii-tool, endpoint, feature, and job-service workflows, and embed tier-specific test instructions (path mapping, fixture choice, coverage scope) directly in each workflow's meta description and TESTS constant.
2026-06-15 14:10:14 +02:00
|
|
|
import { PlanningGenerator } from "./PlanningGenerator.js";
|
2026-06-11 20:52:56 +02:00
|
|
|
import { MediaGallery } from "./MediaGallery.js";
|
2026-06-09 16:06:02 +02:00
|
|
|
import WindowManager from "./components/WindowManager.js";
|
|
|
|
|
import { ContainerTerminalManager } from "./ContainerTerminalManager.js";
|
feat: add admin/internal database API with CRUD, read-only query, and natural-language SQL endpoints
Add a new `/dbapi` router package providing a generic database API over `dataset`, restricted to admin sessions, admin API keys, and the internal gateway key. Includes:
- `tables.py`: list all tables and inspect table schemas
- `crud.py`: full CRUD operations (GET, POST, PATCH, DELETE) with soft-delete awareness, born-live inserts, `?include_deleted`, `.../restore`, and `?hard=true` purge
- `query.py`: validated read-only SELECT execution via sqlglot parsing, classification, and EXPLAIN dry-run; async query jobs with WebSocket streaming via `DbApiJobService`
- `nl.py`: natural-language-to-SQL conversion using the platform AI gateway with re-prompting until validation passes
Also register `DbApiJobService` and `PubSubService` in the service manager, add `DBAPI_DIR` to config data paths, and force cleartext `http://` connections to HTTP/1.1 in `curl_transport` to fix large request failures against uvicorn's HTTP/1.1-only internal gateway.
2026-06-15 01:00:30 +02:00
|
|
|
import { PubSubClient } from "./PubSubClient.js";
|
2026-06-16 05:32:19 +02:00
|
|
|
import { LiveNotifications } from "./LiveNotifications.js";
|
|
|
|
|
import { LocalTime } from "./LocalTime.js";
|
2026-06-22 18:41:53 +02:00
|
|
|
import { GameFarm } from "./GameFarm.js";
|
2026-06-19 10:06:09 +02:00
|
|
|
import { Accessibility } from "./Accessibility.js";
|
2026-05-23 01:50:31 +02:00
|
|
|
|
2026-05-10 09:08:12 +02:00
|
|
|
class Application {
|
|
|
|
|
constructor() {
|
2026-06-19 10:06:09 +02:00
|
|
|
this.accessibility = new Accessibility();
|
feat: add project file system with CRUD, upload, inline editing, and video attachment support
- Add new `/projects/{slug}/files` endpoint group for per-project filesystem operations including directory and file CRUD, upload, and inline editing with public read and owner write access
- Extend attachment system to support video formats (webm, ogv, mov, m4v) with proper file icons and MIME types
- Implement configurable allowed file types via `allowed_file_types` site setting, replacing hardcoded `ALLOWED_UPLOAD_TYPES` with dynamic `allowed_extensions()` and `is_extension_allowed()` functions
- Add `delete_all_project_files()` call in `delete_content_item()` to clean up project files when a project is deleted
- Create database indexes on `project_files` table for `(project_uid, path)` and `(project_uid, parent_path)` to optimize file lookups
- Introduce `docs_prose.py` module with `render_prose()` function that renders Markdown content inside `data-render` divs using mistune, enabling dynamic prose rendering in documentation pages
- Enhance docs search with Markdown-aware text stripping (`_demarkdown()`) and improved HTML/script/style sanitization for better search indexing
- Update documentation API samples to reflect new attachment response fields (`is_image`, `is_video`, `mime_type`) and note video format support
- Update README to document the new project files endpoint and clarify AI gateway attribution for guest Devii sessions
2026-06-08 22:51:09 +02:00
|
|
|
this.dialog = document.createElement("dp-dialog");
|
|
|
|
|
this.contextMenu = document.createElement("dp-context-menu");
|
|
|
|
|
this.toast = document.createElement("dp-toast");
|
2026-06-11 20:52:56 +02:00
|
|
|
this.lightbox = document.createElement("dp-lightbox");
|
|
|
|
|
document.body.append(this.dialog, this.contextMenu, this.toast, this.lightbox);
|
2026-05-23 01:50:31 +02:00
|
|
|
this.modals = new ModalManager();
|
|
|
|
|
this.forms = new FormManager();
|
|
|
|
|
this.votes = new VoteManager();
|
2026-05-25 16:16:53 +02:00
|
|
|
this.notifications = new NotificationManager();
|
2026-05-23 01:50:31 +02:00
|
|
|
this.messageSearch = new MessageSearch();
|
2026-06-11 15:14:13 +02:00
|
|
|
this.messagesLayout = new MessagesLayout();
|
2026-05-23 01:50:31 +02:00
|
|
|
this.profile = new ProfileEditor();
|
|
|
|
|
this.mobileNav = new MobileNav();
|
|
|
|
|
this.comments = new CommentManager();
|
|
|
|
|
this.content = new ContentEnhancer();
|
|
|
|
|
this.dom = new DomUtils();
|
2026-05-23 10:03:27 +02:00
|
|
|
this.push = new PushManager();
|
2026-06-16 05:32:19 +02:00
|
|
|
this.pubsub = new PubSubClient();
|
|
|
|
|
this.counters = new CounterManager(this.pubsub);
|
2026-06-06 16:31:42 +02:00
|
|
|
this.reactions = new ReactionBar();
|
|
|
|
|
this.bookmarks = new BookmarkManager();
|
|
|
|
|
this.polls = new PollManager();
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
this.apiKey = new ApiKeyManager();
|
2026-06-09 22:52:51 +02:00
|
|
|
this.customizationToggle = new CustomizationToggle();
|
feat: add telegram notification channel with outbox service and per-user preferences
Extend the notification system with a third channel (telegram) alongside existing in_app and push channels. Add `telegram_enabled` column to `notification_preferences` table, update `NOTIFICATION_CHANNELS` and `_NOTIFICATION_CHANNEL_COLUMNS` mappings, and set telegram default to off (`_NOTIFICATION_CHANNEL_DEFAULTS`). Create `telegram_outbox` table with columns for uid, user_uid, chat_id, text, status, attempts, created_at, and sent_at, plus an index on status/id for efficient polling. Register `TelegramOutboxService` in the service manager lifecycle. Update API documentation strings to describe the new channel and its pairing requirement. Extend admin notification defaults view to include telegram column. Pass `notif_telegram_paired` flag to profile template based on `telegram_store.is_paired()` check. Update `NotificationPrefForm` and `NotificationDefaultForm` model literals to accept "telegram" as a valid channel value.
2026-06-22 22:52:02 +02:00
|
|
|
this.notificationPrefs = new NotificationPrefs(this.pubsub);
|
2026-06-16 05:32:19 +02:00
|
|
|
this.aiCorrection = new AiCorrection();
|
|
|
|
|
this.aiModifier = new AiModifier();
|
feat: add telegram notification channel with outbox service and per-user preferences
Extend the notification system with a third channel (telegram) alongside existing in_app and push channels. Add `telegram_enabled` column to `notification_preferences` table, update `NOTIFICATION_CHANNELS` and `_NOTIFICATION_CHANNEL_COLUMNS` mappings, and set telegram default to off (`_NOTIFICATION_CHANNEL_DEFAULTS`). Create `telegram_outbox` table with columns for uid, user_uid, chat_id, text, status, attempts, created_at, and sent_at, plus an index on status/id for efficient polling. Register `TelegramOutboxService` in the service manager lifecycle. Update API documentation strings to describe the new channel and its pairing requirement. Extend admin notification defaults view to include telegram column. Pass `notif_telegram_paired` flag to profile template based on `telegram_store.is_paired()` check. Update `NotificationPrefForm` and `NotificationDefaultForm` model literals to accept "telegram" as a valid channel value.
2026-06-22 22:52:02 +02:00
|
|
|
this.telegramPairing = new TelegramPairing(this.pubsub);
|
2026-06-13 12:09:48 +02:00
|
|
|
this.adminNotificationDefaults = new AdminNotificationDefaults();
|
feat: add project file system with CRUD, upload, inline editing, and video attachment support
- Add new `/projects/{slug}/files` endpoint group for per-project filesystem operations including directory and file CRUD, upload, and inline editing with public read and owner write access
- Extend attachment system to support video formats (webm, ogv, mov, m4v) with proper file icons and MIME types
- Implement configurable allowed file types via `allowed_file_types` site setting, replacing hardcoded `ALLOWED_UPLOAD_TYPES` with dynamic `allowed_extensions()` and `is_extension_allowed()` functions
- Add `delete_all_project_files()` call in `delete_content_item()` to clean up project files when a project is deleted
- Create database indexes on `project_files` table for `(project_uid, path)` and `(project_uid, parent_path)` to optimize file lookups
- Introduce `docs_prose.py` module with `render_prose()` function that renders Markdown content inside `data-render` divs using mistune, enabling dynamic prose rendering in documentation pages
- Enhance docs search with Markdown-aware text stripping (`_demarkdown()`) and improved HTML/script/style sanitization for better search indexing
- Update documentation API samples to reflect new attachment response fields (`is_image`, `is_video`, `mime_type`) and note video format support
- Update README to document the new project files endpoint and clarify AI gateway attribution for guest Devii sessions
2026-06-08 22:51:09 +02:00
|
|
|
this.userAiUsage = new UserAiUsage();
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
this.tabs = new Tabs();
|
2026-06-09 16:06:02 +02:00
|
|
|
this.windows = new WindowManager();
|
|
|
|
|
this.containerTerminals = new ContainerTerminalManager();
|
feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 17:38:33 +02:00
|
|
|
this.devii = new DeviiTerminal();
|
2026-06-09 01:32:57 +02:00
|
|
|
this.zipDownloader = new ZipDownloader();
|
2026-06-09 16:06:02 +02:00
|
|
|
this.projectForker = new ProjectForker();
|
2026-06-14 09:48:10 +02:00
|
|
|
this.issueReporter = new IssueReporter();
|
2026-06-19 13:22:05 +02:00
|
|
|
this.issueAttachments = new IssueAttachments();
|
feat: enforce hard test-tier requirement across all DevPlace workflow agents and feature-builder docs
Update the feature-builder agent prompt, test-maintainer agent, and all four workflow JS files (devii-tool, endpoint, feature, job-service) to codify the DevPlace test standard as a non-optional project requirement: one test file per endpoint, directory tree mirroring the URL/source path, split into three tiers (unit, api, e2e). Add explicit Test phases to devii-tool, endpoint, feature, and job-service workflows, and embed tier-specific test instructions (path mapping, fixture choice, coverage scope) directly in each workflow's meta description and TESTS constant.
2026-06-15 14:10:14 +02:00
|
|
|
this.planningGenerator = new PlanningGenerator();
|
2026-06-11 20:52:56 +02:00
|
|
|
this.mediaGallery = new MediaGallery();
|
2026-06-16 05:32:19 +02:00
|
|
|
this.liveNotifications = new LiveNotifications(this.pubsub, this.toast);
|
|
|
|
|
this.localTime = new LocalTime();
|
2026-06-22 18:41:53 +02:00
|
|
|
this.gameFarm = new GameFarm();
|
2026-05-10 09:08:12 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const app = new Application();
|
2026-05-12 15:07:34 +02:00
|
|
|
window.app = app;
|
2026-06-09 16:06:02 +02:00
|
|
|
app.containerTerminals.restore();
|