Add compliance controls

This commit is contained in:
ZacharyZhang-NY committed 2026-05-23 17:25:29 -04:00
1 parent 78dbcbe7ce
commit 38c68ca4af
19 files changed
+882 -7

No files matched your search

+42
View File
@@ -1,5 +1,9 @@
import type {
ApprovalState,
ComplianceExportType,
ComplianceSubjectType,
LegalHoldEntityType,
RetentionFreezeScopeType,
RiskLevel,
SocialPlatform,
TaskPriority,
@@ -172,6 +176,44 @@ export interface CreateMigrationReportInput {
sourceDatabasePath: string;
}
export interface CreateComplianceExportInput {
orgId: string;
subjectType: ComplianceSubjectType;
subjectId: string;
exportType: ComplianceExportType;
requestedByEmployeeId: string;
}
export interface CreateLegalHoldInput {
orgId: string;
entityType: LegalHoldEntityType;
entityId: string;
reason: string;
createdByEmployeeId: string;
}
export interface SetLegalHoldStateInput {
orgId: string;
legalHoldId: string;
active: boolean;
employeeId: string;
}
export interface CreateRetentionFreezeInput {
orgId: string;
scopeType: RetentionFreezeScopeType;
scopeId: string;
reason: string;
createdByEmployeeId: string;
}
export interface SetRetentionFreezeStateInput {
orgId: string;
retentionFreezeId: string;
active: boolean;
employeeId: string;
}
export interface CreateScheduledPostInput {
orgId: string;
socialAccountId: string;
@@ -0,0 +1,53 @@
export const COMPLIANCE_EXPORT_TYPE = {
GDPR_EXPORT: "gdpr_export",
GDPR_DELETE: "gdpr_delete",
} as const;
export const COMPLIANCE_EXPORT_STATE = {
COMPLETED: "completed",
} as const;
type ValueOf<T> = T[keyof T];
export type ComplianceExportType = ValueOf<typeof COMPLIANCE_EXPORT_TYPE>;
export type ComplianceExportState = ValueOf<typeof COMPLIANCE_EXPORT_STATE>;
export type ComplianceSubjectType = "employee" | "agent";
export type LegalHoldEntityType = "organization" | "employee" | "agent" | "chat_thread" | "file_object";
export type RetentionFreezeScopeType = "organization" | "chat_space" | "file_object";
export interface ComplianceExportRecord {
id: string;
orgId: string;
subjectType: ComplianceSubjectType;
subjectId: string;
exportType: ComplianceExportType;
state: ComplianceExportState;
payloadJson: string;
requestedByEmployeeId: string | null;
createdAt: string;
completedAt: string | null;
}
export interface LegalHoldRecord {
id: string;
orgId: string;
entityType: LegalHoldEntityType;
entityId: string;
reason: string;
createdByEmployeeId: string | null;
active: boolean;
createdAt: string;
releasedAt: string | null;
}
export interface RetentionFreezeRecord {
id: string;
orgId: string;
scopeType: RetentionFreezeScopeType;
scopeId: string;
reason: string;
createdByEmployeeId: string | null;
active: boolean;
createdAt: string;
releasedAt: string | null;
}
@@ -7,11 +7,14 @@ import type {
CreateAgentInput,
CreateApprovalInput,
CreateChatSpaceInput,
CreateComplianceExportInput,
CreateLegalHoldInput,
CreateMigrationReportInput,
CheckProviderHealthInput,
MarkChatSpaceReadInput,
CreateOrganizationInput,
CreateProviderResponseInput,
CreateRetentionFreezeInput,
CreateScheduledPostInput,
CreateSocialAccountInput,
CreateTaskInput,
@@ -26,6 +29,8 @@ import type {
SendMessageInput,
SetActiveOrganizationInput,
SetFilePinnedInput,
SetLegalHoldStateInput,
SetRetentionFreezeStateInput,
SetScheduledPostStateInput,
UpdateTaskStatusInput,
} from "./commands";
@@ -63,6 +68,11 @@ export interface DesktopApi {
importFile(input: ImportFileInput): Promise<DesktopResult<AppSnapshot>>;
setFilePinned(input: SetFilePinnedInput): Promise<DesktopResult<AppSnapshot>>;
createMigrationReport(input: CreateMigrationReportInput): Promise<DesktopResult<AppSnapshot>>;
createComplianceExport(input: CreateComplianceExportInput): Promise<DesktopResult<AppSnapshot>>;
createLegalHold(input: CreateLegalHoldInput): Promise<DesktopResult<AppSnapshot>>;
setLegalHoldState(input: SetLegalHoldStateInput): Promise<DesktopResult<AppSnapshot>>;
createRetentionFreeze(input: CreateRetentionFreezeInput): Promise<DesktopResult<AppSnapshot>>;
setRetentionFreezeState(input: SetRetentionFreezeStateInput): Promise<DesktopResult<AppSnapshot>>;
subscribe(callback: (event: RendererEvent) => void): () => void;
platform: "win32" | "darwin" | "linux";
windowMinimize(): Promise<void>;
+5 -4
View File
@@ -1,8 +1,7 @@
import type { BoardInterventionRecord as BoardInterventionRecordModel, ChatThreadBoardState as ChatThreadBoardStateModel } from "./board-domain";
export { BOARD_INTERVENTION_ACTION, BOARD_INTERVENTION_MODE, CHAT_THREAD_BOARD_STATE } from "./board-domain";
export type { BoardInterventionAction, BoardInterventionMode, BoardInterventionRecord, ChatThreadBoardState } from "./board-domain";
import type { ComplianceExportRecord, LegalHoldRecord, RetentionFreezeRecord } from "./compliance-domain";
export { BOARD_INTERVENTION_ACTION, BOARD_INTERVENTION_MODE, CHAT_THREAD_BOARD_STATE, type BoardInterventionAction, type BoardInterventionMode, type BoardInterventionRecord, type ChatThreadBoardState } from "./board-domain";
export { COMPLIANCE_EXPORT_STATE, COMPLIANCE_EXPORT_TYPE, type ComplianceExportRecord, type ComplianceExportState, type ComplianceExportType, type ComplianceSubjectType, type LegalHoldEntityType, type LegalHoldRecord, type RetentionFreezeRecord, type RetentionFreezeScopeType } from "./compliance-domain";
export const TASK_STATUS = {
BACKLOG: "backlog",
IN_PROGRESS: "in_progress",
@@ -192,6 +191,7 @@ export interface ChatSpaceRecord {
name: string;
topic: string;
visibility: string;
retentionPolicy: string;
createdAt: string;
}
@@ -494,5 +494,6 @@ export interface AppSnapshot {
browserActions: BrowserActionRecord[];
policyRules: PolicyRuleRecord[];
migrationReports: MigrationReportRecord[];
complianceExports: ComplianceExportRecord[]; legalHolds: LegalHoldRecord[]; retentionFreezes: RetentionFreezeRecord[];
auditEvents: AuditEventRecord[];
}
+5
View File
@@ -27,6 +27,11 @@ export const IPC_CHANNELS = {
importFile: "agentcompany:import-file",
setFilePinned: "agentcompany:set-file-pinned",
createMigrationReport: "agentcompany:create-migration-report",
createComplianceExport: "agentcompany:create-compliance-export",
createLegalHold: "agentcompany:create-legal-hold",
setLegalHoldState: "agentcompany:set-legal-hold-state",
createRetentionFreeze: "agentcompany:create-retention-freeze",
setRetentionFreezeState: "agentcompany:set-retention-freeze-state",
rendererEvent: "agentcompany:renderer-event",
windowMinimize: "agentcompany:window-minimize",
windowMaximize: "agentcompany:window-maximize",