cencori 1.2.0 → 1.3.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 (48) hide show
  1. package/README.md +3 -51
  2. package/dist/ai/index.d.mts +32 -1
  3. package/dist/ai/index.d.ts +32 -1
  4. package/dist/ai/index.js +131 -0
  5. package/dist/ai/index.js.map +1 -1
  6. package/dist/ai/index.mjs +131 -0
  7. package/dist/ai/index.mjs.map +1 -1
  8. package/dist/compute/index.d.mts +1 -1
  9. package/dist/compute/index.d.ts +1 -1
  10. package/dist/index.d.mts +208 -4
  11. package/dist/index.d.ts +208 -4
  12. package/dist/index.js +348 -8
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +345 -8
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/memory/index.d.mts +1 -1
  17. package/dist/memory/index.d.ts +1 -1
  18. package/dist/react/index.d.mts +52 -0
  19. package/dist/react/index.d.ts +52 -0
  20. package/dist/react/index.js +395 -0
  21. package/dist/react/index.js.map +1 -0
  22. package/dist/react/index.mjs +367 -0
  23. package/dist/react/index.mjs.map +1 -0
  24. package/dist/storage/index.d.mts +1 -1
  25. package/dist/storage/index.d.ts +1 -1
  26. package/dist/storage/index.js +7 -7
  27. package/dist/storage/index.js.map +1 -1
  28. package/dist/storage/index.mjs +7 -7
  29. package/dist/storage/index.mjs.map +1 -1
  30. package/dist/tanstack/index.d.mts +1 -1
  31. package/dist/tanstack/index.d.ts +1 -1
  32. package/dist/tanstack/index.js +3 -0
  33. package/dist/tanstack/index.js.map +1 -1
  34. package/dist/tanstack/index.mjs +3 -0
  35. package/dist/tanstack/index.mjs.map +1 -1
  36. package/dist/telemetry/index.d.mts +1 -1
  37. package/dist/telemetry/index.d.ts +1 -1
  38. package/dist/{types-Cr0muEt3.d.mts → types-kh1whvNH.d.mts} +135 -1
  39. package/dist/{types-Cr0muEt3.d.ts → types-kh1whvNH.d.ts} +135 -1
  40. package/dist/vision/index.d.mts +99 -0
  41. package/dist/vision/index.d.ts +99 -0
  42. package/dist/vision/index.js +93 -0
  43. package/dist/vision/index.js.map +1 -0
  44. package/dist/vision/index.mjs +68 -0
  45. package/dist/vision/index.mjs.map +1 -0
  46. package/dist/workflow/index.d.mts +1 -1
  47. package/dist/workflow/index.d.ts +1 -1
  48. package/package.json +20 -2
@@ -0,0 +1,99 @@
1
+ import { C as CencoriConfig } from '../types-kh1whvNH.js';
2
+
3
+ /**
4
+ * Vision API — analyze, describe, OCR, and classify images.
5
+ *
6
+ * @example
7
+ * const result = await cencori.vision.analyze({
8
+ * image: { url: 'https://example.com/photo.jpg' },
9
+ * prompt: 'What breed of dog is this?',
10
+ * });
11
+ *
12
+ * @example
13
+ * const { text } = await cencori.vision.ocr({ image: { base64, mimeType: 'image/png' } });
14
+ */
15
+
16
+ type VisionProvider = 'openai' | 'anthropic' | 'google';
17
+ type VisionTask = 'analyze' | 'describe' | 'ocr' | 'classify';
18
+ interface VisionImage {
19
+ /** https:// URL or data: URL. Exactly one of `url` or `base64` must be set. */
20
+ url?: string;
21
+ /** Raw base64 (no data: prefix). Requires `mimeType`. */
22
+ base64?: string;
23
+ /** Image mime type. Required when using `base64`. */
24
+ mimeType?: string;
25
+ }
26
+ interface VisionRequest {
27
+ image: VisionImage;
28
+ prompt?: string;
29
+ model?: string;
30
+ maxTokens?: number;
31
+ temperature?: number;
32
+ responseFormat?: 'text' | 'json';
33
+ }
34
+ interface VisionUsage {
35
+ promptTokens: number;
36
+ completionTokens: number;
37
+ totalTokens: number;
38
+ }
39
+ interface VisionCost {
40
+ providerCostUsd: number;
41
+ cencoriChargeUsd: number;
42
+ markupPercentage: number;
43
+ }
44
+ interface VisionResult {
45
+ analysis: string;
46
+ model: string;
47
+ provider: VisionProvider;
48
+ usage: VisionUsage;
49
+ cost: VisionCost;
50
+ }
51
+ interface VisionDescribeResult {
52
+ description: string;
53
+ model: string;
54
+ provider: VisionProvider;
55
+ usage: VisionUsage;
56
+ cost: VisionCost;
57
+ }
58
+ interface VisionOcrResult {
59
+ text: string;
60
+ model: string;
61
+ provider: VisionProvider;
62
+ usage: VisionUsage;
63
+ cost: VisionCost;
64
+ }
65
+ interface VisionClassification {
66
+ primary_category?: string;
67
+ tags?: string[];
68
+ objects?: string[];
69
+ safe_for_work?: boolean;
70
+ confidence?: number;
71
+ summary?: string;
72
+ [key: string]: unknown;
73
+ }
74
+ interface VisionClassifyResult {
75
+ classification: VisionClassification | string;
76
+ raw: string;
77
+ model: string;
78
+ provider: VisionProvider;
79
+ usage: VisionUsage;
80
+ cost: VisionCost;
81
+ }
82
+ declare class VisionNamespace {
83
+ private config;
84
+ constructor(config: Required<CencoriConfig>);
85
+ /**
86
+ * General image analysis — provide your own prompt.
87
+ * Default prompt: "Describe this image in detail."
88
+ */
89
+ analyze(request: VisionRequest): Promise<VisionResult>;
90
+ /** Describe the image in rich detail. */
91
+ describe(request: VisionRequest): Promise<VisionDescribeResult>;
92
+ /** Extract all visible text from the image. */
93
+ ocr(request: VisionRequest): Promise<VisionOcrResult>;
94
+ /** Return structured tags, objects, and category classification. */
95
+ classify(request: VisionRequest): Promise<VisionClassifyResult>;
96
+ private post;
97
+ }
98
+
99
+ export { type VisionClassification, type VisionClassifyResult, type VisionCost, type VisionDescribeResult, type VisionImage, VisionNamespace, type VisionOcrResult, type VisionProvider, type VisionRequest, type VisionResult, type VisionTask, type VisionUsage };
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/vision/index.ts
21
+ var vision_exports = {};
22
+ __export(vision_exports, {
23
+ VisionNamespace: () => VisionNamespace
24
+ });
25
+ module.exports = __toCommonJS(vision_exports);
26
+ function toBody(request) {
27
+ const body = {
28
+ prompt: request.prompt,
29
+ model: request.model,
30
+ max_tokens: request.maxTokens,
31
+ temperature: request.temperature,
32
+ response_format: request.responseFormat
33
+ };
34
+ if (request.image.url) {
35
+ body.image_url = request.image.url;
36
+ } else if (request.image.base64) {
37
+ body.image_base64 = request.image.base64;
38
+ body.mime_type = request.image.mimeType;
39
+ } else {
40
+ throw new Error("vision request requires image.url or image.base64");
41
+ }
42
+ return body;
43
+ }
44
+ var VisionNamespace = class {
45
+ constructor(config) {
46
+ this.config = config;
47
+ }
48
+ /**
49
+ * General image analysis — provide your own prompt.
50
+ * Default prompt: "Describe this image in detail."
51
+ */
52
+ async analyze(request) {
53
+ return this.post("/api/ai/vision", request);
54
+ }
55
+ /** Describe the image in rich detail. */
56
+ async describe(request) {
57
+ return this.post("/api/ai/vision/describe", request);
58
+ }
59
+ /** Extract all visible text from the image. */
60
+ async ocr(request) {
61
+ return this.post("/api/ai/vision/ocr", request);
62
+ }
63
+ /** Return structured tags, objects, and category classification. */
64
+ async classify(request) {
65
+ return this.post("/api/ai/vision/classify", request);
66
+ }
67
+ async post(path, request) {
68
+ const response = await fetch(`${this.config.baseUrl}${path}`, {
69
+ method: "POST",
70
+ headers: {
71
+ "CENCORI_API_KEY": this.config.apiKey,
72
+ "Content-Type": "application/json",
73
+ ...this.config.headers
74
+ },
75
+ body: JSON.stringify(toBody(request))
76
+ });
77
+ const data = await response.json();
78
+ if (!response.ok) {
79
+ const message = data && typeof data === "object" && "message" in data && typeof data.message === "string" ? data.message : `Vision request failed with status ${response.status}`;
80
+ const code = data && typeof data === "object" && "error" in data && typeof data.error === "string" ? data.error : "request_failed";
81
+ const err = new Error(message);
82
+ err.code = code;
83
+ err.details = data;
84
+ throw err;
85
+ }
86
+ return data;
87
+ }
88
+ };
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ VisionNamespace
92
+ });
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * Vision API — analyze, describe, OCR, and classify images.\n *\n * @example\n * const result = await cencori.vision.analyze({\n * image: { url: 'https://example.com/photo.jpg' },\n * prompt: 'What breed of dog is this?',\n * });\n *\n * @example\n * const { text } = await cencori.vision.ocr({ image: { base64, mimeType: 'image/png' } });\n */\n\nimport type { CencoriConfig } from '../types';\n\nexport type VisionProvider = 'openai' | 'anthropic' | 'google';\n\nexport type VisionTask = 'analyze' | 'describe' | 'ocr' | 'classify';\n\nexport interface VisionImage {\n /** https:// URL or data: URL. Exactly one of `url` or `base64` must be set. */\n url?: string;\n /** Raw base64 (no data: prefix). Requires `mimeType`. */\n base64?: string;\n /** Image mime type. Required when using `base64`. */\n mimeType?: string;\n}\n\nexport interface VisionRequest {\n image: VisionImage;\n prompt?: string;\n model?: string;\n maxTokens?: number;\n temperature?: number;\n responseFormat?: 'text' | 'json';\n}\n\nexport interface VisionUsage {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n}\n\nexport interface VisionCost {\n providerCostUsd: number;\n cencoriChargeUsd: number;\n markupPercentage: number;\n}\n\nexport interface VisionResult {\n analysis: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionDescribeResult {\n description: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionOcrResult {\n text: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionClassification {\n primary_category?: string;\n tags?: string[];\n objects?: string[];\n safe_for_work?: boolean;\n confidence?: number;\n summary?: string;\n [key: string]: unknown;\n}\n\nexport interface VisionClassifyResult {\n classification: VisionClassification | string;\n raw: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\ninterface JsonBody {\n image_url?: string;\n image_base64?: string;\n mime_type?: string;\n prompt?: string;\n model?: string;\n max_tokens?: number;\n temperature?: number;\n response_format?: 'text' | 'json';\n}\n\nfunction toBody(request: VisionRequest): JsonBody {\n const body: JsonBody = {\n prompt: request.prompt,\n model: request.model,\n max_tokens: request.maxTokens,\n temperature: request.temperature,\n response_format: request.responseFormat,\n };\n if (request.image.url) {\n body.image_url = request.image.url;\n } else if (request.image.base64) {\n body.image_base64 = request.image.base64;\n body.mime_type = request.image.mimeType;\n } else {\n throw new Error('vision request requires image.url or image.base64');\n }\n return body;\n}\n\nexport class VisionNamespace {\n private config: Required<CencoriConfig>;\n\n constructor(config: Required<CencoriConfig>) {\n this.config = config;\n }\n\n /**\n * General image analysis — provide your own prompt.\n * Default prompt: \"Describe this image in detail.\"\n */\n async analyze(request: VisionRequest): Promise<VisionResult> {\n return this.post<VisionResult>('/api/ai/vision', request);\n }\n\n /** Describe the image in rich detail. */\n async describe(request: VisionRequest): Promise<VisionDescribeResult> {\n return this.post<VisionDescribeResult>('/api/ai/vision/describe', request);\n }\n\n /** Extract all visible text from the image. */\n async ocr(request: VisionRequest): Promise<VisionOcrResult> {\n return this.post<VisionOcrResult>('/api/ai/vision/ocr', request);\n }\n\n /** Return structured tags, objects, and category classification. */\n async classify(request: VisionRequest): Promise<VisionClassifyResult> {\n return this.post<VisionClassifyResult>('/api/ai/vision/classify', request);\n }\n\n private async post<T>(path: string, request: VisionRequest): Promise<T> {\n const response = await fetch(`${this.config.baseUrl}${path}`, {\n method: 'POST',\n headers: {\n 'CENCORI_API_KEY': this.config.apiKey,\n 'Content-Type': 'application/json',\n ...this.config.headers,\n },\n body: JSON.stringify(toBody(request)),\n });\n const data = await response.json();\n if (!response.ok) {\n const message =\n (data && typeof data === 'object' && 'message' in data && typeof data.message === 'string')\n ? data.message\n : `Vision request failed with status ${response.status}`;\n const code =\n (data && typeof data === 'object' && 'error' in data && typeof data.error === 'string')\n ? data.error\n : 'request_failed';\n const err = new Error(message) as Error & { code?: string; details?: unknown };\n err.code = code;\n err.details = data;\n throw err;\n }\n return data as T;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuGA,SAAS,OAAO,SAAkC;AAC9C,QAAM,OAAiB;AAAA,IACnB,QAAQ,QAAQ;AAAA,IAChB,OAAO,QAAQ;AAAA,IACf,YAAY,QAAQ;AAAA,IACpB,aAAa,QAAQ;AAAA,IACrB,iBAAiB,QAAQ;AAAA,EAC7B;AACA,MAAI,QAAQ,MAAM,KAAK;AACnB,SAAK,YAAY,QAAQ,MAAM;AAAA,EACnC,WAAW,QAAQ,MAAM,QAAQ;AAC7B,SAAK,eAAe,QAAQ,MAAM;AAClC,SAAK,YAAY,QAAQ,MAAM;AAAA,EACnC,OAAO;AACH,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACvE;AACA,SAAO;AACX;AAEO,IAAM,kBAAN,MAAsB;AAAA,EAGzB,YAAY,QAAiC;AACzC,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,QAAQ,SAA+C;AACzD,WAAO,KAAK,KAAmB,kBAAkB,OAAO;AAAA,EAC5D;AAAA;AAAA,EAGA,MAAM,SAAS,SAAuD;AAClE,WAAO,KAAK,KAA2B,2BAA2B,OAAO;AAAA,EAC7E;AAAA;AAAA,EAGA,MAAM,IAAI,SAAkD;AACxD,WAAO,KAAK,KAAsB,sBAAsB,OAAO;AAAA,EACnE;AAAA;AAAA,EAGA,MAAM,SAAS,SAAuD;AAClE,WAAO,KAAK,KAA2B,2BAA2B,OAAO;AAAA,EAC7E;AAAA,EAEA,MAAc,KAAQ,MAAc,SAAoC;AACpE,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,GAAG,IAAI,IAAI;AAAA,MAC1D,QAAQ;AAAA,MACR,SAAS;AAAA,QACL,mBAAmB,KAAK,OAAO;AAAA,QAC/B,gBAAgB;AAAA,QAChB,GAAG,KAAK,OAAO;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,OAAO,OAAO,CAAC;AAAA,IACxC,CAAC;AACD,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,UACD,QAAQ,OAAO,SAAS,YAAY,aAAa,QAAQ,OAAO,KAAK,YAAY,WAC5E,KAAK,UACL,qCAAqC,SAAS,MAAM;AAC9D,YAAM,OACD,QAAQ,OAAO,SAAS,YAAY,WAAW,QAAQ,OAAO,KAAK,UAAU,WACxE,KAAK,QACL;AACV,YAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,UAAI,OAAO;AACX,UAAI,UAAU;AACd,YAAM;AAAA,IACV;AACA,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -0,0 +1,68 @@
1
+ // src/vision/index.ts
2
+ function toBody(request) {
3
+ const body = {
4
+ prompt: request.prompt,
5
+ model: request.model,
6
+ max_tokens: request.maxTokens,
7
+ temperature: request.temperature,
8
+ response_format: request.responseFormat
9
+ };
10
+ if (request.image.url) {
11
+ body.image_url = request.image.url;
12
+ } else if (request.image.base64) {
13
+ body.image_base64 = request.image.base64;
14
+ body.mime_type = request.image.mimeType;
15
+ } else {
16
+ throw new Error("vision request requires image.url or image.base64");
17
+ }
18
+ return body;
19
+ }
20
+ var VisionNamespace = class {
21
+ constructor(config) {
22
+ this.config = config;
23
+ }
24
+ /**
25
+ * General image analysis — provide your own prompt.
26
+ * Default prompt: "Describe this image in detail."
27
+ */
28
+ async analyze(request) {
29
+ return this.post("/api/ai/vision", request);
30
+ }
31
+ /** Describe the image in rich detail. */
32
+ async describe(request) {
33
+ return this.post("/api/ai/vision/describe", request);
34
+ }
35
+ /** Extract all visible text from the image. */
36
+ async ocr(request) {
37
+ return this.post("/api/ai/vision/ocr", request);
38
+ }
39
+ /** Return structured tags, objects, and category classification. */
40
+ async classify(request) {
41
+ return this.post("/api/ai/vision/classify", request);
42
+ }
43
+ async post(path, request) {
44
+ const response = await fetch(`${this.config.baseUrl}${path}`, {
45
+ method: "POST",
46
+ headers: {
47
+ "CENCORI_API_KEY": this.config.apiKey,
48
+ "Content-Type": "application/json",
49
+ ...this.config.headers
50
+ },
51
+ body: JSON.stringify(toBody(request))
52
+ });
53
+ const data = await response.json();
54
+ if (!response.ok) {
55
+ const message = data && typeof data === "object" && "message" in data && typeof data.message === "string" ? data.message : `Vision request failed with status ${response.status}`;
56
+ const code = data && typeof data === "object" && "error" in data && typeof data.error === "string" ? data.error : "request_failed";
57
+ const err = new Error(message);
58
+ err.code = code;
59
+ err.details = data;
60
+ throw err;
61
+ }
62
+ return data;
63
+ }
64
+ };
65
+ export {
66
+ VisionNamespace
67
+ };
68
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * Vision API — analyze, describe, OCR, and classify images.\n *\n * @example\n * const result = await cencori.vision.analyze({\n * image: { url: 'https://example.com/photo.jpg' },\n * prompt: 'What breed of dog is this?',\n * });\n *\n * @example\n * const { text } = await cencori.vision.ocr({ image: { base64, mimeType: 'image/png' } });\n */\n\nimport type { CencoriConfig } from '../types';\n\nexport type VisionProvider = 'openai' | 'anthropic' | 'google';\n\nexport type VisionTask = 'analyze' | 'describe' | 'ocr' | 'classify';\n\nexport interface VisionImage {\n /** https:// URL or data: URL. Exactly one of `url` or `base64` must be set. */\n url?: string;\n /** Raw base64 (no data: prefix). Requires `mimeType`. */\n base64?: string;\n /** Image mime type. Required when using `base64`. */\n mimeType?: string;\n}\n\nexport interface VisionRequest {\n image: VisionImage;\n prompt?: string;\n model?: string;\n maxTokens?: number;\n temperature?: number;\n responseFormat?: 'text' | 'json';\n}\n\nexport interface VisionUsage {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n}\n\nexport interface VisionCost {\n providerCostUsd: number;\n cencoriChargeUsd: number;\n markupPercentage: number;\n}\n\nexport interface VisionResult {\n analysis: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionDescribeResult {\n description: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionOcrResult {\n text: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\nexport interface VisionClassification {\n primary_category?: string;\n tags?: string[];\n objects?: string[];\n safe_for_work?: boolean;\n confidence?: number;\n summary?: string;\n [key: string]: unknown;\n}\n\nexport interface VisionClassifyResult {\n classification: VisionClassification | string;\n raw: string;\n model: string;\n provider: VisionProvider;\n usage: VisionUsage;\n cost: VisionCost;\n}\n\ninterface JsonBody {\n image_url?: string;\n image_base64?: string;\n mime_type?: string;\n prompt?: string;\n model?: string;\n max_tokens?: number;\n temperature?: number;\n response_format?: 'text' | 'json';\n}\n\nfunction toBody(request: VisionRequest): JsonBody {\n const body: JsonBody = {\n prompt: request.prompt,\n model: request.model,\n max_tokens: request.maxTokens,\n temperature: request.temperature,\n response_format: request.responseFormat,\n };\n if (request.image.url) {\n body.image_url = request.image.url;\n } else if (request.image.base64) {\n body.image_base64 = request.image.base64;\n body.mime_type = request.image.mimeType;\n } else {\n throw new Error('vision request requires image.url or image.base64');\n }\n return body;\n}\n\nexport class VisionNamespace {\n private config: Required<CencoriConfig>;\n\n constructor(config: Required<CencoriConfig>) {\n this.config = config;\n }\n\n /**\n * General image analysis — provide your own prompt.\n * Default prompt: \"Describe this image in detail.\"\n */\n async analyze(request: VisionRequest): Promise<VisionResult> {\n return this.post<VisionResult>('/api/ai/vision', request);\n }\n\n /** Describe the image in rich detail. */\n async describe(request: VisionRequest): Promise<VisionDescribeResult> {\n return this.post<VisionDescribeResult>('/api/ai/vision/describe', request);\n }\n\n /** Extract all visible text from the image. */\n async ocr(request: VisionRequest): Promise<VisionOcrResult> {\n return this.post<VisionOcrResult>('/api/ai/vision/ocr', request);\n }\n\n /** Return structured tags, objects, and category classification. */\n async classify(request: VisionRequest): Promise<VisionClassifyResult> {\n return this.post<VisionClassifyResult>('/api/ai/vision/classify', request);\n }\n\n private async post<T>(path: string, request: VisionRequest): Promise<T> {\n const response = await fetch(`${this.config.baseUrl}${path}`, {\n method: 'POST',\n headers: {\n 'CENCORI_API_KEY': this.config.apiKey,\n 'Content-Type': 'application/json',\n ...this.config.headers,\n },\n body: JSON.stringify(toBody(request)),\n });\n const data = await response.json();\n if (!response.ok) {\n const message =\n (data && typeof data === 'object' && 'message' in data && typeof data.message === 'string')\n ? data.message\n : `Vision request failed with status ${response.status}`;\n const code =\n (data && typeof data === 'object' && 'error' in data && typeof data.error === 'string')\n ? data.error\n : 'request_failed';\n const err = new Error(message) as Error & { code?: string; details?: unknown };\n err.code = code;\n err.details = data;\n throw err;\n }\n return data as T;\n }\n}\n"],"mappings":";AAuGA,SAAS,OAAO,SAAkC;AAC9C,QAAM,OAAiB;AAAA,IACnB,QAAQ,QAAQ;AAAA,IAChB,OAAO,QAAQ;AAAA,IACf,YAAY,QAAQ;AAAA,IACpB,aAAa,QAAQ;AAAA,IACrB,iBAAiB,QAAQ;AAAA,EAC7B;AACA,MAAI,QAAQ,MAAM,KAAK;AACnB,SAAK,YAAY,QAAQ,MAAM;AAAA,EACnC,WAAW,QAAQ,MAAM,QAAQ;AAC7B,SAAK,eAAe,QAAQ,MAAM;AAClC,SAAK,YAAY,QAAQ,MAAM;AAAA,EACnC,OAAO;AACH,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACvE;AACA,SAAO;AACX;AAEO,IAAM,kBAAN,MAAsB;AAAA,EAGzB,YAAY,QAAiC;AACzC,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,QAAQ,SAA+C;AACzD,WAAO,KAAK,KAAmB,kBAAkB,OAAO;AAAA,EAC5D;AAAA;AAAA,EAGA,MAAM,SAAS,SAAuD;AAClE,WAAO,KAAK,KAA2B,2BAA2B,OAAO;AAAA,EAC7E;AAAA;AAAA,EAGA,MAAM,IAAI,SAAkD;AACxD,WAAO,KAAK,KAAsB,sBAAsB,OAAO;AAAA,EACnE;AAAA;AAAA,EAGA,MAAM,SAAS,SAAuD;AAClE,WAAO,KAAK,KAA2B,2BAA2B,OAAO;AAAA,EAC7E;AAAA,EAEA,MAAc,KAAQ,MAAc,SAAoC;AACpE,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,OAAO,GAAG,IAAI,IAAI;AAAA,MAC1D,QAAQ;AAAA,MACR,SAAS;AAAA,QACL,mBAAmB,KAAK,OAAO;AAAA,QAC/B,gBAAgB;AAAA,QAChB,GAAG,KAAK,OAAO;AAAA,MACnB;AAAA,MACA,MAAM,KAAK,UAAU,OAAO,OAAO,CAAC;AAAA,IACxC,CAAC;AACD,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,UACD,QAAQ,OAAO,SAAS,YAAY,aAAa,QAAQ,OAAO,KAAK,YAAY,WAC5E,KAAK,UACL,qCAAqC,SAAS,MAAM;AAC9D,YAAM,OACD,QAAQ,OAAO,SAAS,YAAY,WAAW,QAAQ,OAAO,KAAK,UAAU,WACxE,KAAK,QACL;AACV,YAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,UAAI,OAAO;AACX,UAAI,UAAU;AACd,YAAM;AAAA,IACV;AACA,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -1,4 +1,4 @@
1
- import { W as WorkflowTriggerOptions } from '../types-Cr0muEt3.mjs';
1
+ import { W as WorkflowTriggerOptions } from '../types-kh1whvNH.mjs';
2
2
 
3
3
  /**
4
4
  * Workflow Namespace - AI Pipelines & Orchestration
@@ -1,4 +1,4 @@
1
- import { W as WorkflowTriggerOptions } from '../types-Cr0muEt3.js';
1
+ import { W as WorkflowTriggerOptions } from '../types-kh1whvNH.js';
2
2
 
3
3
  /**
4
4
  * Workflow Namespace - AI Pipelines & Orchestration
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "cencori",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "description": "Cencori - The unified infrastructure layer for AI applications. One SDK for AI Gateway, Compute, Workflow, and Storage.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -27,6 +27,16 @@
27
27
  "import": "./dist/ai/index.mjs",
28
28
  "require": "./dist/ai/index.js"
29
29
  },
30
+ "./vision": {
31
+ "types": "./dist/vision/index.d.ts",
32
+ "import": "./dist/vision/index.mjs",
33
+ "require": "./dist/vision/index.js"
34
+ },
35
+ "./react": {
36
+ "types": "./dist/react/index.d.ts",
37
+ "import": "./dist/react/index.mjs",
38
+ "require": "./dist/react/index.js"
39
+ },
30
40
  "./compute": {
31
41
  "types": "./dist/compute/index.d.ts",
32
42
  "import": "./dist/compute/index.mjs",
@@ -87,11 +97,19 @@
87
97
  "prepublishOnly": "npm run build"
88
98
  },
89
99
  "peerDependencies": {
90
- "@ai-sdk/provider": ">=1.0.0"
100
+ "@ai-sdk/provider": ">=1.0.0",
101
+ "react": ">=18.0.0",
102
+ "lucide-react": ">=0.400.0"
91
103
  },
92
104
  "peerDependenciesMeta": {
93
105
  "@ai-sdk/provider": {
94
106
  "optional": true
107
+ },
108
+ "react": {
109
+ "optional": true
110
+ },
111
+ "lucide-react": {
112
+ "optional": true
95
113
  }
96
114
  },
97
115
  "devDependencies": {