cencori 1.16.0 → 1.16.2

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 (43) hide show
  1. package/dist/agents/index.d.mts +5 -0
  2. package/dist/agents/index.d.ts +5 -0
  3. package/dist/agents/index.js +9 -2
  4. package/dist/agents/index.js.map +1 -1
  5. package/dist/agents/index.mjs +9 -2
  6. package/dist/agents/index.mjs.map +1 -1
  7. package/dist/ai/index.d.mts +15 -2
  8. package/dist/ai/index.d.ts +15 -2
  9. package/dist/ai/index.js +69 -2
  10. package/dist/ai/index.js.map +1 -1
  11. package/dist/ai/index.mjs +69 -2
  12. package/dist/ai/index.mjs.map +1 -1
  13. package/dist/compute/index.d.mts +1 -1
  14. package/dist/compute/index.d.ts +1 -1
  15. package/dist/documents/index.d.mts +1 -1
  16. package/dist/documents/index.d.ts +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +69 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +69 -2
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/judgment/index.d.mts +1 -1
  24. package/dist/judgment/index.d.ts +1 -1
  25. package/dist/memory/index.d.mts +1 -1
  26. package/dist/memory/index.d.ts +1 -1
  27. package/dist/react/index.js.map +1 -1
  28. package/dist/react/index.mjs.map +1 -1
  29. package/dist/storage/index.d.mts +1 -1
  30. package/dist/storage/index.d.ts +1 -1
  31. package/dist/telemetry/index.d.mts +1 -1
  32. package/dist/telemetry/index.d.ts +1 -1
  33. package/dist/{types-D91o22Gb.d.mts → types-9nSEJEk2.d.mts} +90 -3
  34. package/dist/{types-D91o22Gb.d.ts → types-9nSEJEk2.d.ts} +90 -3
  35. package/dist/vision/index.d.mts +1 -1
  36. package/dist/vision/index.d.ts +1 -1
  37. package/dist/voice/index.d.mts +1 -1
  38. package/dist/voice/index.d.ts +1 -1
  39. package/dist/web/index.d.mts +1 -1
  40. package/dist/web/index.d.ts +1 -1
  41. package/dist/workflow/index.d.mts +1 -1
  42. package/dist/workflow/index.d.ts +1 -1
  43. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { V as VectorSearchOptions } from '../types-D91o22Gb.mjs';
1
+ import { V as VectorSearchOptions } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /**
4
4
  * Storage Namespace - Vector Database, Knowledge Base, RAG
@@ -1,4 +1,4 @@
1
- import { V as VectorSearchOptions } from '../types-D91o22Gb.js';
1
+ import { V as VectorSearchOptions } from '../types-9nSEJEk2.js';
2
2
 
3
3
  /**
4
4
  * Storage Namespace - Vector Database, Knowledge Base, RAG
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /**
4
4
  * Cencori Telemetry Client
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.js';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.js';
2
2
 
3
3
  /**
4
4
  * Cencori Telemetry Client
@@ -204,6 +204,93 @@ interface EmbeddingResponse {
204
204
  totalTokens: number;
205
205
  };
206
206
  }
207
+ type ModerationInputPart = {
208
+ type: 'text';
209
+ text: string;
210
+ } | {
211
+ type: 'image_url';
212
+ image_url: {
213
+ url: string;
214
+ };
215
+ };
216
+ interface ModerationRequest {
217
+ /** A string, up to 100 strings (one result each), or text/image parts (one result). */
218
+ input: string | string[] | ModerationInputPart[];
219
+ /** OpenAI model for the standard categories. Defaults to 'omni-moderation-latest'. */
220
+ model?: string;
221
+ /** Which layers to run. Default all three. ['rules'] alone is fastest and free. */
222
+ layers?: Array<'rules' | 'openai' | 'llm'>;
223
+ /** Flag thresholds per category (0–1); '*' sets the default. Default 0.5. */
224
+ thresholds?: Record<string, number>;
225
+ /** Score at which the recommended action becomes 'block'. Default 0.8. */
226
+ blockThreshold?: number;
227
+ /** When the paid model layer runs: 'auto' (unclear items and custom categories), 'always' or 'never'. */
228
+ escalate?: 'auto' | 'always' | 'never';
229
+ /** Model for the llm layer. Default 'deepseek-v4.1-flash'. */
230
+ llmModel?: string;
231
+ /** Your own categories, judged by the model and returned as 'custom/<name>'. */
232
+ customCategories?: Array<{
233
+ name: string;
234
+ description: string;
235
+ threshold?: number;
236
+ }>;
237
+ /** Terms that always block (category 'custom/blocklist'). */
238
+ blocklist?: string[];
239
+ /** Your own terms that look like scam words, removed before the rules run. */
240
+ allowlist?: string[];
241
+ /** Your brand and product names, to catch people posing as your staff. */
242
+ brandNames?: string[];
243
+ /** One or two sentences about your platform, given to the model layer. */
244
+ context?: string;
245
+ /**
246
+ * Earlier messages in the same conversation, oldest first, so the model can
247
+ * tell banter from a real ask. One array (or null) per input string, or a
248
+ * flat array when the input is a single string.
249
+ */
250
+ previousMessages?: (string[] | null)[] | string[];
251
+ /**
252
+ * Strongest action a category may lead to. By default fraud/romance,
253
+ * fraud/off_platform_contact, harassment, hate and custom categories only
254
+ * go to review, because banter is common there.
255
+ */
256
+ categoryActions?: Record<string, 'review' | 'block'>;
257
+ }
258
+ interface ModerationMatch {
259
+ layer: 'rules' | 'openai' | 'llm';
260
+ category: string;
261
+ score: number;
262
+ rule?: string;
263
+ text?: string;
264
+ /** The model's one-line reason, for llm matches. */
265
+ reason?: string;
266
+ }
267
+ interface ModerationResult {
268
+ flagged: boolean;
269
+ /** Recommended handling: allow, send to human review, or block. */
270
+ action: 'allow' | 'review' | 'block';
271
+ categories: Record<string, boolean>;
272
+ categoryScores: Record<string, number>;
273
+ flaggedCategories: string[];
274
+ matches: ModerationMatch[];
275
+ layersApplied: Array<'rules' | 'openai' | 'llm'>;
276
+ }
277
+ interface ModerationResponse {
278
+ id: string;
279
+ model: string;
280
+ /** True when any result is flagged. */
281
+ flagged: boolean;
282
+ results: ModerationResult[];
283
+ layers: Partial<Record<'rules' | 'openai' | 'llm', 'ok' | 'skipped' | 'error'>>;
284
+ usage: {
285
+ llmItems: number;
286
+ llmCachedItems: number;
287
+ llmCalls: number;
288
+ llmModel: string | null;
289
+ /** What this request cost. Only the llm layer is billed. */
290
+ costUsd: number;
291
+ };
292
+ errors?: string[];
293
+ }
207
294
  /**
208
295
  * Image generation request
209
296
  */
@@ -212,9 +299,9 @@ interface ImageGenerationRequest {
212
299
  prompt: string;
213
300
  /**
214
301
  * Model to use. Supported models:
215
- * - OpenAI: 'gpt-image-1.5', 'dall-e-3', 'dall-e-2'
302
+ * - OpenAI: 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', 'gpt-image-1-mini'
216
303
  * - Google: 'gemini-3-pro-image', 'imagen-3'
217
- * Default: 'dall-e-3'
304
+ * Default: 'gpt-image-1'
218
305
  */
219
306
  model?: string;
220
307
  /** Number of images to generate (default: 1) */
@@ -434,4 +521,4 @@ interface RequestOptions {
434
521
  headers?: Record<string, string>;
435
522
  }
436
523
 
437
- export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ResponsesRequest as R, ToolCall as T, UrlCitation as U, VectorSearchOptions as V, WorkflowTriggerOptions as W, ChatRequest as a, ChatResponse as b, CompletionRequest as c, EmbeddingResponse as d, GenerateObjectResponse as e, ImageGenerationResponse as f, ResponsesResponse as g, ComputeRunOptions as h, RequestOptions as i, ChatMessage as j, ResponsesOutputItem as k, ResponseInputItem as l, ResponsesTool as m, WebSearchTool as n, CodeInterpreterTool as o };
524
+ export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ModerationRequest as M, ResponsesRequest as R, ToolCall as T, UrlCitation as U, VectorSearchOptions as V, WorkflowTriggerOptions as W, ChatRequest as a, ChatResponse as b, CompletionRequest as c, EmbeddingResponse as d, ModerationResponse as e, GenerateObjectResponse as f, ImageGenerationResponse as g, ResponsesResponse as h, ComputeRunOptions as i, RequestOptions as j, ChatMessage as k, ModerationResult as l, ModerationMatch as m, ModerationInputPart as n, ResponsesOutputItem as o, ResponseInputItem as p, ResponsesTool as q, WebSearchTool as r, CodeInterpreterTool as s };
@@ -204,6 +204,93 @@ interface EmbeddingResponse {
204
204
  totalTokens: number;
205
205
  };
206
206
  }
207
+ type ModerationInputPart = {
208
+ type: 'text';
209
+ text: string;
210
+ } | {
211
+ type: 'image_url';
212
+ image_url: {
213
+ url: string;
214
+ };
215
+ };
216
+ interface ModerationRequest {
217
+ /** A string, up to 100 strings (one result each), or text/image parts (one result). */
218
+ input: string | string[] | ModerationInputPart[];
219
+ /** OpenAI model for the standard categories. Defaults to 'omni-moderation-latest'. */
220
+ model?: string;
221
+ /** Which layers to run. Default all three. ['rules'] alone is fastest and free. */
222
+ layers?: Array<'rules' | 'openai' | 'llm'>;
223
+ /** Flag thresholds per category (0–1); '*' sets the default. Default 0.5. */
224
+ thresholds?: Record<string, number>;
225
+ /** Score at which the recommended action becomes 'block'. Default 0.8. */
226
+ blockThreshold?: number;
227
+ /** When the paid model layer runs: 'auto' (unclear items and custom categories), 'always' or 'never'. */
228
+ escalate?: 'auto' | 'always' | 'never';
229
+ /** Model for the llm layer. Default 'deepseek-v4.1-flash'. */
230
+ llmModel?: string;
231
+ /** Your own categories, judged by the model and returned as 'custom/<name>'. */
232
+ customCategories?: Array<{
233
+ name: string;
234
+ description: string;
235
+ threshold?: number;
236
+ }>;
237
+ /** Terms that always block (category 'custom/blocklist'). */
238
+ blocklist?: string[];
239
+ /** Your own terms that look like scam words, removed before the rules run. */
240
+ allowlist?: string[];
241
+ /** Your brand and product names, to catch people posing as your staff. */
242
+ brandNames?: string[];
243
+ /** One or two sentences about your platform, given to the model layer. */
244
+ context?: string;
245
+ /**
246
+ * Earlier messages in the same conversation, oldest first, so the model can
247
+ * tell banter from a real ask. One array (or null) per input string, or a
248
+ * flat array when the input is a single string.
249
+ */
250
+ previousMessages?: (string[] | null)[] | string[];
251
+ /**
252
+ * Strongest action a category may lead to. By default fraud/romance,
253
+ * fraud/off_platform_contact, harassment, hate and custom categories only
254
+ * go to review, because banter is common there.
255
+ */
256
+ categoryActions?: Record<string, 'review' | 'block'>;
257
+ }
258
+ interface ModerationMatch {
259
+ layer: 'rules' | 'openai' | 'llm';
260
+ category: string;
261
+ score: number;
262
+ rule?: string;
263
+ text?: string;
264
+ /** The model's one-line reason, for llm matches. */
265
+ reason?: string;
266
+ }
267
+ interface ModerationResult {
268
+ flagged: boolean;
269
+ /** Recommended handling: allow, send to human review, or block. */
270
+ action: 'allow' | 'review' | 'block';
271
+ categories: Record<string, boolean>;
272
+ categoryScores: Record<string, number>;
273
+ flaggedCategories: string[];
274
+ matches: ModerationMatch[];
275
+ layersApplied: Array<'rules' | 'openai' | 'llm'>;
276
+ }
277
+ interface ModerationResponse {
278
+ id: string;
279
+ model: string;
280
+ /** True when any result is flagged. */
281
+ flagged: boolean;
282
+ results: ModerationResult[];
283
+ layers: Partial<Record<'rules' | 'openai' | 'llm', 'ok' | 'skipped' | 'error'>>;
284
+ usage: {
285
+ llmItems: number;
286
+ llmCachedItems: number;
287
+ llmCalls: number;
288
+ llmModel: string | null;
289
+ /** What this request cost. Only the llm layer is billed. */
290
+ costUsd: number;
291
+ };
292
+ errors?: string[];
293
+ }
207
294
  /**
208
295
  * Image generation request
209
296
  */
@@ -212,9 +299,9 @@ interface ImageGenerationRequest {
212
299
  prompt: string;
213
300
  /**
214
301
  * Model to use. Supported models:
215
- * - OpenAI: 'gpt-image-1.5', 'dall-e-3', 'dall-e-2'
302
+ * - OpenAI: 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', 'gpt-image-1-mini'
216
303
  * - Google: 'gemini-3-pro-image', 'imagen-3'
217
- * Default: 'dall-e-3'
304
+ * Default: 'gpt-image-1'
218
305
  */
219
306
  model?: string;
220
307
  /** Number of images to generate (default: 1) */
@@ -434,4 +521,4 @@ interface RequestOptions {
434
521
  headers?: Record<string, string>;
435
522
  }
436
523
 
437
- export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ResponsesRequest as R, ToolCall as T, UrlCitation as U, VectorSearchOptions as V, WorkflowTriggerOptions as W, ChatRequest as a, ChatResponse as b, CompletionRequest as c, EmbeddingResponse as d, GenerateObjectResponse as e, ImageGenerationResponse as f, ResponsesResponse as g, ComputeRunOptions as h, RequestOptions as i, ChatMessage as j, ResponsesOutputItem as k, ResponseInputItem as l, ResponsesTool as m, WebSearchTool as n, CodeInterpreterTool as o };
524
+ export type { CencoriConfig as C, EmbeddingRequest as E, FileSearchTool as F, GenerateObjectRequest as G, ImageGenerationRequest as I, KnowledgeCitation as K, ModerationRequest as M, ResponsesRequest as R, ToolCall as T, UrlCitation as U, VectorSearchOptions as V, WorkflowTriggerOptions as W, ChatRequest as a, ChatResponse as b, CompletionRequest as c, EmbeddingResponse as d, ModerationResponse as e, GenerateObjectResponse as f, ImageGenerationResponse as g, ResponsesResponse as h, ComputeRunOptions as i, RequestOptions as j, ChatMessage as k, ModerationResult as l, ModerationMatch as m, ModerationInputPart as n, ResponsesOutputItem as o, ResponseInputItem as p, ResponsesTool as q, WebSearchTool as r, CodeInterpreterTool as s };
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /**
4
4
  * Vision API — analyze, describe, OCR, and classify images.
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.js';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.js';
2
2
 
3
3
  /**
4
4
  * Vision API — analyze, describe, OCR, and classify images.
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /**
4
4
  * Voice API — text-to-speech and speech-to-text across providers.
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.js';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.js';
2
2
 
3
3
  /**
4
4
  * Voice API — text-to-speech and speech-to-text across providers.
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.mjs';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /** Cencori Web — first-party fetch, extraction, crawl, and search primitives. */
4
4
 
@@ -1,4 +1,4 @@
1
- import { C as CencoriConfig } from '../types-D91o22Gb.js';
1
+ import { C as CencoriConfig } from '../types-9nSEJEk2.js';
2
2
 
3
3
  /** Cencori Web — first-party fetch, extraction, crawl, and search primitives. */
4
4
 
@@ -1,4 +1,4 @@
1
- import { W as WorkflowTriggerOptions } from '../types-D91o22Gb.mjs';
1
+ import { W as WorkflowTriggerOptions } from '../types-9nSEJEk2.mjs';
2
2
 
3
3
  /**
4
4
  * Workflow Namespace - AI Pipelines & Orchestration
@@ -1,4 +1,4 @@
1
- import { W as WorkflowTriggerOptions } from '../types-D91o22Gb.js';
1
+ import { W as WorkflowTriggerOptions } from '../types-9nSEJEk2.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.16.0",
4
+ "version": "1.16.2",
5
5
  "description": "Cencori - The unified infrastructure layer for AI applications. One SDK for AI Gateway, Agents, Compute, Workflow, and Storage.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",