Commit Graph
51 Commits
Author SHA1 Message Date
can1357 e831c2c758 chore: reformat 2026-05-30 18:08:51 +02:00
can1357 00bb61b054 feat(stats): added time-range-aware bucketing to model series charts
- Passed `bucketMs` to `getModelTimeSeries` and `getModelPerformanceSeries` so SQL bucketing matches the selected range.
- Added `range-meta.ts` to centralise bucket sizes, counts, tick formats, and labels per time range.
- Updated `ChartsContainer` and `ModelsTable` to use range-aware x-axis formatting and trend labels.
2026-05-17 02:15:37 +02:00
can1357 3061c47a32 chore: added robomp workspace, ignored fallow deps, cleaned up exports
- Added `python/robomp` as a workspace package alongside its nested `web` sub-package.
- Added `ignoreDependencies` in `.fallowrc.jsonc` for deps used via bin or in nested workspaces.
- Removed unused `clearTriggerStatus` export and unexported `tick` and `ByModelToggle`.
2026-05-17 01:44:13 +02:00
can1357 8499149627 fix(stats): scan service-tier prefix without materializing entries
parseSessionFile(fromOffset) still recovers the active service tier from the already-ingested prefix, but now scans only for service_tier_change entries and keeps a single current tier value instead of materializing every prefix entry. This preserves incremental sync memory behavior for large sessions.
2026-05-15 18:31:12 +02:00
can1357 be0d9d3e6c fix(stats): preserved service-tier across incremental parseSessionFile offsets
Stats sync depends on service_tier_change entries to derive priority premium requests since 69043d307 stopped folding priority-tier into per-message premiumRequests. parseSessionFile(path, fromOffset) initialized currentServiceTier to undefined per call, so an incremental resume past the tier change attributed subsequent priority OpenAI replies with premiumRequests: 0. When fromOffset > 0, parseSessionFile now replays bytes[0..start] purely to seed currentServiceTier from the latest service_tier_change before parsing the unprocessed tail. Bytes are already loaded, so no extra I/O.
2026-05-15 17:49:49 +02:00
can1357 f8ea641cdb fix(stats): ignored messages without IDs when parsing session entries
- Added message-ID checks in both assistant and user message parsers so entries without valid ids are ignored.
- This filtering prevents legacy, unlinked message records from being treated as parseable assistant or user messages.
2026-05-15 01:09:26 +02:00
can1357 f1f6516056 refactor: reorganized exports and removed obsolete helper branches
- Removed export leakage by demoting many helper and const symbols to module-local scope.
- Renamed underscore-prefixed internals and cache fields, then updated related references and `satisfies never` checks.
- Deleted obsolete logic branches and helpers, including harmony-stream interruption flow and unused benchmark runtime helpers.
- Updated Biome config and manifests by broadening lint coverage and removing an unused `@napi-rs/cli` dev dependency.
- Adjusted tests and utilities to use renamed test helpers and remove redundant private test-only helpers/locals.
2026-05-14 04:36:19 +02:00
can1357 334b6782a5 feat(stats): counted priority service-tier traffic as premium requests in usage stats
- Added `getPriorityPremiumRequests` and used it in OpenAI and OpenAI Codex providers to increment `usage.premiumRequests` when `serviceTier: "priority"` was sent.
- Combined Copilot and priority premium counts in OpenAI completions and responses usage parsing so emitted usage uses the merged premium total.
- Updated stats parsing/backfill to re-read `service_tier_change` entries and UPSERT only `premium_requests`, so historical sessions pick up priority traffic without mutating other metrics.
2026-05-13 11:31:51 +02:00
can1357 e8e2f2cd83 fix(stats): preserve pending behavior backfills 2026-05-12 16:41:28 +02:00
can1357 b468bd5abd feat(stats): show input and output token totals 2026-05-12 16:40:43 +02:00
can1357 1cb451a071 fix(workers): replaced file-URL import pattern with compiled-binary-aware spawn
- Replaced `with { type: "file" }` worker imports with `isCompiledBinary()` hybrid: literal string for `--compile` static analysis, `new URL(import.meta.url)` for dev portability.
- Added worker entrypoints as explicit `--compile` args in `build-binary.ts` so Bun emits them into bunfs.
- Added `smokeTestSyncWorker` and `omp --smoke-test` to catch silent worker-load failures in compiled binaries (fixes #1011, #1027).
- Added `isCompiledBinary()` utility to `@oh-my-pi/pi-utils` detecting bunfs path markers.
2026-05-12 16:40:15 +02:00
can1357 f56cbbf4c6 feat(stats): added frustration metrics to stats parser and charting
- Added new frustration and revised behavior metrics across stats types, parser mappings, and UI charts.
- Reworked session sync to fan out parsing across a capped worker pool with SyncOptions progress callbacks.
- Added worker-based parse messaging and throttled TTY progress rendering in the stats sync command.
- Updated behavior scoring to strip structured content, ignore noisy prompts, and fix profanity boundary regressions.
- Expanded user message schema and migrations, then repaired assistant model/provider links during sync backfill.
- Updated worker-import guidance in AGENTS.md and recorded sync-progress/metrics updates in package changelogs.
2026-05-12 07:55:23 +02:00
can1357 a4d86a075a feat(coding-agent): added verbatim unicode rule to hashline prompt 2026-05-12 05:25:55 +02:00
can1357 770f175795 feat(stats): added user-message behavior metrics parsing and storage
- Added user-message behavior metric extraction and parsing for yelling/profanity/drama counts.
- Added behavior persistence and aggregate reads by extending syncSessionFile, DB schema, and query APIs.
- Added behavior dashboard support with new shared types, /api/stats/behavior route, and client views.
- Changed cost summary/chart rendering by removing per-chart 14/30/90-day filters and trend card behavior.
- Added tests for computeUserMessageMetrics edge cases like empty text, case, thresholds, and punctuation.
- Moved tailwindcss from devDependencies to dependencies for shared client styling usage.
2026-05-11 03:41:02 +02:00
can1357 c462fdf034 feat(stats): added stats range params, selectors, and all-range cutoff
- Added optional time-range parameters to stats API endpoints and client requests.
- Added dashboard time-range selector controls and wired range updates to stats refresh.
- Implemented range normalization and cutoff calculation for dashboard stat aggregation.
- Updated DB queries to support optional cutoffs and unlimited mode for `range=all`.
- Added tests for 24h, 7d, all, and unknown-range fallback filtering behavior.
2026-05-11 02:30:22 +02:00
can1357 c751b9c4d5 fix(stats): resolved stats openai-codex cost fallback to OpenAI rates
- Updated Codex model pricing data to include non-zero input/output/cacheRead rates.
- Added generate-models fallback to copy billable OpenAI costs into bundled openai-codex models.
- Added catalog-cost helpers to fallback openai-codex pricing to openai and compute token totals.
- Added regression tests for openai-codex cost parity and db backfill, and documented the fix in changelog.
2026-04-28 18:12:05 +02:00
can1357 143cf7ee45 refactor(stats/client): typed bar label plugin with explicit bar plugin type
- Added an explicit `Plugin` type import to the cost chart component.
- Updated `makeBarLabelPlugin` to return `Plugin<"bar">` for clearer Chart.js typing.
2026-04-24 07:22:24 +02:00
Christoph Grossandcan1357 cfb5d40f6f feat(stats): add daily cost chart tab to omp stats dashboard
- New Costs tab with bar chart (All Models) and line chart (By Model)
- Toggle between 14d / 30d / 90d time ranges, filtered client-side
- Bar chart shows cost value on top of each bar
- Line chart uses straight lines with always-visible data points
- Summary cards: total 30d cost, avg/day, top model, trend vs prior period
- Backend: getCostTimeSeries() query grouped by day x model x provider
- All cost values displayed as whole dollar amounts (Math.round)
2026-04-24 06:51:23 +02:00
can1357 52719d1a7c refactor: restructured monorepo TypeScript config and build tasks for unified setup
- Migrated all package tsconfig files to extend tsconfig.workspace.json for unified TypeScript configuration across monorepo.
- Consolidated build and check scripts across 10+ packages to use biome for linting/formatting with separate type checking via tsgo.
- Renamed build scripts from build:native and build:binary to build for simplified command naming across packages/natives and packages/coding-agent.
- Refactored CI workflow to invoke bun tasks instead of inline shell scripts, reducing workflow complexity by 40+ lines.
- Removed sync-exports.ts and repro-stuck.ts scripts; deleted path aliases from tsconfig.base.json in favor of workspace-based configuration.
- Updated turbo.json with new task definitions (check:types, lint, fmt, fix) and removed build:native/embed:native tasks.
2026-04-08 17:05:20 +02:00
Miroslav Drbalandcan1357 dc98266281 feat: add marketplace auto-update with background catalog refresh
- Add marketplace.autoUpdate setting (off/notify/auto, default notify)
- Background catalog refresh on startup when stale (>24h)
- /marketplace upgrade [name@marketplace] slash command
- omp plugin upgrade CLI command
- checkForUpdates, upgradePlugin, upgradeAllPlugins, refreshStaleMarketplaces
- Semver-aware version comparison with non-semver fallback
- 10 new tests for auto-update methods
2026-03-30 13:44:53 +02:00
can1357 5ee777b234 feat(stats): added lenient JSONL parsing to handle malformed session entries
- Introduced parseSessionEntriesLenient function that skips over malformed JSON lines and continues parsing valid entries. Updated parseSessionFile to use lenient parsing instead of throwing on parse errors. Updated getSessionEntry to use lenient parsing for robustness when reading session files.

Fixes #273
2026-03-03 19:40:47 +01:00
maximharandGitHub 7ea7b53783 feat(copilot): track premium requests with model multipliers (#255)
* Track Copilot premium requests with model multipliers

* refactor(copilot): source premium multipliers from models.json

* feat(copilot): add gpt-5.3-codex bundled model

* fix(stats): round premium request totals in summary

* fix(stats): round premium requests in sync summary
2026-03-03 03:26:00 +01:00
Corentin AZAISandGitHub adeb778404 fix(stats): include subtask session files in usage stats (#256)
listSessionFiles() only performed a flat readdir, missing subtask JSONL
files nested inside artifact subdirectories. Switch to recursive readdir
to discover .jsonl files at any depth.

Also fix extractFolderFromPath() to derive the project folder via
path.relative from the sessions root instead of regex on basename, which
returned the artifact directory name for nested paths.

Fixes #250
2026-03-03 03:23:38 +01:00
can1357 4ae3568947 Merge branch 'fix/gemini-429-rotation' 2026-03-01 15:45:21 +01:00
n24q02m 06e25f0952 fix: revert aggressive rate limit rotation (Option A) 2026-03-01 17:58:26 +07:00
ravshansboxandGitHub 9e7a423cb2 fix(stats): follow system light/dark theme (#219) 2026-02-28 16:16:36 +01:00
can1357 a83175c94c refactor: migrated imports to unified package root and consolidated skill discovery logic
- Consolidated @oh-my-pi/pi-utils subpath imports into single package root import across 100+ files.
- Moved tryParseJson utility from local web scrapers module to @oh-my-pi/pi-utils package for centralized JSON parsing.
- Renamed loadSkillsFromDir to scanSkillsFromDir and refactored skill discovery to use fs.promises.readdir instead of glob-based approach.
- Replaced custom parseJSON with tryParseJson across discovery modules for consistent error handling.
- Removed emitCustomToolSessionEvent method and cleanupSshResources function, consolidating shutdown logic into dispose method.
- Updated glob pattern construction to use GlobBuilder with literal_separator(true) for improved path handling.
2026-02-23 20:59:17 +01:00
can1357 2a35d016fd style(coding-agent): reformatted imports and array literals for consistency
- Reformatted import statements and array literal for consistency.
2026-02-22 15:34:51 +01:00
can1357 3bbced9b83 feat: added canonical model ID support to GitLab Duo with fallback
- Enhanced GitLab Duo model mapping to support canonical model IDs with fallback lookup.
- Simplified Anthropic auth resolution from 4-tier to 3-tier priority system.
- Fixed artifact manager cache invalidation by validating session file before reuse.
- Improved JSONL parsing in stats package with streaming parser and error handling.
2026-02-22 11:23:32 +01:00
can1357 abf8c1efc9 refactor: unslop common utilities 2026-02-22 11:01:11 +01:00
can1357 9dbf13513a refactor(stats): restructured embedded client archive
- Migrated embedded client archive from base64 constant to lazy-loaded text file for reduced bundle size.
- Refactored extractEmbeddedClientArchive() to accept archiveBytes parameter, decoupling archive loading from extraction logic.
- Optimized getLatestMtime() to use parallel Promise.allSettled() instead of sequential awaits for improved performance.
- Replaced Buffer.from().toString('base64') with btoa() for base64 encoding in clipboard module.
2026-02-22 01:02:25 +01:00
can1357 643eb12df6 fix(coding-agent): correct omp-stats subpath imports for tarball installs 2026-02-21 16:59:37 +01:00
can1357 02eb7072e6 fix(stats): avoided bundling lightningcss in compiled builds 2026-02-16 19:54:24 +01:00
can1357 bc8f4c4c91 chore(stats): updated Tailwind CSS to use @tailwindcss/node package with simplified config
- Updated Tailwind CSS import from 'tailwindcss' to '@tailwindcss/node' package.
- Added '@tailwindcss/node' version 4 as a dependency in package.json.
- Simplified Tailwind compiler configuration by replacing custom loadStylesheet handler with onDependency callback.
2026-02-16 18:33:05 +01:00
can1357 79cfe855c9 feat: enhanced glob patterns, symlink handling, and Tailwind CSS compilation
- Added `recursive` option to GlobOptions to control whether simple glob patterns match recursively by default (true).
- Changed glob pattern behavior to always apply recursive matching for simple patterns instead of requiring explicit `**/` prefix.
- Improved symlink handling in glob file type filters to resolve symlink targets and match based on their actual type (file/dir).
- Enhanced skill discovery in coding-agent to use dual-pass glob approach with deduplication and improved extension module detection.
- Implemented dynamic Tailwind CSS compilation in stats package by extracting actual class names from source files instead of building with empty candidates.
- Refactored Tailwind stylesheet imports to use centralized `tailwindcss/index.css` import with custom stylesheet loader callback.
2026-02-15 14:15:04 +01:00
can1357 fec2c04311 chore(monorepo): refreshed deps, migrated stats to tailwind v4, and improved discovery
- Updated dependency versions across root, ai, coding-agent, stats, and tui packages.
- Pinned @sinclair/typebox to 0.34.48.
- Migrated stats Tailwind build from PostCSS plugin usage to Tailwind v4 compile() API and emitted a standalone styles.css.
- Switched discovery helpers to native glob scanning for faster gitignore-aware file/module discovery.
- Added startup timing markers around model selection and skill discovery in sdk initialization.
2026-02-15 13:56:40 +01:00
can1357 c060e8fa7c refactor(stats/client): replaced colors
- Improved provider display logic to conditionally show provider suffix only when multiple providers exist for the same model.
2026-02-15 07:29:13 +01:00
can1357 35aa15ae94 fix(stats): generated tar bundle for compiled dashboard assets
Generate a tar.gz bundle from stats dist/client during binary builds, embed it into the compiled binary, and extract/serve it at runtime in compiled mode instead of reading //root/client directly.

Updated CI and build:binary flow to generate/reset the embedded bundle around compilation.

Fixes #61
2026-02-15 07:23:40 +01:00
can1357 c305872ddc feat(coding-agent): added real-time OAuth provider authentication validation with status indicators
- Added real-time OAuth provider authentication validation with visual status indicators (checking, valid, invalid).
- Added `validateAuth` and `requestRender` options to OAuthSelectorComponent for custom authentication validation and UI refresh callbacks.
- Changed OAuth provider selector to display live authentication status instead of static login state.
- Updated logout flow to refresh OAuth provider authentication state before showing selector.
2026-02-13 18:33:21 +01:00
can1357 fcd7ff4f84 refactor(dirs): centralized directory path utilities into @oh-my-pi/pi-utils/dirs module
- Extracted directory path utilities from multiple packages into a centralized '@oh-my-pi/pi-utils/dirs' module.
- Moved 30+ path helper functions (getAgentDir, getConfigRootDir, getPluginsDir, getMCPConfigPath, etc.) from scattered locations into a single shared utility module.
- Consolidated APP_NAME, CONFIG_DIR_NAME, and VERSION constants into the centralized dirs module for reuse across packages.
- Updated 70+ import statements across packages/ai, packages/coding-agent, packages/stats, and packages/tui to use the new centralized module.
- Removed local path construction logic and replaced with utility function calls for improved maintainability and consistency.
- Deleted packages/coding-agent/src/extensibility/plugins/paths.ts as its functions were moved to the centralized dirs module.
2026-02-13 15:06:05 +01:00
can1357 ae90d80cfe fix(stats): skip malformed JSONL lines during session sync 2026-02-13 12:39:14 +01:00
can1357 acf8ab5225 style: stylistic changes 2026-02-10 07:39:39 +01:00
can1357 1f7c4f6f90 refactor(stream-parsing): restructured stream utilities to use Web standard APIs and generic SSE parsing
- Refactored SSE stream parsing to use generic `readSseJson` utility instead of domain-specific handlers across multiple packages.
- Migrated from Node.js Buffer API to Web standard APIs (Uint8Array, TextDecoder, DataView) for cross-platform compatibility.
- Simplified stream transformation pipeline by consolidating multiple stream operations into unified `createTextLineSplitter` utility.
- Refactored `ptree.ts` to remove complex stream pumping infrastructure and simplify stderr handling with direct async iteration.
- Rewrote stream utilities to operate at binary level with byte-level parsing for improved efficiency and reduced string allocations.
- Updated TypeScript configuration to include DOM.AsyncIterable type definitions for async iterable DOM API support.
2026-02-05 10:59:47 +01:00
can1357 edf603d1d8 feat(stats): added model time series metrics and enhanced dashboard with performance analytics
- Added model-specific time series and performance metrics to dashboard statistics API.
- Added new ModelTimeSeriesPoint and ModelPerformancePoint types for tracking model usage and performance over time.
- Implemented getModelTimeSeries and getModelPerformanceSeries database queries to retrieve daily model metrics.
- Enhanced dashboard UI with expandable model statistics table showing inline sparklines and detailed performance charts.
- Added Model Preference stacked area chart visualizing request share distribution across models over 14 days.
- Implemented incremental build logic in server to only rebuild client when source files are modified.
2026-02-04 03:51:21 +01:00
can1357 5f46437f70 feat(stats/client): added model statistics table and TTFT/throughput metrics to stats dashboard
- Added ModelStatsTable component to display model statistics with columns for model, provider, requests, cost, tokens, throughput, and error rate.
- Added 'models' tab to stats dashboard for viewing aggregated model performance metrics.
- Added TTFT (Time to First Token) metric display in request details and overview statistics.
- Added Tokens/s (throughput) metric calculation and display in request list and model statistics.
- Improved code formatting and accessibility by adding semantic HTML attributes (type='button', role, aria-modal) and reformatting style objects for readability.
- Refactored loadData function to use useCallback hook for better performance optimization.
2026-01-28 13:35:46 +01:00
can1357 d9a3291641 feat(deps): replaced external JSON/JSONL and text utilities with Bun built-in APIs
- Replaced external JSON/JSONL parsing libraries with Bun's built-in JSON5 and JSONL APIs across all packages.
- Removed dependencies: json5, ndjson, get-east-asian-width, json-stringify-safe, split2, through2, and @types/ndjson.
- Replaced custom text width and ANSI wrapping implementations with Bun.stringWidth() and Bun.wrapAnsi() APIs.
- Updated Bun type definitions from ^1.2.17 to ^1.2.18 and bun-types from ^1.3.5 to ^1.3.7.
- Refactored JSONL parsing throughout codebase to use Bun.JSONL.parse() and Bun.JSONL.parseChunk() with improved buffer management and error handling.
- Updated test assertions to use Bun.stringWidth() for dynamic width calculations instead of hardcoded values.
2026-01-27 19:18:58 +01:00
can1357 779ca4872b style(deps): migrated from Prettier to Biome and updated formatting rules
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome.
- Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'.
- Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock.
- Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters.
- Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
2026-01-24 04:20:19 +01:00
can1357 51d39e7eea refactor(imports): migrated node module imports to namespace imports
- Converted named imports from node modules (fs, path, os) to namespace imports across all packages.
- Extended extension loader error handling with isEacces and hasFsCode type guards.
2026-01-24 03:37:59 +01:00
can1357 e22d123009 refactor(fs): migrated remaining sync file operations to async
- Converted readdirSync, readFileSync, and statSync to async readdir, readFile, stat across skills and agent discovery.
- Made scanDirectoryForSkills async and refactored custom directory scanning to use Promise.all for concurrent processing.
- Updated agent discovery to use fs/promises for async file reading and refactored helper patterns.
- Added AgentParsingError exception class for better error handling during agent parsing.
- Added filesystem error type guards (isEnoent, isEacces, isPerm, etc.) to pi-utils for safe error checking.
- Added color manipulation utilities to pi-utils for accessibility features.
- Added color-blind mode setting to settings manager.
- Migrated plugins, settings, and config modules from sync to async file operations.
- Updated error handling to use new pi-utils type guards for type-safe checking.
2026-01-24 03:18:03 +01:00
can1357 f66e5dba9b build(config): refactored build and TypeScript configuration with Bun loaders
- Removed WASM generation script; use Bun `wasm?raw` loader for imports.
- Added bunfig.toml with loaders for `.md`, `.py`, and `.wasm?raw` text imports.
- Added types/assets/index.d.ts for global TypeScript module declarations.
- Unified TypeScript configuration with tsgo-based checking across monorepo.
- Removed build and WASM steps from install and publish pipelines.
2026-01-24 00:03:52 +01:00