aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
40 lines • 1.62 kB
TypeScript
/**
* Codex hook translator — emits TOML hook entries for ~/.codex/config.toml.
*
* Per ADR-3 §5 backup-and-rollback: the operator-managed config file
* (~/.codex/config.toml) is read, AIWG-tagged entries are merged in
* (via _aiwg_managed: true), and the file is written atomically with a
* timestamped backup.
*
* Codex hook events map per the assessment matrix; this translator
* supports a conservative subset known to exist in the loader.
*/
import type { HookSource, TranslateOptions, TranslateResult } from './types.js';
/**
* Render a single TOML hook entry for a Codex config block.
*
* Codex's hook TOML shape (per the assessment):
* [[hooks.<event>]]
* command = "..."
* args = ["..."]
* _aiwg_managed = true
*
* Operators add their own hooks at the same shape; the _aiwg_managed flag
* lets `aiwg remove --addon aiwg-hooks` distinguish AIWG entries from
* operator-authored ones.
*/
export declare function renderCodexHookToml(source: HookSource): string;
/**
* Inject AIWG-managed hook block into existing TOML config, preserving
* everything outside the markers. Idempotent — replaces an existing block
* rather than appending.
*/
export declare function injectHookBlock(existingToml: string, hookBlock: string): string;
/**
* Translate one HookSource to Codex TOML config.
*
* Writes to ~/.codex/config.toml (user-global), backing up the existing
* file if no AIWG signature is found per ADR-3 §5.
*/
export declare function translateForCodex(source: HookSource, options: TranslateOptions): Promise<TranslateResult>;
//# sourceMappingURL=codex-translator.d.ts.map