| 1 | import type { ProjectNode } from "./types"; |
| 2 | |
| 3 | export interface SessionCatalogStatus { |
| 4 | state: "opening" | "ready" | "degraded" | "rebuilding" | "closed" | string; |
| 5 | mode?: "disk" | "memory" | string; |
| 6 | revision: number; |
| 7 | indexed: number; |
| 8 | total: number; |
| 9 | repairPending: number; |
| 10 | repairActive?: number; |
| 11 | repairDeferred?: number; |
| 12 | repairBlocked?: number; |
| 13 | nextRepairAt?: number; |
| 14 | repairReason?: string; |
| 15 | sourceCount?: number; |
| 16 | unindexedTargetCount?: number; |
| 17 | lastRepairAt?: number; |
| 18 | canRebuild?: boolean; |
| 19 | lastError?: string; |
| 20 | quarantinedPath?: string; |
| 21 | } |
| 22 | |
| 23 | export interface ProjectTreeSnapshot { |
| 24 | revision: number; |
| 25 | projects: ProjectNode[]; |
| 26 | catalog: SessionCatalogStatus; |
| 27 | indexed: number; |
| 28 | total: number; |
| 29 | indexingDone: boolean; |
| 30 | } |
| 31 | |
| 32 | export interface ProjectTopicPageRequest { |
| 33 | scope: "global" | "project" | string; |
| 34 | workspaceRoot?: string; |
| 35 | cursor?: string; |
| 36 | limit?: number; |
| 37 | query?: string; |
| 38 | timeFilter?: string; |
| 39 | sortMode?: "created" | "updated" | string; |
| 40 | groupFilter?: "all" | "ungrouped" | "group" | string; |
| 41 | groupId?: string; |
| 42 | excludePinned?: boolean; |
| 43 | } |
| 44 | |
| 45 | export interface ProjectTopicPage { |
| 46 | items: ProjectNode[]; |
| 47 | nextCursor?: string; |
| 48 | revision: number; |
| 49 | complete?: boolean; |
| 50 | readyDirectories?: number; |
| 51 | pendingDirectories?: number; |
| 52 | failedDirectories?: number; |
| 53 | } |
| 54 | |
| 55 | export interface ProjectTopicKey { |
| 56 | scope: "global" | "project" | string; |
| 57 | workspaceRoot?: string; |
| 58 | topicId: string; |
| 59 | path?: string; |
| 60 | recordClassification?: boolean; |
| 61 | } |
| 62 | |
| 63 | export interface ProjectTreeChangedV2 { |
| 64 | revision: number; |
| 65 | roots: string[]; |
| 66 | reason: string; |
| 67 | } |
| 68 | |
| 69 | export interface ProjectRuntimeTopic { |
| 70 | scope: "global" | "project" | string; |
| 71 | workspaceRoot?: string; |
| 72 | node: ProjectNode; |
| 73 | } |
| 74 | |
| 75 | export interface ProjectTreeRuntimeSnapshot { |
| 76 | revision: number; |
| 77 | topics: ProjectRuntimeTopic[]; |
| 78 | } |
| 79 | |
| 80 | export interface SessionGroup { |
| 81 | id: string; |
| 82 | title: string; |
| 83 | topicIds?: string[]; |
| 84 | sessionKeys?: string[]; |
| 85 | excludedSessionKeys?: string[]; |
| 86 | } |
| 87 | |
| 88 | export interface ProjectGroupsSnapshot { |
| 89 | groups: SessionGroup[]; |
| 90 | revision: number; |
| 91 | applied: boolean; |
| 92 | } |
| 93 | |
| 94 | export interface SessionCatalogBindings { |
| 95 | GetRuntimeStateSnapshot?(): Promise<import("./runtimeStateStore").RuntimeProjection>; |
| 96 | SyncRuntimeState?(): Promise<import("./runtimeStateStore").RuntimeProjection>; |
| 97 | GetProjectTreeSnapshot(): Promise<ProjectTreeSnapshot>; |
| 98 | GetProjectTreeRuntimeSnapshot?(): Promise<ProjectTreeRuntimeSnapshot>; |
| 99 | ListProjectTopics(req: ProjectTopicPageRequest): Promise<ProjectTopicPage>; |
| 100 | GetTopicSummary(key: ProjectTopicKey): Promise<ProjectNode>; |
| 101 | GetSessionCatalogStatus(): Promise<SessionCatalogStatus>; |
| 102 | RebuildSessionCatalog(): Promise<void>; |
| 103 | } |
| 104 | |
| 105 | export interface ProjectTreeOrganizationBindings { |
| 106 | GetSessionOrganization?(workspace: import("../generated/desktopContract.generated").SessionOrganizationWorkspace): Promise<import("../generated/desktopContract.generated").SessionOrganizationSnapshot>; |
| 107 | UpdateSessionOrganization?(workspace: import("../generated/desktopContract.generated").SessionOrganizationWorkspace, expectedRevision: number, |
| 108 | mutation: import("../generated/desktopContract.generated").SessionOrganizationMutation): Promise<import("../generated/desktopContract.generated").SessionOrganizationSnapshot>; |
| 109 | ReorderTopics(scope: string, workspaceRoot: string, orderedTopicIDs: string[]): Promise<void>; |
| 110 | ReorderSessions?(scope: string, workspaceRoot: string, orderedSessionKeys: string[]): Promise<void>; |
| 111 | ListProjectGroups(scope: string, workspaceRoot: string): Promise<SessionGroup[]>; |
| 112 | SaveSessionGroups(scope: string, workspaceRoot: string, groups: SessionGroup[]): Promise<void>; |
| 113 | GetProjectGroups?(scope: string, workspaceRoot: string): Promise<ProjectGroupsSnapshot>; |
| 114 | SaveSessionGroupsVersioned?( |
| 115 | scope: string, |
| 116 | workspaceRoot: string, |
| 117 | expectedRevision: number, |
| 118 | groups: SessionGroup[], |
| 119 | ): Promise<ProjectGroupsSnapshot>; |
| 120 | } |
| 121 | |
| 122 | // SessionReference is a session selected via @ past:chats for context injection. |
| 123 | export interface SessionReference { |
| 124 | path: string; |
| 125 | title: string; |
| 126 | preview?: string; |
| 127 | turns?: number; |
| 128 | turnsState?: "unknown" | "valid" | "corrupt" | string; |
| 129 | createdAt?: number; |
| 130 | lastActivityAt?: number; |
| 131 | } |
| 132 |