@diegoaltoworks/chatter 0.32.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/images/cache.d.ts +32 -0
  2. package/dist/images/cache.d.ts.map +1 -0
  3. package/dist/images/cache.test.d.ts +2 -0
  4. package/dist/images/cache.test.d.ts.map +1 -0
  5. package/dist/images/cacheStore.d.ts +20 -0
  6. package/dist/images/cacheStore.d.ts.map +1 -0
  7. package/dist/images/cacheStore.test.d.ts +8 -0
  8. package/dist/images/cacheStore.test.d.ts.map +1 -0
  9. package/dist/images/captionComposer.d.ts +33 -0
  10. package/dist/images/captionComposer.d.ts.map +1 -0
  11. package/dist/images/captionComposer.test.d.ts +2 -0
  12. package/dist/images/captionComposer.test.d.ts.map +1 -0
  13. package/dist/images/cloudinaryClient.d.ts +12 -0
  14. package/dist/images/cloudinaryClient.d.ts.map +1 -0
  15. package/dist/images/cloudinaryClient.test.d.ts +2 -0
  16. package/dist/images/cloudinaryClient.test.d.ts.map +1 -0
  17. package/dist/images/cloudinaryConfig.d.ts +29 -0
  18. package/dist/images/cloudinaryConfig.d.ts.map +1 -0
  19. package/dist/images/cloudinaryConfig.test.d.ts +2 -0
  20. package/dist/images/cloudinaryConfig.test.d.ts.map +1 -0
  21. package/dist/images/cloudinarySignature.d.ts +9 -0
  22. package/dist/images/cloudinarySignature.d.ts.map +1 -0
  23. package/dist/images/cloudinarySignature.test.d.ts +2 -0
  24. package/dist/images/cloudinarySignature.test.d.ts.map +1 -0
  25. package/dist/images/config.d.ts +28 -0
  26. package/dist/images/config.d.ts.map +1 -0
  27. package/dist/images/config.test.d.ts +2 -0
  28. package/dist/images/config.test.d.ts.map +1 -0
  29. package/dist/images/generator.d.ts +19 -0
  30. package/dist/images/generator.d.ts.map +1 -0
  31. package/dist/images/generator.test.d.ts +2 -0
  32. package/dist/images/generator.test.d.ts.map +1 -0
  33. package/dist/images/index.d.ts +34 -0
  34. package/dist/images/index.d.ts.map +1 -0
  35. package/dist/images/index.js +412 -0
  36. package/dist/images/index.mjs +357 -0
  37. package/dist/images/openaiClient.d.ts +14 -0
  38. package/dist/images/openaiClient.d.ts.map +1 -0
  39. package/dist/images/openaiClient.test.d.ts +2 -0
  40. package/dist/images/openaiClient.test.d.ts.map +1 -0
  41. package/dist/images/types.d.ts +96 -0
  42. package/dist/images/types.d.ts.map +1 -0
  43. package/dist/images/uploader.d.ts +39 -0
  44. package/dist/images/uploader.d.ts.map +1 -0
  45. package/dist/images/uploader.test.d.ts +2 -0
  46. package/dist/images/uploader.test.d.ts.map +1 -0
  47. package/package.json +8 -2
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Image cache - deterministic keying and freshness, no I/O.
3
+ *
4
+ * The store itself is injected ({@link ImageCacheStore}): a host backs it with
5
+ * whatever it wants (see `./cacheStore` for the shipped Turso binding), so
6
+ * this file stays free of any DB client.
7
+ */
8
+ import type { ImageInput } from "./types";
9
+ /** A cached upload: where it lives, and when it was created. */
10
+ export interface ImageCacheEntry {
11
+ url: string;
12
+ /** Epoch milliseconds. */
13
+ createdAt: number;
14
+ }
15
+ /** Structural cache dependency - a host implements this against its own storage. */
16
+ export interface ImageCacheStore {
17
+ get(key: string): Promise<ImageCacheEntry | null>;
18
+ set(key: string, entry: ImageCacheEntry): Promise<void>;
19
+ }
20
+ /** Identical requests are served from cache for this long before regenerating. */
21
+ export declare const CACHE_TTL_MS: number;
22
+ /**
23
+ * Deterministic cache key (and Cloudinary `public_id`) for a request: the
24
+ * prompt plus any base/input images. The same prompt against a different
25
+ * photo must be a different picture.
26
+ */
27
+ export declare function publicIdForRequest(prompt: string, images?: {
28
+ baseImage?: ImageInput;
29
+ inputImages?: ImageInput[];
30
+ }): string;
31
+ export declare function isCacheEntryFresh(entry: ImageCacheEntry, now: number): boolean;
32
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/images/cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,QAAsB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;CAAE,GAC9D,MAAM,CAOR;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cache.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.test.d.ts","sourceRoot":"","sources":["../../src/images/cache.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Turso/libsql-backed {@link ImageCacheStore}.
3
+ *
4
+ * Schema and upsert only, mirroring `../usage/tursoStore`: idempotent table
5
+ * creation memoized per (client, table), and a table name restricted to a
6
+ * plain identifier since it is interpolated into SQL.
7
+ *
8
+ * `@libsql/client` is imported for its type alone, so this module adds no
9
+ * runtime dependency to anyone importing `./cache` for the pure key/freshness
10
+ * helpers.
11
+ */
12
+ import type { Client } from "@libsql/client";
13
+ import type { ImageCacheStore } from "./cache";
14
+ /**
15
+ * Creates a cache store backed by `tableName` on `client`. Table creation is
16
+ * idempotent and happens once per (client, table); give each cached resource
17
+ * its own table.
18
+ */
19
+ export declare function createTursoImageCacheStore(client: Client, tableName: string): ImageCacheStore;
20
+ //# sourceMappingURL=cacheStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cacheStore.d.ts","sourceRoot":"","sources":["../../src/images/cacheStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,SAAS,CAAC;AAmChE;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CA0B7F"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Turso image cache store tests.
3
+ *
4
+ * Run against a real in-memory libsql client, same rationale as
5
+ * `../usage/tursoStore.test.ts`: the properties worth proving are SQL-level.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=cacheStore.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cacheStore.test.d.ts","sourceRoot":"","sources":["../../src/images/cacheStore.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Optional caption helper for a generated image - two tiers, no content of
3
+ * its own.
4
+ *
5
+ * 1. `randomCaption()` picks from a caller-supplied template pool. Always
6
+ * works, costs nothing.
7
+ * 2. `composeCaption()` runs a caller-supplied compose step (typically an LLM
8
+ * call) racing a timeout; any failure or timeout falls back to tier 1. It
9
+ * never throws.
10
+ */
11
+ export interface CaptionRequest {
12
+ /** What the picture is of, used to fill `{subject}` in pool templates. */
13
+ subject: string;
14
+ /** Arbitrary extra context a caller's compose function may use. */
15
+ [key: string]: unknown;
16
+ }
17
+ export type CaptionComposeFn = (request: CaptionRequest) => Promise<string>;
18
+ export interface CaptionComposerOptions {
19
+ /** Templates with an optional `{subject}` placeholder. Ships no content - always caller-supplied. */
20
+ pool: readonly string[];
21
+ /** Best-effort tailored caption step, e.g. wrapping an LLM call. Omit to always use the pool. */
22
+ compose?: CaptionComposeFn;
23
+ /** Milliseconds before `compose` is abandoned in favour of the pool. */
24
+ timeoutMs?: number;
25
+ /** Injectable randomness for tests. Default `Math.random`. */
26
+ random?: () => number;
27
+ }
28
+ export interface CaptionComposer {
29
+ randomCaption(subject?: string): string;
30
+ composeCaption(request: CaptionRequest): Promise<string>;
31
+ }
32
+ export declare function createCaptionComposer(options: CaptionComposerOptions): CaptionComposer;
33
+ //# sourceMappingURL=captionComposer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captionComposer.d.ts","sourceRoot":"","sources":["../../src/images/captionComposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAE5E,MAAM,WAAW,sBAAsB;IACrC,qGAAqG;IACrG,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,iGAAiG;IACjG,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D;AAKD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAsCtF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=captionComposer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captionComposer.test.d.ts","sourceRoot":"","sources":["../../src/images/captionComposer.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The real Cloudinary upload client, over plain HTTP.
3
+ *
4
+ * This is the only file in the module that talks to Cloudinary. `fetchImpl`
5
+ * is injected (defaulting to the global `fetch`), so tests substitute a mock
6
+ * and never make a real upload. No Cloudinary SDK dependency is needed -
7
+ * signed uploads are a handful of form fields over `fetch`.
8
+ */
9
+ import { type CloudinaryModuleConfig } from "./cloudinaryConfig";
10
+ import type { CloudinaryUploadClient } from "./types";
11
+ export declare function createCloudinaryUploadClient(config: CloudinaryModuleConfig, fetchImpl?: typeof fetch): CloudinaryUploadClient;
12
+ //# sourceMappingURL=cloudinaryClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinaryClient.d.ts","sourceRoot":"","sources":["../../src/images/cloudinaryClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,sBAAsB,EAA0B,MAAM,oBAAoB,CAAC;AAEzF,OAAO,KAAK,EAAE,sBAAsB,EAA2B,MAAM,SAAS,CAAC;AAO/E,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,sBAAsB,EAC9B,SAAS,GAAE,OAAO,KAAa,GAC9B,sBAAsB,CA6CxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cloudinaryClient.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinaryClient.test.d.ts","sourceRoot":"","sources":["../../src/images/cloudinaryClient.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Cloudinary upload configuration - pure resolution, no I/O.
3
+ *
4
+ * Same shape as `./config`: the module never reads process.env itself, a host
5
+ * passes an env-shaped record in, and the feature is off when unconfigured.
6
+ */
7
+ export interface CloudinaryModuleConfig {
8
+ cloudName?: string;
9
+ apiKey?: string;
10
+ apiSecret?: string;
11
+ /** Cloudinary folder generated images are uploaded into. */
12
+ folder: string;
13
+ }
14
+ export declare const DEFAULT_CLOUDINARY_FOLDER = "generated";
15
+ /** The env vars this module reads, all optional. */
16
+ export interface CloudinaryEnv {
17
+ CLOUDINARY_CLOUD_NAME?: string;
18
+ CLOUDINARY_API_KEY?: string;
19
+ CLOUDINARY_API_SECRET?: string;
20
+ CLOUDINARY_FOLDER?: string;
21
+ }
22
+ export declare function resolveCloudinaryConfig(env?: CloudinaryEnv, overrides?: Partial<CloudinaryModuleConfig>): CloudinaryModuleConfig;
23
+ /** Feature detection: any credential missing, no upload. Narrows the credential fields to `string`. */
24
+ export declare function isCloudinaryConfigured(config: CloudinaryModuleConfig): config is CloudinaryModuleConfig & {
25
+ cloudName: string;
26
+ apiKey: string;
27
+ apiSecret: string;
28
+ };
29
+ //# sourceMappingURL=cloudinaryConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinaryConfig.d.ts","sourceRoot":"","sources":["../../src/images/cloudinaryConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAOD,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,aAAkB,EACvB,SAAS,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC9C,sBAAsB,CASxB;AAED,uGAAuG;AACvG,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,IAAI,sBAAsB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAE7F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cloudinaryConfig.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinaryConfig.test.d.ts","sourceRoot":"","sources":["../../src/images/cloudinaryConfig.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Cloudinary's signed-upload scheme - pure, no I/O.
3
+ *
4
+ * Sign every parameter except the file itself: sort keys, join as `key=value`
5
+ * pairs with `&`, append the API secret with no separator, then SHA-1 the
6
+ * result. https://cloudinary.com/documentation/signatures
7
+ */
8
+ export declare function signCloudinaryParams(params: Record<string, string>, apiSecret: string): string;
9
+ //# sourceMappingURL=cloudinarySignature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinarySignature.d.ts","sourceRoot":"","sources":["../../src/images/cloudinarySignature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAM9F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cloudinarySignature.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudinarySignature.test.d.ts","sourceRoot":"","sources":["../../src/images/cloudinarySignature.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Image module configuration - pure resolution, no I/O.
3
+ *
4
+ * The module never reads process.env itself; a host passes an env-shaped
5
+ * record in. That keeps the module liftable and lets tests describe
6
+ * configured and unconfigured worlds without touching the real environment.
7
+ */
8
+ export interface ImageModuleConfig {
9
+ /** Absent or empty means the feature is off; the server still boots. */
10
+ apiKey?: string;
11
+ model: string;
12
+ size: string;
13
+ quality: string;
14
+ }
15
+ export declare const DEFAULT_IMAGE_MODEL = "gpt-image-1";
16
+ export declare const DEFAULT_IMAGE_SIZE = "1024x1024";
17
+ export declare const DEFAULT_IMAGE_QUALITY = "medium";
18
+ /** The env vars this module reads, all optional. */
19
+ export interface ImageEnv {
20
+ OPENAI_API_KEY?: string;
21
+ IMAGE_MODEL?: string;
22
+ IMAGE_SIZE?: string;
23
+ IMAGE_QUALITY?: string;
24
+ }
25
+ export declare function resolveImageConfig(env?: ImageEnv, overrides?: Partial<ImageModuleConfig>): ImageModuleConfig;
26
+ /** Feature detection: no key, no image generation. */
27
+ export declare function isImageConfigured(config: ImageModuleConfig): boolean;
28
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/images/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,oDAAoD;AACpD,MAAM,WAAW,QAAQ;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAOD,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,QAAa,EAClB,SAAS,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACzC,iBAAiB,CAOnB;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAEpE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../src/images/config.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Image generation - the API call and its error mapping.
3
+ *
4
+ * Every dependency that costs money is injected, so the test suite never
5
+ * makes a real gpt-image-1 call. Prompt composition is entirely the caller's
6
+ * job (see `ImageRequest.prompt`); this module holds no template or
7
+ * character content.
8
+ */
9
+ import { type ImageModuleConfig } from "./config";
10
+ import { type GeneratedImage, type ImageClient, type ImageRequest } from "./types";
11
+ export interface ImageGeneratorDeps {
12
+ client: ImageClient;
13
+ }
14
+ export interface ImageGenerator {
15
+ isConfigured(): boolean;
16
+ generateImage(request: ImageRequest): Promise<GeneratedImage>;
17
+ }
18
+ export declare function createImageGenerator(config: ImageModuleConfig, deps: ImageGeneratorDeps): ImageGenerator;
19
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/images/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAqB,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,IAAI,OAAO,CAAC;IACxB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC/D;AAuBD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,kBAAkB,GACvB,cAAc,CA6ChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.test.d.ts","sourceRoot":"","sources":["../../src/images/generator.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Image generation module - public entry point.
3
+ *
4
+ * `src/images/` is a self-contained, framework-free module: nothing here
5
+ * imports from chatter's core, routes or channels, so it can be lifted
6
+ * upstream as-is. Prompt composition, caption content and spend limits are
7
+ * all the caller's job - this module ships no persona or bot content of its
8
+ * own, and composes with `../usage` for daily spend limits rather than
9
+ * reimplementing one.
10
+ *
11
+ * Published as the `@diegoaltoworks/chatter/images` subpath so the core
12
+ * install stays untouched by it.
13
+ *
14
+ * @packageDocumentation
15
+ */
16
+ export type { ImageCacheEntry, ImageCacheStore } from "./cache";
17
+ export { CACHE_TTL_MS, isCacheEntryFresh, publicIdForRequest, } from "./cache";
18
+ export { createTursoImageCacheStore } from "./cacheStore";
19
+ export type { CaptionComposeFn, CaptionComposer, CaptionComposerOptions, CaptionRequest, } from "./captionComposer";
20
+ export { createCaptionComposer } from "./captionComposer";
21
+ export { createCloudinaryUploadClient } from "./cloudinaryClient";
22
+ export type { CloudinaryEnv, CloudinaryModuleConfig } from "./cloudinaryConfig";
23
+ export { DEFAULT_CLOUDINARY_FOLDER, isCloudinaryConfigured, resolveCloudinaryConfig, } from "./cloudinaryConfig";
24
+ export { signCloudinaryParams } from "./cloudinarySignature";
25
+ export type { ImageEnv, ImageModuleConfig } from "./config";
26
+ export { DEFAULT_IMAGE_MODEL, DEFAULT_IMAGE_QUALITY, DEFAULT_IMAGE_SIZE, isImageConfigured, resolveImageConfig, } from "./config";
27
+ export type { ImageGenerator, ImageGeneratorDeps } from "./generator";
28
+ export { createImageGenerator } from "./generator";
29
+ export { createOpenAIImageClient } from "./openaiClient";
30
+ export type { CloudinaryUploadClient, CloudinaryUploadRequest, CloudinaryUploadResponse, GeneratedImage, ImageClient, ImageClientRequest, ImageClientResponse, ImageErrorCode, ImageInput, ImageRequest, } from "./types";
31
+ export { ImageGenerationError } from "./types";
32
+ export type { ImageUploader, ImageUploaderDeps, UploadedImage } from "./uploader";
33
+ export { createImageUploader } from "./uploader";
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}