import type { SessionSummaryMeta } from "./state/sessionState.js"; import type { ArtifactOrigin } from "../../artifactIntegrations/common/artifactIntegration.js"; /** * The kinds an agent can record for a chat, as either an artifact (the chat * produced it) or a reference (the chat found it worth returning to). Each kind * carries the one field the client needs to open it, plus a label. */ export declare enum SessionArtifactType { PullRequest = "pullRequest", Issue = "issue", Commit = "commit", Website = "website", File = "file", Resource = "resource" } export declare const SESSION_ARTIFACT_TYPES: readonly SessionArtifactType[]; /** A chat artifact or reference as stored by the host and published to clients. */ export interface ISessionArtifact { readonly id: string; /** Chat that recorded this entry. Older entries have no owner and default to the session's main chat. */ readonly chat?: string; readonly type: SessionArtifactType; readonly label: string; /** * `true` for an artifact — something this chat produced — and `false` for a * reference, something it only points the user at. */ readonly isArtifact: boolean; /** Link for pull request, issue, commit and website entries. */ readonly link?: string; /** Resource URI for file and resource entries. */ readonly uri?: string; /** Commit hash for commit entries. */ readonly commitHash?: string; /** Whether a pull request or issue link points at GitHub. Host-computed. */ readonly isGitHub?: boolean; readonly origin?: ArtifactOrigin; } /** * Reserved key under {@link SessionSummaryMeta} holding the aggregate artifacts * and references recorded across the session's chats. VS Code convention * layered on the protocol's generic `_meta` bag. */ export declare const SESSION_META_ARTIFACTS_KEY = "agentHost/sessionArtifacts"; /** Reads the artifacts recorded on a session's `_meta` bag. */ export declare function readSessionArtifacts(meta: SessionSummaryMeta | undefined): readonly ISessionArtifact[]; /** * The artifacts recorded on a session's `_meta` bag, most recent first. * Artifacts are appended as the agent records them, so the stored order runs * oldest to newest, while every surface lists the newest entry at the top of * its group. */ export declare function readSessionArtifactsNewestFirst(meta: SessionSummaryMeta | undefined): readonly ISessionArtifact[]; /** Returns `meta` with the artifact slot replaced, dropping it when empty. */ export declare function withSessionArtifacts(meta: SessionSummaryMeta | undefined, artifacts: readonly ISessionArtifact[]): SessionSummaryMeta | undefined; /** Serializes artifacts for the session database. */ export declare function stringifySessionArtifacts(artifacts: readonly ISessionArtifact[]): string; /** The outcome of reading persisted artifacts: what was read, and what was lost. */ export interface IParsedSessionArtifacts { readonly artifacts: readonly ISessionArtifact[]; /** Why nothing could be read, when the payload itself was unreadable. */ readonly error?: Error; /** How many individual entries were rejected as malformed. */ readonly dropped: number; } /** * Parses artifacts previously written by {@link stringifySessionArtifacts}. * Reports what could not be read rather than silently returning less, so a * corrupt row does not empty a session's artifacts without a trace. */ export declare function parseSessionArtifacts(value: string | undefined): IParsedSessionArtifacts; /** * The value that identifies an entry for de-duplication: its link, resource * URI or commit hash, normalized for comparison. */ export declare function getSessionArtifactValue(artifact: ISessionArtifact): string; /** Whether a pull request or issue link points at github.com or a GitHub Enterprise host. */ export declare function isGitHubArtifactLink(link: string): boolean;