chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export declare const COMPACTION_CONTEXT_PROMPT: string;
|
||||
@@ -0,0 +1,5 @@
|
||||
export declare const HOOK_NAME = "compaction-context-injector";
|
||||
export declare const AGENT_RECOVERY_PROMPT = "[restore checkpointed session agent configuration after compaction]";
|
||||
export declare const NO_TEXT_TAIL_THRESHOLD = 5;
|
||||
export declare const RECOVERY_COOLDOWN_MS = 60000;
|
||||
export declare const RECENT_COMPACTION_WINDOW_MS: number;
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { CompactionContextClient, CompactionContextInjector } from "./types";
|
||||
export declare function createCompactionContextInjector(options?: {
|
||||
ctx?: CompactionContextClient;
|
||||
backgroundManager?: BackgroundManager;
|
||||
}): CompactionContextInjector;
|
||||
@@ -0,0 +1 @@
|
||||
export { createCompactionContextInjector } from "./hook";
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
|
||||
export type RecoveryPromptConfig = CompactionAgentConfigCheckpoint & {
|
||||
agent: string;
|
||||
};
|
||||
export declare function createExpectedRecoveryPromptConfig(checkpoint: Pick<RecoveryPromptConfig, "agent"> & CompactionAgentConfigCheckpoint, currentPromptConfig: CompactionAgentConfigCheckpoint): RecoveryPromptConfig;
|
||||
export declare function isPromptConfigRecovered(actualPromptConfig: CompactionAgentConfigCheckpoint, expectedPromptConfig: RecoveryPromptConfig): boolean;
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CompactionContextClient } from "./types";
|
||||
import type { TailMonitorState } from "./tail-monitor";
|
||||
export declare function createRecoveryLogic(ctx: CompactionContextClient | undefined, getTailState: (sessionID: string) => TailMonitorState): {
|
||||
recoverCheckpointedAgentConfig: (sessionID: string, reason: "session.compacted" | "no-text-tail") => Promise<boolean>;
|
||||
maybeWarnAboutNoTextTail: (sessionID: string) => Promise<void>;
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare function isCompactionAgent(agent: string | undefined): boolean;
|
||||
export declare function resolveSessionID(props?: Record<string, unknown>): string | undefined;
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
|
||||
type ResolverContext = {
|
||||
client: {
|
||||
session: {
|
||||
messages: (input: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
};
|
||||
};
|
||||
directory: string;
|
||||
};
|
||||
export declare function resolveSessionPromptConfig(ctx: ResolverContext, sessionID: string): Promise<CompactionAgentConfigCheckpoint>;
|
||||
export declare function resolveLatestSessionPromptConfig(ctx: ResolverContext, sessionID: string): Promise<CompactionAgentConfigCheckpoint>;
|
||||
export {};
|
||||
@@ -0,0 +1,13 @@
|
||||
export type TailMonitorState = {
|
||||
currentMessageID?: string;
|
||||
currentHasOutput: boolean;
|
||||
consecutiveNoTextMessages: number;
|
||||
lastCompactedAt?: number;
|
||||
lastRecoveryAt?: number;
|
||||
};
|
||||
export declare function finalizeTrackedAssistantMessage(state: TailMonitorState): number;
|
||||
export declare function shouldTreatAssistantPartAsOutput(part: {
|
||||
type?: string;
|
||||
text?: string;
|
||||
}): boolean;
|
||||
export declare function trackAssistantOutput(state: TailMonitorState, messageID?: string): void;
|
||||
@@ -0,0 +1,43 @@
|
||||
export interface CompactionContextInjector {
|
||||
capture: (sessionID: string) => Promise<void>;
|
||||
inject: (sessionID?: string) => string;
|
||||
event: (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
}
|
||||
export type CompactionContextClient = {
|
||||
client: {
|
||||
session: {
|
||||
messages: (input: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
promptAsync: (input: {
|
||||
path: {
|
||||
id: string;
|
||||
};
|
||||
body: {
|
||||
noReply?: boolean;
|
||||
agent?: string;
|
||||
model?: {
|
||||
providerID: string;
|
||||
modelID: string;
|
||||
};
|
||||
tools?: Record<string, boolean>;
|
||||
parts: Array<{
|
||||
type: "text";
|
||||
text: string;
|
||||
}>;
|
||||
};
|
||||
query?: {
|
||||
directory: string;
|
||||
};
|
||||
}) => Promise<unknown>;
|
||||
};
|
||||
};
|
||||
directory: string;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
|
||||
type PromptConfigInfo = {
|
||||
agent?: string;
|
||||
model?: {
|
||||
providerID?: string;
|
||||
modelID?: string;
|
||||
};
|
||||
providerID?: string;
|
||||
modelID?: string;
|
||||
};
|
||||
export declare function resolveValidatedModel(info: PromptConfigInfo | undefined): CompactionAgentConfigCheckpoint["model"] | undefined;
|
||||
export declare function validateCheckpointModel(checkpointModel: CompactionAgentConfigCheckpoint["model"], currentModel: CompactionAgentConfigCheckpoint["model"]): CompactionAgentConfigCheckpoint["model"] | undefined;
|
||||
export {};
|
||||
Reference in New Issue
Block a user