@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.cjs +245 -0
- package/dist/index.d.cts +1295 -283
- package/dist/index.d.mts +1295 -283
- package/dist/index.mjs +245 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -631,6 +631,17 @@ var Activity = class {
|
|
|
631
631
|
...options
|
|
632
632
|
});
|
|
633
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* Export the activity feed as NDJSON
|
|
636
|
+
*
|
|
637
|
+
* 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.
|
|
638
|
+
*/
|
|
639
|
+
static exportActivity(options) {
|
|
640
|
+
return (options.client ?? client).get({
|
|
641
|
+
url: "/api/v1/activity/export",
|
|
642
|
+
...options
|
|
643
|
+
});
|
|
644
|
+
}
|
|
634
645
|
};
|
|
635
646
|
var Actors = class {
|
|
636
647
|
/**
|
|
@@ -1553,6 +1564,17 @@ var Documents = class {
|
|
|
1553
1564
|
});
|
|
1554
1565
|
}
|
|
1555
1566
|
/**
|
|
1567
|
+
* Export documents as NDJSON
|
|
1568
|
+
*
|
|
1569
|
+
* 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.
|
|
1570
|
+
*/
|
|
1571
|
+
static exportDocuments(options) {
|
|
1572
|
+
return (options.client ?? client).get({
|
|
1573
|
+
url: "/api/v1/documents/export",
|
|
1574
|
+
...options
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1556
1578
|
* Delete a document
|
|
1557
1579
|
*
|
|
1558
1580
|
* Deletes a document and its underlying file
|
|
@@ -1590,6 +1612,45 @@ var Documents = class {
|
|
|
1590
1612
|
});
|
|
1591
1613
|
}
|
|
1592
1614
|
/**
|
|
1615
|
+
* List a document's relations
|
|
1616
|
+
*
|
|
1617
|
+
* 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.
|
|
1618
|
+
*/
|
|
1619
|
+
static listDocumentRelations(options) {
|
|
1620
|
+
return (options.client ?? client).get({
|
|
1621
|
+
url: "/api/v1/documents/{document_id}/relations",
|
|
1622
|
+
...options
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* Assert a relation
|
|
1627
|
+
*
|
|
1628
|
+
* 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.
|
|
1629
|
+
*
|
|
1630
|
+
* 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.
|
|
1631
|
+
*/
|
|
1632
|
+
static createDocumentRelation(options) {
|
|
1633
|
+
return (options.client ?? client).post({
|
|
1634
|
+
url: "/api/v1/documents/{document_id}/relations",
|
|
1635
|
+
...options,
|
|
1636
|
+
headers: {
|
|
1637
|
+
"Content-Type": "application/json",
|
|
1638
|
+
...options.headers
|
|
1639
|
+
}
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Retract a relation
|
|
1644
|
+
*
|
|
1645
|
+
* 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.
|
|
1646
|
+
*/
|
|
1647
|
+
static deleteDocumentRelation(options) {
|
|
1648
|
+
return (options.client ?? client).delete({
|
|
1649
|
+
url: "/api/v1/documents/{document_id}/relations/{relation_id}",
|
|
1650
|
+
...options
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1593
1654
|
* Get document ingestion status
|
|
1594
1655
|
*
|
|
1595
1656
|
* Returns a lightweight ingestion status payload for polling — `status`,
|
|
@@ -1607,6 +1668,70 @@ var Documents = class {
|
|
|
1607
1668
|
});
|
|
1608
1669
|
}
|
|
1609
1670
|
/**
|
|
1671
|
+
* Withdraw a document
|
|
1672
|
+
*
|
|
1673
|
+
* 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.
|
|
1674
|
+
*
|
|
1675
|
+
* 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.
|
|
1676
|
+
*
|
|
1677
|
+
* `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.
|
|
1678
|
+
*
|
|
1679
|
+
*/
|
|
1680
|
+
static withdrawDocument(options) {
|
|
1681
|
+
return (options.client ?? client).post({
|
|
1682
|
+
url: "/api/v1/documents/{document_id}/withdraw",
|
|
1683
|
+
...options,
|
|
1684
|
+
headers: {
|
|
1685
|
+
"Content-Type": "application/json",
|
|
1686
|
+
...options.headers
|
|
1687
|
+
}
|
|
1688
|
+
});
|
|
1689
|
+
}
|
|
1690
|
+
/**
|
|
1691
|
+
* List a document's content versions
|
|
1692
|
+
*
|
|
1693
|
+
* 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.
|
|
1694
|
+
*
|
|
1695
|
+
*/
|
|
1696
|
+
static listDocumentVersions(options) {
|
|
1697
|
+
return (options.client ?? client).get({
|
|
1698
|
+
url: "/api/v1/documents/{document_id}/versions",
|
|
1699
|
+
...options
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* Fetch an archived document version
|
|
1704
|
+
*
|
|
1705
|
+
* 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.
|
|
1706
|
+
*
|
|
1707
|
+
*/
|
|
1708
|
+
static getDocumentVersion(options) {
|
|
1709
|
+
return (options.client ?? client).get({
|
|
1710
|
+
url: "/api/v1/documents/{document_id}/versions/{version}",
|
|
1711
|
+
...options
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Restore an archived document version
|
|
1716
|
+
*
|
|
1717
|
+
* 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.
|
|
1718
|
+
*
|
|
1719
|
+
* 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.
|
|
1720
|
+
*
|
|
1721
|
+
* A tombstone version has no content, so naming one is `400 VALIDATION_FAILED`: restore the version before it instead.
|
|
1722
|
+
*
|
|
1723
|
+
*/
|
|
1724
|
+
static restoreDocumentVersion(options) {
|
|
1725
|
+
return (options.client ?? client).post({
|
|
1726
|
+
url: "/api/v1/documents/{document_id}/versions/{version}/restore",
|
|
1727
|
+
...options,
|
|
1728
|
+
headers: {
|
|
1729
|
+
"Content-Type": "application/json",
|
|
1730
|
+
...options.headers
|
|
1731
|
+
}
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1610
1735
|
* Re-ingest an existing document
|
|
1611
1736
|
*
|
|
1612
1737
|
* Re-runs ingestion for an existing document against its already-stored
|
|
@@ -2705,6 +2830,26 @@ var Memories = class {
|
|
|
2705
2830
|
});
|
|
2706
2831
|
}
|
|
2707
2832
|
/**
|
|
2833
|
+
* Retract a memory
|
|
2834
|
+
*
|
|
2835
|
+
* 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.
|
|
2836
|
+
*
|
|
2837
|
+
* 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.
|
|
2838
|
+
*
|
|
2839
|
+
* The memory stays readable by id, with its text and its assertions. `DELETE` remains the way to remove it outright.
|
|
2840
|
+
*
|
|
2841
|
+
*/
|
|
2842
|
+
static retractMemory(options) {
|
|
2843
|
+
return (options.client ?? client).post({
|
|
2844
|
+
url: "/api/v1/memories/{memory_id}/retract",
|
|
2845
|
+
...options,
|
|
2846
|
+
headers: {
|
|
2847
|
+
"Content-Type": "application/json",
|
|
2848
|
+
...options.headers
|
|
2849
|
+
}
|
|
2850
|
+
});
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2708
2853
|
* List a memory's assertions
|
|
2709
2854
|
*
|
|
2710
2855
|
* 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.
|
|
@@ -2898,6 +3043,17 @@ var MemoryStores = class {
|
|
|
2898
3043
|
});
|
|
2899
3044
|
}
|
|
2900
3045
|
/**
|
|
3046
|
+
* Export a memory store's memories as NDJSON
|
|
3047
|
+
*
|
|
3048
|
+
* 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.
|
|
3049
|
+
*/
|
|
3050
|
+
static exportMemories(options) {
|
|
3051
|
+
return (options.client ?? client).get({
|
|
3052
|
+
url: "/api/v1/memory-stores/{memory_store_id}/export",
|
|
3053
|
+
...options
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3056
|
+
/**
|
|
2901
3057
|
* Get memory store tags
|
|
2902
3058
|
*
|
|
2903
3059
|
* Returns all tags attached to the memory store
|
|
@@ -2939,6 +3095,92 @@ var MemoryStores = class {
|
|
|
2939
3095
|
});
|
|
2940
3096
|
}
|
|
2941
3097
|
};
|
|
3098
|
+
var MetadataSchemas = class {
|
|
3099
|
+
/**
|
|
3100
|
+
* List metadata schemas
|
|
3101
|
+
*
|
|
3102
|
+
* Returns the declarations in scope, oldest first. `resource_type` narrows them to one governed resource.
|
|
3103
|
+
*/
|
|
3104
|
+
static listMetadataSchemas(options) {
|
|
3105
|
+
return (options?.client ?? client).get({
|
|
3106
|
+
url: "/api/v1/metadata-schemas",
|
|
3107
|
+
...options
|
|
3108
|
+
});
|
|
3109
|
+
}
|
|
3110
|
+
/**
|
|
3111
|
+
* Declare a metadata schema
|
|
3112
|
+
*
|
|
3113
|
+
* 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`.
|
|
3114
|
+
*
|
|
3115
|
+
* 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.
|
|
3116
|
+
*
|
|
3117
|
+
*/
|
|
3118
|
+
static createMetadataSchema(options) {
|
|
3119
|
+
return (options.client ?? client).post({
|
|
3120
|
+
url: "/api/v1/metadata-schemas",
|
|
3121
|
+
...options,
|
|
3122
|
+
headers: {
|
|
3123
|
+
"Content-Type": "application/json",
|
|
3124
|
+
...options.headers
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
}
|
|
3128
|
+
/**
|
|
3129
|
+
* Check metadata against what is declared
|
|
3130
|
+
*
|
|
3131
|
+
* 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.
|
|
3132
|
+
*
|
|
3133
|
+
* 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.
|
|
3134
|
+
*
|
|
3135
|
+
*/
|
|
3136
|
+
static validateMetadata(options) {
|
|
3137
|
+
return (options.client ?? client).post({
|
|
3138
|
+
url: "/api/v1/metadata-schemas/validate",
|
|
3139
|
+
...options,
|
|
3140
|
+
headers: {
|
|
3141
|
+
"Content-Type": "application/json",
|
|
3142
|
+
...options.headers
|
|
3143
|
+
}
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* Delete a metadata schema
|
|
3148
|
+
*
|
|
3149
|
+
* Removes the declaration. Documents already stored keep the metadata they hold — the rule governed writes, not rows.
|
|
3150
|
+
*/
|
|
3151
|
+
static deleteMetadataSchema(options) {
|
|
3152
|
+
return (options.client ?? client).delete({
|
|
3153
|
+
url: "/api/v1/metadata-schemas/{metadata_schema_id}",
|
|
3154
|
+
...options
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
/**
|
|
3158
|
+
* Get a metadata schema
|
|
3159
|
+
*
|
|
3160
|
+
* Returns one declaration by id.
|
|
3161
|
+
*/
|
|
3162
|
+
static getMetadataSchema(options) {
|
|
3163
|
+
return (options.client ?? client).get({
|
|
3164
|
+
url: "/api/v1/metadata-schemas/{metadata_schema_id}",
|
|
3165
|
+
...options
|
|
3166
|
+
});
|
|
3167
|
+
}
|
|
3168
|
+
/**
|
|
3169
|
+
* Update a metadata schema
|
|
3170
|
+
*
|
|
3171
|
+
* 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.
|
|
3172
|
+
*/
|
|
3173
|
+
static updateMetadataSchema(options) {
|
|
3174
|
+
return (options.client ?? client).patch({
|
|
3175
|
+
url: "/api/v1/metadata-schemas/{metadata_schema_id}",
|
|
3176
|
+
...options,
|
|
3177
|
+
headers: {
|
|
3178
|
+
"Content-Type": "application/json",
|
|
3179
|
+
...options.headers
|
|
3180
|
+
}
|
|
3181
|
+
});
|
|
3182
|
+
}
|
|
3183
|
+
};
|
|
2942
3184
|
var ModelRoutes = class {
|
|
2943
3185
|
/**
|
|
2944
3186
|
* List model routes
|
|
@@ -4627,6 +4869,7 @@ var SoatClient = class {
|
|
|
4627
4869
|
memories;
|
|
4628
4870
|
memoryRules;
|
|
4629
4871
|
memoryStores;
|
|
4872
|
+
metadataSchemas;
|
|
4630
4873
|
modelRoutes;
|
|
4631
4874
|
orchestrations;
|
|
4632
4875
|
policies;
|
|
@@ -4675,6 +4918,7 @@ var SoatClient = class {
|
|
|
4675
4918
|
this.memories = bindResource(Memories, httpClient);
|
|
4676
4919
|
this.memoryRules = bindResource(MemoryRules, httpClient);
|
|
4677
4920
|
this.memoryStores = bindResource(MemoryStores, httpClient);
|
|
4921
|
+
this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
|
|
4678
4922
|
this.modelRoutes = bindResource(ModelRoutes, httpClient);
|
|
4679
4923
|
this.orchestrations = bindResource(Orchestrations, httpClient);
|
|
4680
4924
|
this.policies = bindResource(Policies, httpClient);
|
|
@@ -4717,6 +4961,7 @@ exports.Knowledge = Knowledge;
|
|
|
4717
4961
|
exports.Memories = Memories;
|
|
4718
4962
|
exports.MemoryRules = MemoryRules;
|
|
4719
4963
|
exports.MemoryStores = MemoryStores;
|
|
4964
|
+
exports.MetadataSchemas = MetadataSchemas;
|
|
4720
4965
|
exports.ModelRoutes = ModelRoutes;
|
|
4721
4966
|
exports.Orchestrations = Orchestrations;
|
|
4722
4967
|
exports.Policies = Policies;
|