/** * IDE-aware wrapper for `peaks standards init` / `peaks standards update`. * * Slice #011-2026-06-07-ide-adapter-resource-profile: the original * `executeProjectStandardsInit` / `executeProjectStandardsUpdate` always * wrote to `CLAUDE.md` + `.claude/rules/**` regardless of which IDE * the user was running. This wrapper dispatches on the IDE detected * (or explicitly requested via `--ide`) and falls back to the legacy * Claude Code path with a stderr warning when the detected IDE has * no `standardsProfile` declared (Trae in slice 1.3.2). * * Two entry points: * * - `executeProjectStandardsInitIdeAware` — same signature as the * underlying `executeProjectStandardsInit`, plus an optional * `ideId` override that bypasses detection. * - `executeProjectStandardsUpdateIdeAware` — same shape, for the * `update` flow. * * Detection precedence: * 1. Explicit `options.ideId` (CLI `--ide` flag) * 2. `IdeRegistry.detect()` from cwd (or the `projectRoot` if given) * 3. `null` (no IDE detected) → fall back to the legacy Claude Code path * * Fallback behavior: when the resolved IDE has no `standardsProfile` * declared, the wrapper STILL calls the legacy Claude Code writer * (so the user gets the files they would have gotten before slice #011) * and emits a stderr warning with the IDE id and the fact that the * adapter is UNVERIFIED for the standards profile. This keeps the * "Trae is UNVERIFIED, ship a working file tree, surface the gap" * contract intact. */ import type { IdeId } from '../ide/ide-types.js'; import { detectAllResourceTargets, getStandardsProfile } from '../ide/resource-profile.js'; import { type ProjectStandardsInitOptions, type ProjectStandardsInitResult, type ProjectStandardsUpdateResult } from './project-standards-service.js'; export type { ProjectStandardsInitResult, ProjectStandardsUpdateResult }; export type ProjectStandardsIdeAwareOptions = ProjectStandardsInitOptions & { /** * Explicit IDE override. When set, bypasses `IdeRegistry.detect()` * (cwd + env heuristics) and uses the provided IDE id directly. * Mirrors the `peaks hooks install --ide ` pattern. */ readonly ideId?: IdeId; }; export type ProjectStandardsUpdateIdeAwareOptions = ProjectStandardsInitOptions & { /** Explicit IDE override. See {@link ProjectStandardsIdeAwareOptions}. */ readonly ideId?: IdeId; }; /** * Resolve the active IDE id for a standards call. Order of precedence: * 1. explicit `options.ideId` * 2. `IdeRegistry.detect()` from `options.projectRoot` * 3. `null` (no detected IDE — caller falls back to legacy) */ export declare function resolveStandardsIdeId(options: { readonly projectRoot: string; readonly ideId?: IdeId; }): IdeId | null; /** * Run `peaks standards init` with IDE-aware dispatch. * * When the resolved IDE has a `standardsProfile`, the call still * delegates to the existing `executeProjectStandardsInit` (the * profile maps to the Claude Code path; future per-IDE writers * plug in here). When the IDE is unregistered for the standards * profile, the call delegates to the legacy path + emits a stderr * warning. */ export declare function executeProjectStandardsInitIdeAware(options: ProjectStandardsIdeAwareOptions): ProjectStandardsInitResult; /** * Run `peaks standards update` with IDE-aware dispatch. * * Same dispatch rules as `executeProjectStandardsInitIdeAware`. */ export declare function executeProjectStandardsUpdateIdeAware(options: ProjectStandardsUpdateIdeAwareOptions): ProjectStandardsUpdateResult; /** * Test seam + integration-test helper: returns the resolved IDE id * for the call, plus the active standards profile. Exported for * the integration test in `tests/unit/standards/ide-aware-standards-service.test.ts` * to assert the dispatch decision without running the full write. */ export declare function inspectStandardsDispatch(options: { readonly projectRoot: string; readonly ideId?: IdeId; }): { readonly ideId: IdeId | null; readonly profile: ReturnType; }; /** * Test seam: the resource-profile accessor exposes * `detectAllResourceTargets` for callers that need to enumerate * across all registered IDEs. Re-exported here for convenience. */ export { detectAllResourceTargets };