import { DoomExtensionContext } from "./config.cjs"; import { Static, Type } from "typebox"; import { Context } from "@deepseek-ai/cordis"; //#region src/schemas/mode.d.ts export declare const MINOR_MODE_CATALOG_SOURCE = "@agimon-ai/doompi/mode-catalog"; export declare const DOOM_MINOR_MODE_CATALOG_SERVICE = "doom/minor-mode-catalog"; export declare const MINOR_MODE_TOOL_NAME = "minor_mode"; export declare const MINOR_MODE_ACTION_TIMEOUT_MS = 30000; export declare const MINOR_MODE_MAX_RECORDS = 128; export declare const MINOR_MODE_MAX_ACTIONS = 16; export declare const MINOR_MODE_MAX_PARAMETERS = 16; export declare const MINOR_MODE_MAX_ENUM_CHOICES = 32; export declare const MINOR_MODE_MAX_ARGUMENT_LENGTH = 4096; export declare const MINOR_MODE_ERROR_CODE: { readonly actionAborted: 'MINOR_MODE_ACTION_ABORTED'; readonly actionDisabled: 'MINOR_MODE_ACTION_DISABLED'; readonly actionNotFound: 'MINOR_MODE_ACTION_NOT_FOUND'; readonly actionTimeout: 'MINOR_MODE_ACTION_TIMEOUT'; readonly invalidArguments: 'MINOR_MODE_INVALID_ARGUMENTS'; readonly modeBusy: 'MINOR_MODE_BUSY'; readonly modeNotFound: 'MINOR_MODE_NOT_FOUND'; readonly ownerFailed: 'MINOR_MODE_OWNER_FAILED'; readonly registrationConflict: 'MINOR_MODE_REGISTRATION_CONFLICT'; readonly sessionReplaced: 'MINOR_MODE_SESSION_REPLACED'; readonly staleRegistration: 'MINOR_MODE_STALE_REGISTRATION'; readonly unsupportedContext: 'MINOR_MODE_UNSUPPORTED_CONTEXT'; }; export declare const MinorModeSourceSchema: Type.TString; export declare const MinorModeIdSchema: Type.TString; export declare const MinorModeParameterNameSchema: Type.TString; export declare const ModeTextColorSchema: Type.TUnion<[Type.TLiteral<"accent">, Type.TLiteral<"warning">, Type.TLiteral<"mdHeading">, Type.TLiteral<"muted">, Type.TLiteral<"dim">]>; export type ModeTextColor = Static; export declare const MinorModeSessionKindSchema: Type.TUnion<[Type.TLiteral<"tui">, Type.TLiteral<"headless">]>; export type MinorModeSessionKind = Static; export declare const MinorModeActivationSchema: Type.TUnion<[Type.TLiteral<"inactive">, Type.TLiteral<"activating">, Type.TLiteral<"active">, Type.TLiteral<"deactivating">]>; export type MinorModeActivation = Static; export declare const MinorModeConditionSchema: Type.TUnion<[Type.TLiteral<"ready">, Type.TLiteral<"paused">, Type.TLiteral<"blocked">, Type.TLiteral<"limited">, Type.TLiteral<"queued">, Type.TLiteral<"degraded">, Type.TLiteral<"failed">]>; export type MinorModeCondition = Static; export declare const MinorModeScalarSchema: Type.TUnion<[Type.TString, Type.TNumber, Type.TBoolean]>; export type MinorModeScalar = Static; export declare const MinorModeActionParameterSchema: Type.TUnion<[Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>; export type MinorModeActionParameter = Static; export declare const MinorModeActionDescriptorSchema: Type.TObject<{ id: Type.TString; label: Type.TString; description: Type.TString; contexts: Type.TArray, Type.TLiteral<"headless">]>>; parameters: Type.TArray; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>>; }>; export type MinorModeActionDescriptor = Static; export declare const MinorModeDescriptorSchema: Type.TObject<{ source: Type.TString; id: Type.TString; label: Type.TString; description: Type.TString; order: Type.TInteger; actions: Type.TArray, Type.TLiteral<"headless">]>>; parameters: Type.TArray; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>>; }>>; }>; export type MinorModeDescriptor = Static; export declare const MinorModeActionAvailabilitySchema: Type.TObject<{ id: Type.TString; enabled: Type.TBoolean; disabledReason: Type.TOptional; }>; export type MinorModeActionAvailability = Static; export declare const MinorModeStateSchema: Type.TObject<{ activation: Type.TUnion<[Type.TLiteral<"inactive">, Type.TLiteral<"activating">, Type.TLiteral<"active">, Type.TLiteral<"deactivating">]>; condition: Type.TUnion<[Type.TLiteral<"ready">, Type.TLiteral<"paused">, Type.TLiteral<"blocked">, Type.TLiteral<"limited">, Type.TLiteral<"queued">, Type.TLiteral<"degraded">, Type.TLiteral<"failed">]>; detail: Type.TOptional; color: Type.TOptional, Type.TLiteral<"warning">, Type.TLiteral<"mdHeading">, Type.TLiteral<"muted">, Type.TLiteral<"dim">]>>; modelContextVariant: Type.TOptional; actions: Type.TArray; }>>; }>; export type MinorModeState = Static; export declare const MinorModeRegistrationRefSchema: Type.TObject<{ source: Type.TString; id: Type.TString; ownerGeneration: Type.TString; registrationId: Type.TString; }>; export type MinorModeRegistrationRef = Static; export declare const MinorModeRecordSchema: Type.TObject<{ descriptor: Type.TObject<{ source: Type.TString; id: Type.TString; label: Type.TString; description: Type.TString; order: Type.TInteger; actions: Type.TArray, Type.TLiteral<"headless">]>>; parameters: Type.TArray; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>>; }>>; }>; state: Type.TObject<{ activation: Type.TUnion<[Type.TLiteral<"inactive">, Type.TLiteral<"activating">, Type.TLiteral<"active">, Type.TLiteral<"deactivating">]>; condition: Type.TUnion<[Type.TLiteral<"ready">, Type.TLiteral<"paused">, Type.TLiteral<"blocked">, Type.TLiteral<"limited">, Type.TLiteral<"queued">, Type.TLiteral<"degraded">, Type.TLiteral<"failed">]>; detail: Type.TOptional; color: Type.TOptional, Type.TLiteral<"warning">, Type.TLiteral<"mdHeading">, Type.TLiteral<"muted">, Type.TLiteral<"dim">]>>; modelContextVariant: Type.TOptional; actions: Type.TArray; }>>; }>; ownerGeneration: Type.TString; registrationId: Type.TString; stateRevision: Type.TInteger; }>; export type MinorModeRecord = Static; export declare const MinorModeCatalogSnapshotSchema: Type.TObject<{ hostGeneration: Type.TString; revision: Type.TInteger; modes: Type.TArray, Type.TLiteral<"headless">]>>; parameters: Type.TArray; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>>; }>>; }>; state: Type.TObject<{ activation: Type.TUnion<[Type.TLiteral<"inactive">, Type.TLiteral<"activating">, Type.TLiteral<"active">, Type.TLiteral<"deactivating">]>; condition: Type.TUnion<[Type.TLiteral<"ready">, Type.TLiteral<"paused">, Type.TLiteral<"blocked">, Type.TLiteral<"limited">, Type.TLiteral<"queued">, Type.TLiteral<"degraded">, Type.TLiteral<"failed">]>; detail: Type.TOptional; color: Type.TOptional, Type.TLiteral<"warning">, Type.TLiteral<"mdHeading">, Type.TLiteral<"muted">, Type.TLiteral<"dim">]>>; modelContextVariant: Type.TOptional; actions: Type.TArray; }>>; }>; ownerGeneration: Type.TString; registrationId: Type.TString; stateRevision: Type.TInteger; }>>; }>; export type MinorModeCatalogSnapshot = Static; export declare const MinorModeArgumentsSchema: Type.TRecord<"^.*$", Type.TUnion<[Type.TString, Type.TNumber, Type.TBoolean]>>; export type MinorModeArguments = Static; export declare const MinorModeToolInputSchema: Type.TObject<{ action: Type.TUnion<[Type.TLiteral<"list">, Type.TLiteral<"invoke">]>; source: Type.TOptional; id: Type.TOptional; ownerGeneration: Type.TOptional; registrationId: Type.TOptional; modeAction: Type.TOptional; arguments: Type.TOptional>>; }>; export type MinorModeToolInput = Static; export declare const MinorModeToolResultSchema: Type.TUnknown; export declare const MinorModeActionRequestSchema: Type.TObject<{ operationId: Type.TString; mode: Type.TObject<{ source: Type.TString; id: Type.TString; ownerGeneration: Type.TString; registrationId: Type.TString; }>; actionId: Type.TString; arguments: Type.TRecord<"^.*$", Type.TUnion<[Type.TString, Type.TNumber, Type.TBoolean]>>; }>; export type MinorModeActionRequest = Static; export declare const MinorModeActionResponseSchema: Type.TObject<{ operationId: Type.TString; catalogRevision: Type.TInteger; mode: Type.TObject<{ descriptor: Type.TObject<{ source: Type.TString; id: Type.TString; label: Type.TString; description: Type.TString; order: Type.TInteger; actions: Type.TArray, Type.TLiteral<"headless">]>>; parameters: Type.TArray; required: Type.TBoolean; kind: Type.TLiteral<"string">; minLength: Type.TOptional; maxLength: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"number">; integer: Type.TOptional; minimum: Type.TOptional; maximum: Type.TOptional; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"boolean">; }>, Type.TObject<{ name: Type.TString; label: Type.TString; description: Type.TOptional; required: Type.TBoolean; kind: Type.TLiteral<"enum">; choices: Type.TArray>; }>]>>; }>>; }>; state: Type.TObject<{ activation: Type.TUnion<[Type.TLiteral<"inactive">, Type.TLiteral<"activating">, Type.TLiteral<"active">, Type.TLiteral<"deactivating">]>; condition: Type.TUnion<[Type.TLiteral<"ready">, Type.TLiteral<"paused">, Type.TLiteral<"blocked">, Type.TLiteral<"limited">, Type.TLiteral<"queued">, Type.TLiteral<"degraded">, Type.TLiteral<"failed">]>; detail: Type.TOptional; color: Type.TOptional, Type.TLiteral<"warning">, Type.TLiteral<"mdHeading">, Type.TLiteral<"muted">, Type.TLiteral<"dim">]>>; modelContextVariant: Type.TOptional; actions: Type.TArray; }>>; }>; ownerGeneration: Type.TString; registrationId: Type.TString; stateRevision: Type.TInteger; }>; message: Type.TOptional; }>; export type MinorModeActionResponse = Static; /** * The custom session entry the catalog host journals whenever its projection * changes. It rides Pi's entry_appended frames, so any RPC client (the web * cockpit) sees minor-mode state live and on replay without a new protocol. */ export declare const DOOM_MINOR_MODE_ENTRY_TYPE = "doom-minor-modes"; export interface MinorModeActionProjection { readonly id: string; readonly label: string; readonly description: string; readonly enabled: boolean; readonly disabledReason?: string; /** Whether invoking it needs arguments a client must ask for first. */ readonly needsInput: boolean; } export interface MinorModeRecordProjection { readonly id: string; readonly label: string; readonly description: string; readonly order: number; readonly activation: MinorModeActivation; readonly condition: MinorModeCondition; readonly detail?: string; readonly actions: readonly MinorModeActionProjection[]; } export interface MinorModeProjection { readonly version: 1; readonly revision: number; readonly modes: readonly MinorModeRecordProjection[]; } export interface MinorModeOwnerActionResult { message?: string; } export interface MinorModeOwnerActionContext { context: ExtensionContext; operationId: string; sessionKind: MinorModeSessionKind; signal: AbortSignal; } export interface MinorModeOwnerDefinition { descriptor: MinorModeDescriptor; initialState: MinorModeState; handleAction(actionId: string, argumentsValue: MinorModeArguments, execution: MinorModeOwnerActionContext): MinorModeOwnerActionResult | void | Promise; onError?(error: unknown): void; } export interface MinorModeOwnerHandle { getState(): MinorModeState; publish(state: MinorModeState): void; dispose(): void; } export interface MinorModeInvokeOptions { readonly signal?: AbortSignal; } /** Direct session-local catalog shared through Cordis. */ export interface MinorModeCatalogService { readonly generation: string; getSnapshot(): MinorModeCatalogSnapshot; list(): MinorModeRecord[]; subscribe(listener: () => void): () => void; registerOwner(definition: MinorModeOwnerDefinition): MinorModeOwnerHandle; invoke(request: MinorModeActionRequest, requesterSource: string, signal?: AbortSignal): Promise; dispose(): void; } declare module '@deepseek-ai/cordis' { interface Context { 'doom/minor-mode-catalog': MinorModeCatalogService; } } export declare function readMinorModeCatalog(context: Context): MinorModeCatalogService | undefined; export declare function requireMinorModeCatalog(context: Context): MinorModeCatalogService; //#endregion //# sourceMappingURL=mode.d.cts.map