export type SkillsStorageMode = "local" | "remote" | "hybrid"; export declare const SKILLS_STORAGE_TABLES: readonly ["skills_sync_records", "skills_sync_cursors"]; export declare const STORAGE_TABLES: readonly ["skills_sync_records", "skills_sync_cursors"]; export type SkillsStorageTable = typeof SKILLS_STORAGE_TABLES[number]; export interface SkillsNativeStorageConfig { mode: SkillsStorageMode; databaseUrl?: string; databaseSsl?: boolean; databaseSchema?: string; s3Bucket?: string; s3Prefix?: string; awsRegion?: string; s3Endpoint?: string; s3ForcePathStyle?: boolean; syncBatchSize: number; dryRun: boolean; } export declare const SKILLS_NATIVE_STORAGE_ENV: { readonly mode: "HASNA_SKILLS_STORAGE_MODE"; readonly databaseUrl: "HASNA_SKILLS_DATABASE_URL"; readonly databaseSsl: "HASNA_SKILLS_DATABASE_SSL"; readonly databaseSchema: "HASNA_SKILLS_DATABASE_SCHEMA"; readonly s3Bucket: "HASNA_SKILLS_S3_BUCKET"; readonly s3Prefix: "HASNA_SKILLS_S3_PREFIX"; readonly awsRegion: "HASNA_SKILLS_AWS_REGION"; readonly s3Endpoint: "HASNA_SKILLS_S3_ENDPOINT"; readonly s3ForcePathStyle: "HASNA_SKILLS_S3_FORCE_PATH_STYLE"; readonly s3AccessKeyId: "HASNA_SKILLS_S3_ACCESS_KEY_ID"; readonly s3SecretAccessKey: "HASNA_SKILLS_S3_SECRET_ACCESS_KEY"; readonly s3SessionToken: "HASNA_SKILLS_S3_SESSION_TOKEN"; readonly syncBatchSize: "HASNA_SKILLS_SYNC_BATCH_SIZE"; readonly dryRun: "HASNA_SKILLS_SYNC_DRY_RUN"; }; export declare const SKILLS_NATIVE_STORAGE_FALLBACK_ENV: { readonly mode: "SKILLS_STORAGE_MODE"; readonly databaseUrl: "SKILLS_DATABASE_URL"; readonly databaseSsl: "SKILLS_DATABASE_SSL"; readonly databaseSchema: "SKILLS_DATABASE_SCHEMA"; readonly s3Bucket: "SKILLS_S3_BUCKET"; readonly s3Prefix: "SKILLS_S3_PREFIX"; readonly awsRegion: "SKILLS_AWS_REGION"; readonly s3Endpoint: "SKILLS_S3_ENDPOINT"; readonly s3ForcePathStyle: "SKILLS_S3_FORCE_PATH_STYLE"; readonly s3AccessKeyId: "SKILLS_S3_ACCESS_KEY_ID"; readonly s3SecretAccessKey: "SKILLS_S3_SECRET_ACCESS_KEY"; readonly s3SessionToken: "SKILLS_S3_SESSION_TOKEN"; readonly syncBatchSize: "SKILLS_SYNC_BATCH_SIZE"; readonly dryRun: "SKILLS_SYNC_DRY_RUN"; }; export declare const SKILLS_STORAGE_ENV: { readonly mode: "HASNA_SKILLS_STORAGE_MODE"; readonly databaseUrl: "HASNA_SKILLS_DATABASE_URL"; readonly databaseSsl: "HASNA_SKILLS_DATABASE_SSL"; readonly databaseSchema: "HASNA_SKILLS_DATABASE_SCHEMA"; readonly s3Bucket: "HASNA_SKILLS_S3_BUCKET"; readonly s3Prefix: "HASNA_SKILLS_S3_PREFIX"; readonly awsRegion: "HASNA_SKILLS_AWS_REGION"; readonly s3Endpoint: "HASNA_SKILLS_S3_ENDPOINT"; readonly s3ForcePathStyle: "HASNA_SKILLS_S3_FORCE_PATH_STYLE"; readonly s3AccessKeyId: "HASNA_SKILLS_S3_ACCESS_KEY_ID"; readonly s3SecretAccessKey: "HASNA_SKILLS_S3_SECRET_ACCESS_KEY"; readonly s3SessionToken: "HASNA_SKILLS_S3_SESSION_TOKEN"; readonly syncBatchSize: "HASNA_SKILLS_SYNC_BATCH_SIZE"; readonly dryRun: "HASNA_SKILLS_SYNC_DRY_RUN"; }; export declare const SKILLS_STORAGE_FALLBACK_ENV: { readonly mode: "SKILLS_STORAGE_MODE"; readonly databaseUrl: "SKILLS_DATABASE_URL"; readonly databaseSsl: "SKILLS_DATABASE_SSL"; readonly databaseSchema: "SKILLS_DATABASE_SCHEMA"; readonly s3Bucket: "SKILLS_S3_BUCKET"; readonly s3Prefix: "SKILLS_S3_PREFIX"; readonly awsRegion: "SKILLS_AWS_REGION"; readonly s3Endpoint: "SKILLS_S3_ENDPOINT"; readonly s3ForcePathStyle: "SKILLS_S3_FORCE_PATH_STYLE"; readonly s3AccessKeyId: "SKILLS_S3_ACCESS_KEY_ID"; readonly s3SecretAccessKey: "SKILLS_S3_SECRET_ACCESS_KEY"; readonly s3SessionToken: "SKILLS_S3_SESSION_TOKEN"; readonly syncBatchSize: "SKILLS_SYNC_BATCH_SIZE"; readonly dryRun: "SKILLS_SYNC_DRY_RUN"; }; export declare function resolveSkillsNativeStorageConfig(env?: Record): SkillsNativeStorageConfig; export declare function resolveStorageConfig(env?: Record): SkillsNativeStorageConfig; export declare function getSkillsStorageMode(env?: Record): SkillsStorageMode; export declare function getStorageMode(env?: Record): SkillsStorageMode; export declare function getSkillsStorageDatabaseEnv(env?: Record): string; export declare function getStorageDatabaseEnv(env?: Record): string; export declare function getSkillsStorageDatabaseUrl(env?: Record): string | undefined; export declare function getStorageDatabaseUrl(env?: Record): string | undefined; export interface SkillsNativeStorageStatus { package: "open-skills"; mode: SkillsStorageMode; tables: readonly SkillsStorageTable[]; env: { mode: string; databaseUrl: string; s3Bucket: string; }; local: { dataDir: string; projectStateDir: string; feedbackDbPath: string; }; remote: { databaseConfigured: boolean; s3Configured: boolean; databaseEnv: string; s3BucketEnv: string; activeModeEnv: string; activeDatabaseEnv: string; activeS3BucketEnv: string; region: string; dryRun: boolean; }; } export declare function getSkillsNativeStorageStatus(options?: { targetDir?: string; env?: Record; }): SkillsNativeStorageStatus; export declare function getSkillsStorageStatus(options?: { targetDir?: string; env?: Record; }): SkillsNativeStorageStatus; export declare function getStorageStatus(options?: { targetDir?: string; env?: Record; }): SkillsNativeStorageStatus; export interface SkillsSnapshotFile { path: string; sizeBytes: number; sha256: string; contentBase64?: string; } export interface SkillsLocalSnapshot { schemaVersion: 1; exportedAt: string; files: SkillsSnapshotFile[]; } export declare function exportSkillsLocalSnapshot(targetDir?: string, options?: { includeFileContents?: boolean; }): SkillsLocalSnapshot; export declare function importSkillsLocalSnapshot(snapshot: SkillsLocalSnapshot, targetDir?: string, options?: { overwrite?: boolean; }): { written: number; skipped: number; }; export interface SkillsPostgresQueryClient { query(sql: string, values?: readonly unknown[]): Promise<{ rows: T[]; }>; } export interface SkillsSyncRecord { scope: string; kind: string; id: string; updatedAt: string; deletedAt?: string | null; source?: string | null; payload: Record; } export declare const skillsPostgresSyncSchemaSql: string; export declare class SkillsPostgresSyncStore { private readonly client; constructor(client: SkillsPostgresQueryClient); ensureSchema(): Promise; upsertRecords(records: readonly SkillsSyncRecord[]): Promise; pullUpdatedSince(params: { scope: string; since?: string; limit?: number; }): Promise; getCursor(scope: string, cursorName: string): Promise; setCursor(scope: string, cursorName: string, value: string): Promise; } export declare function createSkillsPostgresSyncStore(client: SkillsPostgresQueryClient): SkillsPostgresSyncStore; export declare function createSkillsSnapshotSyncRecord(snapshot: SkillsLocalSnapshot, options?: { scope?: string; id?: string; source?: string; }): SkillsSyncRecord; export interface AwsCredentials { accessKeyId: string; secretAccessKey: string; sessionToken?: string; } export interface SkillsS3ObjectStoreOptions { bucket: string; region?: string; prefix?: string; endpoint?: string; forcePathStyle?: boolean; credentials: AwsCredentials; fetch?: SkillsFetch; } export interface SkillsS3PutObjectOptions { key: string; body: Uint8Array | string; contentType?: string; } export interface SkillsS3StoredObject { key: string; url: string; etag?: string | null; sizeBytes: number; } export type SkillsFetch = (input: string | URL | Request, init?: RequestInit) => Promise; export declare class SkillsS3ObjectStore { private readonly options; private readonly fetchImpl; private readonly region; private readonly prefix; constructor(options: SkillsS3ObjectStoreOptions); objectKey(path: string): string; objectUrl(key: string): string; putObject(params: SkillsS3PutObjectOptions): Promise; getObject(key: string): Promise; } export declare function createSkillsS3ObjectStore(options: SkillsS3ObjectStoreOptions): SkillsS3ObjectStore; export interface SkillsS3SnapshotPlanEntry { path: string; key: string; sizeBytes: number; sha256: string; } export declare function planSkillsS3SnapshotUpload(snapshot: SkillsLocalSnapshot, options?: { prefix?: string; }): SkillsS3SnapshotPlanEntry[]; export declare function uploadSkillsSnapshotFilesToS3(snapshot: SkillsLocalSnapshot, store: SkillsS3ObjectStore): Promise; export interface SignSkillsAwsV4RequestOptions { method: string; url: string; region: string; service: string; headers?: Record; body?: Uint8Array | string; credentials: AwsCredentials; now?: Date; } export declare function signSkillsAwsV4Request(options: SignSkillsAwsV4RequestOptions): { headers: Record; canonicalRequest: string; stringToSign: string; }; export declare function buildSkillsS3ObjectUrl(params: { bucket: string; key: string; region?: string; endpoint?: string; forcePathStyle?: boolean; }): string;