@mastra/client-js 1.8.5-alpha.0 → 1.9.0-alpha.2
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/CHANGELOG.md +18 -0
- package/dist/client.d.ts +37 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-server-mastra-client.md +1 -1
- package/dist/index.cjs +233 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +233 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/observability.d.ts +72 -1
- package/dist/resources/observability.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2829,6 +2829,9 @@ var Observability = class extends BaseResource {
|
|
|
2829
2829
|
constructor(options) {
|
|
2830
2830
|
super(options);
|
|
2831
2831
|
}
|
|
2832
|
+
// --------------------------------------------------------------------------
|
|
2833
|
+
// Traces
|
|
2834
|
+
// --------------------------------------------------------------------------
|
|
2832
2835
|
/**
|
|
2833
2836
|
* Retrieves a specific trace by ID
|
|
2834
2837
|
* @param traceId - ID of the trace to retrieve
|
|
@@ -2910,6 +2913,151 @@ var Observability = class extends BaseResource {
|
|
|
2910
2913
|
body: { ...params }
|
|
2911
2914
|
});
|
|
2912
2915
|
}
|
|
2916
|
+
// --------------------------------------------------------------------------
|
|
2917
|
+
// Logs
|
|
2918
|
+
// --------------------------------------------------------------------------
|
|
2919
|
+
/**
|
|
2920
|
+
* Retrieves a paginated list of logs with optional filtering and sorting.
|
|
2921
|
+
*/
|
|
2922
|
+
listLogs(params = {}) {
|
|
2923
|
+
const queryString = toQueryParams(params, ["filters", "pagination", "orderBy"]);
|
|
2924
|
+
return this.request(`/observability/logs${queryString ? `?${queryString}` : ""}`);
|
|
2925
|
+
}
|
|
2926
|
+
// --------------------------------------------------------------------------
|
|
2927
|
+
// Scores (observability storage)
|
|
2928
|
+
// --------------------------------------------------------------------------
|
|
2929
|
+
/**
|
|
2930
|
+
* Retrieves a paginated list of scores with optional filtering and sorting.
|
|
2931
|
+
*/
|
|
2932
|
+
listScores(params = {}) {
|
|
2933
|
+
const queryString = toQueryParams(params, ["filters", "pagination", "orderBy"]);
|
|
2934
|
+
return this.request(`/observability/scores${queryString ? `?${queryString}` : ""}`);
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* Creates a single score record in the observability store.
|
|
2938
|
+
* Timestamp is set server-side.
|
|
2939
|
+
*/
|
|
2940
|
+
createScore(params) {
|
|
2941
|
+
return this.request(`/observability/scores`, {
|
|
2942
|
+
method: "POST",
|
|
2943
|
+
body: params
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2946
|
+
// --------------------------------------------------------------------------
|
|
2947
|
+
// Feedback
|
|
2948
|
+
// --------------------------------------------------------------------------
|
|
2949
|
+
/**
|
|
2950
|
+
* Retrieves a paginated list of feedback with optional filtering and sorting.
|
|
2951
|
+
*/
|
|
2952
|
+
listFeedback(params = {}) {
|
|
2953
|
+
const queryString = toQueryParams(params, ["filters", "pagination", "orderBy"]);
|
|
2954
|
+
return this.request(`/observability/feedback${queryString ? `?${queryString}` : ""}`);
|
|
2955
|
+
}
|
|
2956
|
+
/**
|
|
2957
|
+
* Creates a single feedback record in the observability store.
|
|
2958
|
+
* Timestamp is set server-side.
|
|
2959
|
+
*/
|
|
2960
|
+
createFeedback(params) {
|
|
2961
|
+
return this.request(`/observability/feedback`, {
|
|
2962
|
+
method: "POST",
|
|
2963
|
+
body: params
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
// --------------------------------------------------------------------------
|
|
2967
|
+
// Metrics OLAP
|
|
2968
|
+
// --------------------------------------------------------------------------
|
|
2969
|
+
/**
|
|
2970
|
+
* Returns an aggregated metric value with optional period-over-period comparison.
|
|
2971
|
+
*/
|
|
2972
|
+
getMetricAggregate(params) {
|
|
2973
|
+
return this.request(`/observability/metrics/aggregate`, {
|
|
2974
|
+
method: "POST",
|
|
2975
|
+
body: params
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
/**
|
|
2979
|
+
* Returns metric values grouped by specified dimensions.
|
|
2980
|
+
*/
|
|
2981
|
+
getMetricBreakdown(params) {
|
|
2982
|
+
return this.request(`/observability/metrics/breakdown`, {
|
|
2983
|
+
method: "POST",
|
|
2984
|
+
body: params
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
/**
|
|
2988
|
+
* Returns metric values bucketed by time interval with optional grouping.
|
|
2989
|
+
*/
|
|
2990
|
+
getMetricTimeSeries(params) {
|
|
2991
|
+
return this.request(`/observability/metrics/timeseries`, {
|
|
2992
|
+
method: "POST",
|
|
2993
|
+
body: params
|
|
2994
|
+
});
|
|
2995
|
+
}
|
|
2996
|
+
/**
|
|
2997
|
+
* Returns percentile values for a metric bucketed by time interval.
|
|
2998
|
+
*/
|
|
2999
|
+
getMetricPercentiles(params) {
|
|
3000
|
+
return this.request(`/observability/metrics/percentiles`, {
|
|
3001
|
+
method: "POST",
|
|
3002
|
+
body: params
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
// --------------------------------------------------------------------------
|
|
3006
|
+
// Discovery
|
|
3007
|
+
// --------------------------------------------------------------------------
|
|
3008
|
+
/**
|
|
3009
|
+
* Returns distinct metric names with optional prefix filtering.
|
|
3010
|
+
*/
|
|
3011
|
+
getMetricNames(params = {}) {
|
|
3012
|
+
const queryString = toQueryParams(params);
|
|
3013
|
+
return this.request(`/observability/discovery/metric-names${queryString ? `?${queryString}` : ""}`);
|
|
3014
|
+
}
|
|
3015
|
+
/**
|
|
3016
|
+
* Returns distinct label keys for a given metric.
|
|
3017
|
+
*/
|
|
3018
|
+
getMetricLabelKeys(params) {
|
|
3019
|
+
const queryString = toQueryParams(params);
|
|
3020
|
+
return this.request(`/observability/discovery/metric-label-keys${queryString ? `?${queryString}` : ""}`);
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* Returns distinct values for a given metric label key.
|
|
3024
|
+
*/
|
|
3025
|
+
getMetricLabelValues(params) {
|
|
3026
|
+
const queryString = toQueryParams(params);
|
|
3027
|
+
return this.request(`/observability/discovery/metric-label-values${queryString ? `?${queryString}` : ""}`);
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* Returns distinct entity types from observability data.
|
|
3031
|
+
*/
|
|
3032
|
+
getEntityTypes() {
|
|
3033
|
+
return this.request(`/observability/discovery/entity-types`);
|
|
3034
|
+
}
|
|
3035
|
+
/**
|
|
3036
|
+
* Returns distinct entity names with optional type filtering.
|
|
3037
|
+
*/
|
|
3038
|
+
getEntityNames(params = {}) {
|
|
3039
|
+
const queryString = toQueryParams(params);
|
|
3040
|
+
return this.request(`/observability/discovery/entity-names${queryString ? `?${queryString}` : ""}`);
|
|
3041
|
+
}
|
|
3042
|
+
/**
|
|
3043
|
+
* Returns distinct service names from observability data.
|
|
3044
|
+
*/
|
|
3045
|
+
getServiceNames() {
|
|
3046
|
+
return this.request(`/observability/discovery/service-names`);
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Returns distinct environments from observability data.
|
|
3050
|
+
*/
|
|
3051
|
+
getEnvironments() {
|
|
3052
|
+
return this.request(`/observability/discovery/environments`);
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* Returns distinct tags with optional entity type filtering.
|
|
3056
|
+
*/
|
|
3057
|
+
getTags(params = {}) {
|
|
3058
|
+
const queryString = toQueryParams(params);
|
|
3059
|
+
return this.request(`/observability/discovery/tags${queryString ? `?${queryString}` : ""}`);
|
|
3060
|
+
}
|
|
2913
3061
|
};
|
|
2914
3062
|
|
|
2915
3063
|
// src/resources/stored-agent.ts
|
|
@@ -4326,6 +4474,7 @@ var MastraClient = class extends BaseResource {
|
|
|
4326
4474
|
body: params
|
|
4327
4475
|
});
|
|
4328
4476
|
}
|
|
4477
|
+
/** Retrieves a specific trace by ID. */
|
|
4329
4478
|
getTrace(traceId) {
|
|
4330
4479
|
return this.observability.getTrace(traceId);
|
|
4331
4480
|
}
|
|
@@ -4353,9 +4502,93 @@ var MastraClient = class extends BaseResource {
|
|
|
4353
4502
|
listScoresBySpan(params) {
|
|
4354
4503
|
return this.observability.listScoresBySpan(params);
|
|
4355
4504
|
}
|
|
4505
|
+
/** Scores one or more traces using a specified scorer (fire-and-forget). */
|
|
4356
4506
|
score(params) {
|
|
4357
4507
|
return this.observability.score(params);
|
|
4358
4508
|
}
|
|
4509
|
+
// --------------------------------------------------------------------------
|
|
4510
|
+
// Logs
|
|
4511
|
+
// --------------------------------------------------------------------------
|
|
4512
|
+
/** Retrieves a paginated list of observability logs. */
|
|
4513
|
+
listLogsVNext(params = {}) {
|
|
4514
|
+
return this.observability.listLogs(params);
|
|
4515
|
+
}
|
|
4516
|
+
// --------------------------------------------------------------------------
|
|
4517
|
+
// Scores
|
|
4518
|
+
// --------------------------------------------------------------------------
|
|
4519
|
+
/** Retrieves a paginated list of observability scores. */
|
|
4520
|
+
listScores(params = {}) {
|
|
4521
|
+
return this.observability.listScores(params);
|
|
4522
|
+
}
|
|
4523
|
+
/** Creates a single score record in the observability store. */
|
|
4524
|
+
createScore(params) {
|
|
4525
|
+
return this.observability.createScore(params);
|
|
4526
|
+
}
|
|
4527
|
+
// --------------------------------------------------------------------------
|
|
4528
|
+
// Feedback
|
|
4529
|
+
// --------------------------------------------------------------------------
|
|
4530
|
+
/** Retrieves a paginated list of feedback records. */
|
|
4531
|
+
listFeedback(params = {}) {
|
|
4532
|
+
return this.observability.listFeedback(params);
|
|
4533
|
+
}
|
|
4534
|
+
/** Creates a single feedback record in the observability store. */
|
|
4535
|
+
createFeedback(params) {
|
|
4536
|
+
return this.observability.createFeedback(params);
|
|
4537
|
+
}
|
|
4538
|
+
// --------------------------------------------------------------------------
|
|
4539
|
+
// Metrics
|
|
4540
|
+
// --------------------------------------------------------------------------
|
|
4541
|
+
/** Returns an aggregated metric value with optional period-over-period comparison. */
|
|
4542
|
+
getMetricAggregate(params) {
|
|
4543
|
+
return this.observability.getMetricAggregate(params);
|
|
4544
|
+
}
|
|
4545
|
+
/** Returns metric values grouped by specified dimensions. */
|
|
4546
|
+
getMetricBreakdown(params) {
|
|
4547
|
+
return this.observability.getMetricBreakdown(params);
|
|
4548
|
+
}
|
|
4549
|
+
/** Returns metric values bucketed by time interval with optional grouping. */
|
|
4550
|
+
getMetricTimeSeries(params) {
|
|
4551
|
+
return this.observability.getMetricTimeSeries(params);
|
|
4552
|
+
}
|
|
4553
|
+
/** Returns percentile values for a metric bucketed by time interval. */
|
|
4554
|
+
getMetricPercentiles(params) {
|
|
4555
|
+
return this.observability.getMetricPercentiles(params);
|
|
4556
|
+
}
|
|
4557
|
+
// --------------------------------------------------------------------------
|
|
4558
|
+
// Discovery
|
|
4559
|
+
// --------------------------------------------------------------------------
|
|
4560
|
+
/** Returns distinct metric names with optional prefix filtering. */
|
|
4561
|
+
getMetricNames(params = {}) {
|
|
4562
|
+
return this.observability.getMetricNames(params);
|
|
4563
|
+
}
|
|
4564
|
+
/** Returns distinct label keys for a given metric. */
|
|
4565
|
+
getMetricLabelKeys(params) {
|
|
4566
|
+
return this.observability.getMetricLabelKeys(params);
|
|
4567
|
+
}
|
|
4568
|
+
/** Returns distinct values for a given metric label key. */
|
|
4569
|
+
getMetricLabelValues(params) {
|
|
4570
|
+
return this.observability.getMetricLabelValues(params);
|
|
4571
|
+
}
|
|
4572
|
+
/** Returns distinct entity types from observability data. */
|
|
4573
|
+
getEntityTypes() {
|
|
4574
|
+
return this.observability.getEntityTypes();
|
|
4575
|
+
}
|
|
4576
|
+
/** Returns distinct entity names with optional type filtering. */
|
|
4577
|
+
getEntityNames(params = {}) {
|
|
4578
|
+
return this.observability.getEntityNames(params);
|
|
4579
|
+
}
|
|
4580
|
+
/** Returns distinct service names from observability data. */
|
|
4581
|
+
getServiceNames() {
|
|
4582
|
+
return this.observability.getServiceNames();
|
|
4583
|
+
}
|
|
4584
|
+
/** Returns distinct environments from observability data. */
|
|
4585
|
+
getEnvironments() {
|
|
4586
|
+
return this.observability.getEnvironments();
|
|
4587
|
+
}
|
|
4588
|
+
/** Returns distinct tags with optional entity type filtering. */
|
|
4589
|
+
getTags(params = {}) {
|
|
4590
|
+
return this.observability.getTags(params);
|
|
4591
|
+
}
|
|
4359
4592
|
// ============================================================================
|
|
4360
4593
|
// Stored Agents
|
|
4361
4594
|
// ============================================================================
|