Add document, knowledge, and automation subsystems
Migration 040 creates documents, knowledge_entries, and automation_rules tables. Full-stack services (DocumentService, KnowledgeService, AutomationService), IPC handlers, preload bridge, desktop-api types, and domain records wired into the snapshot. UI pages follow next.
This commit is contained in:
1 parent
3b115e8bec
commit
b5b8f3ba3c
13 files changed
+344
-1
No files matched your search
@@ -470,6 +470,74 @@ export interface BootstrapOnboardingSummary {
|
||||
providerId: string;
|
||||
}
|
||||
|
||||
export interface CreateDocumentInput {
|
||||
orgId: string;
|
||||
title: string;
|
||||
docType: string;
|
||||
content: string;
|
||||
authorAgentId: string | null;
|
||||
reviewerAgentId: string | null;
|
||||
projectId: string | null;
|
||||
goalId: string | null;
|
||||
taskId: string | null;
|
||||
}
|
||||
|
||||
export interface UpdateDocumentInput {
|
||||
orgId: string;
|
||||
documentId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface DeleteDocumentInput {
|
||||
orgId: string;
|
||||
documentId: string;
|
||||
}
|
||||
|
||||
export interface CreateKnowledgeEntryInput {
|
||||
orgId: string;
|
||||
topic: string;
|
||||
category: string;
|
||||
content: string;
|
||||
importance: string;
|
||||
sourceType: string;
|
||||
sourceId: string | null;
|
||||
}
|
||||
|
||||
export interface DeleteKnowledgeEntryInput {
|
||||
orgId: string;
|
||||
entryId: string;
|
||||
}
|
||||
|
||||
export interface CreateAutomationRuleInput {
|
||||
orgId: string;
|
||||
name: string;
|
||||
triggerEvent: string;
|
||||
conditions: Record<string, unknown>;
|
||||
actionType: string;
|
||||
actionConfig: Record<string, unknown>;
|
||||
priority: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateAutomationRuleInput {
|
||||
orgId: string;
|
||||
ruleId: string;
|
||||
name: string;
|
||||
triggerEvent: string;
|
||||
conditions: Record<string, unknown>;
|
||||
actionType: string;
|
||||
actionConfig: Record<string, unknown>;
|
||||
priority: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface DeleteAutomationRuleInput {
|
||||
orgId: string;
|
||||
ruleId: string;
|
||||
}
|
||||
|
||||
export interface NativeDialogResult {
|
||||
canceled: boolean;
|
||||
filePaths: string[];
|
||||
|
||||
@@ -9,9 +9,17 @@ import type {
|
||||
CreateAgentInput,
|
||||
UpdateAgentInput,
|
||||
CreateApprovalInput,
|
||||
CreateAutomationRuleInput,
|
||||
CreateDocumentInput,
|
||||
CreateGoalInput,
|
||||
CreateKnowledgeEntryInput,
|
||||
CreateProjectInput,
|
||||
CreateWorkspaceInput,
|
||||
DeleteAutomationRuleInput,
|
||||
DeleteDocumentInput,
|
||||
DeleteKnowledgeEntryInput,
|
||||
UpdateAutomationRuleInput,
|
||||
UpdateDocumentInput,
|
||||
CreateAuditReplayInput,
|
||||
CreateChatSpaceInput,
|
||||
CreateComplianceExportInput,
|
||||
@@ -96,6 +104,14 @@ export interface DesktopApi {
|
||||
createGoal(input: CreateGoalInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createProject(input: CreateProjectInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createWorkspace(input: CreateWorkspaceInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createDocument(input: CreateDocumentInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
updateDocument(input: UpdateDocumentInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
deleteDocument(input: DeleteDocumentInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createKnowledgeEntry(input: CreateKnowledgeEntryInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
deleteKnowledgeEntry(input: DeleteKnowledgeEntryInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createAutomationRule(input: CreateAutomationRuleInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
updateAutomationRule(input: UpdateAutomationRuleInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
deleteAutomationRule(input: DeleteAutomationRuleInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createApproval(input: CreateApprovalInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
decideApproval(input: DecideApprovalInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
syncEmployeeIdentity(input: SyncEmployeeIdentityInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
|
||||
@@ -383,6 +383,51 @@ export interface MigrationReportRecord {
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface DocumentRecord {
|
||||
id: string;
|
||||
orgId: string;
|
||||
title: string;
|
||||
docType: string;
|
||||
content: string;
|
||||
status: string;
|
||||
authorAgentId: string | null;
|
||||
reviewerAgentId: string | null;
|
||||
projectId: string | null;
|
||||
goalId: string | null;
|
||||
taskId: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface KnowledgeEntryRecord {
|
||||
id: string;
|
||||
orgId: string;
|
||||
topic: string;
|
||||
category: string;
|
||||
content: string;
|
||||
importance: string;
|
||||
sourceType: string;
|
||||
sourceId: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface AutomationRuleRecord {
|
||||
id: string;
|
||||
orgId: string;
|
||||
name: string;
|
||||
triggerEvent: string;
|
||||
conditionJson: string;
|
||||
actionType: string;
|
||||
actionConfigJson: string;
|
||||
priority: number;
|
||||
enabled: boolean;
|
||||
lastFiredAt: string | null;
|
||||
fireCount: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface AppSnapshot {
|
||||
activeOrgId: string | null;
|
||||
organizations: OrganizationRecord[];
|
||||
@@ -439,4 +484,7 @@ export interface AppSnapshot {
|
||||
sdlcReviewAgents: SdlcReviewAgentRecord[]; sdlcReviewRuns: SdlcReviewRunRecord[]; evalSuites: EvalSuiteRecord[]; evalCases: EvalCaseRecord[]; evalRuns: EvalRunRecord[]; prBotGates: PrBotGateRecord[];
|
||||
auditReplayRuns: AuditReplayRunRecord[];
|
||||
auditEvents: AuditEventRecord[];
|
||||
documents: DocumentRecord[];
|
||||
knowledgeEntries: KnowledgeEntryRecord[];
|
||||
automationRules: AutomationRuleRecord[];
|
||||
}
|
||||
@@ -60,6 +60,14 @@ export const IPC_CHANNELS = {
|
||||
createGoal: "agentcompany:create-goal",
|
||||
createProject: "agentcompany:create-project",
|
||||
createWorkspace: "agentcompany:create-workspace",
|
||||
createDocument: "agentcompany:create-document",
|
||||
updateDocument: "agentcompany:update-document",
|
||||
deleteDocument: "agentcompany:delete-document",
|
||||
createKnowledgeEntry: "agentcompany:create-knowledge-entry",
|
||||
deleteKnowledgeEntry: "agentcompany:delete-knowledge-entry",
|
||||
createAutomationRule: "agentcompany:create-automation-rule",
|
||||
updateAutomationRule: "agentcompany:update-automation-rule",
|
||||
deleteAutomationRule: "agentcompany:delete-automation-rule",
|
||||
search: "agentcompany:search",
|
||||
rendererEvent: "agentcompany:renderer-event",
|
||||
windowMinimize: "agentcompany:window-minimize",
|
||||
|
||||
Reference in new issue
Block a user