semantic markup update

This commit is contained in:
2026-01-18 21:29:54 +03:00
parent 11c59fb420
commit 76baeb1038
85 changed files with 7020 additions and 5953 deletions

View File

@@ -10,6 +10,8 @@ const API_BASE_URL = '/api';
// [DEF:getWsUrl:Function]
// @PURPOSE: Returns the WebSocket URL for a specific task, with fallback logic.
// @PRE: taskId is provided.
// @POST: Returns valid WebSocket URL string.
// @PARAM: taskId (string) - The ID of the task.
// @RETURN: string - The WebSocket URL.
export const getWsUrl = (taskId) => {
@@ -25,6 +27,8 @@ export const getWsUrl = (taskId) => {
// [DEF:fetchApi:Function]
// @PURPOSE: Generic GET request wrapper.
// @PRE: endpoint string is provided.
// @POST: Returns Promise resolving to JSON data or throws on error.
// @PARAM: endpoint (string) - API endpoint.
// @RETURN: Promise<any> - JSON response.
async function fetchApi(endpoint) {
@@ -45,6 +49,8 @@ async function fetchApi(endpoint) {
// [DEF:postApi:Function]
// @PURPOSE: Generic POST request wrapper.
// @PRE: endpoint and body are provided.
// @POST: Returns Promise resolving to JSON data or throws on error.
// @PARAM: endpoint (string) - API endpoint.
// @PARAM: body (object) - Request payload.
// @RETURN: Promise<any> - JSON response.
@@ -72,6 +78,8 @@ async function postApi(endpoint, body) {
// [DEF:requestApi:Function]
// @PURPOSE: Generic request wrapper.
// @PRE: endpoint and method are provided.
// @POST: Returns Promise resolving to JSON data or throws on error.
async function requestApi(endpoint, method = 'GET', body = null) {
try {
console.log(`[api.requestApi][Action] ${method} to context={{'endpoint': '${endpoint}'}}`);

View File

@@ -38,6 +38,8 @@ export const taskLogs = writable([]);
// [DEF:fetchPlugins:Function]
// @PURPOSE: Fetches plugins from the API and updates the plugins store.
// @PRE: None.
// @POST: plugins store is updated with data from the API.
export async function fetchPlugins() {
try {
console.log("[stores.fetchPlugins][Action] Fetching plugins.");
@@ -52,6 +54,8 @@ export async function fetchPlugins() {
// [DEF:fetchTasks:Function]
// @PURPOSE: Fetches tasks from the API and updates the tasks store.
// @PRE: None.
// @POST: tasks store is updated with data from the API.
export async function fetchTasks() {
try {
console.log("[stores.fetchTasks][Action] Fetching tasks.");

View File

@@ -12,6 +12,8 @@ export const toasts = writable([]);
// [DEF:addToast:Function]
// @PURPOSE: Adds a new toast message.
// @PRE: message string is provided.
// @POST: New toast is added to the store and scheduled for removal.
// @PARAM: message (string) - The message text.
// @PARAM: type (string) - The type of toast (info, success, error).
// @PARAM: duration (number) - Duration in ms before the toast is removed.
@@ -25,6 +27,8 @@ export function addToast(message, type = 'info', duration = 3000) {
// [DEF:removeToast:Function]
// @PURPOSE: Removes a toast message by ID.
// @PRE: id is provided.
// @POST: Toast is removed from the store.
// @PARAM: id (string) - The ID of the toast to remove.
function removeToast(id) {
console.log(`[toasts.removeToast][Action] Removing toast context={{'id': '${id}'}}`);