cencori 1.6.1 → 1.7.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.
- package/README.md +54 -0
- package/dist/ai/index.d.mts +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/compute/index.d.mts +1 -1
- package/dist/compute/index.d.ts +1 -1
- package/dist/documents/index.d.mts +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/index.d.mts +561 -3
- package/dist/index.d.ts +561 -3
- package/dist/index.js +685 -179
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +668 -179
- package/dist/index.mjs.map +1 -1
- package/dist/memory/index.d.mts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-kh1whvNH.d.mts → types-xSwLRBZw.d.mts} +17 -2
- package/dist/{types-kh1whvNH.d.ts → types-xSwLRBZw.d.ts} +17 -2
- package/dist/vision/index.d.mts +1 -1
- package/dist/vision/index.d.ts +1 -1
- package/dist/voice/index.d.mts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/web/index.d.mts +3 -3
- package/dist/web/index.d.ts +3 -3
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +1 -1
- package/dist/web/index.mjs +1 -1
- package/dist/web/index.mjs.map +1 -1
- package/dist/workflow/index.d.mts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -31,8 +31,34 @@ console.log(response.content);
|
|
|
31
31
|
| Product | Status | Description |
|
|
32
32
|
|---------|--------|-------------|
|
|
33
33
|
| **AI Gateway** | ✅ Available | Multi-provider routing, security, observability |
|
|
34
|
+
| **Web** | ✅ Available | First-party fetch, extraction, crawl, and evidence-bearing search |
|
|
34
35
|
| **Billing** | ✅ Available | End-user usage monetization and Stripe integration |
|
|
35
36
|
| **Integration** | ✅ Available | SDKs, Vercel AI, TanStack |
|
|
37
|
+
| **Embedded Agents** | ✅ Available | Multi-tenant agent backend: tenants, versions, runs, approvals, metering |
|
|
38
|
+
|
|
39
|
+
## Embedded Agents
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { Cencori } from 'cencori';
|
|
43
|
+
|
|
44
|
+
const cencori = new Cencori({ apiKey: process.env.CENCORI_API_KEY });
|
|
45
|
+
|
|
46
|
+
// Tenants → install → scoped session
|
|
47
|
+
const tenant = await cencori.tenants.create({ external_id: 'company_123', name: 'Acme Ltd' });
|
|
48
|
+
await cencori.installations.create({ tenant_id: tenant.id, agent_id: 'agt_...', version: '1.0.0' });
|
|
49
|
+
const { token } = await cencori.clientTokens.mint({ tenant_id: tenant.id, external_user_id: 'u_1' });
|
|
50
|
+
|
|
51
|
+
// Background run with idempotency, then approve once
|
|
52
|
+
const run = await cencori.runs.create('agt_...', { installation_id: 'ins_...', mode: 'background', input: {} }, 'plan-123');
|
|
53
|
+
await cencori.actions.approve('act_...');
|
|
54
|
+
|
|
55
|
+
// Skills, MCP, usage
|
|
56
|
+
await cencori.skills.create({ name: 'Refund policy' });
|
|
57
|
+
await cencori.mcpServers.register({ name: 'CRM', url: 'https://mcp.example.com/mcp' });
|
|
58
|
+
const csv = await cencori.usage.exportCsv({ days: 30, tenant_id: tenant.id });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Namespaces: `tenants`, `clientTokens`, `models`, `providerConnections`, `agentVersions`, `installations`, `runs`, `actions`, `knowledge`, `connections`, `mcpServers`, `skills`, `skillImports`, `webhooks`, `usage`, `endUsers`, `ratePlans`. Full reference: https://cencori.com/openapi/embedded-agents.json.
|
|
36
62
|
|
|
37
63
|
## AI Gateway
|
|
38
64
|
|
|
@@ -195,6 +221,34 @@ const { answer } = await cencori.documents.query({
|
|
|
195
221
|
|
|
196
222
|
Full API in [docs](https://cencori.com/docs/ai/endpoints/documents). See the [Contract Analyzer tutorial](https://cencori.com/docs/guides/build-a-contract-analyzer) for an end-to-end example.
|
|
197
223
|
|
|
224
|
+
### Web Search and Retrieval
|
|
225
|
+
|
|
226
|
+
Fetch and extract public pages, build a private project corpus, or search Cencori's continuously refreshed public index:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
const results = await cencori.web.search({
|
|
230
|
+
query: 'PostgreSQL row-level locking',
|
|
231
|
+
freshness: '30d',
|
|
232
|
+
limit: 10,
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
for (const result of results.results) {
|
|
236
|
+
console.log(result.title, result.canonicalUrl, result.evidence.quote);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const page = await cencori.web.extract({
|
|
240
|
+
url: 'https://www.postgresql.org/docs/current/explicit-locking.html',
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
await cencori.web.crawl({
|
|
244
|
+
seeds: ['https://docs.example.com/'],
|
|
245
|
+
maxPages: 100,
|
|
246
|
+
maxDepth: 2,
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
For tool-calling agents, import `WEB_SEARCH_TOOL` or `WEB_FETCH_TOOL` from `cencori/web`, then resolve emitted calls with `cencori.web.executeTool(...)`. Retrieved page content is always marked as untrusted input.
|
|
251
|
+
|
|
198
252
|
### Image Generation
|
|
199
253
|
|
|
200
254
|
Generate images from text prompts using multiple providers:
|
package/dist/ai/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CencoriConfig, a as ChatRequest, b as ChatResponse, T as ToolCall, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, G as GenerateObjectRequest, e as GenerateObjectResponse, I as ImageGenerationRequest, f as ImageGenerationResponse, R as ResponsesRequest, g as ResponsesResponse } from '../types-
|
|
1
|
+
import { C as CencoriConfig, a as ChatRequest, b as ChatResponse, T as ToolCall, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, G as GenerateObjectRequest, e as GenerateObjectResponse, I as ImageGenerationRequest, f as ImageGenerationResponse, R as ResponsesRequest, g as ResponsesResponse } from '../types-xSwLRBZw.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AI Gateway - Chat, Completions, Embeddings, and Streaming
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CencoriConfig, a as ChatRequest, b as ChatResponse, T as ToolCall, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, G as GenerateObjectRequest, e as GenerateObjectResponse, I as ImageGenerationRequest, f as ImageGenerationResponse, R as ResponsesRequest, g as ResponsesResponse } from '../types-
|
|
1
|
+
import { C as CencoriConfig, a as ChatRequest, b as ChatResponse, T as ToolCall, c as CompletionRequest, E as EmbeddingRequest, d as EmbeddingResponse, G as GenerateObjectRequest, e as GenerateObjectResponse, I as ImageGenerationRequest, f as ImageGenerationResponse, R as ResponsesRequest, g as ResponsesResponse } from '../types-xSwLRBZw.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AI Gateway - Chat, Completions, Embeddings, and Streaming
|
package/dist/compute/index.d.mts
CHANGED
package/dist/compute/index.d.ts
CHANGED