@mastra/client-js 1.60.1-alpha.0 → 1.60.1-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.
@@ -3,7 +3,7 @@ name: mastra-client-js
3
3
  description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/client-js"
6
- version: "1.60.1-alpha.0"
6
+ version: "1.60.1-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,36 +1,36 @@
1
1
  {
2
- "version": "1.60.1-alpha.0",
2
+ "version": "1.60.1-alpha.2",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {
5
5
  "ClientTool": {
6
6
  "types": "dist/tools.d.ts",
7
7
  "implementation": "dist/index.js",
8
- "line": 9624
8
+ "line": 9628
9
9
  },
10
10
  "MastraClient": {
11
11
  "types": "dist/client.d.ts",
12
12
  "implementation": "dist/index.js",
13
- "line": 7767
13
+ "line": 7771
14
14
  },
15
15
  "MastraClientError": {
16
16
  "types": "dist/types.d.ts",
17
17
  "implementation": "dist/index.js",
18
- "line": 1171
18
+ "line": 1175
19
19
  },
20
20
  "agentControllerMessageText": {
21
21
  "types": "dist/resources/agent-controller.d.ts",
22
22
  "implementation": "dist/index.js",
23
- "line": 7744
23
+ "line": 7748
24
24
  },
25
25
  "createTool": {
26
26
  "types": "dist/tools.d.ts",
27
27
  "implementation": "dist/index.js",
28
- "line": 9638
28
+ "line": 9642
29
29
  },
30
30
  "isKnownAgentControllerEvent": {
31
31
  "types": "dist/resources/agent-controller.d.ts",
32
32
  "implementation": "dist/index.js",
33
- "line": 7107
33
+ "line": 7111
34
34
  }
35
35
  },
36
36
  "modules": {}
@@ -280,6 +280,8 @@ const controller = new AgentController({
280
280
  })
281
281
  ```
282
282
 
283
+ Calls to tools the rules allow don't pause the run. On a regular `Agent`, tool calls in one step run concurrently when none of them needs approval or can suspend. Durable agents run them one at a time unless the session's `yolo` state is on.
284
+
283
285
  Configure category policies with [`session.permissions.setForCategory()`](https://mastra.ai/reference/agent-controller/session) and tool policies with [`session.permissions.setForTool()`](https://mastra.ai/reference/agent-controller/session):
284
286
 
285
287
  ```typescript
@@ -181,15 +181,15 @@ Groups matching records by one or more dimensions and aggregates each group. The
181
181
 
182
182
  #### Arguments
183
183
 
184
- | Field | Type | Required | Description |
185
- | ---------------- | ---------------------- | -------------------- | ----------------------------------------------------------------------------------- |
186
- | `name` | `string[]` | Yes | One or more metric names |
187
- | `groupBy` | `string[]` | Yes | One or more fields to group by |
188
- | `aggregation` | `AggregationType` | Yes | Aggregation for each group |
189
- | `distinctColumn` | `MetricDistinctColumn` | For `count_distinct` | Column whose distinct values are counted |
190
- | `filters` | `MetricsFilter` | No | Shared metric filters |
191
- | `limit` | `number` | No | Positive integer up to 1,000. Required for high-cardinality groupings. |
192
- | `orderDirection` | `'ASC' \| 'DESC'` | No | Sort direction for the aggregated value. Storage implementations default to `DESC`. |
184
+ | Field | Type | Required | Description |
185
+ | ---------------- | ---------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
186
+ | `name` | `string[]` | Yes | One or more metric names |
187
+ | `groupBy` | `string[]` | Yes | One or more fields to group by |
188
+ | `aggregation` | `AggregationType` | Yes | Aggregation for each group |
189
+ | `distinctColumn` | `MetricDistinctColumn` | For `count_distinct` | Column whose distinct values are counted |
190
+ | `filters` | `MetricsFilter` | No | Shared metric filters |
191
+ | `limit` | `number` | No | Positive integer up to 1,000. Keeps only the top groups after sorting by `orderDirection`. When omitted, all groups are returned. Set it for high-cardinality groupings such as `threadId` to bound the response. When grouping by a label key, some stores, such as PostgreSQL, exclude rows where the label is missing or empty, so the groups might not add up to the overall total even without a `limit`. Use `getMetricAggregate()` for that total. |
192
+ | `orderDirection` | `'ASC' \| 'DESC'` | No | Sort direction for the aggregated value. Storage implementations default to `DESC`. |
193
193
 
194
194
  #### Returns
195
195
 
package/dist/index.cjs CHANGED
@@ -183,6 +183,10 @@ var ObservabilityCollectorImpl = class {
183
183
  flush() {
184
184
  if (this.#flushed) return {};
185
185
  this.#flushed = true;
186
+ if (this.#spans.some((span) => span.endTimeNs < span.startTimeNs) || this.#executionStartMs !== void 0 && this.#executionEndMs !== void 0 && this.#executionEndMs < this.#executionStartMs) {
187
+ console.warn("Client observability timing ends before it starts; dropping telemetry.");
188
+ return {};
189
+ }
186
190
  const payload = {};
187
191
  if (this.#executionStartMs !== void 0 && this.#executionEndMs !== void 0) payload.executionDurationMs = this.#executionEndMs - this.#executionStartMs;
188
192
  if (this.#spans.length > 0) payload.spans = { resourceSpans: [{ scopeSpans: [{