repositories / pi-ext
pi-ext
bugabingas pi extensions
owned by admin
extensions/autopsy/src/types.ts
Rawexport type PromptSnapshot = {
id: number;
timestamp: string;
entryId: string | null;
prompt: string;
grouped: string;
};
export type InspectorCost = {
input: number | null;
output: number | null;
cacheRead: number | null;
cacheWrite: number | null;
total: number | null;
};
export type CatalogPrices = {
input: number;
output: number;
cacheRead: number;
cacheWrite: number;
tiers?:
| readonly {
inputTokensAbove: number;
input: number;
output: number;
cacheRead: number;
cacheWrite: number;
}[]
| undefined;
};
export type InspectorUsage = {
input: number | null;
output: number | null;
cacheRead: number | null;
cacheWrite: number | null;
totalTokens: number | null;
cost: number | null;
costSource: "provider" | "catalog" | "recorded";
costBreakdown: InspectorCost;
catalogCost: InspectorCost | null;
};
export type InspectorMetrics = {
durationMs: number | null;
startedAt: string | null;
textBytes: number | null;
imageBytes: number | null;
imageCount: number | null;
totalBytes: number | null;
};
export type EntryDetailEvent =
| { type: "text"; text: string }
| { type: "image"; index: number; mimeType: string }
| { type: "end" }
| { type: "error"; message: string };
export type InspectorEntry = {
id: string;
parentId: string | null;
timestamp: string;
type: string;
role: string;
toolNames: string[];
images: {
index: number;
mimeType: string;
bytes: number | null;
width: number | null;
height: number | null;
}[];
provider: string | null;
model: string | null;
metrics: InspectorMetrics;
onBranch: boolean;
text: string;
raw: string;
previewTruncated: boolean;
usage: InspectorUsage | null;
};
export type InspectorQuery = {
q?: string;
role?: string;
type?: string;
branch?: "current" | "all";
provider?: string;
model?: string;
from?: string;
to?: string;
order?: "newest" | "oldest";
after?: string;
before?: string;
around?: string;
limit?: number;
};
export type InspectorSummary = {
entries: number;
usageEntries: number;
tokens: number | null;
tokensKnown: number;
storedCost: number | null;
storedCostKnown: number;
catalogCost: number | null;
catalogCostKnown: number;
durationMs: number | null;
durationKnown: number;
firstTimestamp: string | null;
lastTimestamp: string | null;
};
export type InspectorMetricEvent =
| { type: "entry"; entry: InspectorEntry }
| { type: "end" }
| { type: "error"; message: string };
export type InspectorData = {
sessionId: string;
name: string;
cwd: string;
leafId: string | null;
generatedAt: string;
entries: InspectorEntry[];
revision: string;
page: {
total: number;
start: number;
nextCursor: string | null;
previousCursor: string | null;
};
summary: InspectorSummary;
facets: {
roles: string[];
types: string[];
providers: (string | null)[];
models: (string | null)[];
};
prompts: PromptSnapshot[];
warnings: string[];
};