mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 14:16:28 +03:00
Carved out of #371, minus progressive publication. Everything here works against real project source the way main's Live already does: the agent writes variants into the file the browser loaded, HMR fires, Accept promotes and carbonizes. Nothing is staged anywhere. Poll lanes. Events now carry an explicit priority: accept/discard/exit ahead of manual_edit_apply/steer/carbonize_cleanup ahead of generate. A long generate can no longer sit in front of the Accept the user just clicked. leaseEvent claims its lease before awaiting, so a slow prepare cannot hand the same event to two pollers. Source locks. A per-file mutex around every accept and discard path, keyed on a digest of the absolute path. Staleness is decided by owner-pid liveness rather than mtime, so a wedged lock clears when its owner dies instead of after an arbitrary timeout, and a slow-but-live accept is never stolen from. Only the owning process can release a lock. Preflight scaffolding. The server runs live-wrap (or live-insert) before the poll returns and hands the result back as event.scaffold. That walk is measured at ~7.6s on a large repo; moving it off the agent's critical path removes a deterministic tool round trip without touching the generated design. Falls back cleanly to the agent running the helper itself. Vue previews. previewMode: "vue-component" for Nuxt/Vue targets, matching the existing Svelte component path: variants compile as real SFCs from a dev-only directory so the route is never rewritten during generation, and Vite mounts them without invalidating page state. Accept is the only route write. Includes a Vue attr tokenizer that normalizes shorthand bindings (@x, :x, #x) to their canonical forms. Accept hardening. Every thrown failure now returns mode: 'error' rather than an ambiguous unhandled result, so a real failure is never classified as a deliberate manual handoff and silently dropped. The marker search skips node_modules/.git/dist/build/.impeccable. Shared CLI arg parsing extracted to scripts/lib/cli-args.mjs. Assisted-by: Claude Code
126 lines
4.2 KiB
JavaScript
126 lines
4.2 KiB
JavaScript
/**
|
|
* Provider configurations for the transformer factory.
|
|
*
|
|
* Each config specifies:
|
|
* - provider: key into PROVIDER_PLACEHOLDERS (e.g. 'claude-code')
|
|
* - configDir: dot-directory name (e.g. '.claude')
|
|
* - displayName: human-readable name for log output (e.g. 'Claude Code')
|
|
* - providerTags: markdown block tags kept for this target (e.g. <codex>...</codex>)
|
|
* - frontmatterFields: which optional fields to emit beyond name + description
|
|
* - bodyTransform: optional function (body, skill) => transformed body
|
|
*/
|
|
export const PROVIDERS = {
|
|
cursor: {
|
|
provider: 'cursor',
|
|
providerTags: ['cursor'],
|
|
configDir: '.cursor',
|
|
displayName: 'Cursor',
|
|
frontmatterFields: ['license', 'compatibility', 'metadata'],
|
|
emitHooks: 'cursor',
|
|
// Cursor reads `.cursor/hooks.json`, not `.cursor/hooks/hooks.json`.
|
|
hooksManifestRel: 'hooks.json',
|
|
},
|
|
'claude-code': {
|
|
provider: 'claude-code',
|
|
providerTags: ['claude-code', 'claude'],
|
|
configDir: '.claude',
|
|
displayName: 'Claude Code',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata', 'allowed-tools'],
|
|
agentFormat: 'claude-md',
|
|
emitHooks: 'claude',
|
|
// Project-local Claude Code hooks live in `.claude/settings.json`.
|
|
hooksManifestRel: 'settings.json',
|
|
},
|
|
gemini: {
|
|
provider: 'gemini',
|
|
providerTags: ['gemini'],
|
|
configDir: '.gemini',
|
|
displayName: 'Gemini',
|
|
frontmatterFields: [],
|
|
},
|
|
codex: {
|
|
provider: 'codex',
|
|
providerTags: ['codex'],
|
|
configDir: '.codex',
|
|
displayName: 'Codex',
|
|
frontmatterFields: [],
|
|
writeOpenAIMetadata: true,
|
|
// No agentFormat: the Codex subagent ships nested inside the skill's own
|
|
// agents/ folder (see CODEX_SKILL_PROVIDERS in factory.js), which Codex
|
|
// auto-discovers on install. No top-level .codex/agents/ sidecar is emitted.
|
|
emitHooks: 'codex',
|
|
// Codex discovers project-local hooks at `.codex/hooks.json`.
|
|
hooksManifestRel: 'hooks.json',
|
|
},
|
|
agents: {
|
|
provider: 'agents',
|
|
providerTags: ['agents', 'codex'],
|
|
configDir: '.agents',
|
|
displayName: 'Codex Repo Skills',
|
|
placeholderProvider: 'codex',
|
|
frontmatterFields: [],
|
|
writeOpenAIMetadata: true,
|
|
},
|
|
github: {
|
|
provider: 'github',
|
|
providerTags: ['github'],
|
|
configDir: '.github',
|
|
displayName: 'GitHub Copilot',
|
|
placeholderProvider: 'agents',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata'],
|
|
emitHooks: 'github',
|
|
// GitHub Copilot discovers repo-level hooks under `.github/hooks/*.json`.
|
|
hooksManifestRel: 'hooks/impeccable.json',
|
|
},
|
|
kiro: {
|
|
provider: 'kiro',
|
|
providerTags: ['kiro'],
|
|
configDir: '.kiro',
|
|
displayName: 'Kiro',
|
|
frontmatterFields: ['license', 'compatibility', 'metadata'],
|
|
},
|
|
opencode: {
|
|
provider: 'opencode',
|
|
providerTags: ['opencode'],
|
|
configDir: '.opencode',
|
|
displayName: 'OpenCode',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata', 'allowed-tools'],
|
|
},
|
|
pi: {
|
|
provider: 'pi',
|
|
providerTags: ['pi'],
|
|
configDir: '.pi',
|
|
displayName: 'Pi',
|
|
frontmatterFields: ['license', 'compatibility', 'metadata', 'allowed-tools'],
|
|
},
|
|
qoder: {
|
|
provider: 'qoder',
|
|
providerTags: ['qoder'],
|
|
configDir: '.qoder',
|
|
displayName: 'Qoder',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata', 'allowed-tools'],
|
|
},
|
|
'trae-cn': {
|
|
provider: 'trae-cn',
|
|
providerTags: ['trae-cn', 'trae'],
|
|
configDir: '.trae-cn',
|
|
displayName: 'Trae China',
|
|
placeholderProvider: 'trae',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata'],
|
|
},
|
|
trae: {
|
|
provider: 'trae',
|
|
providerTags: ['trae'],
|
|
configDir: '.trae',
|
|
displayName: 'Trae',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata'],
|
|
},
|
|
'rovo-dev': {
|
|
provider: 'rovo-dev',
|
|
providerTags: ['rovo-dev'],
|
|
configDir: '.rovodev',
|
|
displayName: 'Rovo Dev',
|
|
frontmatterFields: ['user-invocable', 'argument-hint', 'license', 'compatibility', 'metadata', 'allowed-tools'],
|
|
},
|
|
};
|