mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-30 08:28:48 +02:00
feat: scaffold electron orchestrator foundation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export const ipcChannels = {
|
||||
loadWorkspace: 'workspace:load',
|
||||
addProject: 'workspace:add-project',
|
||||
removeProject: 'workspace:remove-project',
|
||||
savePattern: 'patterns:save',
|
||||
deletePattern: 'patterns:delete',
|
||||
createSession: 'sessions:create',
|
||||
sendSessionMessage: 'sessions:send-message',
|
||||
selectProject: 'selection:project',
|
||||
selectPattern: 'selection:pattern',
|
||||
selectSession: 'selection:session',
|
||||
workspaceUpdated: 'workspace:updated',
|
||||
sessionEvent: 'sessions:event',
|
||||
} as const;
|
||||
@@ -0,0 +1,38 @@
|
||||
import type { PatternDefinition } from '@shared/domain/pattern';
|
||||
import type { ProjectRecord } from '@shared/domain/project';
|
||||
import type { SessionEventRecord } from '@shared/domain/event';
|
||||
import type { WorkspaceState } from '@shared/domain/workspace';
|
||||
|
||||
export interface CreateSessionInput {
|
||||
projectId: string;
|
||||
patternId: string;
|
||||
}
|
||||
|
||||
export interface SavePatternInput {
|
||||
pattern: PatternDefinition;
|
||||
}
|
||||
|
||||
export interface SendSessionMessageInput {
|
||||
sessionId: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface ElectronApi {
|
||||
loadWorkspace(): Promise<WorkspaceState>;
|
||||
addProject(): Promise<WorkspaceState>;
|
||||
removeProject(projectId: string): Promise<WorkspaceState>;
|
||||
savePattern(input: SavePatternInput): Promise<WorkspaceState>;
|
||||
deletePattern(patternId: string): Promise<WorkspaceState>;
|
||||
createSession(input: CreateSessionInput): Promise<WorkspaceState>;
|
||||
sendSessionMessage(input: SendSessionMessageInput): Promise<void>;
|
||||
selectProject(projectId?: string): Promise<WorkspaceState>;
|
||||
selectPattern(patternId?: string): Promise<WorkspaceState>;
|
||||
selectSession(sessionId?: string): Promise<WorkspaceState>;
|
||||
onWorkspaceUpdated(listener: (workspace: WorkspaceState) => void): () => void;
|
||||
onSessionEvent(listener: (event: SessionEventRecord) => void): () => void;
|
||||
}
|
||||
|
||||
export interface RendererSelectionState {
|
||||
selectedProject?: ProjectRecord;
|
||||
selectedPattern?: PatternDefinition;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import type { PatternDefinition, PatternValidationIssue } from '@shared/domain/pattern';
|
||||
import type { ChatMessageRecord } from '@shared/domain/session';
|
||||
|
||||
export interface SidecarModeCapability {
|
||||
available: boolean;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export interface SidecarCapabilities {
|
||||
runtime: 'dotnet-maf';
|
||||
modes: Record<PatternDefinition['mode'], SidecarModeCapability>;
|
||||
}
|
||||
|
||||
export interface DescribeCapabilitiesCommand {
|
||||
type: 'describe-capabilities';
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export interface ValidatePatternCommand {
|
||||
type: 'validate-pattern';
|
||||
requestId: string;
|
||||
pattern: PatternDefinition;
|
||||
}
|
||||
|
||||
export interface RunTurnCommand {
|
||||
type: 'run-turn';
|
||||
requestId: string;
|
||||
sessionId: string;
|
||||
projectPath: string;
|
||||
pattern: PatternDefinition;
|
||||
messages: ChatMessageRecord[];
|
||||
}
|
||||
|
||||
export type SidecarCommand = DescribeCapabilitiesCommand | ValidatePatternCommand | RunTurnCommand;
|
||||
|
||||
export interface CapabilitiesEvent {
|
||||
type: 'capabilities';
|
||||
requestId: string;
|
||||
capabilities: SidecarCapabilities;
|
||||
}
|
||||
|
||||
export interface PatternValidationEvent {
|
||||
type: 'pattern-validation';
|
||||
requestId: string;
|
||||
issues: PatternValidationIssue[];
|
||||
}
|
||||
|
||||
export interface TurnDeltaEvent {
|
||||
type: 'turn-delta';
|
||||
requestId: string;
|
||||
sessionId: string;
|
||||
messageId: string;
|
||||
authorName: string;
|
||||
contentDelta: string;
|
||||
}
|
||||
|
||||
export interface TurnCompleteEvent {
|
||||
type: 'turn-complete';
|
||||
requestId: string;
|
||||
sessionId: string;
|
||||
messages: ChatMessageRecord[];
|
||||
}
|
||||
|
||||
export interface CommandErrorEvent {
|
||||
type: 'command-error';
|
||||
requestId: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CommandCompleteEvent {
|
||||
type: 'command-complete';
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export type SidecarEvent =
|
||||
| CapabilitiesEvent
|
||||
| PatternValidationEvent
|
||||
| TurnDeltaEvent
|
||||
| TurnCompleteEvent
|
||||
| CommandErrorEvent
|
||||
| CommandCompleteEvent;
|
||||
Reference in New Issue
Block a user