Commit Graph

72 Commits

Author SHA1 Message Date
john kevin asprec
f5e24d8921 feat: remove obsolete CI workflows and update documentation for new CI structure 2026-08-13 19:43:48 +08:00
john kevin asprec
2c00d2e431 feat(cli): add initial CLI implementation with argument parsing and prompt handling
Some checks failed
CI — Test & Build / Test & Build (pull_request) Has been cancelled
Preview — PR Build Check / PR Preview Build (pull_request) Has been cancelled
- Created package.json and package-lock.json for CLI package.
- Implemented argument parsing in args.ts to handle various flags and commands.
- Developed main CLI logic in cli.ts to execute commands and handle errors.
- Added configuration loading from a JSON file in config.ts, with environment variable support.
- Implemented prompt resolution and provider interaction in prompt.ts.
- Added usage documentation for the CLI.
- Configured TypeScript settings in tsconfig.json for the CLI package.
- Updated README in vscode package to reflect the new CLI functionality.
- Refactored root tsconfig.json to streamline project structure.
2026-08-13 19:19:42 +08:00
john kevin asprec
d63d698b57 feat: add popup and options pages for LexAI extension
- Created index.html for options page with basic structure.
- Implemented Popup component in Popup.tsx with state management for user input and actions.
- Added index.html for popup page with necessary scripts.
- Included various icon assets for the extension.
- Designed SVG icon for the extension with gradient background and lightning bolt.
- Added multiple screenshots for Chrome Web Store listing.
- Configured WXT for building the Chrome extension with manifest settings.
2026-08-13 19:16:54 +08:00
john kevin asprec
8bc529ef2d feat: add LexAI status bar and suggestion panel
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
- Implemented a status bar item for LexAI with dynamic status updates (ready, processing, notReady).
- Created a suggestion panel for displaying and interacting with AI-generated suggestions.
- Added functionality for accepting, regenerating, and discarding suggestions within the suggestion zone.
- Introduced configuration options for writing style, prompt patterns, personas, and formats.
- Integrated progress indicators for long-running tasks and improved user feedback.
- Established TypeScript configuration for the vscode package.
2026-08-13 18:06:45 +08:00
john kevin asprec
fc19ead0a7 feat: add documentation for release notes verification and workflow testing
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
2026-08-12 08:24:54 +08:00
john kevin asprec
2a2fecbfdd docs: add changelog-accuracy lesson and pre-tag eval
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
2026-08-12 07:54:03 +08:00
john kevin asprec
0207be46db Merge branch 'feat/update-prompt-builder-pattern'
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
release: v1.1.0 — Prompt Builder patterns + CHANGELOG-driven release notes
2026-08-12 07:51:27 +08:00
john kevin asprec
7adcb47584 release: v1.1.0 — prompt patterns, CHANGELOG-driven release notes
- Prompt Builder: 12 named patterns (Direct/Reasoning/Agentic + Auto), live
  per-pattern hints in popup and in-page dialog, legacy promptStyle migration,
  and a 2048-token floor fix so longer patterns stop getting truncated.
- CHANGELOG.md added (Keep a Changelog + SemVer); release.yml now builds the
  Gitea release body from the matching version section, with a generic
  fallback, plus a zip-root fix so manifest.json sits at the archive root.
- package.json/package-lock.json bumped to 1.1.0; CLAUDE.md documents the
  CHANGELOG-gated release process.
2026-08-12 07:51:15 +08:00
john kevin asprec
444060c3eb Add new agents and skills for enhanced project orchestration and review processes
- Introduced `critic`, an independent adversarial reviewer for security and correctness.
- Added `fable-orchestrator` to manage task routing and verification.
- Implemented `gauntlet-critic` for fresh-context evaluation of gauntlet rounds.
- Created `planner` for generating executable implementation plans with dependencies.
- Developed `security-auditor` for application security reviews and audits.
- Established `system-steward` to improve agent prompts and skills based on verified failures.
- Added `dev-loop` skill for autonomous development loops over repositories.
- Implemented `gauntlet-loop` skill for iterative quality benchmarking against reference standards.
- Updated project settings to utilize the new orchestrator agent.
- Created documentation for `GAUNTLET.md`, `PROGRESS.md`, and `REFERENCE_BAR.md` to track project status and quality benchmarks.
- Added detailed prompting style guide to enhance understanding of prompt patterns and agentic loops.
2026-08-08 16:49:07 +08:00
john kevin asprec
6aee260533 fix: never send an API key to the provider it wasn't entered for (v1.0.2)
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 1m33s
A stored key carried no record of which provider it belonged to. Options
saves {provider, model} without the key whenever the field is blank (which
it always is after a save, since it shows the encrypted badge instead), so
switching provider left the previous provider's key attached to the new one.
Every call then failed with that provider's own "Invalid API Key" while the
UI still showed a key as configured.

- types.ts: new `keyProvider` storage field, added to CONFIG_STORAGE_KEYS
- background.ts: keyProviderMismatch() guards the chat, COPY_AS and
  stored-key LIST_MODELS paths; absent keyProvider (pre-upgrade) is allowed
- Options.tsx: stamps keyProvider on every save; drops the encrypted badge
  and requires a new key when the saved one belongs to another provider or
  is rejected; save-time guard messages are now actually rendered (they were
  gated on modelsStatus === 'error' and never drew, so Save looked dead)
- providers.ts: providerLabel(); settings hint appended to 401/403 only;
  listModels reports keyRejected and labels errors with the display name
- Anthropic: send anthropic-dangerous-direct-browser-access on the chat path

Docs: CLAUDE.md version-bump rule corrected — wxt.config.ts reads
pkg.version, so package.json is the only place to edit.

typecheck clean, 58/58 tests, build clean (281.72 kB, manifest 1.0.2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 15:50:07 +08:00
john kevin asprec
d5a2f4a0be Implement code changes to enhance functionality and improve performance
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 1m18s
2026-07-15 18:23:29 +08:00
john kevin asprec
bda888b943 chore: Bump version to 1.0.1 in package.json and package-lock.json
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 1m17s
2026-07-15 16:25:54 +08:00
john kevin asprec
c2ca659a2b feat: Enhance project memory and skills documentation; add memory-sync skill for knowledge consolidation
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 1m15s
2026-07-15 16:01:13 +08:00
john kevin asprec
acea99d7ad feat: Implement Prompt Builder functionality in Popup and Options
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 39s
- Added a new "Prompt Builder" tab in the Popup for generating AI prompts with customizable parameters.
- Introduced new state variables for managing prompt styles, personas, formats, and models.
- Enhanced the Options page to fetch and display models based on the provided API key.
- Updated the actions and types to include the new 'prompt' action and its associated parameters.
- Implemented migration logic for legacy plaintext API keys to encrypted storage.
- Updated the getSystemPrompt function to incorporate prompt parameters for better instruction generation.
- Added tests for the new functionality, including context menu entries and prompt generation logic.
2026-07-15 15:27:41 +08:00
john kevin asprec
0fef9848cb chore: gitignore playwright test-results and temp verification files
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 11:02:12 +08:00
john kevin asprec
b7798047dc test: typecheck test files in CI; drop mock-only test; richer chrome mock
- typecheck now also runs tsc over tsconfig.test.json (test files were
  never type-checked before).
- Delete tests/unit/background.test.ts, which only asserted the vitest
  chrome mock's own behavior — every remaining test imports production
  code from src/lib.
- Baseline mock gains runtime.id, storage.session/remove, contextMenus,
  and tabs.sendMessage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:45:22 +08:00
john kevin asprec
d0c4cc947d refactor: declarative context-menu registry; named selection threshold
CONTEXT_MENU_ENTRIES maps every menu id to {action, style, parentId,
title}, replacing the split('-') id parsing that only worked because no
name contained a hyphen. Foreign menu ids are now ignored explicitly.
Parity pinned by tests enumerating all 30 previous ids. The 10-char
toolbar trigger threshold is now the named MIN_SELECTION_LENGTH.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:44:16 +08:00
john kevin asprec
f0962471b4 refactor: collapse 8 provider functions into one adapter table
src/lib/providers.ts holds a per-provider spec (url, headers, body,
extractor, default model) and a single callProvider() covering both the
action-prompt and custom-prompt families (~250 lines -> one path).
getSystemPrompt, fetchWithTimeout, and listModels move along with it;
background.ts drops from 553 to 130 lines.

Behavior pinned by 20 parity tests written from the old functions
(request shapes, headers, defaults, error strings). One deliberate
change: max_tokens now scales with input length (1024-8192) instead of
a hard-coded 1024, so Expand no longer truncates long selections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:42:39 +08:00
john kevin asprec
c4634d4965 refactor: consolidate API-key crypto into src/lib/crypto with compat tests
Encrypt (Options) and decrypt (background) now share one module; wire
format unchanged. Tests include fixtures proving values encrypted by the
old inline Options code still decrypt, plus tamper/wrong-key cases. The
module documents the honest threat model (key co-located with ciphertext
= obfuscation, not encryption).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:38:42 +08:00
john kevin asprec
47d9152bda refactor: single source for writing styles + action labels; add theme module
- src/lib/actions.ts: canonical ACTIONS/ACTION_LABELS/WRITING_STYLES;
  context-menu styles derived (WRITING_STYLES minus Default). Replaces
  the three duplicated style arrays in popup, content, and background.
- src/lib/theme.ts: canonical palette. Existing hex literals in the
  entrypoints are swapped wholesale when light/dark theming lands, so
  the color plumbing is only rewritten once.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:35:54 +08:00
john kevin asprec
324cfcc486 refactor: extract shared types + safe chrome wrappers into src/lib
- src/lib/types.ts: message contract (both ANALYZE_TEXT shapes preserved),
  config/response types, storage-key constants.
- src/lib/messaging.ts: single safeStorageGet/safeStorageSet/safeSendMessage/
  isExtensionValid implementation replacing the three divergent copies in
  Options, Popup, and content. Content script keeps its refresh-toast
  behavior via an onContextInvalidated callback.
- New '@lib' import alias (wxt force-overwrites '~' and '@' to srcDir, so
  those cannot point at ./src); wired in wxt.config, tsconfig, vitest.
- tests/unit/messaging.test.ts: 14 unit tests over the wrappers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:33:56 +08:00
john kevin asprec
04a4a2dc99 chore: remove unused deps, pin toolchain, single-source version, quarantine e2e
- Uninstall zustand, tailwindcss, autoprefixer, tweetnacl-util (all
  unused); README no longer advertises Tailwind/Zustand.
- Fix stale 'Tone' -> 'Explain' copy in Options.
- Add .nvmrc/engines/packageManager (Node 22 to match CI).
- wxt.config.ts reads manifest version from package.json so the two
  can never drift.
- Ignore *.zip build artifacts.
- Skip the two e2e specs with literal [EXTENSION_ID] placeholders
  (cannot pass; TODO references the e2e-ID-resolution task).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:26:51 +08:00
john kevin asprec
57bc3419fa fix(ci): test triggering ref on PRs, unify token secret, harden JSON parsing
- ci.yml: check out the PR head (or push SHA) instead of always cloning
  main; PR checks now test the actual diff. Drop http.sslVerify=false.
  Publish to the package registry only on push events.
- preview.yml/release.yml: use GITEATOKEN (GITEA_TOKEN is reserved by
  Gitea, so these token steps were silently broken).
- deploy-chrome.yml/release.yml: parse JSON with node instead of
  python3 (not installed in the container) and grep; fail loudly
  instead of swallowing errors with 2>/dev/null.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:26:36 +08:00
john kevin asprec
a5608e7b09 fix: gate content-script debug logging behind dev mode
Selection text substrings no longer reach the host page's console in
production builds; logs only fire under 'wxt' dev serve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 21:26:21 +08:00
john kevin asprec
f7fcd41341 feat: implement API key resolution and live model listing for providers
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 59s
2026-07-13 13:56:48 +08:00
50df1b5d93 chore: bump manifest version to 1.0.0 in wxt.config.ts
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 1m46s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Successful in 1m53s
Release — Package & Publish / Build & Package Release (push) Successful in 1m46s
v1.0.0
2026-03-11 09:37:44 +00:00
1fedaf4dfa fix: zip chrome-mv3 contents at root level + log manifest version
Some checks failed
CI — Test & Build / Test & Build (push) Successful in 1m20s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Failing after 1m18s
Release — Package & Publish / Build & Package Release (push) Successful in 1m13s
2026-03-11 08:42:39 +00:00
41b13e5b90 fix: use python3 to parse upload response (handles multiline JSON)
Some checks failed
CI — Test & Build / Test & Build (push) Successful in 1m41s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Failing after 1m7s
Release — Package & Publish / Build & Package Release (push) Successful in 1m5s
2026-03-11 08:21:28 +00:00
ecbab9c7ac fix: use python3 to parse OAuth2 token response (handles spaces in JSON)
Some checks failed
CI — Test & Build / Test & Build (push) Successful in 1m0s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Failing after 1m0s
Release — Package & Publish / Build & Package Release (push) Successful in 57s
2026-03-11 08:17:42 +00:00
229fac8a2c chore: bump version to 1.0.0
Some checks failed
CI — Test & Build / Test & Build (push) Successful in 59s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Failing after 49s
Release — Package & Publish / Build & Package Release (push) Successful in 50s
2026-03-11 08:09:49 +00:00
64c1e65dea ci: add Chrome Web Store deploy workflow
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 54s
2026-03-11 08:06:28 +00:00
a4580cd892 fix: use GITEATOKEN secret (GITEA_TOKEN is reserved by Gitea)
All checks were successful
CI — Test & Build / Test & Build (push) Successful in 52s
2026-03-06 22:44:49 +00:00
Forge
1239e5a90e fix: reduce Options page padding and margins - tighter form layout
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 50s
2026-03-06 15:57:31 +08:00
Forge
b0f79566e6 feat: LEXAI-15 writing style selector in modal, popup, and right-click menu
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 47s
2026-03-06 15:43:10 +08:00
Forge
2bc73d5fc9 feat: LEXAI-23 move Copy As + Download into More dropdown on toolbar
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 45s
2026-03-06 15:30:48 +08:00
Forge
1490e6641f feat: replace Tone Analysis with Explain - simplifies highlighted text in plain language
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 49s
2026-03-06 15:27:40 +08:00
Forge
107929c9e3 release: LEXAI-16 19 20 complete
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 44s
2026-03-06 15:25:53 +08:00
Forge
e3b4925ef5 feat: LEXAI-16 request timeout (fetchWithTimeout), LEXAI-19 Copy As, LEXAI-20 Download
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
2026-03-06 15:25:45 +08:00
Forge
209a26c09c fix: LEXAI-21 popup message type mismatch - use ANALYZE_TEXT to match background handler
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 45s
2026-03-06 15:21:06 +08:00
Forge
58b6728332 fix: popup configured check — also detect apiKeyEnc (encrypted key)
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 49s
2026-03-06 15:12:24 +08:00
Forge
88855ba53b release: LEXAI-11 12 13 complete
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 44s
2026-03-06 15:06:52 +08:00
Forge
0273356f4d feat: LEXAI-13 API encryption, LEXAI-11 context menu, LEXAI-12 tone analysis
- LEXAI-13: TweetNaCl secretbox encryption for API keys in Options + background
  - getOrCreateEncKey() generates per-device 32-byte key stored in chrome.storage.local
  - Keys saved as nonce+ciphertext (base64) under apiKeyEnc
  - Backward compat: falls back to plaintext apiKey if no encrypted key found
  - Lock icon 🔒 shown in Options label when key is encrypted
- LEXAI-11: Right-click context menu with Fix, Rephrase, Shorten, Expand, Tone
  - Registered via onInstalled in background service worker
  - Sends lexai-context-menu message to content script
  - Content script listener added at bottom of main()
- LEXAI-12: Tone analysis button added to floating toolbar (teal #2dd4bf)
  - Analysis-only: showModal called with null originalText = no Replace button
  - Tone system prompt updated to pure analysis (no rewrite)
2026-03-06 15:06:43 +08:00
Forge
004819472d release: LEXAI-21 popup with text input
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 42s
2026-03-06 15:01:40 +08:00
Forge
9604bef3a4 feat: LEXAI-21 popup text input with quick action buttons
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
2026-03-06 15:01:29 +08:00
Forge
ec3ece0ea1 fix: simplify contenteditable replace - restore selection + execCommand, no manual delete
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 47s
2026-03-06 14:45:34 +08:00
Forge
8d3887a0af fix: use execCommand insertText for contenteditable replace - fixes delete-without-paste bug
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 43s
2026-03-06 14:44:05 +08:00
Forge
132e8790dc release: build with definitive replace fix
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 44s
2026-03-06 14:37:01 +08:00
Forge
ec98bac146 fix: capture selection on toolbar button mousedown - definitive replace fix
Some checks failed
CI — Test & Build / Test & Build (push) Has been cancelled
Root cause (dual bugs):
1. SCOPE BUG: snapStart/snapEnd/snapElement/snapRange were local vars inside
   runAction() but showModal() is a sibling function — those snap vars were
   never in scope inside the Replace button handler. The condition always
   silently fell through, doing nothing.

2. TIMING BUG: Selection was only captured on document mouseup, which could
   race against focus changes when clicking the toolbar.

Fix:
- showModal() now accepts snapStart/snapEnd/snapElement/snapRange as explicit
  parameters — guaranteed in-scope, no closure ambiguity
- Each toolbar button mousedown calls captureForButton() BEFORE any focus
  shift can occur (belt-and-suspenders, works even if e.preventDefault fails)
- Added console.log debug lines to Replace handler and runAction snapshot
- selectionLocked reset on Escape and overlay click (was missing)
2026-03-06 14:36:48 +08:00
Forge
1936d6a7b5 fix: lock stored selection during modal - prevents mouseup from resetting on Replace click
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 44s
2026-03-06 14:15:41 +08:00
Forge
a3072dadfb fix: add timestamp to package version to prevent duplicate conflict
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 46s
2026-03-06 14:05:04 +08:00