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.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { defineContentScript } from 'wxt/utils/define-content-script';
|
||||
import { isExtensionValid, safeSendMessage } from '@lib/messaging';
|
||||
import { MIN_SELECTION_LENGTH, WRITING_STYLES, PROMPT_STYLES, PROMPT_PERSONAS, PROMPT_FORMATS } from '@lib/actions';
|
||||
import { MIN_SELECTION_LENGTH, WRITING_STYLES, PROMPT_PATTERNS, PROMPT_PERSONAS, PROMPT_FORMATS, resolvePromptPattern } from '@lib/actions';
|
||||
|
||||
export default defineContentScript({
|
||||
matches: ['<all_urls>'],
|
||||
@@ -654,11 +654,6 @@ export default defineContentScript({
|
||||
header.appendChild(closeX);
|
||||
panel.appendChild(header);
|
||||
|
||||
const hint = document.createElement('div');
|
||||
hint.textContent = '"Auto" lets it decide from your selected text.';
|
||||
Object.assign(hint.style, { fontSize: '11px', color: '#6c7086', marginBottom: '10px' });
|
||||
panel.appendChild(hint);
|
||||
|
||||
const selectStyle = {
|
||||
flex: '1', background: 'rgba(49,50,68,0.95)', border: '1px solid rgba(205,214,244,0.2)',
|
||||
borderRadius: '6px', color: '#cdd6f4', fontSize: '12px', padding: '5px 8px',
|
||||
@@ -670,19 +665,50 @@ export default defineContentScript({
|
||||
Object.assign(row.style, { display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '8px' });
|
||||
const label = document.createElement('span');
|
||||
label.textContent = labelText;
|
||||
Object.assign(label.style, { fontSize: '12px', color: '#a6adc8', width: '58px', flexShrink: '0' });
|
||||
Object.assign(label.style, { fontSize: '12px', color: '#a6adc8', width: '64px', flexShrink: '0' });
|
||||
row.appendChild(label);
|
||||
row.appendChild(control);
|
||||
panel.appendChild(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
function makeSelect(options: readonly string[]): HTMLSelectElement {
|
||||
// Plain flat-list select (Persona/Format), or a grouped select (Pattern)
|
||||
// when `grouped` is true — 'auto' renders first as a bare option, then
|
||||
// one <optgroup> per PROMPT_PATTERNS group.
|
||||
function makeSelect(options: readonly string[]): HTMLSelectElement;
|
||||
function makeSelect(options: typeof PROMPT_PATTERNS, grouped: true): HTMLSelectElement;
|
||||
function makeSelect(options: readonly string[] | typeof PROMPT_PATTERNS, grouped?: true): HTMLSelectElement {
|
||||
const sel = document.createElement('select');
|
||||
sel.setAttribute('data-lexai', 'true');
|
||||
Object.assign(sel.style, selectStyle);
|
||||
options.forEach((o) => {
|
||||
|
||||
if (grouped) {
|
||||
const defs = options as typeof PROMPT_PATTERNS;
|
||||
const addOption = (parent: Element, p: (typeof PROMPT_PATTERNS)[number]) => {
|
||||
const opt = document.createElement('option');
|
||||
opt.setAttribute('data-lexai', 'true');
|
||||
opt.value = p.id;
|
||||
opt.textContent = p.label;
|
||||
opt.title = p.hint;
|
||||
parent.appendChild(opt);
|
||||
};
|
||||
const auto = defs.find((p) => p.id === 'auto');
|
||||
if (auto) addOption(sel, auto);
|
||||
(['Direct', 'Reasoning', 'Agentic'] as const).forEach((group) => {
|
||||
const inGroup = defs.filter((p) => p.id !== 'auto' && p.group === group);
|
||||
if (inGroup.length === 0) return;
|
||||
const optgroup = document.createElement('optgroup');
|
||||
optgroup.setAttribute('data-lexai', 'true');
|
||||
optgroup.label = group;
|
||||
inGroup.forEach((p) => addOption(optgroup, p));
|
||||
sel.appendChild(optgroup);
|
||||
});
|
||||
return sel;
|
||||
}
|
||||
|
||||
(options as readonly string[]).forEach((o) => {
|
||||
const opt = document.createElement('option');
|
||||
opt.setAttribute('data-lexai', 'true');
|
||||
opt.value = o;
|
||||
opt.textContent = o;
|
||||
sel.appendChild(opt);
|
||||
@@ -690,8 +716,21 @@ export default defineContentScript({
|
||||
return sel;
|
||||
}
|
||||
|
||||
const selPromptStyle = makeSelect(PROMPT_STYLES);
|
||||
makeRow('Style:', selPromptStyle);
|
||||
const selPattern = makeSelect(PROMPT_PATTERNS, true);
|
||||
makeRow('Pattern:', selPattern);
|
||||
|
||||
const patternHint = document.createElement('div');
|
||||
patternHint.setAttribute('data-lexai', 'true');
|
||||
Object.assign(patternHint.style, {
|
||||
fontSize: '11px', color: '#6c7086', margin: '2px 0 8px 72px',
|
||||
minHeight: '28px', lineHeight: '1.3',
|
||||
});
|
||||
panel.appendChild(patternHint);
|
||||
const updatePatternHint = () => {
|
||||
patternHint.textContent = PROMPT_PATTERNS.find((p) => p.id === selPattern.value)?.hint ?? '';
|
||||
};
|
||||
selPattern.addEventListener('change', updatePatternHint);
|
||||
updatePatternHint();
|
||||
|
||||
const selPersona = makeSelect(PROMPT_PERSONAS);
|
||||
makeRow('Persona:', selPersona);
|
||||
@@ -720,9 +759,10 @@ export default defineContentScript({
|
||||
|
||||
// Prefill from saved settings, then fetch the model list.
|
||||
chrome.storage.local.get(
|
||||
['promptStyle', 'promptPersona', 'customPersona', 'promptFormat', 'promptModel'],
|
||||
['promptPattern', 'promptStyle', 'promptPersona', 'customPersona', 'promptFormat', 'promptModel'],
|
||||
(saved) => {
|
||||
if (saved.promptStyle) selPromptStyle.value = saved.promptStyle as string;
|
||||
selPattern.value = resolvePromptPattern(saved.promptPattern as string | undefined, saved.promptStyle as string | undefined);
|
||||
updatePatternHint();
|
||||
if (saved.promptPersona) {
|
||||
selPersona.value = saved.promptPersona as string;
|
||||
customRow.style.display = selPersona.value === 'Custom…' ? 'flex' : 'none';
|
||||
@@ -771,7 +811,7 @@ export default defineContentScript({
|
||||
// Persist selections (shared with the popup), then run — the background
|
||||
// reads these same keys for prompt requests without explicit params.
|
||||
chrome.storage.local.set({
|
||||
promptStyle: selPromptStyle.value,
|
||||
promptPattern: selPattern.value,
|
||||
promptPersona: selPersona.value,
|
||||
customPersona: customInput.value,
|
||||
promptFormat: selFormat.value,
|
||||
|
||||
Reference in New Issue
Block a user