@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.mjs CHANGED
@@ -2630,7 +2630,7 @@ var Knowledge = class {
2630
2630
  /**
2631
2631
  * Search knowledge
2632
2632
  *
2633
- * Searches across documents and memory entries using semantic search, file paths, document IDs, or memory IDs/tags. At least one of `query`, `document_paths`, `document_ids`, `memory_ids`, or `memory_tags` must be provided.
2633
+ * 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.
2634
2634
  */
2635
2635
  static searchKnowledge(options) {
2636
2636
  return (options.client ?? client).post({
@@ -2707,6 +2707,47 @@ var Memories = class {
2707
2707
  }
2708
2708
  });
2709
2709
  }
2710
+ /**
2711
+ * Get memory tags
2712
+ *
2713
+ * Returns all tags attached to the memory
2714
+ */
2715
+ static getMemoryTags(options) {
2716
+ return (options.client ?? client).get({
2717
+ url: "/api/v1/memories/{memory_id}/tags",
2718
+ ...options
2719
+ });
2720
+ }
2721
+ /**
2722
+ * Merge memory tags
2723
+ *
2724
+ * Merges provided tags with existing tags (existing tags are preserved unless overridden)
2725
+ */
2726
+ static mergeMemoryTags(options) {
2727
+ return (options.client ?? client).patch({
2728
+ url: "/api/v1/memories/{memory_id}/tags",
2729
+ ...options,
2730
+ headers: {
2731
+ "Content-Type": "application/json",
2732
+ ...options.headers
2733
+ }
2734
+ });
2735
+ }
2736
+ /**
2737
+ * Replace memory tags
2738
+ *
2739
+ * Replaces all tags on the memory with the provided tags (not merged)
2740
+ */
2741
+ static replaceMemoryTags(options) {
2742
+ return (options.client ?? client).put({
2743
+ url: "/api/v1/memories/{memory_id}/tags",
2744
+ ...options,
2745
+ headers: {
2746
+ "Content-Type": "application/json",
2747
+ ...options.headers
2748
+ }
2749
+ });
2750
+ }
2710
2751
  };
2711
2752
  var MemoryEntries = class {
2712
2753
  /**
@@ -2772,6 +2813,47 @@ var MemoryEntries = class {
2772
2813
  }
2773
2814
  });
2774
2815
  }
2816
+ /**
2817
+ * Get memory entry tags
2818
+ *
2819
+ * Returns all tags attached to the memory entry
2820
+ */
2821
+ static getMemoryEntryTags(options) {
2822
+ return (options.client ?? client).get({
2823
+ url: "/api/v1/memory-entries/{entry_id}/tags",
2824
+ ...options
2825
+ });
2826
+ }
2827
+ /**
2828
+ * Merge memory entry tags
2829
+ *
2830
+ * Merges provided tags with existing tags (existing tags are preserved unless overridden)
2831
+ */
2832
+ static mergeMemoryEntryTags(options) {
2833
+ return (options.client ?? client).patch({
2834
+ url: "/api/v1/memory-entries/{entry_id}/tags",
2835
+ ...options,
2836
+ headers: {
2837
+ "Content-Type": "application/json",
2838
+ ...options.headers
2839
+ }
2840
+ });
2841
+ }
2842
+ /**
2843
+ * Replace memory entry tags
2844
+ *
2845
+ * Replaces all tags on the memory entry with the provided tags (not merged)
2846
+ */
2847
+ static replaceMemoryEntryTags(options) {
2848
+ return (options.client ?? client).put({
2849
+ url: "/api/v1/memory-entries/{entry_id}/tags",
2850
+ ...options,
2851
+ headers: {
2852
+ "Content-Type": "application/json",
2853
+ ...options.headers
2854
+ }
2855
+ });
2856
+ }
2775
2857
  };
2776
2858
  var ModelRoutes = class {
2777
2859
  /**
@@ -3415,7 +3497,7 @@ var Sessions = class {
3415
3497
  /**
3416
3498
  * Get a session
3417
3499
  *
3418
- * Returns details of a single session.
3500
+ * 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.
3419
3501
  */
3420
3502
  static getSession(options) {
3421
3503
  return (options.client ?? client).get({
@@ -3946,7 +4028,9 @@ var Usage = class {
3946
4028
  /**
3947
4029
  * List usage events
3948
4030
  *
3949
- * Returns the raw usage events the caller can access, most recent first, optionally filtered by agent, generation, trace, actor, session, or `source`. Each event is the per-generation token usage as reported by the provider, for audit and reconciliation.
4031
+ * 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.
4032
+ *
4033
+ * 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.
3950
4034
  *
3951
4035
  */
3952
4036
  static listUsageEvents(options) {
@@ -3958,9 +4042,11 @@ var Usage = class {
3958
4042
  /**
3959
4043
  * Get aggregated usage for a project
3960
4044
  *
3961
- * Returns a project's usage rolled up over an optional `[from, to]` time window, bucketed by a single dimension and optionally narrowed to one `meter_type`. 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.
4045
+ * 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.
4046
+ *
4047
+ * 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.
3962
4048
  *
3963
- * `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.
4049
+ * `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.
3964
4050
  *
3965
4051
  */
3966
4052
  static getUsageAggregate(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",