cencori 1.7.5 → 1.8.1

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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/ai/index.d.mts +1 -1
  3. package/dist/ai/index.d.ts +1 -1
  4. package/dist/ai/index.js +154 -19
  5. package/dist/ai/index.js.map +1 -1
  6. package/dist/ai/index.mjs +152 -19
  7. package/dist/ai/index.mjs.map +1 -1
  8. package/dist/catalog/index.d.mts +113 -0
  9. package/dist/catalog/index.d.ts +113 -0
  10. package/dist/catalog/index.js +73 -0
  11. package/dist/catalog/index.js.map +1 -0
  12. package/dist/catalog/index.mjs +45 -0
  13. package/dist/catalog/index.mjs.map +1 -0
  14. package/dist/compute/index.d.mts +1 -1
  15. package/dist/compute/index.d.ts +1 -1
  16. package/dist/documents/index.d.mts +1 -1
  17. package/dist/documents/index.d.ts +1 -1
  18. package/dist/index.d.mts +106 -12
  19. package/dist/index.d.ts +106 -12
  20. package/dist/index.js +324 -101
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +319 -100
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/memory/index.d.mts +151 -26
  25. package/dist/memory/index.d.ts +151 -26
  26. package/dist/memory/index.js +210 -6
  27. package/dist/memory/index.js.map +1 -1
  28. package/dist/memory/index.mjs +208 -6
  29. package/dist/memory/index.mjs.map +1 -1
  30. package/dist/storage/index.d.mts +1 -1
  31. package/dist/storage/index.d.ts +1 -1
  32. package/dist/telemetry/index.d.mts +1 -1
  33. package/dist/telemetry/index.d.ts +1 -1
  34. package/dist/{types-CZSIg4JQ.d.mts → types-DbHh0iAg.d.mts} +30 -1
  35. package/dist/{types-CZSIg4JQ.d.ts → types-DbHh0iAg.d.ts} +30 -1
  36. package/dist/vision/index.d.mts +1 -1
  37. package/dist/vision/index.d.ts +1 -1
  38. package/dist/voice/index.d.mts +1 -1
  39. package/dist/voice/index.d.ts +1 -1
  40. package/dist/web/index.d.mts +1 -1
  41. package/dist/web/index.d.ts +1 -1
  42. package/dist/workflow/index.d.mts +1 -1
  43. package/dist/workflow/index.d.ts +1 -1
  44. package/package.json +6 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CencoriConfig, i as RequestOptions } from './types-CZSIg4JQ.js';
2
- export { j as ChatMessage, a as ChatRequest, b as ChatResponse, o as CodeInterpreterTool, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, F as FileSearchTool, l as ResponseInputItem, k as ResponsesOutputItem, R as ResponsesRequest, g as ResponsesResponse, m as ResponsesTool, U as UrlCitation, n as WebSearchTool } from './types-CZSIg4JQ.js';
1
+ import { C as CencoriConfig, i as RequestOptions } from './types-DbHh0iAg.js';
2
+ export { j as ChatMessage, a as ChatRequest, b as ChatResponse, o as CodeInterpreterTool, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, F as FileSearchTool, l as ResponseInputItem, k as ResponsesOutputItem, R as ResponsesRequest, g as ResponsesResponse, m as ResponsesTool, U as UrlCitation, n as WebSearchTool } from './types-DbHh0iAg.js';
3
3
  import { AINamespace } from './ai/index.js';
4
4
  export { StreamChunk } from './ai/index.js';
5
5
  import { VisionNamespace } from './vision/index.js';
@@ -17,6 +17,7 @@ import { TelemetryClient } from './telemetry/index.js';
17
17
  export { WebTelemetryPayload } from './telemetry/index.js';
18
18
  import { WebNamespace } from './web/index.js';
19
19
  export { WEB_FETCH_TOOL, WEB_SEARCH_TOOL, WebBrowseJob, WebBrowseRequest, WebBrowserAction, WebCrawlRequest, WebCrawlResponse, WebEvidenceSpan, WebExtractResult, WebFetchRequest, WebFetchResult, WebLink, WebSearchHit, WebSearchRequest, WebSearchResponse, WebTakedownRequest, WebTakedownResponse } from './web/index.js';
20
+ export { CatalogModel, CatalogModelFilters, CatalogModelPricing, CatalogModelsResponse, CatalogProvider, CatalogProvidersResponse, CatalogRequestOptions, DEFAULT_CATALOG_BASE_URL, listCatalogModels, listCatalogProviders, providerLogoUrl } from './catalog/index.js';
20
21
  export { CencoriChatSettings, CencoriProvider, CencoriProviderSettings, cencori, createCencori } from './vercel/index.js';
21
22
  import '@ai-sdk/provider';
22
23
 
@@ -286,6 +287,20 @@ interface ChatCompletionResponse {
286
287
  content: string;
287
288
  }>;
288
289
  write_status: 'pending' | 'disabled';
290
+ /** Chat request id backing the async writeback — poll GET /v1/memory/writes/:id. Null when write is disabled. */
291
+ write_request_id?: string | null;
292
+ };
293
+ /** Request id for support correlation (X-Request-Id). */
294
+ requestId?: string | null;
295
+ /** Input-guard classification the gateway verdicts (absent when unstreamed/skipped). */
296
+ safety?: {
297
+ scanned: boolean;
298
+ input?: {
299
+ safe: boolean;
300
+ layer: string;
301
+ riskScore: number;
302
+ reasons: string[];
303
+ };
289
304
  };
290
305
  }
291
306
  interface ChatCompletionChunk {
@@ -295,6 +310,14 @@ interface ChatCompletionChunk {
295
310
  interface ChatCompletionStream extends AsyncIterable<ChatCompletionChunk> {
296
311
  /** Number of memories injected into this request (from X-Cencori-Memory-Retrieved). */
297
312
  memoriesRetrieved: number;
313
+ /** Input-guard verdict from the stream-open headers (absent when unscanned). */
314
+ safety?: {
315
+ scanned: boolean;
316
+ input?: {
317
+ safe: boolean;
318
+ riskScore: number;
319
+ };
320
+ };
298
321
  }
299
322
  declare class Completions {
300
323
  private config;
@@ -429,10 +452,15 @@ declare class ModelsNamespace {
429
452
  available?: boolean;
430
453
  source?: string;
431
454
  connection_id?: string;
455
+ limit?: number;
456
+ cursor?: string;
432
457
  }): Promise<{
433
458
  object: string;
434
459
  data: UnifiedModel[];
435
460
  providers: unknown[];
461
+ total: number;
462
+ next_cursor: string | null;
463
+ partial: boolean;
436
464
  }>;
437
465
  }
438
466
  declare class ProviderConnectionsNamespace {
@@ -525,7 +553,11 @@ declare class InstallationsNamespace {
525
553
  connection_ids?: string[];
526
554
  approval_policy?: Record<string, unknown>;
527
555
  }): Promise<unknown>;
528
- list(tenantId?: string): Promise<{
556
+ list(tenantId?: string, params?: {
557
+ agent_id?: string;
558
+ limit?: number;
559
+ cursor?: string;
560
+ }): Promise<{
529
561
  data: unknown[];
530
562
  next_cursor: string | null;
531
563
  }>;
@@ -549,6 +581,13 @@ declare class RunsNamespace {
549
581
  response_format?: unknown;
550
582
  session_id?: string;
551
583
  }, idempotencyKey?: string, options?: EmbeddedRequestOptions): Promise<unknown>;
584
+ history(agentId: string, params?: {
585
+ limit?: number;
586
+ cursor?: string;
587
+ }): Promise<{
588
+ data: unknown[];
589
+ next_cursor: string | null;
590
+ }>;
552
591
  get(runId: string, options?: EmbeddedRequestOptions): Promise<unknown>;
553
592
  events(runId: string, params?: {
554
593
  after?: string;
@@ -777,6 +816,27 @@ declare class McpServersNamespace {
777
816
  }>;
778
817
  refreshTools(serverId: string): Promise<unknown>;
779
818
  }
819
+ declare class MarketplaceNamespace {
820
+ private config;
821
+ constructor(config: Required<CencoriConfig>);
822
+ list(params?: {
823
+ limit?: number;
824
+ cursor?: string;
825
+ }): Promise<{
826
+ data: unknown[];
827
+ next_cursor: string | null;
828
+ }>;
829
+ get(versionId: string): Promise<unknown>;
830
+ install(params: {
831
+ version_id: string;
832
+ tenant_id: string;
833
+ knowledge_base_ids?: string[];
834
+ connection_ids?: string[];
835
+ approval_policy?: Record<string, unknown>;
836
+ budget?: Record<string, unknown>;
837
+ overlay_config?: Record<string, unknown>;
838
+ }): Promise<unknown>;
839
+ }
780
840
  declare class WebhooksNamespace {
781
841
  private config;
782
842
  constructor(config: Required<CencoriConfig>);
@@ -809,16 +869,27 @@ declare class UsageNamespace {
809
869
  constructor(config: Required<CencoriConfig>);
810
870
  summary(params?: {
811
871
  days?: number;
872
+ since?: string;
873
+ until?: string;
812
874
  tenant_id?: string;
813
875
  agent_id?: string;
876
+ installation_id?: string;
877
+ model?: string;
814
878
  }): Promise<{
815
879
  totals: unknown;
816
880
  groups: unknown[];
881
+ truncated: boolean;
882
+ row_cap: number;
883
+ unresolved_rows: number;
817
884
  }>;
818
885
  events(params?: {
819
886
  days?: number;
887
+ since?: string;
888
+ until?: string;
820
889
  tenant_id?: string;
821
890
  agent_id?: string;
891
+ installation_id?: string;
892
+ model?: string;
822
893
  limit?: number;
823
894
  cursor?: string;
824
895
  }): Promise<{
@@ -1057,6 +1128,7 @@ declare class Cencori {
1057
1128
  readonly knowledge: KnowledgeNamespace;
1058
1129
  readonly connections: ConnectionsNamespace;
1059
1130
  readonly mcpServers: McpServersNamespace;
1131
+ readonly marketplace: MarketplaceNamespace;
1060
1132
  readonly skills: SkillsNamespace;
1061
1133
  readonly skillImports: SkillImportsNamespace;
1062
1134
  readonly webhooks: WebhooksNamespace;
@@ -1107,32 +1179,54 @@ declare class Cencori {
1107
1179
  /**
1108
1180
  * Cencori Error Classes
1109
1181
  *
1110
- * Custom error types for better error handling
1182
+ * Custom error types for better error handling. Every API failure carries
1183
+ * the HTTP status, the machine-readable code, the request id (for support
1184
+ * correlation), and any retry hint the server sent — so callers never have
1185
+ * to guess from a bare message again.
1111
1186
  */
1112
1187
  declare class CencoriError extends Error {
1113
1188
  statusCode?: number | undefined;
1114
1189
  code?: string | undefined;
1115
- constructor(message: string, statusCode?: number | undefined, code?: string | undefined);
1190
+ options?: {
1191
+ requestId?: string | null;
1192
+ retryAfterMs?: number | null;
1193
+ errorBody?: unknown;
1194
+ } | undefined;
1195
+ constructor(message: string, statusCode?: number | undefined, code?: string | undefined, options?: {
1196
+ requestId?: string | null;
1197
+ retryAfterMs?: number | null;
1198
+ errorBody?: unknown;
1199
+ } | undefined);
1200
+ /** Request id for support correlation (X-Request-Id), when the server sent one. */
1201
+ get requestId(): string | null;
1202
+ /** Server-advised wait before retrying, when sent (Retry-After / retry_after_ms). */
1203
+ get retryAfterMs(): number | null;
1204
+ /** True for failures worth retrying: rate limits, bad gateway, unavailable, timeouts. */
1205
+ get isRetryable(): boolean;
1116
1206
  }
1117
1207
  declare class AuthenticationError extends CencoriError {
1118
- constructor(message?: string);
1208
+ constructor(message?: string, options?: {
1209
+ requestId?: string | null;
1210
+ });
1119
1211
  }
1120
1212
  declare class RateLimitError extends CencoriError {
1121
1213
  retryAfterSeconds?: number | null | undefined;
1122
- constructor(message?: string, retryAfterSeconds?: number | null | undefined);
1214
+ constructor(message?: string, retryAfterSeconds?: number | null | undefined, options?: {
1215
+ requestId?: string | null;
1216
+ errorBody?: unknown;
1217
+ });
1123
1218
  }
1124
1219
  declare class SafetyError extends CencoriError {
1125
1220
  reasons?: string[] | undefined;
1126
- constructor(message?: string, reasons?: string[] | undefined);
1221
+ constructor(message?: string, reasons?: string[] | undefined, options?: {
1222
+ requestId?: string | null;
1223
+ errorBody?: unknown;
1224
+ });
1127
1225
  }
1128
1226
 
1129
1227
  /**
1130
1228
  * Utility functions for Cencori SDK
1131
1229
  */
1132
- /**
1133
- * Fetch with automatic retry on 5xx errors
1134
- * Uses exponential backoff: 1s, 2s, 4s
1135
- */
1136
1230
  declare function fetchWithRetry(url: string, options: RequestInit, maxRetries?: number): Promise<Response>;
1137
1231
 
1138
1232
  export { AINamespace, ActionsNamespace, type Agent, type AgentConfig, type AgentKey, type AgentListItem, AgentVersionsNamespace, AgentsNamespace, AuthenticationError, Cencori, CencoriConfig, CencoriEmbeddedApiError, CencoriError, type ChatCompletionChunk, type ChatCompletionCreateParams, type ChatCompletionResponse, type ChatCompletionStream, type ChatMemoryOptions, ChatNamespace, ClientTokensNamespace, ComputeNamespace, ConnectionsNamespace, type CreateAgentKeyParams, type CreateAgentParams, type CreateSessionParams, DocumentsNamespace, type EmbeddedRequestOptions, EndUsersNamespace, InstallationsNamespace, KnowledgeNamespace, McpServersNamespace, MemoryClient, ModelsNamespace, type PaginatedResponse, ProviderConnectionsNamespace, RateLimitError, RatePlansNamespace, RequestOptions, RunsNamespace, SafetyError, type Session, type SessionEvent, type SessionListParams, SessionsNamespace, SkillImportsNamespace, SkillsNamespace, StorageNamespace, TelemetryClient, type Tenant, TenantsNamespace, type TurnParams, type UnifiedModel, type UpdateAgentParams, UsageNamespace, VisionNamespace, VoiceNamespace, WebNamespace, WebhooksNamespace, WorkflowNamespace, Cencori as default, fetchWithRetry };