wauldo 0.8.0 → 0.10.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/README.md CHANGED
@@ -226,7 +226,7 @@ Free tier (300 req/month): [RapidAPI](https://rapidapi.com/binnewzzin/api/smart-
226
226
 
227
227
  ## Contributing
228
228
 
229
- PRs welcome. Check the [good first issues](https://github.com/wauldo/wauldo-sdk-js/labels/good%20first%20issue).
229
+ PRs welcome. Check the [good first issues](https://github.com/wauldoai/wauldo-sdk-js/labels/good%20first%20issue).
230
230
 
231
231
  ## License
232
232
 
package/dist/index.d.mts CHANGED
@@ -716,13 +716,24 @@ interface TaskClaim {
716
716
  * Verification block attached to completed tasks. When
717
717
  * `verification_source === "prompt_only"` the `confidence` and
718
718
  * `hallucination_rate` fields reflect self-consistency only; rely on
719
- * `verdict` + `trust_score` + `message` as authoritative.
719
+ * `verdict` + `support_score` (alias `trust_score`) + `message` as authoritative.
720
+ *
721
+ * Note: `support_score` is the public name for the same numeric value
722
+ * the wire protocol calls `trust_score`. The JSON wire field is unchanged
723
+ * for backward compatibility — use `supportScore(v)` to read the value
724
+ * by its public name. New code should prefer `support_score`.
720
725
  */
721
726
  interface TaskVerification {
722
727
  verdict: Verdict;
723
728
  hallucination_rate: number;
724
729
  confidence: number;
725
730
  trust_score: number;
731
+ /**
732
+ * Public name for `trust_score` (0-1 fraction of claims supported
733
+ * by the sources). Optional on the wire; always equals `trust_score`
734
+ * when populated. Prefer the `supportScore()` helper to read it.
735
+ */
736
+ support_score?: number;
726
737
  verification_source: string;
727
738
  claims: TaskClaim[];
728
739
  verification_retries: number;
@@ -731,6 +742,13 @@ interface TaskVerification {
731
742
  sources_cited?: number[];
732
743
  stripped_claims?: string[];
733
744
  }
745
+ /**
746
+ * Read the support score of a verification block. Falls back to
747
+ * `trust_score` when the optional `support_score` field is absent
748
+ * (the JSON wire format only emits `trust_score` for backward
749
+ * compatibility). Always returns the same numeric value either way.
750
+ */
751
+ declare function supportScore(v: TaskVerification): number;
734
752
  /** Full task record returned by `GET /v1/tasks/:id`. */
735
753
  interface Task {
736
754
  task_id: string;
@@ -783,8 +801,8 @@ declare class AgentsClient {
783
801
  get(agentId: string): Promise<DeployedAgent>;
784
802
  update(agentId: string, patch: UpdateAgentPatch): Promise<DeployedAgent>;
785
803
  delete(agentId: string): Promise<void>;
786
- run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive"): Promise<AgentRunResponse>;
787
- a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive"): Promise<A2aResponse>;
804
+ run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<AgentRunResponse>;
805
+ a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<A2aResponse>;
788
806
  /** `GET /v1/tasks/:id` — fetch the current state of a task. */
789
807
  getTask(taskId: string): Promise<Task>;
790
808
  /** `DELETE /v1/tasks/:id` — cancel a queued or running task. */
@@ -815,4 +833,4 @@ declare class AgentsClient {
815
833
  streamTask(taskId: string): AsyncGenerator<StateTransition>;
816
834
  }
817
835
 
818
- export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRunResponse, AgentsClient, type AgentsClientConfig, type CallToolResponse, type ChatChoice, type ChatClientLike, type ChatMessage, type ChatRequest, type ChatResponse, type ChatUsage, type Chunk, type ChunkResult, type ClientOptions, type Concept, type ConceptResult, ConnectionError, Conversation, type CreateAgentInput, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type LogLevel, MockHttpClient, type ModelInfo, type ModelList, type OrchestratorResponse, type PlanOptions, type PlanResult, type PlanStep, type RagAuditInfo, type RagQueryResponse, type RagSource, type RagUploadResponse, type ReasoningOptions, type ReasoningResult, type RequestOptions, type RetrievalResult, ServerError, type SourceType, type StateTransition, type Task, type TaskClaim, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus };
836
+ export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRunResponse, AgentsClient, type AgentsClientConfig, type CallToolResponse, type ChatChoice, type ChatClientLike, type ChatMessage, type ChatRequest, type ChatResponse, type ChatUsage, type Chunk, type ChunkResult, type ClientOptions, type Concept, type ConceptResult, ConnectionError, Conversation, type CreateAgentInput, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type LogLevel, MockHttpClient, type ModelInfo, type ModelList, type OrchestratorResponse, type PlanOptions, type PlanResult, type PlanStep, type RagAuditInfo, type RagQueryResponse, type RagSource, type RagUploadResponse, type ReasoningOptions, type ReasoningResult, type RequestOptions, type RetrievalResult, ServerError, type SourceType, type StateTransition, type Task, type TaskClaim, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus, supportScore };
package/dist/index.d.ts CHANGED
@@ -716,13 +716,24 @@ interface TaskClaim {
716
716
  * Verification block attached to completed tasks. When
717
717
  * `verification_source === "prompt_only"` the `confidence` and
718
718
  * `hallucination_rate` fields reflect self-consistency only; rely on
719
- * `verdict` + `trust_score` + `message` as authoritative.
719
+ * `verdict` + `support_score` (alias `trust_score`) + `message` as authoritative.
720
+ *
721
+ * Note: `support_score` is the public name for the same numeric value
722
+ * the wire protocol calls `trust_score`. The JSON wire field is unchanged
723
+ * for backward compatibility — use `supportScore(v)` to read the value
724
+ * by its public name. New code should prefer `support_score`.
720
725
  */
721
726
  interface TaskVerification {
722
727
  verdict: Verdict;
723
728
  hallucination_rate: number;
724
729
  confidence: number;
725
730
  trust_score: number;
731
+ /**
732
+ * Public name for `trust_score` (0-1 fraction of claims supported
733
+ * by the sources). Optional on the wire; always equals `trust_score`
734
+ * when populated. Prefer the `supportScore()` helper to read it.
735
+ */
736
+ support_score?: number;
726
737
  verification_source: string;
727
738
  claims: TaskClaim[];
728
739
  verification_retries: number;
@@ -731,6 +742,13 @@ interface TaskVerification {
731
742
  sources_cited?: number[];
732
743
  stripped_claims?: string[];
733
744
  }
745
+ /**
746
+ * Read the support score of a verification block. Falls back to
747
+ * `trust_score` when the optional `support_score` field is absent
748
+ * (the JSON wire format only emits `trust_score` for backward
749
+ * compatibility). Always returns the same numeric value either way.
750
+ */
751
+ declare function supportScore(v: TaskVerification): number;
734
752
  /** Full task record returned by `GET /v1/tasks/:id`. */
735
753
  interface Task {
736
754
  task_id: string;
@@ -783,8 +801,8 @@ declare class AgentsClient {
783
801
  get(agentId: string): Promise<DeployedAgent>;
784
802
  update(agentId: string, patch: UpdateAgentPatch): Promise<DeployedAgent>;
785
803
  delete(agentId: string): Promise<void>;
786
- run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive"): Promise<AgentRunResponse>;
787
- a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive"): Promise<A2aResponse>;
804
+ run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<AgentRunResponse>;
805
+ a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<A2aResponse>;
788
806
  /** `GET /v1/tasks/:id` — fetch the current state of a task. */
789
807
  getTask(taskId: string): Promise<Task>;
790
808
  /** `DELETE /v1/tasks/:id` — cancel a queued or running task. */
@@ -815,4 +833,4 @@ declare class AgentsClient {
815
833
  streamTask(taskId: string): AsyncGenerator<StateTransition>;
816
834
  }
817
835
 
818
- export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRunResponse, AgentsClient, type AgentsClientConfig, type CallToolResponse, type ChatChoice, type ChatClientLike, type ChatMessage, type ChatRequest, type ChatResponse, type ChatUsage, type Chunk, type ChunkResult, type ClientOptions, type Concept, type ConceptResult, ConnectionError, Conversation, type CreateAgentInput, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type LogLevel, MockHttpClient, type ModelInfo, type ModelList, type OrchestratorResponse, type PlanOptions, type PlanResult, type PlanStep, type RagAuditInfo, type RagQueryResponse, type RagSource, type RagUploadResponse, type ReasoningOptions, type ReasoningResult, type RequestOptions, type RetrievalResult, ServerError, type SourceType, type StateTransition, type Task, type TaskClaim, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus };
836
+ export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRunResponse, AgentsClient, type AgentsClientConfig, type CallToolResponse, type ChatChoice, type ChatClientLike, type ChatMessage, type ChatRequest, type ChatResponse, type ChatUsage, type Chunk, type ChunkResult, type ClientOptions, type Concept, type ConceptResult, ConnectionError, Conversation, type CreateAgentInput, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type LogLevel, MockHttpClient, type ModelInfo, type ModelList, type OrchestratorResponse, type PlanOptions, type PlanResult, type PlanStep, type RagAuditInfo, type RagQueryResponse, type RagSource, type RagUploadResponse, type ReasoningOptions, type ReasoningResult, type RequestOptions, type RetrievalResult, ServerError, type SourceType, type StateTransition, type Task, type TaskClaim, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus, supportScore };
package/dist/index.js CHANGED
@@ -35,7 +35,8 @@ __export(index_exports, {
35
35
  chatContent: () => chatContent,
36
36
  guardIsBlocked: () => guardIsBlocked,
37
37
  guardIsSafe: () => guardIsSafe,
38
- isTerminalStatus: () => isTerminalStatus
38
+ isTerminalStatus: () => isTerminalStatus,
39
+ supportScore: () => supportScore
39
40
  });
40
41
  module.exports = __toCommonJS(index_exports);
41
42
 
@@ -1290,6 +1291,9 @@ function guardIsBlocked(response) {
1290
1291
 
1291
1292
  // src/agents.ts
1292
1293
  var MAX_RESPONSE_SIZE = 10 * 1024 * 1024;
1294
+ function supportScore(v) {
1295
+ return v.support_score ?? v.trust_score;
1296
+ }
1293
1297
  function isTerminalStatus(s) {
1294
1298
  return s === "completed" || s === "failed" || s === "cancelled";
1295
1299
  }
@@ -1403,20 +1407,22 @@ var AgentsClient = class {
1403
1407
  await this.request("DELETE", `/v1/agents/${agentId}`);
1404
1408
  }
1405
1409
  // ── Runs ────────────────────────────────────────────────────────
1406
- async run(agentId, input, verificationMode) {
1410
+ async run(agentId, input, verificationMode, factCheckMode) {
1407
1411
  if (!input) throw new Error("input is required");
1408
1412
  const body = { input };
1409
1413
  if (verificationMode) body.verification_mode = verificationMode;
1414
+ if (factCheckMode) body.fact_check_mode = factCheckMode;
1410
1415
  return await this.request(
1411
1416
  "POST",
1412
1417
  `/v1/agents/${agentId}/runs`,
1413
1418
  body
1414
1419
  );
1415
1420
  }
1416
- async a2aInvoke(agentId, input, trace, verificationMode) {
1421
+ async a2aInvoke(agentId, input, trace, verificationMode, factCheckMode) {
1417
1422
  if (!input) throw new Error("input is required");
1418
1423
  const body = { input };
1419
1424
  if (verificationMode) body.verification_mode = verificationMode;
1425
+ if (factCheckMode) body.fact_check_mode = factCheckMode;
1420
1426
  const extraHeaders = {};
1421
1427
  if (trace && trace.length > 0) extraHeaders["x-a2a-trace"] = trace.join(",");
1422
1428
  return await this.request(
@@ -1529,5 +1535,6 @@ var AgentsClient = class {
1529
1535
  chatContent,
1530
1536
  guardIsBlocked,
1531
1537
  guardIsSafe,
1532
- isTerminalStatus
1538
+ isTerminalStatus,
1539
+ supportScore
1533
1540
  });
package/dist/index.mjs CHANGED
@@ -1249,6 +1249,9 @@ function guardIsBlocked(response) {
1249
1249
 
1250
1250
  // src/agents.ts
1251
1251
  var MAX_RESPONSE_SIZE = 10 * 1024 * 1024;
1252
+ function supportScore(v) {
1253
+ return v.support_score ?? v.trust_score;
1254
+ }
1252
1255
  function isTerminalStatus(s) {
1253
1256
  return s === "completed" || s === "failed" || s === "cancelled";
1254
1257
  }
@@ -1362,20 +1365,22 @@ var AgentsClient = class {
1362
1365
  await this.request("DELETE", `/v1/agents/${agentId}`);
1363
1366
  }
1364
1367
  // ── Runs ────────────────────────────────────────────────────────
1365
- async run(agentId, input, verificationMode) {
1368
+ async run(agentId, input, verificationMode, factCheckMode) {
1366
1369
  if (!input) throw new Error("input is required");
1367
1370
  const body = { input };
1368
1371
  if (verificationMode) body.verification_mode = verificationMode;
1372
+ if (factCheckMode) body.fact_check_mode = factCheckMode;
1369
1373
  return await this.request(
1370
1374
  "POST",
1371
1375
  `/v1/agents/${agentId}/runs`,
1372
1376
  body
1373
1377
  );
1374
1378
  }
1375
- async a2aInvoke(agentId, input, trace, verificationMode) {
1379
+ async a2aInvoke(agentId, input, trace, verificationMode, factCheckMode) {
1376
1380
  if (!input) throw new Error("input is required");
1377
1381
  const body = { input };
1378
1382
  if (verificationMode) body.verification_mode = verificationMode;
1383
+ if (factCheckMode) body.fact_check_mode = factCheckMode;
1379
1384
  const extraHeaders = {};
1380
1385
  if (trace && trace.length > 0) extraHeaders["x-a2a-trace"] = trace.join(",");
1381
1386
  return await this.request(
@@ -1487,5 +1492,6 @@ export {
1487
1492
  chatContent,
1488
1493
  guardIsBlocked,
1489
1494
  guardIsSafe,
1490
- isTerminalStatus
1495
+ isTerminalStatus,
1496
+ supportScore
1491
1497
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wauldo",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Official TypeScript SDK for Wauldo — Verified AI answers from your documents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,10 +42,10 @@
42
42
  "license": "MIT",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/wauldo/wauldo-sdk-js"
45
+ "url": "https://github.com/wauldoai/wauldo-sdk-js"
46
46
  },
47
47
  "bugs": {
48
- "url": "https://github.com/wauldo/wauldo-sdk-js/issues"
48
+ "url": "https://github.com/wauldoai/wauldo-sdk-js/issues"
49
49
  },
50
50
  "homepage": "https://wauldo.com",
51
51
  "engines": {