wauldo 0.11.0 → 0.12.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.mts CHANGED
@@ -695,6 +695,50 @@ interface AgentRunResponse {
695
695
  status: string;
696
696
  created_at: number;
697
697
  }
698
+ /**
699
+ * Immutable snapshot of an agent's `AgentContractV2` payload, content-addressed
700
+ * via SHA-256 and identified by a monotone `rev` integer. Mirrors AWS ECS
701
+ * task-definition revisions: append-only, O(1) rollback via `setActiveRevision`.
702
+ */
703
+ interface AgentRevision {
704
+ rev: number;
705
+ sha256: string;
706
+ contract_json: string;
707
+ created_at: number;
708
+ message?: string;
709
+ created_by?: string;
710
+ }
711
+ interface CreateRevisionInput {
712
+ /** Full `AgentContractV2` JSON payload (same shape as `custom_preset` on POST /v1/agents). */
713
+ customPreset: Record<string, unknown>;
714
+ /** Optional commit-message-style note (≤256 chars). */
715
+ message?: string;
716
+ /** When `true` (default) the new revision becomes active immediately. */
717
+ setActive?: boolean;
718
+ }
719
+ interface CreateRevisionResponse {
720
+ rev: number;
721
+ sha256: string;
722
+ active_rev: number;
723
+ }
724
+ interface ListRevisionsResponse {
725
+ revisions: AgentRevision[];
726
+ active_rev: number;
727
+ head_rev: number;
728
+ count: number;
729
+ }
730
+ /**
731
+ * Result of `shareTask` / `unshareTask`.
732
+ *
733
+ * `expiresAt` is epoch milliseconds, or `null` for paid tenants
734
+ * (no expiration). Free-tier shares default to a 30-day TTL ; once
735
+ * elapsed, the public `GET /v1/runs/<shareId>` returns 404.
736
+ */
737
+ interface ShareResponse {
738
+ share_id: string;
739
+ url: string;
740
+ expires_at: number | null;
741
+ }
698
742
  interface A2aResponse {
699
743
  task_id: string;
700
744
  agent_id: string;
@@ -801,12 +845,54 @@ declare class AgentsClient {
801
845
  get(agentId: string): Promise<DeployedAgent>;
802
846
  update(agentId: string, patch: UpdateAgentPatch): Promise<DeployedAgent>;
803
847
  delete(agentId: string): Promise<void>;
848
+ /**
849
+ * `POST /v1/agents/:id/revisions` — mint an immutable revision.
850
+ *
851
+ * The server validates `customPreset` (size, depth, states, cycle, tools,
852
+ * quota) and stores an immutable snapshot keyed by SHA-256. When
853
+ * `setActive` is `true` (default) the new revision becomes the agent's
854
+ * live revision; `false` stages it for review.
855
+ */
856
+ createRevision(agentId: string, input: CreateRevisionInput): Promise<CreateRevisionResponse>;
857
+ /** `GET /v1/agents/:id/revisions` — list revisions newest-first. */
858
+ listRevisions(agentId: string): Promise<ListRevisionsResponse>;
859
+ /** `GET /v1/agents/:id/revisions/:rev` — fetch one revision verbatim. */
860
+ getRevision(agentId: string, rev: number): Promise<AgentRevision>;
861
+ /**
862
+ * `PATCH /v1/agents/:id/active-revision` — O(1) rollback / promotion.
863
+ *
864
+ * No LLM cost — the revision is already validated and stored. Use this
865
+ * to roll back to a previous good revision when the current one breaks
866
+ * in production.
867
+ */
868
+ setActiveRevision(agentId: string, rev: number): Promise<DeployedAgent>;
804
869
  run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<AgentRunResponse>;
805
870
  a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<A2aResponse>;
806
871
  /** `GET /v1/tasks/:id` — fetch the current state of a task. */
807
872
  getTask(taskId: string): Promise<Task>;
808
873
  /** `DELETE /v1/tasks/:id` — cancel a queued or running task. */
809
874
  cancelTask(taskId: string): Promise<void>;
875
+ /**
876
+ * `POST /v1/tasks/:id/share` — publish a run as a public URL.
877
+ *
878
+ * Idempotent : calling on an already-shared task returns the existing
879
+ * `ShareResponse` without bumping the per-tenant cap. The returned
880
+ * `url` (form `https://wauldo.com/r/<id>`) can be pasted anywhere —
881
+ * anyone with the link sees the verdict + claims + sources + timeline
882
+ * through a strict-whitelist projection (no `custom_preset` /
883
+ * `wauldo_toml` / system prompt / tool args ever leave the tenant).
884
+ *
885
+ * Free-tier tenants get a 30-day TTL ; paid tenants get
886
+ * `expires_at = null` (no expiration).
887
+ */
888
+ shareTask(taskId: string): Promise<ShareResponse>;
889
+ /**
890
+ * `DELETE /v1/tasks/:id/share` — make a published run private again.
891
+ *
892
+ * Idempotent : calling on a never-published task returns 204.
893
+ * Subsequent `GET /v1/runs/<shareId>` for the cleared id returns 404.
894
+ */
895
+ unshareTask(taskId: string): Promise<void>;
810
896
  /**
811
897
  * Poll `getTask` until the task reaches a terminal status. Resolves
812
898
  * with the final Task snapshot. Rejects with `Error("timeout")` if
@@ -941,4 +1027,4 @@ declare class HistoryClient {
941
1027
  deleteTask(taskId: string): Promise<number>;
942
1028
  }
943
1029
 
944
- 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, HistoryClient, type HistoryClientConfig, type ExportOptions as HistoryExportOptions, type ListOptions as HistoryListOptions, type HistoryListResponse, 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 TaskHistoryEntry, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus, supportScore };
1030
+ export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRevision, 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 CreateRevisionInput, type CreateRevisionResponse, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HistoryClient, type HistoryClientConfig, type ExportOptions as HistoryExportOptions, type ListOptions as HistoryListOptions, type HistoryListResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type ListRevisionsResponse, 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 TaskHistoryEntry, 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
@@ -695,6 +695,50 @@ interface AgentRunResponse {
695
695
  status: string;
696
696
  created_at: number;
697
697
  }
698
+ /**
699
+ * Immutable snapshot of an agent's `AgentContractV2` payload, content-addressed
700
+ * via SHA-256 and identified by a monotone `rev` integer. Mirrors AWS ECS
701
+ * task-definition revisions: append-only, O(1) rollback via `setActiveRevision`.
702
+ */
703
+ interface AgentRevision {
704
+ rev: number;
705
+ sha256: string;
706
+ contract_json: string;
707
+ created_at: number;
708
+ message?: string;
709
+ created_by?: string;
710
+ }
711
+ interface CreateRevisionInput {
712
+ /** Full `AgentContractV2` JSON payload (same shape as `custom_preset` on POST /v1/agents). */
713
+ customPreset: Record<string, unknown>;
714
+ /** Optional commit-message-style note (≤256 chars). */
715
+ message?: string;
716
+ /** When `true` (default) the new revision becomes active immediately. */
717
+ setActive?: boolean;
718
+ }
719
+ interface CreateRevisionResponse {
720
+ rev: number;
721
+ sha256: string;
722
+ active_rev: number;
723
+ }
724
+ interface ListRevisionsResponse {
725
+ revisions: AgentRevision[];
726
+ active_rev: number;
727
+ head_rev: number;
728
+ count: number;
729
+ }
730
+ /**
731
+ * Result of `shareTask` / `unshareTask`.
732
+ *
733
+ * `expiresAt` is epoch milliseconds, or `null` for paid tenants
734
+ * (no expiration). Free-tier shares default to a 30-day TTL ; once
735
+ * elapsed, the public `GET /v1/runs/<shareId>` returns 404.
736
+ */
737
+ interface ShareResponse {
738
+ share_id: string;
739
+ url: string;
740
+ expires_at: number | null;
741
+ }
698
742
  interface A2aResponse {
699
743
  task_id: string;
700
744
  agent_id: string;
@@ -801,12 +845,54 @@ declare class AgentsClient {
801
845
  get(agentId: string): Promise<DeployedAgent>;
802
846
  update(agentId: string, patch: UpdateAgentPatch): Promise<DeployedAgent>;
803
847
  delete(agentId: string): Promise<void>;
848
+ /**
849
+ * `POST /v1/agents/:id/revisions` — mint an immutable revision.
850
+ *
851
+ * The server validates `customPreset` (size, depth, states, cycle, tools,
852
+ * quota) and stores an immutable snapshot keyed by SHA-256. When
853
+ * `setActive` is `true` (default) the new revision becomes the agent's
854
+ * live revision; `false` stages it for review.
855
+ */
856
+ createRevision(agentId: string, input: CreateRevisionInput): Promise<CreateRevisionResponse>;
857
+ /** `GET /v1/agents/:id/revisions` — list revisions newest-first. */
858
+ listRevisions(agentId: string): Promise<ListRevisionsResponse>;
859
+ /** `GET /v1/agents/:id/revisions/:rev` — fetch one revision verbatim. */
860
+ getRevision(agentId: string, rev: number): Promise<AgentRevision>;
861
+ /**
862
+ * `PATCH /v1/agents/:id/active-revision` — O(1) rollback / promotion.
863
+ *
864
+ * No LLM cost — the revision is already validated and stored. Use this
865
+ * to roll back to a previous good revision when the current one breaks
866
+ * in production.
867
+ */
868
+ setActiveRevision(agentId: string, rev: number): Promise<DeployedAgent>;
804
869
  run(agentId: string, input: string, verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<AgentRunResponse>;
805
870
  a2aInvoke(agentId: string, input: string, trace?: string[], verificationMode?: "strict" | "balanced" | "permissive", factCheckMode?: "lexical" | "hybrid" | "semantic"): Promise<A2aResponse>;
806
871
  /** `GET /v1/tasks/:id` — fetch the current state of a task. */
807
872
  getTask(taskId: string): Promise<Task>;
808
873
  /** `DELETE /v1/tasks/:id` — cancel a queued or running task. */
809
874
  cancelTask(taskId: string): Promise<void>;
875
+ /**
876
+ * `POST /v1/tasks/:id/share` — publish a run as a public URL.
877
+ *
878
+ * Idempotent : calling on an already-shared task returns the existing
879
+ * `ShareResponse` without bumping the per-tenant cap. The returned
880
+ * `url` (form `https://wauldo.com/r/<id>`) can be pasted anywhere —
881
+ * anyone with the link sees the verdict + claims + sources + timeline
882
+ * through a strict-whitelist projection (no `custom_preset` /
883
+ * `wauldo_toml` / system prompt / tool args ever leave the tenant).
884
+ *
885
+ * Free-tier tenants get a 30-day TTL ; paid tenants get
886
+ * `expires_at = null` (no expiration).
887
+ */
888
+ shareTask(taskId: string): Promise<ShareResponse>;
889
+ /**
890
+ * `DELETE /v1/tasks/:id/share` — make a published run private again.
891
+ *
892
+ * Idempotent : calling on a never-published task returns 204.
893
+ * Subsequent `GET /v1/runs/<shareId>` for the cleared id returns 404.
894
+ */
895
+ unshareTask(taskId: string): Promise<void>;
810
896
  /**
811
897
  * Poll `getTask` until the task reaches a terminal status. Resolves
812
898
  * with the final Task snapshot. Rejects with `Error("timeout")` if
@@ -941,4 +1027,4 @@ declare class HistoryClient {
941
1027
  deleteTask(taskId: string): Promise<number>;
942
1028
  }
943
1029
 
944
- 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, HistoryClient, type HistoryClientConfig, type ExportOptions as HistoryExportOptions, type ListOptions as HistoryListOptions, type HistoryListResponse, 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 TaskHistoryEntry, type TaskStatus, type TaskVerification, TimeoutError, type ToolContent, type ToolDefinition, ToolNotFoundError, type UpdateAgentPatch, ValidationError, type Verdict, WauldoError, chatContent, guardIsBlocked, guardIsSafe, isTerminalStatus, supportScore };
1030
+ export { type A2aResponse, AgentClient, type AgentListResponse, type AgentRevision, 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 CreateRevisionInput, type CreateRevisionResponse, type DeployedAgent, type DetailLevel, type EmbeddingData, type EmbeddingResponse, type EmbeddingUsage, type GraphNode, type GuardClaim, type GuardMode, type GuardResponse, HistoryClient, type HistoryClientConfig, type ExportOptions as HistoryExportOptions, type ListOptions as HistoryListOptions, type HistoryListResponse, HttpClient, type HttpClientConfig, HttpError, type KnowledgeGraphResult, type ListRevisionsResponse, 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 TaskHistoryEntry, 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
@@ -1407,6 +1407,55 @@ var AgentsClient = class {
1407
1407
  async delete(agentId) {
1408
1408
  await this.request("DELETE", `/v1/agents/${agentId}`);
1409
1409
  }
1410
+ // ── Revisions (ECS-style versioning) ────────────────────────────
1411
+ /**
1412
+ * `POST /v1/agents/:id/revisions` — mint an immutable revision.
1413
+ *
1414
+ * The server validates `customPreset` (size, depth, states, cycle, tools,
1415
+ * quota) and stores an immutable snapshot keyed by SHA-256. When
1416
+ * `setActive` is `true` (default) the new revision becomes the agent's
1417
+ * live revision; `false` stages it for review.
1418
+ */
1419
+ async createRevision(agentId, input) {
1420
+ const body = {
1421
+ custom_preset: input.customPreset,
1422
+ set_active: input.setActive ?? true
1423
+ };
1424
+ if (input.message !== void 0) body.message = input.message;
1425
+ return await this.request(
1426
+ "POST",
1427
+ `/v1/agents/${agentId}/revisions`,
1428
+ body
1429
+ );
1430
+ }
1431
+ /** `GET /v1/agents/:id/revisions` — list revisions newest-first. */
1432
+ async listRevisions(agentId) {
1433
+ return await this.request(
1434
+ "GET",
1435
+ `/v1/agents/${agentId}/revisions`
1436
+ );
1437
+ }
1438
+ /** `GET /v1/agents/:id/revisions/:rev` — fetch one revision verbatim. */
1439
+ async getRevision(agentId, rev) {
1440
+ return await this.request(
1441
+ "GET",
1442
+ `/v1/agents/${agentId}/revisions/${rev}`
1443
+ );
1444
+ }
1445
+ /**
1446
+ * `PATCH /v1/agents/:id/active-revision` — O(1) rollback / promotion.
1447
+ *
1448
+ * No LLM cost — the revision is already validated and stored. Use this
1449
+ * to roll back to a previous good revision when the current one breaks
1450
+ * in production.
1451
+ */
1452
+ async setActiveRevision(agentId, rev) {
1453
+ return await this.request(
1454
+ "PATCH",
1455
+ `/v1/agents/${agentId}/active-revision`,
1456
+ { rev }
1457
+ );
1458
+ }
1410
1459
  // ── Runs ────────────────────────────────────────────────────────
1411
1460
  async run(agentId, input, verificationMode, factCheckMode) {
1412
1461
  if (!input) throw new Error("input is required");
@@ -1442,6 +1491,36 @@ var AgentsClient = class {
1442
1491
  async cancelTask(taskId) {
1443
1492
  await this.request("DELETE", `/v1/tasks/${taskId}`);
1444
1493
  }
1494
+ // ── Shareable runs ──────────────────────────────────────────────
1495
+ /**
1496
+ * `POST /v1/tasks/:id/share` — publish a run as a public URL.
1497
+ *
1498
+ * Idempotent : calling on an already-shared task returns the existing
1499
+ * `ShareResponse` without bumping the per-tenant cap. The returned
1500
+ * `url` (form `https://wauldo.com/r/<id>`) can be pasted anywhere —
1501
+ * anyone with the link sees the verdict + claims + sources + timeline
1502
+ * through a strict-whitelist projection (no `custom_preset` /
1503
+ * `wauldo_toml` / system prompt / tool args ever leave the tenant).
1504
+ *
1505
+ * Free-tier tenants get a 30-day TTL ; paid tenants get
1506
+ * `expires_at = null` (no expiration).
1507
+ */
1508
+ async shareTask(taskId) {
1509
+ return await this.request(
1510
+ "POST",
1511
+ `/v1/tasks/${taskId}/share`,
1512
+ {}
1513
+ );
1514
+ }
1515
+ /**
1516
+ * `DELETE /v1/tasks/:id/share` — make a published run private again.
1517
+ *
1518
+ * Idempotent : calling on a never-published task returns 204.
1519
+ * Subsequent `GET /v1/runs/<shareId>` for the cleared id returns 404.
1520
+ */
1521
+ async unshareTask(taskId) {
1522
+ await this.request("DELETE", `/v1/tasks/${taskId}/share`);
1523
+ }
1445
1524
  /**
1446
1525
  * Poll `getTask` until the task reaches a terminal status. Resolves
1447
1526
  * with the final Task snapshot. Rejects with `Error("timeout")` if
package/dist/index.mjs CHANGED
@@ -1364,6 +1364,55 @@ var AgentsClient = class {
1364
1364
  async delete(agentId) {
1365
1365
  await this.request("DELETE", `/v1/agents/${agentId}`);
1366
1366
  }
1367
+ // ── Revisions (ECS-style versioning) ────────────────────────────
1368
+ /**
1369
+ * `POST /v1/agents/:id/revisions` — mint an immutable revision.
1370
+ *
1371
+ * The server validates `customPreset` (size, depth, states, cycle, tools,
1372
+ * quota) and stores an immutable snapshot keyed by SHA-256. When
1373
+ * `setActive` is `true` (default) the new revision becomes the agent's
1374
+ * live revision; `false` stages it for review.
1375
+ */
1376
+ async createRevision(agentId, input) {
1377
+ const body = {
1378
+ custom_preset: input.customPreset,
1379
+ set_active: input.setActive ?? true
1380
+ };
1381
+ if (input.message !== void 0) body.message = input.message;
1382
+ return await this.request(
1383
+ "POST",
1384
+ `/v1/agents/${agentId}/revisions`,
1385
+ body
1386
+ );
1387
+ }
1388
+ /** `GET /v1/agents/:id/revisions` — list revisions newest-first. */
1389
+ async listRevisions(agentId) {
1390
+ return await this.request(
1391
+ "GET",
1392
+ `/v1/agents/${agentId}/revisions`
1393
+ );
1394
+ }
1395
+ /** `GET /v1/agents/:id/revisions/:rev` — fetch one revision verbatim. */
1396
+ async getRevision(agentId, rev) {
1397
+ return await this.request(
1398
+ "GET",
1399
+ `/v1/agents/${agentId}/revisions/${rev}`
1400
+ );
1401
+ }
1402
+ /**
1403
+ * `PATCH /v1/agents/:id/active-revision` — O(1) rollback / promotion.
1404
+ *
1405
+ * No LLM cost — the revision is already validated and stored. Use this
1406
+ * to roll back to a previous good revision when the current one breaks
1407
+ * in production.
1408
+ */
1409
+ async setActiveRevision(agentId, rev) {
1410
+ return await this.request(
1411
+ "PATCH",
1412
+ `/v1/agents/${agentId}/active-revision`,
1413
+ { rev }
1414
+ );
1415
+ }
1367
1416
  // ── Runs ────────────────────────────────────────────────────────
1368
1417
  async run(agentId, input, verificationMode, factCheckMode) {
1369
1418
  if (!input) throw new Error("input is required");
@@ -1399,6 +1448,36 @@ var AgentsClient = class {
1399
1448
  async cancelTask(taskId) {
1400
1449
  await this.request("DELETE", `/v1/tasks/${taskId}`);
1401
1450
  }
1451
+ // ── Shareable runs ──────────────────────────────────────────────
1452
+ /**
1453
+ * `POST /v1/tasks/:id/share` — publish a run as a public URL.
1454
+ *
1455
+ * Idempotent : calling on an already-shared task returns the existing
1456
+ * `ShareResponse` without bumping the per-tenant cap. The returned
1457
+ * `url` (form `https://wauldo.com/r/<id>`) can be pasted anywhere —
1458
+ * anyone with the link sees the verdict + claims + sources + timeline
1459
+ * through a strict-whitelist projection (no `custom_preset` /
1460
+ * `wauldo_toml` / system prompt / tool args ever leave the tenant).
1461
+ *
1462
+ * Free-tier tenants get a 30-day TTL ; paid tenants get
1463
+ * `expires_at = null` (no expiration).
1464
+ */
1465
+ async shareTask(taskId) {
1466
+ return await this.request(
1467
+ "POST",
1468
+ `/v1/tasks/${taskId}/share`,
1469
+ {}
1470
+ );
1471
+ }
1472
+ /**
1473
+ * `DELETE /v1/tasks/:id/share` — make a published run private again.
1474
+ *
1475
+ * Idempotent : calling on a never-published task returns 204.
1476
+ * Subsequent `GET /v1/runs/<shareId>` for the cleared id returns 404.
1477
+ */
1478
+ async unshareTask(taskId) {
1479
+ await this.request("DELETE", `/v1/tasks/${taskId}/share`);
1480
+ }
1402
1481
  /**
1403
1482
  * Poll `getTask` until the task reaches a terminal status. Resolves
1404
1483
  * with the final Task snapshot. Rejects with `Error("timeout")` if
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wauldo",
3
- "version": "0.11.0",
3
+ "version": "0.12.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",