feat(core): define TrajectoryProvider interface

This commit is contained in:
Sehoon Shon
2026-03-19 00:23:02 -04:00
parent 2009fbbd92
commit b75ec12185
+23
View File
@@ -9,6 +9,8 @@ import * as path from 'node:path';
import { inspect } from 'node:util'; import { inspect } from 'node:util';
import process from 'node:process'; import process from 'node:process';
import { z } from 'zod'; import { z } from 'zod';
import type { ConversationRecord } from '../services/chatRecordingService.js';
export type { ConversationRecord };
import { import {
AuthType, AuthType,
createContentGenerator, createContentGenerator,
@@ -228,6 +230,25 @@ export interface ResolvedExtensionSetting {
source?: string; source?: string;
} }
export interface TrajectoryProvider {
/** Prefix used to identify sessions from this provider (e.g., 'ext:') */
prefix: string;
/** Optional display name for UI Tabs */
displayName?: string;
/** Return an array of conversational tags/ids */
listSessions(workspaceUri?: string): Promise<
Array<{
id: string;
mtime: string;
name?: string;
displayName?: string;
messageCount?: number;
}>
>;
/** Load a single conversation payload */
loadSession(id: string): Promise<ConversationRecord | null>;
}
export interface AgentRunConfig { export interface AgentRunConfig {
maxTimeMinutes?: number; maxTimeMinutes?: number;
maxTurns?: number; maxTurns?: number;
@@ -377,6 +398,8 @@ export interface GeminiCLIExtension {
* Used to migrate an extension to a new repository source. * Used to migrate an extension to a new repository source.
*/ */
migratedTo?: string; migratedTo?: string;
/** Loaded JS module for trajectory decoding */
trajectoryProviderModule?: TrajectoryProvider;
} }
export interface ExtensionInstallMetadata { export interface ExtensionInstallMetadata {