@revealui/ai 0.8.1 → 0.9.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.
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
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;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,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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,CA2CnC"}
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
- // Ollama is local - we cannot reliably probe it from the server.
57
- // Accept the key as-is (Ollama doesn't use API keys anyway).
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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revealui/ai",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
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",
@@ -26,8 +26,8 @@
26
26
  "lru-cache": "^11.5.1",
27
27
  "zod": "^4.4.3",
28
28
  "@revealui/contracts": "0.8.1",
29
- "@revealui/core": "0.12.1",
30
- "@revealui/db": "0.9.0",
29
+ "@revealui/core": "0.12.2",
30
+ "@revealui/db": "0.10.0",
31
31
  "@revealui/resilience": "0.2.4"
32
32
  },
33
33
  "devDependencies": {