import { DoomTelemetryOptions } from "@agimon-ai/doompi-telemetry"; import { Static, Type } from "typebox"; import { supersedeDoomConfigTransition } from "@agimon-ai/doompi-config/piContext"; import { TransitionExecutionStrategy, TransitionSelectionSnapshot } from "@agimon-ai/doompi-core/transition"; import { VoiceReloadHandoffStore } from "@agimon-ai/doompi-core/voiceReloadHandoff"; import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes"; import { Context } from "@deepseek-ai/cordis"; import { ExtensionContext, Theme } from "@earendil-works/pi-coding-agent"; import { SelectItem } from "@earendil-works/pi-tui"; import { DoomConfigContext, DoomConfigPendingSelection } from "@agimon-ai/doompi-config/types"; //#region src/types/majorMode.d.ts /** The npm name this package registers its voice tool and contributions under. */ declare const MAJOR_MODE_SOURCE = "@agimon-ai/doompi-major-mode"; /** Discriminates this package's reload handoffs from every other axis's. */ declare const MAJOR_MODE_SWITCH_HANDOFF_KIND = "major-mode-switch"; /** The selection as both the command and the voice tool need to see it. */ interface MajorModeView { config: MajorModesConfig; majorMode: string; domains: readonly string[]; profile?: string; } //#endregion //#region src/types/majorModeCommand.d.ts interface MajorModeCommandDependencies { readonly cordisContext: () => Context; readonly currentView: (ctx: ExtensionContext) => Promise; readonly reloadHandoffs: VoiceReloadHandoffStore; readonly loadPicker: () => Promise; readonly loadSelectionSwitch: () => Promise; readonly loadConfigJournal: () => Promise; readonly resolveLayers: (config: MajorModeView['config'], majorMode: string) => string[]; /** Whether an owning process supervisor listens for relaunch requests. */ readonly supervisedRelaunchAvailable: () => boolean; /** Asks the supervisor to relaunch with the picked mode; call only at idle. */ readonly requestSupervisedRelaunch: (majorMode: string, operationId: string) => boolean; } //#endregion //#region src/types/telemetry.d.ts /** Telemetry events this package reports, and the port that records them. */ declare const MAJOR_MODE_EVENT: { readonly majorModeSwitched: 'doom_pi_major_mode.switched'; readonly majorModeUnavailable: 'doom_pi_major_mode.unavailable'; }; type MajorModeEventName = (typeof MAJOR_MODE_EVENT)[keyof typeof MAJOR_MODE_EVENT]; type MajorModeEventAttributes = Record; interface MajorModeTelemetry { recordError(event: MajorModeEventName, error: unknown, attributes?: MajorModeEventAttributes): Promise; recordEvent(event: MajorModeEventName, attributes?: MajorModeEventAttributes): Promise; } //#endregion //#region src/services/logSinkTelemetry/index.d.ts interface MajorModeTelemetryOptions { cwd?: string; workspaceRoot?: string; env?: NodeJS.ProcessEnv; telemetryFactory?: NonNullable; warn?: (message: string) => void; } declare function createMajorModeTelemetry(options?: MajorModeTelemetryOptions): MajorModeTelemetry; //#endregion //#region src/schemas/majorModeVoiceTools.d.ts declare const MAJOR_MODE_VOICE_TOOL_NAME = "major_mode"; declare const MAJOR_MODE_VOICE_INPUT_SCHEMA: Type.TUnion<[Type.TObject<{ action: Type.TLiteral<"list">; }>, Type.TObject<{ action: Type.TLiteral<"switch">; majorMode: Type.TString; }>]>; declare const MAJOR_MODE_VOICE_RESULT_SCHEMA: Type.TUnion<[Type.TObject<{ status: Type.TLiteral<"listed">; current: Type.TString; modes: Type.TArray; }>>; }>, Type.TObject<{ status: Type.TLiteral<"unchanged">; majorMode: Type.TString; }>, Type.TObject<{ status: Type.TLiteral<"queued">; majorMode: Type.TString; stopBatch: Type.TLiteral<"session-reload">; }>]>; type MajorModeVoiceInput = Static; type MajorModeVoiceResult = Static; //#endregion //#region src/services/majorModeText/index.d.ts declare const MAJOR_MODE_COMMAND = "mode"; declare const VOICE_SWITCH_TOKEN_PREFIX = "--voice-switch-token="; /** Picker rows show the resolved layers while retaining bare major mode values. */ declare function majorModeItems(config: MajorModesConfig, names: string[]): SelectItem[]; declare function majorModeOptionLabel(name: string, layers: string[], current: string): string; declare function optionName(option: string): string; /** * What a switch actually applied. * * A synced session composes its extension set on every load, so a reload picks * up the new layers outright. A launcher session cannot: Pi freezes the CLI * `--extension` list at construction, so a layer that contributes extensions * needs a relaunch there and only the hooks change in place. */ declare function applySummary(picked: string, layers: string[], stale: boolean, composed?: boolean, strategy?: TransitionExecutionStrategy, supervised?: boolean): string; declare function majorModeSummary(picked: string, layers: string[], current: string, composed?: boolean): string; /** The opaque token a voice switch hands to the follow-up command invocation. */ declare function voiceSwitchToken(args: string): string | undefined; //#endregion //#region src/services/pendingSelection/index.d.ts type ConfigTransitionWriter = Parameters[0]; /** The journal shape a transition records for the session that resumes after it. */ declare function selectionFromSnapshot(snapshot: TransitionSelectionSnapshot): { version: 1; majorMode: string; domains: string[]; profile: string | undefined; compositionFingerprint: string | undefined; }; declare function clearPendingSelection(pi: ConfigTransitionWriter, cordis: Context): void; declare function bindPendingSelection(context: DoomConfigContext, pendingSelection: DoomConfigPendingSelection): DoomConfigContext; //#endregion //#region src/services/statusLine/index.d.ts declare const STATUS_KEY = "doom-major-mode"; /** Compact footer text for the selected major mode, domains, and profile. */ declare function statusText(majorMode: string, domains: readonly string[], profile?: string): string; /** * The same footer, coloured. * * A pure function of the theme it is handed rather than of an ambient one, so it * stays testable with a plain object and lives beside statusText rather than in * the TUI layer the command may not reach. */ declare function colorStatus(theme: Theme, majorMode: string, domains: readonly string[], profile: string | undefined, pending: boolean): string; //#endregion export { MajorModeEventAttributes as C, MAJOR_MODE_SOURCE as D, MajorModeCommandDependencies as E, MAJOR_MODE_SWITCH_HANDOFF_KIND as O, MAJOR_MODE_EVENT as S, MajorModeTelemetry as T, MAJOR_MODE_VOICE_TOOL_NAME as _, clearPendingSelection as a, MajorModeTelemetryOptions as b, VOICE_SWITCH_TOKEN_PREFIX as c, majorModeOptionLabel as d, majorModeSummary as f, MAJOR_MODE_VOICE_RESULT_SCHEMA as g, MAJOR_MODE_VOICE_INPUT_SCHEMA as h, bindPendingSelection as i, MajorModeView as k, applySummary as l, voiceSwitchToken as m, colorStatus as n, selectionFromSnapshot as o, optionName as p, statusText as r, MAJOR_MODE_COMMAND as s, STATUS_KEY as t, majorModeItems as u, MajorModeVoiceInput as v, MajorModeEventName as w, createMajorModeTelemetry as x, MajorModeVoiceResult as y }; //# sourceMappingURL=index-WVJHFxo7.d.mts.map