feat(imajin-client): ✨ update version numbers in package files
This commit is contained in:
parent
2f85d6a258
commit
5600964067
8 changed files with 258 additions and 6 deletions
2
node_modules/.package-lock.json
generated
vendored
2
node_modules/.package-lock.json
generated
vendored
|
|
@ -8786,7 +8786,7 @@
|
|||
},
|
||||
"packages/imajin-client": {
|
||||
"name": "@lilith/imajin-client",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lilith/imajin-diffusion-client": "*",
|
||||
|
|
|
|||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -10237,7 +10237,7 @@
|
|||
},
|
||||
"packages/imajin-client": {
|
||||
"name": "@lilith/imajin-client",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lilith/imajin-diffusion-client": "*",
|
||||
|
|
|
|||
143
packages/imajin-client/dist/index.cjs
vendored
Normal file
143
packages/imajin-client/dist/index.cjs
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var index_exports = {};
|
||||
__export(index_exports, {
|
||||
DEFAULT_CONFIG: () => DEFAULT_CONFIG,
|
||||
DiffusionClient: () => DiffusionClient,
|
||||
ImajinClient: () => ImajinClient,
|
||||
ProcessingClient: () => ProcessingClient,
|
||||
PromptClient: () => PromptClient
|
||||
});
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
var PromptClient = __toESM(require("@lilith/imajin-prompt-client"), 1);
|
||||
var DiffusionClient = __toESM(require("@lilith/imajin-diffusion-client"), 1);
|
||||
var ProcessingClient = __toESM(require("@lilith/imajin-processing-client"), 1);
|
||||
var ImajinClient = class {
|
||||
baseUrl;
|
||||
timeout;
|
||||
constructor(baseUrl = "http://localhost:8080", options = {}) {
|
||||
this.baseUrl = baseUrl.replace(/\/$/, "");
|
||||
this.timeout = options.timeout ?? 3e5;
|
||||
}
|
||||
/**
|
||||
* End-to-end image generation.
|
||||
*
|
||||
* Pipeline: LLM analysis → diffusion → post-processing
|
||||
*/
|
||||
async generate(request) {
|
||||
const response = await fetch(`${this.baseUrl}/generate`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
category: request.category,
|
||||
city: request.city,
|
||||
role: request.role,
|
||||
filters: request.filters ?? [],
|
||||
model_override: request.modelOverride,
|
||||
skip_processing: request.skipProcessing ?? false
|
||||
}),
|
||||
signal: AbortSignal.timeout(this.timeout)
|
||||
});
|
||||
if (!response.ok) {
|
||||
const text = await response.text();
|
||||
throw new Error(`Imajin generate failed (${response.status}): ${text}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
return {
|
||||
success: data.success,
|
||||
imageUrl: data.image_url,
|
||||
imageBase64: data.image_base64,
|
||||
metadata: data.metadata,
|
||||
error: data.error
|
||||
};
|
||||
}
|
||||
/**
|
||||
* LLM context analysis only (no image generation).
|
||||
*
|
||||
* Useful for previewing what the LLM will decide before generating.
|
||||
*/
|
||||
async analyze(request) {
|
||||
const response = await fetch(`${this.baseUrl}/analyze`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
category: request.category,
|
||||
city: request.city,
|
||||
role: request.role,
|
||||
filters: request.filters ?? []
|
||||
}),
|
||||
signal: AbortSignal.timeout(this.timeout)
|
||||
});
|
||||
if (!response.ok) {
|
||||
const text = await response.text();
|
||||
throw new Error(`Imajin analyze failed (${response.status}): ${text}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
return {
|
||||
imageModel: data.image_model,
|
||||
maturity: data.maturity,
|
||||
subjectCount: data.subject_count,
|
||||
subjectGenders: data.subject_genders,
|
||||
requiresClientFigure: data.requires_client_figure,
|
||||
prompt: data.prompt,
|
||||
negativePrompt: data.negative_prompt,
|
||||
aestheticKeywords: data.aesthetic_keywords,
|
||||
reasoning: data.reasoning
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Health check - verifies all downstream services.
|
||||
*/
|
||||
async health() {
|
||||
const response = await fetch(`${this.baseUrl}/health`, {
|
||||
signal: AbortSignal.timeout(5e3)
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Health check failed (${response.status})`);
|
||||
}
|
||||
return await response.json();
|
||||
}
|
||||
};
|
||||
var DEFAULT_CONFIG = {
|
||||
promptServiceUrl: "http://localhost:8003",
|
||||
diffusionServiceUrl: "http://localhost:8002",
|
||||
processingServiceUrl: "http://localhost:8004",
|
||||
timeout: 3e4
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
DEFAULT_CONFIG,
|
||||
DiffusionClient,
|
||||
ImajinClient,
|
||||
ProcessingClient,
|
||||
PromptClient
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
packages/imajin-client/dist/index.cjs.map
vendored
Normal file
1
packages/imajin-client/dist/index.cjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
107
packages/imajin-client/dist/index.d.cts
vendored
Normal file
107
packages/imajin-client/dist/index.d.cts
vendored
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
import * as imajinPromptClient from '@lilith/imajin-prompt-client';
|
||||
export { imajinPromptClient as PromptClient };
|
||||
import * as imajinDiffusionClient from '@lilith/imajin-diffusion-client';
|
||||
export { imajinDiffusionClient as DiffusionClient };
|
||||
import * as imajinProcessingClient from '@lilith/imajin-processing-client';
|
||||
export { imajinProcessingClient as ProcessingClient };
|
||||
|
||||
/**
|
||||
* Unified client for Imajin image generation
|
||||
*
|
||||
* Primary usage - call the main orchestrator service:
|
||||
* ```ts
|
||||
* import { ImajinClient } from '@lilith/imajin-client';
|
||||
*
|
||||
* const client = new ImajinClient('http://localhost:8080');
|
||||
* const result = await client.generate({
|
||||
* category: 'escort',
|
||||
* city: 'reykjavik',
|
||||
* role: 'hero',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Advanced usage - direct access to individual services:
|
||||
* ```ts
|
||||
* import { PromptClient, DiffusionClient, ProcessingClient } from '@lilith/imajin-client';
|
||||
*
|
||||
* const promptClient = new PromptClient.ImagegenAssistantClient({ baseUrl: '...' });
|
||||
* const diffusionClient = new DiffusionClient.ImageGenerationClient({ ... });
|
||||
* const processingClient = ProcessingClient.createLocalClient();
|
||||
* ```
|
||||
*/
|
||||
interface GenerateRequest {
|
||||
category: string;
|
||||
city: string;
|
||||
role: string;
|
||||
filters?: string[];
|
||||
modelOverride?: string;
|
||||
skipProcessing?: boolean;
|
||||
}
|
||||
interface GenerateResponse {
|
||||
success: boolean;
|
||||
imageUrl?: string;
|
||||
imageBase64?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
error?: string;
|
||||
}
|
||||
interface AnalyzeRequest {
|
||||
category: string;
|
||||
city: string;
|
||||
role: string;
|
||||
filters?: string[];
|
||||
}
|
||||
interface AnalyzeResponse {
|
||||
imageModel: string;
|
||||
maturity: string;
|
||||
subjectCount: number;
|
||||
subjectGenders: string[];
|
||||
requiresClientFigure: boolean;
|
||||
prompt: string;
|
||||
negativePrompt: string;
|
||||
aestheticKeywords: string[];
|
||||
reasoning: string;
|
||||
}
|
||||
interface HealthResponse {
|
||||
status: 'healthy' | 'degraded' | 'unhealthy';
|
||||
services: Record<string, boolean>;
|
||||
}
|
||||
interface ImajinClientOptions {
|
||||
timeout?: number;
|
||||
}
|
||||
/**
|
||||
* Main client for Imajin image generation service.
|
||||
*
|
||||
* This is THE recommended way to generate images - it handles the full
|
||||
* pipeline: LLM analysis → image generation → post-processing.
|
||||
*/
|
||||
declare class ImajinClient {
|
||||
private readonly baseUrl;
|
||||
private readonly timeout;
|
||||
constructor(baseUrl?: string, options?: ImajinClientOptions);
|
||||
/**
|
||||
* End-to-end image generation.
|
||||
*
|
||||
* Pipeline: LLM analysis → diffusion → post-processing
|
||||
*/
|
||||
generate(request: GenerateRequest): Promise<GenerateResponse>;
|
||||
/**
|
||||
* LLM context analysis only (no image generation).
|
||||
*
|
||||
* Useful for previewing what the LLM will decide before generating.
|
||||
*/
|
||||
analyze(request: AnalyzeRequest): Promise<AnalyzeResponse>;
|
||||
/**
|
||||
* Health check - verifies all downstream services.
|
||||
*/
|
||||
health(): Promise<HealthResponse>;
|
||||
}
|
||||
|
||||
interface ImajinClientConfig {
|
||||
promptServiceUrl?: string;
|
||||
diffusionServiceUrl?: string;
|
||||
processingServiceUrl?: string;
|
||||
timeout?: number;
|
||||
}
|
||||
declare const DEFAULT_CONFIG: ImajinClientConfig;
|
||||
|
||||
export { type AnalyzeRequest, type AnalyzeResponse, DEFAULT_CONFIG, type GenerateRequest, type GenerateResponse, type HealthResponse, ImajinClient, type ImajinClientConfig, type ImajinClientOptions };
|
||||
2
packages/imajin-client/node_modules/.pnpm-workspace-state-v1.json
generated
vendored
2
packages/imajin-client/node_modules/.pnpm-workspace-state-v1.json
generated
vendored
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"lastValidatedTimestamp": 1768051171267,
|
||||
"lastValidatedTimestamp": 1768051568339,
|
||||
"projects": {},
|
||||
"pnpmfiles": [],
|
||||
"settings": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lilith/imajin-client",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"description": "Unified HTTP client for all Imajin services",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
|
@ -9,7 +9,8 @@
|
|||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { defineConfig } from 'tsup';
|
|||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
format: ['esm'],
|
||||
format: ['esm', 'cjs'],
|
||||
dts: true,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue