@revealui/ai 0.8.1 → 0.9.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/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/llm/key-validator.d.ts.map +1 -1
- package/dist/llm/key-validator.js +42 -3
- package/dist/orchestration/runtime.d.ts +5 -2
- package/dist/orchestration/runtime.d.ts.map +1 -1
- package/dist/orchestration/runtime.js +4 -1
- package/dist/tools/mcp-adapter.d.ts +10 -0
- package/dist/tools/mcp-adapter.d.ts.map +1 -1
- package/dist/tools/mcp-adapter.js +15 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -14,14 +14,19 @@
|
|
|
14
14
|
* ```typescript
|
|
15
15
|
* import { EpisodicMemory } from '@revealui/ai/memory/stores'
|
|
16
16
|
* import { NodeIdService } from '@revealui/ai/memory/services'
|
|
17
|
+
* import { AgentOrchestrator, LLMClient, ToolRegistry } from '@revealui/ai'
|
|
17
18
|
*
|
|
18
19
|
* // Memory operations
|
|
19
20
|
* const memory = new EpisodicMemory(userId, nodeId, db)
|
|
20
21
|
* await memory.add(agentMemory)
|
|
21
|
-
*
|
|
22
|
-
* // LLM, orchestration, and tools coming soon
|
|
23
22
|
* ```
|
|
24
23
|
*
|
|
24
|
+
* LLM, orchestration, and tools all ship from this root entry today:
|
|
25
|
+
* `LLMClient` and `createLLMClientFromEnv` come from `./llm/client.js`,
|
|
26
|
+
* `AgentOrchestrator` from `./orchestration/orchestrator.js`, and
|
|
27
|
+
* `ToolRegistry` plus `globalToolRegistry` from `./tools/registry.js`.
|
|
28
|
+
* See the re-export block below for the full surface.
|
|
29
|
+
*
|
|
25
30
|
* ## Architecture
|
|
26
31
|
*
|
|
27
32
|
* ```
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAGH,cAAc,gBAAgB,CAAC;AAE/B,cAAc,kBAAkB,CAAC;AAIjC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,sBAAsB,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,mBAAmB,CAAC;AAElC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAElC,cAAc,sBAAsB,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,14 +14,19 @@
|
|
|
14
14
|
* ```typescript
|
|
15
15
|
* import { EpisodicMemory } from '@revealui/ai/memory/stores'
|
|
16
16
|
* import { NodeIdService } from '@revealui/ai/memory/services'
|
|
17
|
+
* import { AgentOrchestrator, LLMClient, ToolRegistry } from '@revealui/ai'
|
|
17
18
|
*
|
|
18
19
|
* // Memory operations
|
|
19
20
|
* const memory = new EpisodicMemory(userId, nodeId, db)
|
|
20
21
|
* await memory.add(agentMemory)
|
|
21
|
-
*
|
|
22
|
-
* // LLM, orchestration, and tools coming soon
|
|
23
22
|
* ```
|
|
24
23
|
*
|
|
24
|
+
* LLM, orchestration, and tools all ship from this root entry today:
|
|
25
|
+
* `LLMClient` and `createLLMClientFromEnv` come from `./llm/client.js`,
|
|
26
|
+
* `AgentOrchestrator` from `./orchestration/orchestrator.js`, and
|
|
27
|
+
* `ToolRegistry` plus `globalToolRegistry` from `./tools/registry.js`.
|
|
28
|
+
* See the re-export block below for the full surface.
|
|
29
|
+
*
|
|
25
30
|
* ## Architecture
|
|
26
31
|
*
|
|
27
32
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-validator.d.ts","sourceRoot":"","sources":["../../src/llm/key-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,wBAAwB,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAezF;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"key-validator.d.ts","sourceRoot":"","sources":["../../src/llm/key-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,wBAAwB,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAezF;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,wBAAwB,CAAC,CAkFnC"}
|
|
@@ -30,6 +30,44 @@ async function probeFetch(url, init) {
|
|
|
30
30
|
export async function validateProviderKey(provider, apiKey) {
|
|
31
31
|
try {
|
|
32
32
|
switch (provider) {
|
|
33
|
+
case 'anthropic': {
|
|
34
|
+
// Cheapest read-only probe: the models list. Honors the same base-URL
|
|
35
|
+
// override as the env factory (client.ts) so self-hosted proxies work.
|
|
36
|
+
const base = process.env.ANTHROPIC_BASE_URL ?? 'https://api.anthropic.com/v1';
|
|
37
|
+
const res = await probeFetch(`${base}/models`, {
|
|
38
|
+
headers: { 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
|
|
39
|
+
});
|
|
40
|
+
if (res.ok)
|
|
41
|
+
return { valid: true };
|
|
42
|
+
if (res.status === 401 || res.status === 403) {
|
|
43
|
+
return { valid: false, error: 'Invalid Anthropic API key' };
|
|
44
|
+
}
|
|
45
|
+
return { valid: false, error: `Anthropic validation failed: HTTP ${res.status}` };
|
|
46
|
+
}
|
|
47
|
+
case 'openai': {
|
|
48
|
+
const base = process.env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1';
|
|
49
|
+
const res = await probeFetch(`${base}/models`, {
|
|
50
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
51
|
+
});
|
|
52
|
+
if (res.ok)
|
|
53
|
+
return { valid: true };
|
|
54
|
+
if (res.status === 401 || res.status === 403) {
|
|
55
|
+
return { valid: false, error: 'Invalid OpenAI API key' };
|
|
56
|
+
}
|
|
57
|
+
return { valid: false, error: `OpenAI validation failed: HTTP ${res.status}` };
|
|
58
|
+
}
|
|
59
|
+
case 'xai': {
|
|
60
|
+
const base = process.env.XAI_BASE_URL ?? 'https://api.x.ai/v1';
|
|
61
|
+
const res = await probeFetch(`${base}/models`, {
|
|
62
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
63
|
+
});
|
|
64
|
+
if (res.ok)
|
|
65
|
+
return { valid: true };
|
|
66
|
+
if (res.status === 401 || res.status === 403) {
|
|
67
|
+
return { valid: false, error: 'Invalid xAI API key' };
|
|
68
|
+
}
|
|
69
|
+
return { valid: false, error: `xAI validation failed: HTTP ${res.status}` };
|
|
70
|
+
}
|
|
33
71
|
case 'groq': {
|
|
34
72
|
const res = await probeFetch('https://api.groq.com/openai/v1/models', {
|
|
35
73
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
@@ -52,9 +90,10 @@ export async function validateProviderKey(provider, apiKey) {
|
|
|
52
90
|
}
|
|
53
91
|
return { valid: false, error: `HuggingFace validation failed: HTTP ${res.status}` };
|
|
54
92
|
}
|
|
55
|
-
case 'ollama':
|
|
56
|
-
|
|
57
|
-
//
|
|
93
|
+
case 'ollama':
|
|
94
|
+
case 'inference-snaps': {
|
|
95
|
+
// Local providers - we cannot reliably probe them from the server,
|
|
96
|
+
// and neither uses a real API key. Accept the key as-is.
|
|
58
97
|
return { valid: true };
|
|
59
98
|
}
|
|
60
99
|
default:
|
|
@@ -37,8 +37,11 @@ export interface RuntimeConfig {
|
|
|
37
37
|
*
|
|
38
38
|
* @deprecated Prefer `mcpClients` (Stage 5.1a). The hypervisor path doesn't
|
|
39
39
|
* expose the full MCP protocol surface (resources, prompts, sampling,
|
|
40
|
-
* elicitation). Standard `McpClient` instances do.
|
|
41
|
-
*
|
|
40
|
+
* elicitation). Standard `McpClient` instances do.
|
|
41
|
+
*
|
|
42
|
+
* **Removal owner:** product AI runtime. **REMOVE-BY:** `@revealui/ai` 1.0.0
|
|
43
|
+
* (with `MCPToolSource` / `discoverMCPTools`). Product agent-stream already
|
|
44
|
+
* mounts via `createToolsFromMcpClient` only; this field is external-compat.
|
|
42
45
|
*/
|
|
43
46
|
mcpToolSource?: MCPToolSource;
|
|
44
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/orchestration/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAW,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/orchestration/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAW,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,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A+B9B;;OAEG;IACH,SAAS,IAAI;QACX,cAAc,EAAE,OAAO,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;KACxB;CAOF"}
|
|
@@ -7,7 +7,7 @@ import { registerCleanupHandler } from '@revealui/core/monitoring';
|
|
|
7
7
|
import { z } from 'zod/v4';
|
|
8
8
|
import { estimateCost } from '../llm/token-counter.js';
|
|
9
9
|
import { ToolCallDeduplicator } from '../tools/deduplicator.js';
|
|
10
|
-
import { createToolsFromMcpClient, discoverMCPTools } from '../tools/mcp-adapter.js';
|
|
10
|
+
import { createToolsFromMcpClient, discoverMCPTools, warnHypervisorMcpPathDeprecated, } from '../tools/mcp-adapter.js';
|
|
11
11
|
import { createWebSearchTool } from '../tools/web/duck-duck-go.js';
|
|
12
12
|
export class AgentRuntime {
|
|
13
13
|
config;
|
|
@@ -15,6 +15,9 @@ export class AgentRuntime {
|
|
|
15
15
|
executingTasks = new Map();
|
|
16
16
|
isShuttingDown = false;
|
|
17
17
|
constructor(config = {}) {
|
|
18
|
+
if (config.mcpToolSource) {
|
|
19
|
+
warnHypervisorMcpPathDeprecated('AgentRuntime mcpToolSource');
|
|
20
|
+
}
|
|
18
21
|
this.config = {
|
|
19
22
|
maxIterations: config.maxIterations ?? 10,
|
|
20
23
|
timeout: config.timeout ?? 60000, // 60 seconds
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import type { Tool } from './base.js';
|
|
24
24
|
import { type McpEventSink, type McpToolCallEvent } from './mcp-events.js';
|
|
25
|
+
export declare function warnHypervisorMcpPathDeprecated(site: string): void;
|
|
26
|
+
/** Test-only: reset the one-time deprecation warn latch. */
|
|
27
|
+
export declare function resetHypervisorMcpPathWarningForTests(): void;
|
|
25
28
|
export interface MCPTool {
|
|
26
29
|
name: string;
|
|
27
30
|
description: string;
|
|
@@ -42,6 +45,12 @@ export interface MCPClient {
|
|
|
42
45
|
* @deprecated Prefer `McpClientLike` + `createToolsFromMcpClient()` (Stage 5.1a).
|
|
43
46
|
* The hypervisor path doesn't expose the full MCP protocol surface (resources,
|
|
44
47
|
* prompts, sampling, elicitation). The typed-client path does.
|
|
48
|
+
*
|
|
49
|
+
* **Removal owner:** product AI runtime (agent-stream already uses `mcpClients`).
|
|
50
|
+
* **REMOVE-BY:** `@revealui/ai` 1.0.0 — delete `MCPToolSource`, `discoverMCPTools`,
|
|
51
|
+
* and `AgentRuntime` `mcpToolSource` once no external kit still calls them
|
|
52
|
+
* (grep product + published examples in the same PR). Until then this path is
|
|
53
|
+
* retained for external SDK compatibility only.
|
|
45
54
|
*/
|
|
46
55
|
export interface MCPToolSource {
|
|
47
56
|
getAllTools(): Array<{
|
|
@@ -262,6 +271,7 @@ export interface DiscoverMCPToolsOptions {
|
|
|
262
271
|
*
|
|
263
272
|
* @deprecated Prefer `createToolsFromMcpClient` (Stage 5.1a). Kept for
|
|
264
273
|
* AgentRuntime `mcpToolSource` compatibility.
|
|
274
|
+
* **REMOVE-BY:** `@revealui/ai` 1.0.0 (same train as `MCPToolSource`).
|
|
265
275
|
*
|
|
266
276
|
* @example
|
|
267
277
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-adapter.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,WAAW,CAAC;AAClD,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-adapter.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,WAAW,CAAC;AAClD,OAAO,EAAgB,KAAK,YAAY,EAAE,KAA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,MAAM,CAAC;CAClB;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,IAAI,EAAE,CAAC,CA2CjB;AAqZD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAuB9E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,GACvC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAa1D;AAED,4EAA4E;AAC5E,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,IAAI,EAAE,CAiEjG"}
|
|
@@ -22,6 +22,19 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from 'zod/v4';
|
|
24
24
|
import { emitMcpEvent } from './mcp-events.js';
|
|
25
|
+
/** One-time process warning for the hypervisor MCP tool path (REMOVE-BY ai@1.0.0). */
|
|
26
|
+
let hypervisorPathWarned = false;
|
|
27
|
+
export function warnHypervisorMcpPathDeprecated(site) {
|
|
28
|
+
if (hypervisorPathWarned)
|
|
29
|
+
return;
|
|
30
|
+
hypervisorPathWarned = true;
|
|
31
|
+
process.emitWarning(`@revealui/ai: ${site} is deprecated. Prefer mcpClients / createToolsFromMcpClient (Stage 5.1a). ` +
|
|
32
|
+
'REMOVE-BY: @revealui/ai 1.0.0. See packages/ai/src/tools/mcp-adapter.ts.', 'DeprecationWarning', 'REVEALUI_AI_MCP_HYPERVISOR_DEPRECATED');
|
|
33
|
+
}
|
|
34
|
+
/** Test-only: reset the one-time deprecation warn latch. */
|
|
35
|
+
export function resetHypervisorMcpPathWarningForTests() {
|
|
36
|
+
hypervisorPathWarned = false;
|
|
37
|
+
}
|
|
25
38
|
/**
|
|
26
39
|
* Connect the agent's tool registry to a standard MCP client. Lists tools
|
|
27
40
|
* from the MCP server and returns agent-side `Tool` instances that dispatch
|
|
@@ -504,6 +517,7 @@ export function serializeMCPResult(value) {
|
|
|
504
517
|
*
|
|
505
518
|
* @deprecated Prefer `createToolsFromMcpClient` (Stage 5.1a). Kept for
|
|
506
519
|
* AgentRuntime `mcpToolSource` compatibility.
|
|
520
|
+
* **REMOVE-BY:** `@revealui/ai` 1.0.0 (same train as `MCPToolSource`).
|
|
507
521
|
*
|
|
508
522
|
* @example
|
|
509
523
|
* ```typescript
|
|
@@ -516,6 +530,7 @@ export function serializeMCPResult(value) {
|
|
|
516
530
|
* ```
|
|
517
531
|
*/
|
|
518
532
|
export function discoverMCPTools(source, options) {
|
|
533
|
+
warnHypervisorMcpPathDeprecated('discoverMCPTools() / MCPToolSource');
|
|
519
534
|
return source.getAllTools().map(({ namespacedName, serverName, tool }) => {
|
|
520
535
|
const zodSchema = jsonSchemaToZod(tool.inputSchema);
|
|
521
536
|
const agentTool = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revealui/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "AI runtime for agent-driven products — agents, memory, LLM providers (Inference Snaps, Ollama, OpenAI-compatible), tools, and orchestration. Anthropic-SDK-free.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"lru-cache": "^11.5.1",
|
|
27
27
|
"zod": "^4.4.3",
|
|
28
|
-
"@revealui/contracts": "0.8.
|
|
29
|
-
"@revealui/core": "0.12.
|
|
30
|
-
"@revealui/db": "0.
|
|
28
|
+
"@revealui/contracts": "0.8.2",
|
|
29
|
+
"@revealui/core": "0.12.4",
|
|
30
|
+
"@revealui/db": "0.10.0",
|
|
31
31
|
"@revealui/resilience": "0.2.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@testing-library/react": "^16.3.2",
|
|
36
36
|
"@vitest/coverage-v8": "^4.1.10",
|
|
37
37
|
"jsdom": "29.1.1",
|
|
38
|
-
"react": "
|
|
39
|
-
"react-dom": "
|
|
38
|
+
"react": "19.2.8",
|
|
39
|
+
"react-dom": "19.2.8",
|
|
40
40
|
"typescript": "^6.0.3",
|
|
41
41
|
"vitest": "^4.1.10",
|
|
42
42
|
"@revealui/dev": "0.1.0"
|