import { Config, Context, Effect, Layer, Redacted } from "effect"; import { HttpClient } from "effect/unstable/http"; export interface AddBookmarkInput { url: string; archived?: boolean; tags?: string[]; note?: string; } export interface KarakeepCredentials { readonly baseUrl: string; readonly apiKey: string | Redacted.Redacted; } declare const KarakeepError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "KarakeepError"; } & Readonly; /** A Karakeep API call failed (transport, status, decode, or timeout). */ export declare class KarakeepError extends KarakeepError_base<{ readonly operation: "createBookmark" | "attachTags"; readonly url: string | undefined; readonly bookmarkId: string | undefined; readonly cause: unknown; }> { get message(): string; } declare const KarakeepDisabledError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & { readonly _tag: "KarakeepDisabledError"; } & Readonly; /** `Karakeep.layerConfig` found no `KARAKEEP_URL` / `KARAKEEP_API_KEY`. */ export declare class KarakeepDisabledError extends KarakeepDisabledError_base { get message(): string; } declare const Karakeep_base: Context.ServiceClass): Effect.Effect<{ id: string; }, KarakeepError | KarakeepDisabledError>; attachTags(bookmarkId: string, tags: string[]): Effect.Effect; /** The dashboard URL of a bookmark. */ bookmarkUrl(bookmarkId: string): string; /** * Creates the bookmark, attaches `tags`, and resolves the dashboard URL. * A tag failure still fails (with the `bookmarkId` on the error) so the * caller can see the bookmark exists. */ addBookmark(input: AddBookmarkInput): Effect.Effect; }>; export declare class Karakeep extends Karakeep_base { static layer(credentials: KarakeepCredentials): Layer.Layer; /** Every call fails with `KarakeepDisabledError`. */ static readonly layerDisabled: Layer.Layer; /** Reads `KARAKEEP_URL` and `KARAKEEP_API_KEY`; disabled when either is missing. */ static readonly layerConfig: Layer.Layer; } /** Adds a bookmark through the `Karakeep` service and resolves its dashboard URL. */ export declare const addBookmark: (input: AddBookmarkInput) => Effect.Effect; export {};