@soat/sdk 0.57.0 → 0.58.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.mjs CHANGED
@@ -630,6 +630,17 @@ var Activity = class {
630
630
  ...options
631
631
  });
632
632
  }
633
+ /**
634
+ * Export the activity feed as NDJSON
635
+ *
636
+ * Streams a project's activity entries as newline-delimited JSON — one entry object per line, **oldest first**, where the feed itself reads newest first: a feed answers what just happened, and a file is read start to end. `project_id` is required: the export is per-project by design. Filters behave exactly as they do on the list endpoint.
637
+ */
638
+ static exportActivity(options) {
639
+ return (options.client ?? client).get({
640
+ url: "/api/v1/activity/export",
641
+ ...options
642
+ });
643
+ }
633
644
  };
634
645
  var Actors = class {
635
646
  /**
@@ -1552,6 +1563,17 @@ var Documents = class {
1552
1563
  });
1553
1564
  }
1554
1565
  /**
1566
+ * Export documents as NDJSON
1567
+ *
1568
+ * Streams a project's documents as newline-delimited JSON — one document object per line, oldest first — for archiving the corpus or shipping it into another system. `project_id` is required: the export is per-project by design. The rows are the rows the listing returns for the same caller, so a policy that hides a document hides it here too, and withdrawn documents and the reserved `/.system/` root are left out.
1569
+ */
1570
+ static exportDocuments(options) {
1571
+ return (options.client ?? client).get({
1572
+ url: "/api/v1/documents/export",
1573
+ ...options
1574
+ });
1575
+ }
1576
+ /**
1555
1577
  * Delete a document
1556
1578
  *
1557
1579
  * Deletes a document and its underlying file
@@ -1589,6 +1611,45 @@ var Documents = class {
1589
1611
  });
1590
1612
  }
1591
1613
  /**
1614
+ * List a document's relations
1615
+ *
1616
+ * Returns the typed edges this document asserts about others, oldest first. An edge is owned by the document it leaves, so this is what the document claims — use `?related_to=` on the listing to find what claims something about it.
1617
+ */
1618
+ static listDocumentRelations(options) {
1619
+ return (options.client ?? client).get({
1620
+ url: "/api/v1/documents/{document_id}/relations",
1621
+ ...options
1622
+ });
1623
+ }
1624
+ /**
1625
+ * Assert a relation
1626
+ *
1627
+ * Asserts a typed edge from this document to another in the same project. Asserting the same edge twice is `409`: an edge is a fact, and the second assertion is the same fact.
1628
+ *
1629
+ * Writing an edge is a write of the asserting document (`documents:UpdateDocument`); the document it points at is unchanged, which is what lets an agent record what its own report derives from without being able to make another report claim anything.
1630
+ */
1631
+ static createDocumentRelation(options) {
1632
+ return (options.client ?? client).post({
1633
+ url: "/api/v1/documents/{document_id}/relations",
1634
+ ...options,
1635
+ headers: {
1636
+ "Content-Type": "application/json",
1637
+ ...options.headers
1638
+ }
1639
+ });
1640
+ }
1641
+ /**
1642
+ * Retract a relation
1643
+ *
1644
+ * Removes an edge this document asserts. Both documents are left as they are — retracting a claim is not a change to what it was about.
1645
+ */
1646
+ static deleteDocumentRelation(options) {
1647
+ return (options.client ?? client).delete({
1648
+ url: "/api/v1/documents/{document_id}/relations/{relation_id}",
1649
+ ...options
1650
+ });
1651
+ }
1652
+ /**
1592
1653
  * Get document ingestion status
1593
1654
  *
1594
1655
  * Returns a lightweight ingestion status payload for polling — `status`,
@@ -1606,6 +1667,70 @@ var Documents = class {
1606
1667
  });
1607
1668
  }
1608
1669
  /**
1670
+ * Withdraw a document
1671
+ *
1672
+ * Takes a document out of every default read while keeping its history. The withdrawal is archived as a **tombstone version**, so one mechanism answers what a document holds now and there is no second lifecycle flag for a reader to miss.
1673
+ *
1674
+ * Its chunks are dropped from the knowledge index, so a withdrawn document costs a live search nothing. The content is not lost with them: it is in the version before the tombstone, which [`POST /api/v1/documents/{document_id}/versions/{version}/restore`](/docs/api/documents/restore-document-version) re-chunks from.
1675
+ *
1676
+ * `DELETE` stays what it is — permanent, and it removes the backing file. Withdrawal is the reversible act. It does not apply under `/.system/`: a platform-written document keeps the owning module's lifecycle.
1677
+ *
1678
+ */
1679
+ static withdrawDocument(options) {
1680
+ return (options.client ?? client).post({
1681
+ url: "/api/v1/documents/{document_id}/withdraw",
1682
+ ...options,
1683
+ headers: {
1684
+ "Content-Type": "application/json",
1685
+ ...options.headers
1686
+ }
1687
+ });
1688
+ }
1689
+ /**
1690
+ * List a document's content versions
1691
+ *
1692
+ * Returns the document's archived states, newest first. A version is written on create and on every subsequent write that changes the content or its annotations, and a withdrawal is archived as a version carrying no content.
1693
+ *
1694
+ */
1695
+ static listDocumentVersions(options) {
1696
+ return (options.client ?? client).get({
1697
+ url: "/api/v1/documents/{document_id}/versions",
1698
+ ...options
1699
+ });
1700
+ }
1701
+ /**
1702
+ * Fetch an archived document version
1703
+ *
1704
+ * Returns the exact content and annotations the document held at a given version, which is what lets a run that cited a version read what it read.
1705
+ *
1706
+ */
1707
+ static getDocumentVersion(options) {
1708
+ return (options.client ?? client).get({
1709
+ url: "/api/v1/documents/{document_id}/versions/{version}",
1710
+ ...options
1711
+ });
1712
+ }
1713
+ /**
1714
+ * Restore an archived document version
1715
+ *
1716
+ * Writes an archived version's content and annotations back as the document's live state, which archives them again as a **new** version rather than rewinding the counter — so a run citing any version in between still resolves.
1717
+ *
1718
+ * The restore runs through the ordinary update path, so the content is re-chunked and re-embedded; restoring the state the document already holds is a no-op and archives nothing. Restoring any content version of a withdrawn document brings it back into listings and search.
1719
+ *
1720
+ * A tombstone version has no content, so naming one is `400 VALIDATION_FAILED`: restore the version before it instead.
1721
+ *
1722
+ */
1723
+ static restoreDocumentVersion(options) {
1724
+ return (options.client ?? client).post({
1725
+ url: "/api/v1/documents/{document_id}/versions/{version}/restore",
1726
+ ...options,
1727
+ headers: {
1728
+ "Content-Type": "application/json",
1729
+ ...options.headers
1730
+ }
1731
+ });
1732
+ }
1733
+ /**
1609
1734
  * Re-ingest an existing document
1610
1735
  *
1611
1736
  * Re-runs ingestion for an existing document against its already-stored
@@ -2704,6 +2829,26 @@ var Memories = class {
2704
2829
  });
2705
2830
  }
2706
2831
  /**
2832
+ * Retract a memory
2833
+ *
2834
+ * Retires a fact that stopped holding with nothing replacing it. The memory leaves the default listing, [knowledge search](/docs/api/knowledge/search-knowledge) and write deduplication, so restating the fact later lands as a new memory.
2835
+ *
2836
+ * It is an invalidation with no successor, which is what tells it apart from a supersede: `invalidated_at` is set and `superseded_by_memory_id` stays null. The retraction is appended to the assertion ledger with outcome `retracted`, so who withdrew the fact is part of the record.
2837
+ *
2838
+ * The memory stays readable by id, with its text and its assertions. `DELETE` remains the way to remove it outright.
2839
+ *
2840
+ */
2841
+ static retractMemory(options) {
2842
+ return (options.client ?? client).post({
2843
+ url: "/api/v1/memories/{memory_id}/retract",
2844
+ ...options,
2845
+ headers: {
2846
+ "Content-Type": "application/json",
2847
+ ...options.headers
2848
+ }
2849
+ });
2850
+ }
2851
+ /**
2707
2852
  * List a memory's assertions
2708
2853
  *
2709
2854
  * Returns every write that resolved into this memory, oldest first: the one that created it, the duplicates it absorbed, and the assertion that superseded another memory in its favour. A superseded memory keeps its own assertions, so the chain can be walked in both directions.
@@ -2897,6 +3042,17 @@ var MemoryStores = class {
2897
3042
  });
2898
3043
  }
2899
3044
  /**
3045
+ * Export a memory store's memories as NDJSON
3046
+ *
3047
+ * Streams one store's memories as newline-delimited JSON — one memory object per line, oldest first. Invalidated memories (retracted or superseded) are left out unless `include_invalidated` asks for them, so the file holds what the store currently asserts. The rows are the rows the listing returns for the same caller.
3048
+ */
3049
+ static exportMemories(options) {
3050
+ return (options.client ?? client).get({
3051
+ url: "/api/v1/memory-stores/{memory_store_id}/export",
3052
+ ...options
3053
+ });
3054
+ }
3055
+ /**
2900
3056
  * Get memory store tags
2901
3057
  *
2902
3058
  * Returns all tags attached to the memory store
@@ -2938,6 +3094,92 @@ var MemoryStores = class {
2938
3094
  });
2939
3095
  }
2940
3096
  };
3097
+ var MetadataSchemas = class {
3098
+ /**
3099
+ * List metadata schemas
3100
+ *
3101
+ * Returns the declarations in scope, oldest first. `resource_type` narrows them to one governed resource.
3102
+ */
3103
+ static listMetadataSchemas(options) {
3104
+ return (options?.client ?? client).get({
3105
+ url: "/api/v1/metadata-schemas",
3106
+ ...options
3107
+ });
3108
+ }
3109
+ /**
3110
+ * Declare a metadata schema
3111
+ *
3112
+ * Declares what `metadata` must satisfy for one resource type under one selector. A document is selected by `path_prefix`, matched on a path boundary: `/reports` covers `/reports/q1.txt` and never `/reports-archive/q1.txt`.
3113
+ *
3114
+ * The schema is compiled here, so one JSON Schema cannot parse is refused rather than stored — a stored one would be a rule that silently governs nothing. One selector has one schema per resource type; a second declaration of the same one is `409 NAME_CONFLICT`. The reserved root `/.system` cannot be governed: a platform-written document carries no caller metadata.
3115
+ *
3116
+ */
3117
+ static createMetadataSchema(options) {
3118
+ return (options.client ?? client).post({
3119
+ url: "/api/v1/metadata-schemas",
3120
+ ...options,
3121
+ headers: {
3122
+ "Content-Type": "application/json",
3123
+ ...options.headers
3124
+ }
3125
+ });
3126
+ }
3127
+ /**
3128
+ * Check metadata against what is declared
3129
+ *
3130
+ * Answers what a write would be told, without writing: a caller preparing a batch learns which declaration would refuse it, and why, before it sends anything.
3131
+ *
3132
+ * It reports; it does not enforce. The refusal itself lives in each resource's own write path, because a check a writer has to call is advisory and the writer who skips it is the one the rule exists for.
3133
+ *
3134
+ */
3135
+ static validateMetadata(options) {
3136
+ return (options.client ?? client).post({
3137
+ url: "/api/v1/metadata-schemas/validate",
3138
+ ...options,
3139
+ headers: {
3140
+ "Content-Type": "application/json",
3141
+ ...options.headers
3142
+ }
3143
+ });
3144
+ }
3145
+ /**
3146
+ * Delete a metadata schema
3147
+ *
3148
+ * Removes the declaration. Documents already stored keep the metadata they hold — the rule governed writes, not rows.
3149
+ */
3150
+ static deleteMetadataSchema(options) {
3151
+ return (options.client ?? client).delete({
3152
+ url: "/api/v1/metadata-schemas/{metadata_schema_id}",
3153
+ ...options
3154
+ });
3155
+ }
3156
+ /**
3157
+ * Get a metadata schema
3158
+ *
3159
+ * Returns one declaration by id.
3160
+ */
3161
+ static getMetadataSchema(options) {
3162
+ return (options.client ?? client).get({
3163
+ url: "/api/v1/metadata-schemas/{metadata_schema_id}",
3164
+ ...options
3165
+ });
3166
+ }
3167
+ /**
3168
+ * Update a metadata schema
3169
+ *
3170
+ * Changes the schema, the selector, or both. `resource_type` is fixed at creation: it decides the selector's spelling and which write path reads the row, so changing it would silently repoint the declaration at a different door — delete it and declare again instead.
3171
+ */
3172
+ static updateMetadataSchema(options) {
3173
+ return (options.client ?? client).patch({
3174
+ url: "/api/v1/metadata-schemas/{metadata_schema_id}",
3175
+ ...options,
3176
+ headers: {
3177
+ "Content-Type": "application/json",
3178
+ ...options.headers
3179
+ }
3180
+ });
3181
+ }
3182
+ };
2941
3183
  var ModelRoutes = class {
2942
3184
  /**
2943
3185
  * List model routes
@@ -4626,6 +4868,7 @@ var SoatClient = class {
4626
4868
  memories;
4627
4869
  memoryRules;
4628
4870
  memoryStores;
4871
+ metadataSchemas;
4629
4872
  modelRoutes;
4630
4873
  orchestrations;
4631
4874
  policies;
@@ -4674,6 +4917,7 @@ var SoatClient = class {
4674
4917
  this.memories = bindResource(Memories, httpClient);
4675
4918
  this.memoryRules = bindResource(MemoryRules, httpClient);
4676
4919
  this.memoryStores = bindResource(MemoryStores, httpClient);
4920
+ this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
4677
4921
  this.modelRoutes = bindResource(ModelRoutes, httpClient);
4678
4922
  this.orchestrations = bindResource(Orchestrations, httpClient);
4679
4923
  this.policies = bindResource(Policies, httpClient);
@@ -4692,4 +4936,4 @@ var SoatClient = class {
4692
4936
  }
4693
4937
  };
4694
4938
  //#endregion
4695
- export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
4939
+ export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.57.0",
3
+ "version": "0.58.1",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -43,7 +43,7 @@
43
43
  "devDependencies": {
44
44
  "@hey-api/openapi-ts": "^0.99.0",
45
45
  "@ttoss/config": "^1.38.0",
46
- "@ttoss/openapi-codegen": "^0.3.0",
46
+ "@ttoss/openapi-codegen": "^0.4.0",
47
47
  "@types/node": "^26.5.1",
48
48
  "tsdown": "^0.23.0",
49
49
  "tsx": "^4.23.13",