@soat/sdk 0.45.0 → 0.47.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.cjs +91 -5
- package/dist/index.d.cts +539 -174
- package/dist/index.d.mts +539 -174
- package/dist/index.mjs +91 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2631,7 +2631,7 @@ var Knowledge = class {
|
|
|
2631
2631
|
/**
|
|
2632
2632
|
* Search knowledge
|
|
2633
2633
|
*
|
|
2634
|
-
* Searches across documents and memory entries using semantic search, file paths, document IDs,
|
|
2634
|
+
* Searches across documents and memory entries using semantic search, file paths, document IDs, memory IDs, or tags. At least one of `query`, `tags`, `document_paths`, `document_ids`, or `memory_ids` must be provided.
|
|
2635
2635
|
*/
|
|
2636
2636
|
static searchKnowledge(options) {
|
|
2637
2637
|
return (options.client ?? client).post({
|
|
@@ -2708,6 +2708,47 @@ var Memories = class {
|
|
|
2708
2708
|
}
|
|
2709
2709
|
});
|
|
2710
2710
|
}
|
|
2711
|
+
/**
|
|
2712
|
+
* Get memory tags
|
|
2713
|
+
*
|
|
2714
|
+
* Returns all tags attached to the memory
|
|
2715
|
+
*/
|
|
2716
|
+
static getMemoryTags(options) {
|
|
2717
|
+
return (options.client ?? client).get({
|
|
2718
|
+
url: "/api/v1/memories/{memory_id}/tags",
|
|
2719
|
+
...options
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
/**
|
|
2723
|
+
* Merge memory tags
|
|
2724
|
+
*
|
|
2725
|
+
* Merges provided tags with existing tags (existing tags are preserved unless overridden)
|
|
2726
|
+
*/
|
|
2727
|
+
static mergeMemoryTags(options) {
|
|
2728
|
+
return (options.client ?? client).patch({
|
|
2729
|
+
url: "/api/v1/memories/{memory_id}/tags",
|
|
2730
|
+
...options,
|
|
2731
|
+
headers: {
|
|
2732
|
+
"Content-Type": "application/json",
|
|
2733
|
+
...options.headers
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
/**
|
|
2738
|
+
* Replace memory tags
|
|
2739
|
+
*
|
|
2740
|
+
* Replaces all tags on the memory with the provided tags (not merged)
|
|
2741
|
+
*/
|
|
2742
|
+
static replaceMemoryTags(options) {
|
|
2743
|
+
return (options.client ?? client).put({
|
|
2744
|
+
url: "/api/v1/memories/{memory_id}/tags",
|
|
2745
|
+
...options,
|
|
2746
|
+
headers: {
|
|
2747
|
+
"Content-Type": "application/json",
|
|
2748
|
+
...options.headers
|
|
2749
|
+
}
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2711
2752
|
};
|
|
2712
2753
|
var MemoryEntries = class {
|
|
2713
2754
|
/**
|
|
@@ -2773,6 +2814,47 @@ var MemoryEntries = class {
|
|
|
2773
2814
|
}
|
|
2774
2815
|
});
|
|
2775
2816
|
}
|
|
2817
|
+
/**
|
|
2818
|
+
* Get memory entry tags
|
|
2819
|
+
*
|
|
2820
|
+
* Returns all tags attached to the memory entry
|
|
2821
|
+
*/
|
|
2822
|
+
static getMemoryEntryTags(options) {
|
|
2823
|
+
return (options.client ?? client).get({
|
|
2824
|
+
url: "/api/v1/memory-entries/{entry_id}/tags",
|
|
2825
|
+
...options
|
|
2826
|
+
});
|
|
2827
|
+
}
|
|
2828
|
+
/**
|
|
2829
|
+
* Merge memory entry tags
|
|
2830
|
+
*
|
|
2831
|
+
* Merges provided tags with existing tags (existing tags are preserved unless overridden)
|
|
2832
|
+
*/
|
|
2833
|
+
static mergeMemoryEntryTags(options) {
|
|
2834
|
+
return (options.client ?? client).patch({
|
|
2835
|
+
url: "/api/v1/memory-entries/{entry_id}/tags",
|
|
2836
|
+
...options,
|
|
2837
|
+
headers: {
|
|
2838
|
+
"Content-Type": "application/json",
|
|
2839
|
+
...options.headers
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* Replace memory entry tags
|
|
2845
|
+
*
|
|
2846
|
+
* Replaces all tags on the memory entry with the provided tags (not merged)
|
|
2847
|
+
*/
|
|
2848
|
+
static replaceMemoryEntryTags(options) {
|
|
2849
|
+
return (options.client ?? client).put({
|
|
2850
|
+
url: "/api/v1/memory-entries/{entry_id}/tags",
|
|
2851
|
+
...options,
|
|
2852
|
+
headers: {
|
|
2853
|
+
"Content-Type": "application/json",
|
|
2854
|
+
...options.headers
|
|
2855
|
+
}
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2776
2858
|
};
|
|
2777
2859
|
var ModelRoutes = class {
|
|
2778
2860
|
/**
|
|
@@ -3416,7 +3498,7 @@ var Sessions = class {
|
|
|
3416
3498
|
/**
|
|
3417
3499
|
* Get a session
|
|
3418
3500
|
*
|
|
3419
|
-
* Returns details of a single session.
|
|
3501
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, a split by day or model, or one end user across every session, narrow the usage aggregate with `session_id` / `actor_id` instead.
|
|
3420
3502
|
*/
|
|
3421
3503
|
static getSession(options) {
|
|
3422
3504
|
return (options.client ?? client).get({
|
|
@@ -3947,7 +4029,9 @@ var Usage = class {
|
|
|
3947
4029
|
/**
|
|
3948
4030
|
* List usage events
|
|
3949
4031
|
*
|
|
3950
|
-
* Returns the raw usage events the caller can access, most recent first,
|
|
4032
|
+
* Returns the raw usage events the caller can access, most recent first, narrowed by any combination of the same filters the aggregate takes — agent, generation, trace, actor, session, AI provider, orchestration run, orchestration, trigger, action, meter type, model or `source` — so a rollup and the events behind it are addressed the same way. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
4033
|
+
*
|
|
4034
|
+
* An id naming nothing in scope yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
|
|
3951
4035
|
*
|
|
3952
4036
|
*/
|
|
3953
4037
|
static listUsageEvents(options) {
|
|
@@ -3959,9 +4043,11 @@ var Usage = class {
|
|
|
3959
4043
|
/**
|
|
3960
4044
|
* Get aggregated usage for a project
|
|
3961
4045
|
*
|
|
3962
|
-
* Returns a project's usage rolled up over an optional `[from, to]` time window, bucketed by a single dimension and
|
|
4046
|
+
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of thirteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, meter type, model, source, trigger and action. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
4047
|
+
*
|
|
4048
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all thirteen are echoed back under `filters`. The eight naming a resource are resolved against the project, and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other five are matched against the value the event recorded.
|
|
3963
4049
|
*
|
|
3964
|
-
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it.
|
|
4050
|
+
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
3965
4051
|
*
|
|
3966
4052
|
*/
|
|
3967
4053
|
static getUsageAggregate(options) {
|