Commit Graph
96 Commits
Author SHA1 Message Date
ars9 622924ed53 refactor(nav): reorganize sidebar with dynamic sections at top
- move runs and sessions to top of navigation (most dynamic)
- add visual separator between dynamic and configuration sections
- reorder remaining items: scenarios, snippets, credentials, environments
- implement separator component in nav rendering logic
2026-04-14 23:15:49 +03:00
ars9 6c43b53590 fix(scenarios): add error handling for API calls and dev script with local API
- add catch handler to promises for better error visibility
- use null coalescing operators to prevent undefined accessing
- add dev:compose-api npm script pointing to localhost:13000 API
- include toast dependency in useCallback to avoid stale closures
2026-04-14 23:09:38 +03:00
ars9 e66e53c817 chore: apply code formatting and linting
- format long import statements with consistent line wrapping
- apply consistent indentation across client and server modules
- remove generated tsconfig.tsbuildinfo file
2026-04-14 22:54:03 +03:00
ars9 a71be39076 fix: fix links in scenario service 2026-04-14 21:11:35 +03:00
ars9 5ec9fd0bc3 refactor: add session and environment relationships to scenario run
- add sessionId optional column to ScenarioRunEntity
- add ManyToOne relationship to EnvironmentEntity (with eager loading)
- add ManyToOne relationship to SessionEntity (optional)
- update ScenarioRun client types to include session and environment data
- add environment name and session link to RunDetailPage
- update UI to display save session, environment, and session info
2026-04-14 19:29:48 +03:00
ars9 80d9af42b5 fix: add save session checkbox to run modal on scenarios list page
- add saveSessionFlag state to ScenariosPage
- pass saveSessionFlag to scenarios.run() call
- render save session checkbox in run modal when envs are available
- reset saveSessionFlag after scenario run completes
2026-04-14 19:24:13 +03:00
ars9 dcb002304b feat(run-detail): add expandable step output blocks with json pretty-printing
- add collapsible code blocks for step output with JSON syntax highlighting
- display byte count when output exists but no description available
- support both individual row expansion and header-level expand all toggle
- pretty-print JSON output for improved readability
- wrap log messages in code tags for monospace display
- fix step order numbering to start from 1 instead of 2
2026-04-14 19:19:39 +03:00
ars9 196bf4c2e8 feat: add saveSession flag to create scenario runs
- Add optional `saveSession` boolean parameter to CreateScenarioRunDto
- Add `saveSession` column to ScenarioRunEntity
- When saveSession=true and run completes, preserve the browser context as a named explore session instead of closing it
- Session name follows pattern: run-{runId}
- Automatically extracts token and localStorage for session persistence
- Injected SessionService and SessionContextService into ScenarioSchedulerService
- Updated MCP run_scenario tool to accept saveSession parameter
- Updated UI run dialog with checkbox to enable session preservation
- Client API updated to pass saveSession flag
2026-04-14 18:54:45 +03:00
ars9 0e47623a6b feat(browser,mcp): resolve environment and credentials from DB in exec
- POST /exec now accepts environmentId (UUID) and credentials (alias → UUID)
  instead of raw payloads; resolves entities via EnvironmentService and
  CredentialService before passing data to browserService.exec
- exec_code MCP tool updated with same schema: environmentId + credentials map
- CredentialModule imported into BrowserModule and McpModule
- docs(scenario): rewrite script runtime section for single context argument
- docs(mcp): update exec_code description to reflect new parameter shapes
- style: reorder imports across server source (formatter)
2026-04-14 18:09:28 +03:00
ars9 90be5a5490 refactor(code-executor): migrate user scripts to single context argument
- replace (page, context, helpers) signature with async (context) => {}
- add ScriptContext interface exposing page, browser, env, getEnv,
  getCredential, getStepOutput, runSnippet, dumpDom, log/warn/error
- rename getEnvUrl to getEnv throughout service and docs
- fix step ordering: normalizeStepOrder and run step rows are now 1-based
- migrate existing DB rows (scenario_steps, scenario_run_steps) +1
- update all tests and stored snippet/step code in DB to new API
2026-04-14 17:44:59 +03:00
ars9 1a2e786ca8 feat(browser): add environment, credentials, and script logger to POST /exec
- ExecDto gains optional `environment` and `credentials` fields
- BrowserService.exec forwards both to CodeExecutorService.execute so
  helpers.env, helpers.getEnvUrl(), and helpers.getCredential() work
  identically to scenario-scheduler steps
- script console.log/warn/error now routed through TraceLogger with
  session label prefix
- integration tests cover env/creds injection and missing-alias error
2026-04-14 16:57:06 +03:00
ars9 d34ea9e943 fix(browser): inject snippets into exec_code context; fix(ui): step order starts at 1 in run detail
- BrowserService.exec() now builds snippet map via SnippetService and passes
  it to CodeExecutorService.execute() for both named-session and anonymous paths
- SnippetModule added to BrowserModule imports to wire the dependency
- RunDetailPage step order column renders s.order + 1 (was 0-based)
2026-04-14 16:28:31 +03:00
ars9 310997c3ae feat(mcp): add credential and all-runs tools; replace deprecated z.string().uuid()
- add list_scenario_credentials, add_scenario_credential, remove_scenario_credential tools
- add list_all_runs tool (global across all scenarios)
- replace all deprecated z.string().uuid() with z.uuid() throughout mcp.service
2026-04-14 14:45:55 +03:00
ars9 7acd1bc5a1 feat(client): add nginx config for SPA routing and API proxy
- add try_files fallback to serve index.html for all non-asset paths
- proxy /api/ requests to the server container to avoid HTML being
  returned by nginx for API calls when using full route paths
2026-04-14 13:05:55 +03:00
ars9 5ba327b745 1.5.0 2026-04-11 00:53:44 +03:00
ars9 238c52610a refactor(scenario): remove validateCode — assertions live in execCode
- drop validateCode column, DTOs, service mappings, and scheduler branch
- remove parseValidateResult helper and ValidateResult interface
- inject playwright expect into code executor for direct use in execCode
- strip validateCode from MCP tool schemas, client types, and UI forms
2026-04-11 00:52:50 +03:00
ars9 29e91b0078 test(server): align specs with run environment and step schema
- update scenario tests to create runs with required environmentId
- adjust browser controller expectations to session auto-create behavior
- sync playwright/context mocks with current browser service usage
2026-04-11 00:22:58 +03:00
ars9 56d23f913d feat(scenarios): require environment for scenario runs
- require environmentId when creating runs in API and MCP tools

- pass selected environment data into step execution helpers

- prompt for environment selection before running scenarios in UI
2026-04-11 00:12:21 +03:00
ars9 d8ea2d0126 feat(ui): require confirmation before delete actions
- add a reusable modal component and export it from the shared ui barrel

- gate all delete and remove flows behind explicit confirmation dialogs

- use a solid modal surface color token with fallback to avoid transparent body
2026-04-10 23:46:20 +03:00
ars9 7223371fae refactor(snippets): adopt alias/title model and markdown UX
- rename snippet identity from name to alias and add required title fields

- migrate snippet API, forms, cards, and detail views to alias/title semantics

- render markdown descriptions with short card previews and split vendor chunks
2026-04-10 23:26:36 +03:00
ars9 11db983ea6 refactor(api): version routes and externalize client base url
- serve REST endpoints under /api/v1 with root exceptions for health and mcp

- move swagger UI to /docs and allow direct frontend calls via CORS

- remove Vite proxy/hash routing and rely on env-driven VITE_API_URL
2026-04-10 22:53:32 +03:00
ars9 ccce3381c1 refactor(client): centralize error feedback with toast events
- emit API/network failures through a shared toast event bridge

- remove per-page inline error notifications to avoid duplicate error UI

- dedupe repeated toast messages to keep feedback readable
2026-04-10 22:24:30 +03:00
ars9 7444082b65 feat(ui): add toasts for create edit and run flows
- add global ToastProvider and useToast hook mounted at app root

- show success/error toasts for environment, credential, snippet, and scenario create/edit actions

- show run-started/error toasts on scenario run actions with 100ms exit animation
2026-04-10 21:44:04 +03:00
ars9 d511c85891 refactor(client): split feature chunks and polish environment ui
- lazy-load route pages and add entity-based manual chunking in Vite

- prevent environment pages from crashing when legacy records miss data

- fix sidebar toggle chevron direction and make env forms full width
2026-04-10 21:32:07 +03:00
ars9 fd515ee459 refactor(environment): rename urls payload to data
- replace hardcoded URL keys with a generic key-value data map

- align backend DTOs, MCP schemas, and service import/export mapping

- update environment UI forms to edit JSON data instead of fixed fields
2026-04-10 21:22:46 +03:00
ars9 b45f95d8cf refactor(session): auto-create named browser sessions
- create and register named browser sessions on open/exec when missing

- align scenario step DTO/entity/service by removing sessionName usage

- update MCP scenario-step schemas to use optional title fields
2026-04-10 21:06:00 +03:00
ars9 1627733701 docs: refresh architecture and runtime documentation
- align architecture, development, MCP, and scenario docs with current code

- remove obsolete key descriptor document and stale keys/auth references
2026-04-10 20:40:20 +03:00
ars9 0e4a2e1819 feat(app): add environment import/export and sidebar footer info
- add environment import/export API endpoints and client integration

- add environment export actions and toolbar import/export buttons in UI

- move theme switcher to sidebar bottom and show root package version

- switch snippet card menu icon to cog for consistent options affordance
2026-04-10 20:29:40 +03:00
ars9 99da7ac891 feat(ui): add breadcrumb icons, fix alignment, and remove duplicate form headers
- add section icons to all breadcrumbs across every page
- fix breadcrumb nav display:flex so icons align vertically with buttons
- wrap all page breadcrumbs in pageToolbar div for consistent layout
- add Breadcrumbs to AllRunsPage which previously used a plain h1
- fix envCardHeader flex:1 so settings button hugs the right edge
- remove card header from environment create/edit forms (duplicated breadcrumb)
2026-04-10 19:58:33 +03:00
ars9 de0cbeef7c refactor(workspace): restore yaml exports and align docker builds
- return scenario export payloads as yaml to match existing workflows

- harden step reordering flow for drag-and-drop and one-based ui labels

- switch server container to workspace-lockfile installs and root ignore rules
2026-04-10 18:19:38 +03:00
ars9 259dac806e refactor(auth): remove keys auth module and align tests
- remove server auth module and client keys page/routes/api to simplify flow

- update mcp and scenario tests to match uuid routes and step schema
2026-04-10 16:42:43 +03:00
ars9 673aa0f458 refactor(scenario): remove step type and simplify scheduler to exec-only
- remove StepType, type column, and type field from step entity and DTOs
- remove executeLoginStep, executeSignStep, executeExecStep from scheduler
- inline exec logic directly in executeStepRun; all steps run execCode
- remove AuthService, EnvironmentService, runEnvironments from scheduler
- remove type selector from CreateStepPage and EditStepPage
- remove type badge column from ScenarioDetailPage
- fix useEffect dependency arrays in RunDetailPage (FINAL, id, runId, polling)
- fix duplicate /snippets proxy key in vite.config.ts
- remove unused escapeHtml export from hljs.ts
2026-04-10 16:14:17 +03:00
ars9 1c13e068ad feat(ui): add CodeBlock and CodeEditor components with Monaco and hljs
- add CodeBlock for read-only syntax-highlighted display (hljs, js/json)
- add CodeEditor wrapping Monaco editor with theme sync, focus state, and error state
- replace code textareas in snippet, credential, and step pages with CodeEditor
- replace code <pre> blocks in snippet and credential detail pages with CodeBlock
- make form cards full-width on pages with code editors
- add resize:vertical support to CodeEditor wrapper with automaticLayout
2026-04-10 15:53:26 +03:00
ars9 2046e64428 feat(runs): add log search with backend LIKE filter and pagination
- add Search pill component with lucide icon and focus highlight
- wire debounced search input to GET /run/:id?q= backend filter
- backend filters run logs with LIKE %q% via TypeORM
- add sectionHeadingRow layout for heading + search alignment
- add i18n keys: runs.step_title, logs_search_placeholder
2026-04-10 15:09:05 +03:00
ars9 fd655c3253 feat(runs): add step title column, step descriptions, and snippet logging 2026-04-10 14:56:15 +03:00
ars9 607abcafc5 fix(scenarios): order runs by createdAt desc, scenarios list by updatedAt desc 2026-04-10 13:57:34 +03:00
ars9 b26eb10b3d 1.4.0 2026-04-10 13:09:25 +03:00
ars9 32be7c0a59 feat(export-import): add yaml export/import with id upsert for credentials, snippets, and scenarios
- all entities export a kind field (credential/snippet/scenario) for safe type checking on import
- import upserts by id: overwrites if id exists, creates with explicit id otherwise
- scenario export now includes id and step ids; import deletes old steps before recreating
- add GET /:id/export and POST /import endpoints to credential and snippet controllers
- add UuidBadge ui component: shortens uuid to first+last 4 hex chars, tooltip, clipboard copy with animated ClipboardCheck icon pop
- apply UuidBadge across all entity id display sites (detail pages, card footers, table columns)
- add export/import buttons to CredentialsPage, SnippetsPage, CredentialDetailPage, SnippetDetailPage
2026-04-10 13:09:09 +03:00
ars9 1164289173 feat(snippets): add snippets entity, crud, and auto-browser-per-run
- add Snippet entity with name, description, code; full CRUD backend
- add snippets pages (list, create, edit, detail) and nav entry
- add runSnippet helper in code-executor using new Function with args array
- add result param to execute() so validateCode can access exec output
- remove sessionName from steps; each run now spawns its own fresh browser
- fix waitForURL race by polling localStorage for token instead
2026-04-10 00:22:51 +03:00
ars9 1efbbb38a3 feat(scenarios): add step title, scenario credentials, and environment context in executor
- add nullable title column to scenario steps; exposed in create/edit forms and step table
- add scenario-credential join (many-to-many with CredentialEntity) with CRUD endpoints
- expose environment URLs in code executor helpers via helpers.env and helpers.getEnvUrl()
- resolve and cache environment per run from the login step's environmentName in scheduler
- add section spacing and step table title column to ScenarioDetailPage
2026-04-09 23:37:21 +03:00
ars9 1f3a604940 feat(runs): add runs pages, polling, autorefresh indicator, and scheduler fix
- add global runs page and per-scenario runs/run-detail pages
- run detail page polls every 1s until pass/fail, cleans up on unmount
- runs list pages poll every 10s with AutoRefreshIndicator (pulse on data load)
- fix scheduler: set run to pass after empty step loop to prevent stuck in_progress
- fix table header colors and link cell color for readability
- fix play button to navigate to the new run after creation
- fix package.json import paths in server for Docker build context
2026-04-09 21:58:27 +03:00
ars9 ebcb8b8ff4 refactor(client): group pages by entity and add scenario/step crud
- move environment, scenario, session pages into entity subdirs
- add CreateScenarioPage and EditScenarioPage
- add CreateStepPage and EditStepPage with order/type/session/code fields
- add per-step edit and delete row actions on ScenarioDetailPage
- add step api methods (get, create, update, remove) to api client
- add sectionToolbar, formField, fieldLabel, textarea css utilities
2026-04-09 20:45:34 +03:00
ars9 6b1307c58a 1.3.0 2026-04-09 20:26:45 +03:00
ars9 a2afe97cd3 chore: rename project to liqa and fix code quality issues
- rename package names from liquio-qa-bot to liqa/liqa-client/liqa-server
- replace QA Bot text with liqa.svg logo image in sidebar header
- add favicon.svg (liqa-mini.svg) and page title update
- fix DescriptionList extractText generic type for TS strict props access
- configure server eslint to allow underscore-prefixed unused vars
- fix session.controller unused destructured vars (_cookies, _localStorage)
- update server package.json version import path after server rename
- fix session DELETE test assertion from 200 to 204
2026-04-09 20:26:31 +03:00
ars9 a5f87b904e feat(scenarios): add detail page, comfortable DescriptionList layout, and environment card refactor
- Add ScenarioDetailPage with DescriptionList, steps table, run/delete actions
- Add /scenarios/:id route
- Add i18n keys for scenario detail fields, steps columns, and 404 error
- Add 'comfortable' and 'inline' layout variants to DescriptionList (with compact as default stacked)
- Apply layout="comfortable" to session, environment, and scenario detail pages
- Apply layout="compact" to EnvironmentsPage card DescriptionList
- Refactor EnvironmentsPage card to use ContextMenu (view/edit/delete) with icons
- Add ScenariosPage clickable rows, Play icon (primary) and Trash2 icon (danger) action buttons
- Add Page.module.css sectionHeading and stepsSection utility classes
- Fix Notification.tsx and Table.tsx formatting (prettier)
2026-04-09 19:16:49 +03:00
ars9 d342637eb6 feat(sessions): add detail page, Notification component, and session API improvements
- add SessionDetailPage with breadcrumbs, DescriptionList, status badge, masked token
- add Notification component (info/success/error/warning/note variants) for contextual messages
- use Notification for 404 errors on session and environment detail pages
- add GET /sessions/:id endpoint; sanitize token (head…tail) and strip cookies/localStorage
- change DELETE /sessions/:id to return 204 No Content so client redirect works correctly
- add onRowClick prop to Table for clickable rows; stop propagation on actions column
- update status badges: open=success (green), closed=error (red) on both list and detail
2026-04-09 19:00:16 +03:00
ars9 097c747993 style(Table): apply Kimberly header and striped row backgrounds 2026-04-09 17:45:33 +03:00
ars9 18177cac52 feat(client): add create/edit environment pages and hoverable cards
- add CreateEnvironmentPage and EditEnvironmentPage with pre-filled form
- add /environments/new and /environments/:id/edit routes
- add Edit option to card context menu and detail page toolbar
- move env id pill to card footer (left), timestamp stays right
- make env cards clickable (navigate to detail); cog stops propagation
- add hoverable Card variant with primary border+shadow on hover
- add link color tokens and global anchor styles for both themes
- fix Timestamp pill visibility in dark mode with border token
- add DescriptionList truncate prop with ellipsis and title tooltip
- stack DescriptionList dd below dt with 8px gap between items
2026-04-09 17:22:01 +03:00
ars9 89016b01d2 feat(client): add Card header/footer, DescriptionList, and portal ContextMenu
- add Card header prop (primary/secondary variants) and footer prop (sticks to bottom)
- add Breadcrumbs to all 5 pages; remove duplicate h1 headings
- add pageToolbar layout for breadcrumbs + danger button aligned right
- add DescriptionList component replacing raw dl/dt/dd markup; supports truncate+tooltip
- rewrite ContextMenu to render dropdown via React portal to avoid clip/overflow issues
- update EnvironmentCard to use Card header (primary), footer (Timestamp), and truncated DescriptionList
- fix cog button contrast, square sizing, and right-edge alignment on colored header
- add border to Timestamp pill for dark-mode visibility
- add id badge pill styling to environment card header
2026-04-09 14:29:16 +03:00
ars9 35997f8bcb feat(client): add ContextMenu component, environment cards, detail page, and breadcrumbs
- add ContextMenu component with click-outside/Escape dismiss, align prop, and danger variant
- replace EnvironmentsPage table with responsive card grid
- add cog button to each card opening a context menu with view and delete actions
- add EnvironmentDetailPage at /environments/:id with meta grid, URLs card, and delete
- add Breadcrumbs to all pages; detail page uses two-item trail with delete button inline
- add Table stories for pagination and Timestamp column
2026-04-09 10:55:45 +03:00
ars9 077cd6ad5f feat(client): add Pagination component and integrate with Table and pages
- add Pagination component with prev/next, ellipsis page range, and optional page-size selector
- add Pagination and Table pagination stories (WithPagination, WithPaginationAndSizeSelector)
- extend Table with optional pageSize and pageSizeOptions props for built-in client-side pagination
- add Timestamp column to Table story fixtures
- enable pagination on all four pages with pageSize=10 and size selector
- add pagination i18n keys to en.json
2026-04-09 10:43:45 +03:00
ars9 b4d576c6e9 chore: centralise version field in root package.json
- remove version from server and client workspace packages
- bump root to 1.2.0 to match previous server version
2026-04-09 10:35:07 +03:00
ars9 f83141b484 docs: update architecture and development docs to cover client workspace
- add client workspace section to architecture diagram and description
- split development.md commands into server and client per-workspace
- document client tech stack, directory layout, routing, and theming
- add Client overview section with Storybook test instructions
2026-04-09 10:32:49 +03:00
ars9 32beec2229 feat(client): add Timestamp component, ESLint 10 + Prettier, and code quality fixes
- add Timestamp component with moment relative time and ISO tooltip
- add Timestamp stories (JustNow, MinutesAgo, HoursAgo, DaysAgo, MonthsAgo)
- add ESLint 10 with typescript-eslint, react-hooks, react-refresh, prettier
- add Prettier config with singleQuote, semi, trailingComma all, printWidth 100
- add lint, lint:fix, format, test:storybook scripts to package.json
- fix react-hooks/set-state-in-effect in all page components
- auto-fix 113 Prettier formatting issues across src and .storybook
2026-04-09 10:25:15 +03:00
ars9 50b942801f feat(client): add routing and sidebar icons
- install react-router-dom and wrap app in HashRouter to avoid dev proxy conflicts
- replace useState-based section switching with NavLink + Routes
- add lucide icons (Globe, KeyRound, Monitor, ClipboardList) to nav items
- icon opacity transitions on hover and active state via CSS
2026-04-09 10:09:19 +03:00
ars9 876b1518da feat(client): add i18n with i18next and react-i18next
- install i18next and react-i18next
- create src/i18n/index.ts bootstrapping i18next with initReactI18next
- add src/i18n/locales/en.json with keys for nav, all pages, and ThemeSwitcher
- replace hardcoded English strings in App, all pages, and ThemeSwitcher with t()
- move static column definitions inside components where useTranslation is available
2026-04-09 10:03:54 +03:00
ars9 aefa1db2bd feat(client): add ThemeSwitcher and relocate stories to .storybook/
- add lucide-react for Sun/Moon icons
- add useTheme hook persisting choice to localStorage with prefers-color-scheme fallback
- add ThemeSwitcher button component wired into SidePanel header
- add blocking inline script to index.html to prevent flash-of-wrong-theme
- move all *.stories.tsx from src/ into .storybook/stories/ and update imports
- update main.ts stories glob to .storybook/stories/**
2026-04-09 09:56:59 +03:00
ars9 9916ef5aaf feat(client): add UI kit, data layer, app shell, and Table component
- design token system (Atlantis, Kimberly, Powder Ash palette)
- Button, Badge, Input, Select, Card, SidePanel, Breadcrumbs components
- generic typed Table<T> component with loading/empty states
- API data layer: typed fetch client for environments, keys, sessions, scenarios
- Vite dev proxy targeting server on port 13000
- App shell with SidePanel nav and four entity pages (Environments, Keys, Sessions, Scenarios)
- Storybook config with dark/light theme toggle and a11y addon
2026-04-09 00:11:55 +03:00
ars9 5cc16725fb chore(repo): restructure as monorepo with server and client workspaces
- move NestJS app into server/ subdirectory
- add client/ React+TypeScript (Vite) app with Hello World
- update docker-compose to build and run both services
- add root package.json declaring npm workspaces
- update .gitignore to cover node_modules and dist at all depths
2026-04-08 21:28:01 +03:00
ars9 afc4627353 fix(auth): skip sign widget open if already visible
- check for file input visibility before clicking the sign button
- prevents double-open when Готово triggers the widget automatically
- remove stale scenario-25-export.json (superseded by notes export)
2026-04-08 21:09:36 +03:00
ars9 73cfe99cb7 1.2.0 2026-04-08 20:14:10 +03:00
ars9 9e79cad237 feat(session): persistent browser context pool with lifecycle management
- SessionContextService: in-memory Map of live Playwright handles, reused
  per sessionName across exec_code/open_url calls; closed on module destroy
- SessionSchedulerService: @Interval closes idle sessions and deletes old
  closed ones using SESSION_IDLE_TIMEOUT_MINUTES / SESSION_DELETE_CLOSED_DAYS
- SessionService: onApplicationBootstrap closes all open sessions on restart;
  upsert marks status=open and sets lastUsedAt; adds markOpen/markClosed/
  touchLastUsed/findExpiredOpen/findOldClosed/findById helpers
- SessionEntity: status (open|closed) and lastUsedAt columns added
- AuthService: keeps browser alive after login, registers context in pool
- BrowserService: named sessions reuse persistent context; anonymous remain ephemeral
- AppConfig: all config fields declared with typed defaults; validate wired
  into ConfigModule so mis-configuration fails fast at startup
- ConfigService<AppConfig, true> used everywhere — no more untyped get() calls
2026-04-08 20:14:05 +03:00
ars9 b2edac062f 1.1.1 2026-04-08 19:02:53 +03:00
ars9 71bcc8faec feat(scenario): step output, getStepOutput helper, export/import MCP tools, doc restructure
- add output column to ScenarioRunStepEntity; exec step return value is JSON-serialised and stored
- expose helpers.getStepOutput(order) in exec code; negative order is relative to current step
- add get_scenario_run, wait_for_scenario_run, export_scenario, import_scenario MCP tools
- move Architecture, Key descriptors, MCP tools, Scenario, Development docs to docs/
- delete CONTRIBUTING.md (replaced by docs/development.md)
2026-04-08 19:02:36 +03:00
ars9 e2813208ba 1.1.0 2026-04-08 18:10:51 +03:00
ars9 9a9ccbfe37 feat(scenario): run logs, lint/format tooling, CONTRIBUTING
- add ScenarioRunLogEntity to persist step script output to DB
- stepLogger dual-writes to NestJS logger and DB (fire-and-forget)
- add GET /scenarios/:id/run/:runId returning run, stepRuns and logs
- add POST /scenarios/:id/run/:runId/wait (polls until terminal state)
- 9 new integration tests for the two endpoints (136 total)
- add eslint with typescript-eslint and eslint-config-prettier
- add npm scripts: format, lint, lint:fix
- resolve all lint errors across src and test (no any types)
- add CONTRIBUTING.md covering dev workflow
2026-04-08 18:10:42 +03:00
ars9 b0c02a1cdc refactor(scheduler): single continuous loop per run with trace ID
- replace two @Interval jobs (activate + process-one-step) with one job
  that spawns an async loop per run, eliminating 1-second gaps between steps
- track active runs via Set to prevent duplicate processing
- wrap each run loop in traceStorage.run() with a fresh UUID so all log
  lines for a run share a trace ID without an HTTP request context
2026-04-08 17:21:41 +03:00
ars9 c4ca622da5 fix(code-executor): shadow console via Function parameter instead of global mutation
- avoids mutating the global console object entirely
- passes fakeConsole as a named parameter so the script's lexical console
  is the intercepted version without any save/restore dance
- eliminates concurrency hazard when multiple scripts run concurrently
2026-04-08 17:13:20 +03:00
ars9 7527a0b34b feat(logging): redirect script console output through service logger
- suppress raw stdout from exec/validate code by overriding console
- route console.log/warn/error/info through ScriptLogger callback
- expose helpers.log/warn/error for scripts to use explicitly
- scheduler passes step-run-prefixed logger to all execute() calls
- log response body length instead of full body in LoggingInterceptor
2026-04-08 16:51:16 +03:00
ars9 af45a281dd feat(scenario): export/import endpoints and integration tests
- add GET /scenarios/:id/export returning ScenarioExportDto
- add POST /scenarios/import creating scenario with all steps
- add ScenarioExportDto and ScenarioStepExportDto classes
- fix McpServer singleton by creating fresh instance per handle() call
- add 12 integration tests covering shape, ordering, round-trip, validation
2026-04-08 16:33:58 +03:00
ars9 e85acc8fb2 feat(scenario): shared browser per run, sign step type, key loading helper
- all steps in a run share one browser/page instance so wizard state persists
- add 'sign' step type: execCode is {keyId} and signs via EDS widget on current page
- extract AuthService.loadKeyDescriptor() to deduplicate key file parsing
- extend StepType, DTOs, and MCP enums to include 'sign'
2026-04-08 15:42:42 +03:00
ars9 eeece70866 refactor(config): derive APP_NAME and APP_VERSION defaults from package.json 2026-04-08 12:58:59 +03:00
ars9 8e62ad8b4e style(logging): clean up log format with ISO8601 timestamps and no PID prefix
- override getTimestamp() to emit ISO 8601 instead of locale string
- override formatMessage() to drop PID prefix and level padding
- enable timestamp: true so timestampDiff (+Nms) appears on each line
- pass TraceLogger instance to NestFactory so framework logs use same format
2026-04-08 12:57:28 +03:00
ars9 3367828c39 docs(mcp): replace @All with explicit POST/GET/DELETE and add OpenAPI descriptions
- restrict endpoint to spec-mandated HTTP methods only
- POST: JSON-RPC messages, responds with application/json or SSE
- GET: opens persistent SSE stream for server-to-client push
- DELETE: optional client-initiated session termination via Mcp-Session-Id
2026-04-08 12:30:07 +03:00
ars9 6fd991811f feat(logging): add trace ID propagation via AsyncLocalStorage
- add TraceInterceptor that reads x-trace-id header or generates a UUID
- add AsyncLocalStorage store in common/trace-context for request-scoped trace ID
- replace NestJS Logger with TraceLogger (extends ConsoleLogger) that injects trace ID into log context
- register TraceInterceptor globally before LoggingInterceptor
- move HealthController into HealthModule so global interceptors apply to /healthz
- omit body/response from log lines when empty or null
2026-04-08 12:20:06 +03:00
ars9 7f5a2bfe18 refactor(mcp): hoist McpServer to singleton, read name/version from package.json
- server instantiated once in constructor, tools registered once
- per-request transport created fresh and closed in finally to reset server state
- name and version sourced from package.json instead of hard-coded strings
2026-04-08 11:45:52 +03:00
ars9 f0437d9390 refactor(browser): make sessionName optional, add selector filter, deduplicate session setup
- sessionName is now optional in open/exec; skips session restore when omitted
- add selector param to open: returns outerHTML or textContent of matched element
- extract session restore logic into private setupSession() to remove duplication
- replace per-exception instanceof checks with single HttpException base class check
- embed label into InternalServerErrorException message instead of logging separately
- update MCP tool schemas and HTTP DTOs to reflect optional sessionName and new selector
- add integration tests: sessionless open/exec, selector, selector+readerMode
2026-04-08 11:10:08 +03:00
ars9 f1dadc602a feat(mcp): add helpers.dumpDom() to exec_code context
- new dom-helpers.ts exports dumpDom(page, selector?) that evaluates a
  browser-side tree walker returning a lean DomNode structure
- filters ignored tags (svg, script, path, etc.) and hidden elements
- captures role, data-testid, data-qa, data-action, data-element-id,
  id, type, name, href (relativized), checked, disabled, and text
- prunes single-child non-significant divs; discards empty non-sig nodes
- code-executor wraps dumpDom in a pageHelpers object passed as helpers
  param so user scripts can call helpers.dumpDom() or helpers.dumpDom('main')
- 29 unit tests covering all behaviours via fake DOM builder
2026-04-07 19:33:21 +03:00
ars9 ae8852d738 feat(auth): add login/password authentication strategy
- KeyDescriptor now accepts optional login field alongside keyFile
- when login is present, clicks login/password auth method, fills email+password fields, and submits
- file-key flow unchanged; validation ensures exactly one strategy is present
2026-04-07 19:33:08 +03:00
ars9 02630e4919 fix(browser): pass executablePath from env var in all chromium.launch() calls
- system Chromium path from PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH was not forwarded
  to the launch options, causing 'executable doesn't exist' errors in Docker
2026-04-07 18:02:33 +03:00
ars9 36f8b8c0ca feat(pagination): add generic typed pagination with ordering to all list endpoints
- add PaginationQueryDto<TOrderBy> generic with orderBy and orderDir fields
- add SessionOrderBy, EnvironmentOrderBy, ScenarioOrderBy type aliases
- update session, environment, scenario services and controllers to use typed pagination
- update MCP list_sessions, list_environments, list_scenarios tools to expose orderBy/orderDir
- update tests for all list endpoints to cover page, limit, ordering, and invalid param rejection
2026-04-07 17:54:23 +03:00
ars9 d9cdb64ee2 feat(mcp): add scenario tools and fix per-request server lifecycle
- add list_scenarios, get_scenario, create_scenario, update_scenario, delete_scenario
- add create_scenario_step, get_scenario_step, update_scenario_step, delete_scenario_step
- add list_scenario_runs, run_scenario
- import ScenarioModule into McpModule so ScenarioService is injectable
- move tool registration to private registerTools(server) method; create
  fresh McpServer per request in handle() to satisfy SDK one-connection rule
- fix mcp.controller.spec: parse SSE data line instead of res.body; assert
  exact status 200 everywhere; remove vague toBeLessThan(500) guards
2026-04-07 17:25:55 +03:00
ars9 00f310e899 test: add jest test suite with controller specs and mocks
- add jest, ts-jest, supertest, and related dev dependencies
- add test scripts (test, test:debug, test:watch) to package.json
- add jest.config.js with ts-jest transform and module name mappers
- add controller specs for auth, browser, environment, mcp, scenario, session
- add mocks for jsdom, playwright, and readability
- add test/tsconfig.json and exclude test dir from main tsconfig
2026-04-07 15:54:13 +03:00
ars9 cff36ffeff feat(scenario): add scheduler, cancelled step status, and runs list endpoint
- install @nestjs/schedule and register ScheduleModule in AppModule
- add ScenarioSchedulerService with two 1s interval jobs:
  - activatePendingRuns: flips pending runs to in_progress
  - processPendingStepRuns: executes next pending step run (login or exec),
    runs optional validateCode, advances or fails the run accordingly
- on step pass: next waiting step becomes pending; last step pass flips run to pass
- on step fail: remaining steps set to cancelled, run flipped to fail
- add cancelled to RunStepStatus union
- add GET /scenarios/:id/runs with pagination and optional ?status= filter
2026-04-07 14:51:37 +03:00
ars9 caf120741d feat(scenario): add scenario runs, run steps, and step ordering
- add ScenarioRunEntity (pending|in_progress|pass|fail) and ScenarioRunStepEntity (waiting|pending|in_progress|pass|fail)
- add POST /scenarios/:id/run — creates run with first step pending, rest waiting
- add order field to ScenarioStepEntity and ScenarioRunStepEntity for deterministic sequential execution
- findOne and createRun now sort steps/stepRuns by order ASC
2026-04-07 14:27:17 +03:00
ars9 d669bf1c59 feat(scenario): add scenario and scenario step CRUD module
- add ScenarioEntity and ScenarioStepEntity with cascade delete
- step fields: type (login|exec), sessionName (required), execCode, validateCode
- login steps create a named session; exec steps consume it by sessionName
- full CRUD controller under /scenarios and /scenarios/:id/steps
- paginated GET /scenarios with page/limit query params returning { data, total, page, limit }
- register ScenarioModule and entities in AppModule
2026-04-07 14:13:06 +03:00
ars9 5ac26ecb3a feat(observability): add exception filter, logging interceptor, and CodeExecutorModule
- add HttpExceptionFilter logging BadRequestException at warn and InternalServerErrorException at error with cause chain
- add LoggingInterceptor logging request/response pairs at debug level with method, path, body, status, and duration
- extract CodeExecutorService into standalone CodeExecutorModule imported by BrowserModule and McpModule
- thread { cause: err } into all catch blocks across auth, browser, and code-executor services
2026-04-07 13:49:02 +03:00
ars9 bf1b6249a9 feat(mcp): add MCP endpoint; fix TODOs (pkg.json name/version, NestJS Logger) 2026-04-07 13:20:15 +03:00
ars9 6f23c0f736 chore(docker): add Dockerfile, docker-compose.yaml, and .dockerignore 2026-04-07 13:06:33 +03:00
ars9 de48a912d4 feat(environment): add environment CRUD module and wire into auth login 2026-04-07 13:00:54 +03:00
ars9 49dd1aa14c feat(sessions): add GET /sessions and DELETE /sessions/:id endpoints 2026-04-07 12:44:08 +03:00
ars9 238ce0289c feat(auth): add GET /keys to list available key identifiers 2026-04-07 12:40:03 +03:00
ars9 9898fb6472 feat(browser): add POST /exec for custom Playwright code execution
- accepts sessionName, optional url, and arbitrary JS code string
- restores cookies and localStorage from session before execution
- exposes page and context to user code as async function arguments
- session not found now returns 404 instead of 400
2026-04-07 12:36:27 +03:00
ars9 9e5a813e9d feat(browser): add POST /open with session restore and reader mode
- restores cookies and localStorage from DB before page navigation
- readerMode flag extracts plain text via @mozilla/readability (Firefox reader engine)
- add localStorage default '{}' on session entity for clean schema migrations
2026-04-07 12:27:34 +03:00
ars9 41dbddd2a1 feat(auth): add POST /login with Playwright automation and SQLite session storage
- automates file-key login on the ID portal using Playwright/Chromium
- captures token, cookies, and localStorage after successful redirect
- stores session data in SQLite via TypeORM (better-sqlite3)
- sessions are keyed by sessionName (auto-generated UUID if not provided)
- login URL, cabinet redirect URL, keys dir, and DB path are all configurable via env
2026-04-07 12:07:13 +03:00
ars9 70f016d113 Initial commit 2026-04-07 11:36:33 +03:00