Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyAsset ¶
CopyAsset copies a file to the assets directory using its SHA-256 hash as the filename. Returns the asset:// reference. Only passive image types are accepted; active content is rejected.
func ExtractZip ¶
ExtractZip extracts a zip file to a temporary directory. Returns the directory path and a cleanup function that removes it. The caller must call cleanup when done.
Types ¶
type AssetIndex ¶
type AssetIndex struct {
// contains filtered or unexported fields
}
AssetIndex maps asset pointer prefixes to file paths on disk.
func BuildAssetIndex ¶
func BuildAssetIndex(exportDir string) AssetIndex
BuildAssetIndex scans an export directory for image assets. ChatGPT exports store images in three locations:
- dalle-generations/ (DALL-E outputs)
- user-*/ directories (user uploads via sediment://)
- root directory as file-* (user uploads via file-service://)
type ImportCallbacks ¶
type ImportCallbacks struct {
// OnProgress fires after each conversation with current
// cumulative stats.
OnProgress func(ImportStats)
// OnIndexing fires before the FTS index rebuild starts.
OnIndexing func()
}
ImportCallbacks provides optional progress reporting.
type ImportStats ¶
type ImportStats struct {
Imported int `json:"imported"`
Updated int `json:"updated"`
Skipped int `json:"skipped"`
Errors int `json:"errors"`
}
ImportStats reports the outcome of an import operation.
func ImportChatGPT ¶
func ImportChatGPT( ctx context.Context, store db.Store, dir string, assetsDir string, cb *ImportCallbacks, ) (stats ImportStats, retErr error)
ImportChatGPT reads a ChatGPT export directory (containing conversations-*.json files) and imports each conversation into the store. Existing sessions are skipped to preserve archived data.
func ImportClaudeAI ¶
func ImportClaudeAI( ctx context.Context, store db.Store, r io.Reader, cb *ImportCallbacks, ) (stats ImportStats, retErr error)
ImportClaudeAI reads a Claude.ai conversations.json export and upserts each conversation into the store. Existing sessions are updated (messages replaced); user-renamed display names are preserved. Excluded (deleted) sessions are counted as skipped.