mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix(ai-vault): list managed Antigravity chats in Agent Session History Orca's managed Antigravity chat sets GEMINI_HOME under the app's data directory, so its transcripts land in antigravity-chat/antigravity-acp/brain, which the history scanner never walked. Scan that root, take each session's cwd from the server's conversations/<id>.meta so the row shows in its workspace, and treat rows no chat owns as transcript references, since agy cannot open the server's conversations. * fix(ai-vault): scan managed Antigravity chats only for reference-aware clients
43 lines
1.7 KiB
TypeScript
43 lines
1.7 KiB
TypeScript
export const ANTIGRAVITY_HISTORY_ROOTS = [
|
|
'antigravity-cli',
|
|
'antigravity-ide',
|
|
'antigravity'
|
|
] as const
|
|
/** The ACP server's home under GEMINI_HOME; Orca's managed chat runtime writes here. */
|
|
export const ANTIGRAVITY_ACP_HOME = 'antigravity-acp'
|
|
export type AntigravitySessionOrigin =
|
|
| (typeof ANTIGRAVITY_HISTORY_ROOTS)[number]
|
|
| typeof ANTIGRAVITY_ACP_HOME
|
|
|
|
export function antigravitySessionOrigin(filePath: string): AntigravitySessionOrigin | null {
|
|
const segments = filePath.split(/[\\/]+/).filter(Boolean)
|
|
const brainIndex = segments.lastIndexOf('brain')
|
|
// GEMINI_HOME relocates the ACP home, so its parent need not be .gemini.
|
|
if (brainIndex >= 1 && segments[brainIndex - 1] === ANTIGRAVITY_ACP_HOME) {
|
|
return ANTIGRAVITY_ACP_HOME
|
|
}
|
|
if (brainIndex < 2 || segments[brainIndex - 2] !== '.gemini') {
|
|
return null
|
|
}
|
|
return ANTIGRAVITY_HISTORY_ROOTS.find((origin) => origin === segments[brainIndex - 1]) ?? null
|
|
}
|
|
|
|
/** agy cannot resume these natively, so it continues from the transcript; an owning chat reopens instead. */
|
|
export function isAntigravityReferenceSession(session: {
|
|
agent: string
|
|
filePath?: string
|
|
structuredSession?: unknown
|
|
}): boolean {
|
|
const origin = session.filePath ? antigravitySessionOrigin(session.filePath) : null
|
|
return (
|
|
session.agent === 'antigravity' &&
|
|
origin !== null &&
|
|
origin !== 'antigravity-cli' &&
|
|
!session.structuredSession
|
|
)
|
|
}
|
|
|
|
export function antigravityTranscriptReferencePrompt(filePath: string): string {
|
|
return `Review the chat transcript at ${JSON.stringify(filePath)}. Confirm your understanding of the previous conversation and continue from where it left off. This starts a new CLI conversation using the original transcript as a reference.`
|
|
}
|