Add provider gateway and collaboration records

This commit is contained in:
ZacharyZhang-NY committed 2026-05-20 23:35:30 -04:00
1 parent fcf6d90731
commit c694b7fc2c
12 files changed
+556 -9

No files matched your search

+8
View File
@@ -62,6 +62,7 @@ export interface SendMessageInput {
senderType: "employee" | "agent" | "board" | "system";
senderId: string | null;
bodyMd: string;
attachmentFileIds?: string[];
}
export interface SaveProviderCredentialInput {
@@ -71,6 +72,13 @@ export interface SaveProviderCredentialInput {
model: string | null;
}
export interface CreateProviderResponseInput {
orgId: string;
providerId: string;
prompt: string;
instructions: string | null;
}
export interface ImportSkillDirectoryInput {
orgId: string;
directoryPath: string;
@@ -5,6 +5,7 @@ import type {
CreateAgentInput,
CreateApprovalInput,
CreateOrganizationInput,
CreateProviderResponseInput,
CreateSocialAccountInput,
CreateTaskInput,
DecideApprovalInput,
@@ -30,6 +31,7 @@ export interface DesktopApi {
decideApproval(input: DecideApprovalInput): Promise<DesktopResult<AppSnapshot>>;
sendMessage(input: SendMessageInput): Promise<DesktopResult<AppSnapshot>>;
saveProviderCredential(input: SaveProviderCredentialInput): Promise<DesktopResult<AppSnapshot>>;
createProviderResponse(input: CreateProviderResponseInput): Promise<DesktopResult<AppSnapshot>>;
importSkillDirectory(input: ImportSkillDirectoryInput): Promise<DesktopResult<AppSnapshot>>;
bindSkill(input: BindSkillInput): Promise<DesktopResult<AppSnapshot>>;
createSocialAccount(input: CreateSocialAccountInput): Promise<DesktopResult<AppSnapshot>>;
+76
View File
@@ -31,12 +31,19 @@ export const SOCIAL_PLATFORM = {
INSTAGRAM: "instagram",
} as const;
export const PROVIDER_REQUEST_STATE = {
PENDING: "pending",
SUCCEEDED: "succeeded",
FAILED: "failed",
} as const;
export type ValueOf<T> = T[keyof T];
export type TaskStatus = ValueOf<typeof TASK_STATUS>;
export type ApprovalState = ValueOf<typeof APPROVAL_STATE>;
export type RiskLevel = ValueOf<typeof RISK_LEVEL>;
export type ProviderAuthType = ValueOf<typeof PROVIDER_AUTH_TYPE>;
export type SocialPlatform = ValueOf<typeof SOCIAL_PLATFORM>;
export type ProviderRequestState = ValueOf<typeof PROVIDER_REQUEST_STATE>;
export interface OrganizationRecord {
id: string;
@@ -118,6 +125,33 @@ export interface ChatMessageRecord {
deletedAt: string | null;
}
export interface ChatThreadRecord {
id: string;
orgId: string;
spaceId: string;
rootMessageId: string | null;
title: string;
state: string;
createdAt: string;
updatedAt: string;
}
export interface ChatAttachmentRecord {
messageId: string;
fileId: string;
transferType: string;
checksum: string;
previewKey: string | null;
}
export interface ChatPresenceRecord {
principalType: string;
principalId: string;
status: string;
statusText: string;
lastSeenAt: string;
}
export interface FileObjectRecord {
id: string;
orgId: string;
@@ -151,6 +185,21 @@ export interface ProviderCatalogEntry {
capabilityTags: string[];
}
export interface ProviderRequestRecord {
id: string;
orgId: string;
providerId: string;
providerKey: string;
model: string;
promptSha256: string;
responseText: string | null;
rawResponseJson: string | null;
state: ProviderRequestState;
errorMessage: string | null;
createdAt: string;
completedAt: string | null;
}
export interface SkillDefinitionRecord {
id: string;
orgId: string;
@@ -183,6 +232,16 @@ export interface SkillBindingRecord {
enabled: boolean;
}
export interface SkillRuntimeSnapshotRecord {
id: string;
agentId: string;
runId: string;
compiledPrompt: string;
toolsManifest: string;
sourceRevisionIds: string;
createdAt: string;
}
export interface SocialAccountRecord {
id: string;
orgId: string;
@@ -205,6 +264,17 @@ export interface AuditEventRecord {
createdAt: string;
}
export interface PolicyRuleRecord {
id: string;
orgId: string;
subjectType: string;
subjectId: string | null;
action: string;
effect: string;
riskCeiling: RiskLevel;
createdAt: string;
}
export interface AppSnapshot {
activeOrgId: string | null;
organizations: OrganizationRecord[];
@@ -214,12 +284,18 @@ export interface AppSnapshot {
approvals: ApprovalRecord[];
chatSpaces: ChatSpaceRecord[];
chatMessages: ChatMessageRecord[];
chatThreads: ChatThreadRecord[];
chatAttachments: ChatAttachmentRecord[];
chatPresence: ChatPresenceRecord[];
files: FileObjectRecord[];
providers: ProviderRecord[];
providerCatalog: ProviderCatalogEntry[];
providerRequests: ProviderRequestRecord[];
skillDefinitions: SkillDefinitionRecord[];
skillRevisions: SkillRevisionRecord[];
skillBindings: SkillBindingRecord[];
skillRuntimeSnapshots: SkillRuntimeSnapshotRecord[];
socialAccounts: SocialAccountRecord[];
policyRules: PolicyRuleRecord[];
auditEvents: AuditEventRecord[];
}
+1
View File
@@ -8,6 +8,7 @@ export const IPC_CHANNELS = {
decideApproval: "agentcompany:decide-approval",
sendMessage: "agentcompany:send-message",
saveProviderCredential: "agentcompany:save-provider-credential",
createProviderResponse: "agentcompany:create-provider-response",
importSkillDirectory: "agentcompany:import-skill-directory",
bindSkill: "agentcompany:bind-skill",
createSocialAccount: "agentcompany:create-social-account",