@mastra/client-js 0.0.0-fix-cloud-peer-deps-20250923194656 → 0.0.0-fix-cloud-peer-deps-libsql-20250929202200

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 CHANGED
@@ -1,6 +1,32 @@
1
1
  # @mastra/client-js
2
2
 
3
- ## 0.0.0-fix-cloud-peer-deps-20250923194656
3
+ ## 0.0.0-fix-cloud-peer-deps-libsql-20250929202200
4
+
5
+ ### Minor Changes
6
+
7
+ - Remove legacy helpers ([#8017](https://github.com/mastra-ai/mastra/pull/8017))
8
+
9
+ ### Patch Changes
10
+
11
+ - Fix duplicate messages being created using clientTools with client-js sdk ([#8187](https://github.com/mastra-ai/mastra/pull/8187))
12
+
13
+ - Add server apis to get scores by span ([#8237](https://github.com/mastra-ai/mastra/pull/8237))
14
+
15
+ - Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`7fceb0a`](https://github.com/mastra-ai/mastra/commit/7fceb0a327d678e812f90f5387c5bc4f38bd039e), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`e8f379d`](https://github.com/mastra-ai/mastra/commit/e8f379d390efa264c4e0874f9ac0cf8839b07777), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
16
+ - @mastra/core@0.0.0-fix-cloud-peer-deps-libsql-20250929202200
17
+
18
+ ## 0.14.0-alpha.0
19
+
20
+ ### Minor Changes
21
+
22
+ - Remove legacy helpers ([#8017](https://github.com/mastra-ai/mastra/pull/8017))
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
27
+ - @mastra/core@0.18.1-alpha.0
28
+
29
+ ## 0.13.2
4
30
 
5
31
  ### Patch Changes
6
32
 
@@ -15,7 +41,7 @@
15
41
  - Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
16
42
 
17
43
  - Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
18
- - @mastra/core@0.0.0-fix-cloud-peer-deps-20250923194656
44
+ - @mastra/core@0.18.0
19
45
 
20
46
  ## 0.13.2-alpha.3
21
47
 
package/dist/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { AITraceRecord, AITracesPaginatedArg, WorkflowInfo } from '@mastra/core';
2
2
  import type { ServerDetailInfo } from '@mastra/core/mcp';
3
3
  import type { RuntimeContext } from '@mastra/core/runtime-context';
4
- import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, A2A, MCPTool, LegacyWorkflow, AgentBuilder } from './resources/index.js';
4
+ import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, A2A, MCPTool, AgentBuilder } from './resources/index.js';
5
5
  import { NetworkMemoryThread } from './resources/network-memory-thread.js';
6
6
  import { VNextNetwork } from './resources/vNextNetwork.js';
7
- import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetMemoryThreadParams, GetMemoryThreadResponse, GetTelemetryParams, GetTelemetryResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetLegacyWorkflowResponse, GetVNextNetworkResponse, GetNetworkMemoryThreadParams, CreateNetworkMemoryThreadParams, SaveNetworkMessageToMemoryParams, GetScorerResponse, GetScoresByScorerIdParams, GetScoresResponse, GetScoresByRunIdParams, GetScoresByEntityIdParams, SaveScoreParams, SaveScoreResponse, GetAITracesResponse, GetMemoryConfigParams, GetMemoryConfigResponse, GetMemoryThreadMessagesResponse } from './types.js';
7
+ import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetMemoryThreadParams, GetMemoryThreadResponse, GetTelemetryParams, GetTelemetryResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetVNextNetworkResponse, GetNetworkMemoryThreadParams, CreateNetworkMemoryThreadParams, SaveNetworkMessageToMemoryParams, GetScorerResponse, GetScoresByScorerIdParams, GetScoresResponse, GetScoresByRunIdParams, GetScoresByEntityIdParams, GetScoresBySpanParams, SaveScoreParams, SaveScoreResponse, GetAITracesResponse, GetMemoryConfigParams, GetMemoryConfigResponse, GetMemoryThreadMessagesResponse } from './types.js';
8
8
  export declare class MastraClient extends BaseResource {
9
9
  private observability;
10
10
  constructor(options: ClientOptions);
@@ -111,17 +111,6 @@ export declare class MastraClient extends BaseResource {
111
111
  * @returns Tool instance
112
112
  */
113
113
  getTool(toolId: string): Tool;
114
- /**
115
- * Retrieves all available legacy workflows
116
- * @returns Promise containing map of legacy workflow IDs to legacy workflow details
117
- */
118
- getLegacyWorkflows(): Promise<Record<string, GetLegacyWorkflowResponse>>;
119
- /**
120
- * Gets a legacy workflow instance by ID
121
- * @param workflowId - ID of the legacy workflow to retrieve
122
- * @returns Legacy Workflow instance
123
- */
124
- getLegacyWorkflow(workflowId: string): LegacyWorkflow;
125
114
  /**
126
115
  * Retrieves all available workflows
127
116
  * @param runtimeContext - Optional runtime context to pass as query parameter
@@ -286,6 +275,7 @@ export declare class MastraClient extends BaseResource {
286
275
  getModelProviders(): Promise<string[]>;
287
276
  getAITrace(traceId: string): Promise<AITraceRecord>;
288
277
  getAITraces(params: AITracesPaginatedArg): Promise<GetAITracesResponse>;
278
+ getScoresBySpan(params: GetScoresBySpanParams): Promise<GetScoresResponse>;
289
279
  score(params: {
290
280
  scorerName: string;
291
281
  targets: Array<{
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,GAAG,EACH,OAAO,EACP,cAAc,EACd,YAAY,EAEb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;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AE,KAAK,CAAC;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACtD,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAGjD"}
package/dist/index.cjs CHANGED
@@ -229,11 +229,7 @@ async function executeToolCallAndRespond({
229
229
  }
230
230
  );
231
231
  const updatedMessages = [
232
- {
233
- role: "user",
234
- content: params.messages
235
- },
236
- ...response.response.messages,
232
+ ...response.response.messages || [],
237
233
  {
238
234
  role: "tool",
239
235
  content: [
@@ -374,10 +370,6 @@ var Agent = class extends BaseResource {
374
370
  }
375
371
  );
376
372
  const updatedMessages = [
377
- {
378
- role: "user",
379
- content: params.messages
380
- },
381
373
  ...response.response.messages,
382
374
  {
383
375
  role: "tool",
@@ -1087,9 +1079,7 @@ var Agent = class extends BaseResource {
1087
1079
  toolInvocation.state = "result";
1088
1080
  toolInvocation.result = result;
1089
1081
  }
1090
- const originalMessages = processedParams.messages;
1091
- const messageArray = Array.isArray(originalMessages) ? originalMessages : [originalMessages];
1092
- const updatedMessages = lastMessage != null ? [...messageArray, ...messages.filter((m) => m.id !== lastMessage.id), lastMessage] : [...messageArray, ...messages];
1082
+ const updatedMessages = lastMessage != null ? [...messages.filter((m) => m.id !== lastMessage.id), lastMessage] : [...messages];
1093
1083
  this.processStreamResponse_vNext(
1094
1084
  {
1095
1085
  ...processedParams,
@@ -1265,12 +1255,10 @@ var Agent = class extends BaseResource {
1265
1255
  } finally {
1266
1256
  writer.releaseLock();
1267
1257
  }
1268
- const originalMessages = processedParams.messages;
1269
- const messageArray = Array.isArray(originalMessages) ? originalMessages : [originalMessages];
1270
1258
  this.processStreamResponse(
1271
1259
  {
1272
1260
  ...processedParams,
1273
- messages: [...messageArray, ...messages.filter((m) => m.id !== lastMessage.id), lastMessage]
1261
+ messages: [...messages.filter((m) => m.id !== lastMessage.id), lastMessage]
1274
1262
  },
1275
1263
  writable
1276
1264
  ).catch((error) => {
@@ -1517,193 +1505,6 @@ var Vector = class extends BaseResource {
1517
1505
  }
1518
1506
  };
1519
1507
 
1520
- // src/resources/legacy-workflow.ts
1521
- var RECORD_SEPARATOR = "";
1522
- var LegacyWorkflow = class extends BaseResource {
1523
- constructor(options, workflowId) {
1524
- super(options);
1525
- this.workflowId = workflowId;
1526
- }
1527
- /**
1528
- * Retrieves details about the legacy workflow
1529
- * @param runtimeContext - Optional runtime context to pass as query parameter
1530
- * @returns Promise containing legacy workflow details including steps and graphs
1531
- */
1532
- details(runtimeContext) {
1533
- return this.request(`/api/workflows/legacy/${this.workflowId}${runtimeContextQueryString(runtimeContext)}`);
1534
- }
1535
- /**
1536
- * Retrieves all runs for a legacy workflow
1537
- * @param params - Parameters for filtering runs
1538
- * @param runtimeContext - Optional runtime context to pass as query parameter
1539
- * @returns Promise containing legacy workflow runs array
1540
- */
1541
- runs(params, runtimeContext) {
1542
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
1543
- const searchParams = new URLSearchParams();
1544
- if (params?.fromDate) {
1545
- searchParams.set("fromDate", params.fromDate.toISOString());
1546
- }
1547
- if (params?.toDate) {
1548
- searchParams.set("toDate", params.toDate.toISOString());
1549
- }
1550
- if (params?.limit) {
1551
- searchParams.set("limit", String(params.limit));
1552
- }
1553
- if (params?.offset) {
1554
- searchParams.set("offset", String(params.offset));
1555
- }
1556
- if (params?.resourceId) {
1557
- searchParams.set("resourceId", params.resourceId);
1558
- }
1559
- if (runtimeContextParam) {
1560
- searchParams.set("runtimeContext", runtimeContextParam);
1561
- }
1562
- if (searchParams.size) {
1563
- return this.request(`/api/workflows/legacy/${this.workflowId}/runs?${searchParams}`);
1564
- } else {
1565
- return this.request(`/api/workflows/legacy/${this.workflowId}/runs`);
1566
- }
1567
- }
1568
- /**
1569
- * Creates a new legacy workflow run
1570
- * @returns Promise containing the generated run ID
1571
- */
1572
- createRun(params) {
1573
- const searchParams = new URLSearchParams();
1574
- if (!!params?.runId) {
1575
- searchParams.set("runId", params.runId);
1576
- }
1577
- return this.request(`/api/workflows/legacy/${this.workflowId}/create-run?${searchParams.toString()}`, {
1578
- method: "POST"
1579
- });
1580
- }
1581
- /**
1582
- * Starts a legacy workflow run synchronously without waiting for the workflow to complete
1583
- * @param params - Object containing the runId and triggerData
1584
- * @returns Promise containing success message
1585
- */
1586
- start(params) {
1587
- return this.request(`/api/workflows/legacy/${this.workflowId}/start?runId=${params.runId}`, {
1588
- method: "POST",
1589
- body: params?.triggerData
1590
- });
1591
- }
1592
- /**
1593
- * Resumes a suspended legacy workflow step synchronously without waiting for the workflow to complete
1594
- * @param stepId - ID of the step to resume
1595
- * @param runId - ID of the legacy workflow run
1596
- * @param context - Context to resume the legacy workflow with
1597
- * @returns Promise containing the legacy workflow resume results
1598
- */
1599
- resume({
1600
- stepId,
1601
- runId,
1602
- context
1603
- }) {
1604
- return this.request(`/api/workflows/legacy/${this.workflowId}/resume?runId=${runId}`, {
1605
- method: "POST",
1606
- body: {
1607
- stepId,
1608
- context
1609
- }
1610
- });
1611
- }
1612
- /**
1613
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
1614
- * @param params - Object containing the optional runId and triggerData
1615
- * @returns Promise containing the workflow execution results
1616
- */
1617
- startAsync(params) {
1618
- const searchParams = new URLSearchParams();
1619
- if (!!params?.runId) {
1620
- searchParams.set("runId", params.runId);
1621
- }
1622
- return this.request(`/api/workflows/legacy/${this.workflowId}/start-async?${searchParams.toString()}`, {
1623
- method: "POST",
1624
- body: params?.triggerData
1625
- });
1626
- }
1627
- /**
1628
- * Resumes a suspended legacy workflow step asynchronously and returns a promise that resolves when the workflow is complete
1629
- * @param params - Object containing the runId, stepId, and context
1630
- * @returns Promise containing the workflow resume results
1631
- */
1632
- resumeAsync(params) {
1633
- return this.request(`/api/workflows/legacy/${this.workflowId}/resume-async?runId=${params.runId}`, {
1634
- method: "POST",
1635
- body: {
1636
- stepId: params.stepId,
1637
- context: params.context
1638
- }
1639
- });
1640
- }
1641
- /**
1642
- * Creates an async generator that processes a readable stream and yields records
1643
- * separated by the Record Separator character (\x1E)
1644
- *
1645
- * @param stream - The readable stream to process
1646
- * @returns An async generator that yields parsed records
1647
- */
1648
- async *streamProcessor(stream) {
1649
- const reader = stream.getReader();
1650
- let doneReading = false;
1651
- let buffer = "";
1652
- try {
1653
- while (!doneReading) {
1654
- const { done, value } = await reader.read();
1655
- doneReading = done;
1656
- if (done && !value) continue;
1657
- try {
1658
- const decoded = value ? new TextDecoder().decode(value) : "";
1659
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR);
1660
- buffer = chunks.pop() || "";
1661
- for (const chunk of chunks) {
1662
- if (chunk) {
1663
- if (typeof chunk === "string") {
1664
- try {
1665
- const parsedChunk = JSON.parse(chunk);
1666
- yield parsedChunk;
1667
- } catch {
1668
- }
1669
- }
1670
- }
1671
- }
1672
- } catch {
1673
- }
1674
- }
1675
- if (buffer) {
1676
- try {
1677
- yield JSON.parse(buffer);
1678
- } catch {
1679
- }
1680
- }
1681
- } finally {
1682
- reader.cancel().catch(() => {
1683
- });
1684
- }
1685
- }
1686
- /**
1687
- * Watches legacy workflow transitions in real-time
1688
- * @param runId - Optional run ID to filter the watch stream
1689
- * @returns AsyncGenerator that yields parsed records from the legacy workflow watch stream
1690
- */
1691
- async watch({ runId }, onRecord) {
1692
- const response = await this.request(`/api/workflows/legacy/${this.workflowId}/watch?runId=${runId}`, {
1693
- stream: true
1694
- });
1695
- if (!response.ok) {
1696
- throw new Error(`Failed to watch legacy workflow: ${response.statusText}`);
1697
- }
1698
- if (!response.body) {
1699
- throw new Error("Response body is null");
1700
- }
1701
- for await (const record of this.streamProcessor(response.body)) {
1702
- onRecord(record);
1703
- }
1704
- }
1705
- };
1706
-
1707
1508
  // src/resources/tool.ts
1708
1509
  var Tool = class extends BaseResource {
1709
1510
  constructor(options, toolId) {
@@ -1740,7 +1541,7 @@ var Tool = class extends BaseResource {
1740
1541
  };
1741
1542
 
1742
1543
  // src/resources/workflow.ts
1743
- var RECORD_SEPARATOR2 = "";
1544
+ var RECORD_SEPARATOR = "";
1744
1545
  var Workflow = class extends BaseResource {
1745
1546
  constructor(options, workflowId) {
1746
1547
  super(options);
@@ -1764,7 +1565,7 @@ var Workflow = class extends BaseResource {
1764
1565
  if (done && !value) continue;
1765
1566
  try {
1766
1567
  const decoded = value ? new TextDecoder().decode(value) : "";
1767
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR2);
1568
+ const chunks = (buffer + decoded).split(RECORD_SEPARATOR);
1768
1569
  buffer = chunks.pop() || "";
1769
1570
  for (const chunk of chunks) {
1770
1571
  if (chunk) {
@@ -2010,7 +1811,7 @@ var Workflow = class extends BaseResource {
2010
1811
  async transform(chunk, controller) {
2011
1812
  try {
2012
1813
  const decoded = new TextDecoder().decode(chunk);
2013
- const chunks = decoded.split(RECORD_SEPARATOR2);
1814
+ const chunks = decoded.split(RECORD_SEPARATOR);
2014
1815
  for (const chunk2 of chunks) {
2015
1816
  if (chunk2) {
2016
1817
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2057,7 +1858,7 @@ var Workflow = class extends BaseResource {
2057
1858
  async transform(chunk, controller) {
2058
1859
  try {
2059
1860
  const decoded = new TextDecoder().decode(chunk);
2060
- const chunks = decoded.split(RECORD_SEPARATOR2);
1861
+ const chunks = decoded.split(RECORD_SEPARATOR);
2061
1862
  for (const chunk2 of chunks) {
2062
1863
  if (chunk2) {
2063
1864
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2108,7 +1909,7 @@ var Workflow = class extends BaseResource {
2108
1909
  async transform(chunk, controller) {
2109
1910
  try {
2110
1911
  const decoded = new TextDecoder().decode(chunk);
2111
- const chunks = decoded.split(RECORD_SEPARATOR2);
1912
+ const chunks = decoded.split(RECORD_SEPARATOR);
2112
1913
  for (const chunk2 of chunks) {
2113
1914
  if (chunk2) {
2114
1915
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2195,7 +1996,7 @@ var Workflow = class extends BaseResource {
2195
1996
  async start(controller) {
2196
1997
  try {
2197
1998
  for await (const record of records) {
2198
- const json = JSON.stringify(record) + RECORD_SEPARATOR2;
1999
+ const json = JSON.stringify(record) + RECORD_SEPARATOR;
2199
2000
  controller.enqueue(encoder.encode(json));
2200
2001
  }
2201
2002
  controller.close();
@@ -2318,7 +2119,7 @@ var MCPTool = class extends BaseResource {
2318
2119
  };
2319
2120
 
2320
2121
  // src/resources/agent-builder.ts
2321
- var RECORD_SEPARATOR3 = "";
2122
+ var RECORD_SEPARATOR2 = "";
2322
2123
  var AgentBuilder = class extends BaseResource {
2323
2124
  constructor(options, actionId) {
2324
2125
  super(options);
@@ -2458,7 +2259,7 @@ var AgentBuilder = class extends BaseResource {
2458
2259
  if (done && !value) continue;
2459
2260
  try {
2460
2261
  const decoded = value ? new TextDecoder().decode(value) : "";
2461
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR3);
2262
+ const chunks = (buffer + decoded).split(RECORD_SEPARATOR2);
2462
2263
  buffer = chunks.pop() || "";
2463
2264
  for (const chunk of chunks) {
2464
2265
  if (chunk) {
@@ -2515,7 +2316,7 @@ var AgentBuilder = class extends BaseResource {
2515
2316
  async transform(chunk, controller) {
2516
2317
  try {
2517
2318
  const decoded = new TextDecoder().decode(chunk);
2518
- const chunks = decoded.split(RECORD_SEPARATOR3);
2319
+ const chunks = decoded.split(RECORD_SEPARATOR2);
2519
2320
  for (const chunk2 of chunks) {
2520
2321
  if (chunk2) {
2521
2322
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2564,7 +2365,7 @@ var AgentBuilder = class extends BaseResource {
2564
2365
  async transform(chunk, controller) {
2565
2366
  try {
2566
2367
  const decoded = new TextDecoder().decode(chunk);
2567
- const chunks = decoded.split(RECORD_SEPARATOR3);
2368
+ const chunks = decoded.split(RECORD_SEPARATOR2);
2568
2369
  for (const chunk2 of chunks) {
2569
2370
  if (chunk2) {
2570
2371
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2735,6 +2536,25 @@ var Observability = class extends BaseResource {
2735
2536
  const queryString = searchParams.toString();
2736
2537
  return this.request(`/api/observability/traces${queryString ? `?${queryString}` : ""}`);
2737
2538
  }
2539
+ /**
2540
+ * Retrieves scores by trace ID and span ID
2541
+ * @param params - Parameters containing trace ID, span ID, and pagination options
2542
+ * @returns Promise containing scores and pagination info
2543
+ */
2544
+ getScoresBySpan(params) {
2545
+ const { traceId, spanId, page, perPage } = params;
2546
+ const searchParams = new URLSearchParams();
2547
+ if (page !== void 0) {
2548
+ searchParams.set("page", String(page));
2549
+ }
2550
+ if (perPage !== void 0) {
2551
+ searchParams.set("perPage", String(perPage));
2552
+ }
2553
+ const queryString = searchParams.toString();
2554
+ return this.request(
2555
+ `/api/observability/traces/${encodeURIComponent(traceId)}/${encodeURIComponent(spanId)}/scores${queryString ? `?${queryString}` : ""}`
2556
+ );
2557
+ }
2738
2558
  score(params) {
2739
2559
  return this.request(`/api/observability/traces/score`, {
2740
2560
  method: "POST",
@@ -2807,7 +2627,7 @@ var NetworkMemoryThread = class extends BaseResource {
2807
2627
  };
2808
2628
 
2809
2629
  // src/resources/vNextNetwork.ts
2810
- var RECORD_SEPARATOR4 = "";
2630
+ var RECORD_SEPARATOR3 = "";
2811
2631
  var VNextNetwork = class extends BaseResource {
2812
2632
  constructor(options, networkId) {
2813
2633
  super(options);
@@ -2860,7 +2680,7 @@ var VNextNetwork = class extends BaseResource {
2860
2680
  if (done && !value) continue;
2861
2681
  try {
2862
2682
  const decoded = value ? new TextDecoder().decode(value) : "";
2863
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR4);
2683
+ const chunks = (buffer + decoded).split(RECORD_SEPARATOR3);
2864
2684
  buffer = chunks.pop() || "";
2865
2685
  for (const chunk of chunks) {
2866
2686
  if (chunk) {
@@ -3106,21 +2926,6 @@ var MastraClient = class extends BaseResource {
3106
2926
  getTool(toolId) {
3107
2927
  return new Tool(this.options, toolId);
3108
2928
  }
3109
- /**
3110
- * Retrieves all available legacy workflows
3111
- * @returns Promise containing map of legacy workflow IDs to legacy workflow details
3112
- */
3113
- getLegacyWorkflows() {
3114
- return this.request("/api/workflows/legacy");
3115
- }
3116
- /**
3117
- * Gets a legacy workflow instance by ID
3118
- * @param workflowId - ID of the legacy workflow to retrieve
3119
- * @returns Legacy Workflow instance
3120
- */
3121
- getLegacyWorkflow(workflowId) {
3122
- return new LegacyWorkflow(this.options, workflowId);
3123
- }
3124
2929
  /**
3125
2930
  * Retrieves all available workflows
3126
2931
  * @param runtimeContext - Optional runtime context to pass as query parameter
@@ -3420,7 +3225,7 @@ var MastraClient = class extends BaseResource {
3420
3225
  * @returns Promise containing the scorer
3421
3226
  */
3422
3227
  getScorer(scorerId) {
3423
- return this.request(`/api/scores/scorers/${scorerId}`);
3228
+ return this.request(`/api/scores/scorers/${encodeURIComponent(scorerId)}`);
3424
3229
  }
3425
3230
  getScoresByScorerId(params) {
3426
3231
  const { page, perPage, scorerId, entityId, entityType } = params;
@@ -3438,7 +3243,7 @@ var MastraClient = class extends BaseResource {
3438
3243
  searchParams.set("perPage", String(perPage));
3439
3244
  }
3440
3245
  const queryString = searchParams.toString();
3441
- return this.request(`/api/scores/scorer/${scorerId}${queryString ? `?${queryString}` : ""}`);
3246
+ return this.request(`/api/scores/scorer/${encodeURIComponent(scorerId)}${queryString ? `?${queryString}` : ""}`);
3442
3247
  }
3443
3248
  /**
3444
3249
  * Retrieves scores by run ID
@@ -3455,7 +3260,7 @@ var MastraClient = class extends BaseResource {
3455
3260
  searchParams.set("perPage", String(perPage));
3456
3261
  }
3457
3262
  const queryString = searchParams.toString();
3458
- return this.request(`/api/scores/run/${runId}${queryString ? `?${queryString}` : ""}`);
3263
+ return this.request(`/api/scores/run/${encodeURIComponent(runId)}${queryString ? `?${queryString}` : ""}`);
3459
3264
  }
3460
3265
  /**
3461
3266
  * Retrieves scores by entity ID and type
@@ -3472,7 +3277,9 @@ var MastraClient = class extends BaseResource {
3472
3277
  searchParams.set("perPage", String(perPage));
3473
3278
  }
3474
3279
  const queryString = searchParams.toString();
3475
- return this.request(`/api/scores/entity/${entityType}/${entityId}${queryString ? `?${queryString}` : ""}`);
3280
+ return this.request(
3281
+ `/api/scores/entity/${encodeURIComponent(entityType)}/${encodeURIComponent(entityId)}${queryString ? `?${queryString}` : ""}`
3282
+ );
3476
3283
  }
3477
3284
  /**
3478
3285
  * Saves a score
@@ -3498,6 +3305,9 @@ var MastraClient = class extends BaseResource {
3498
3305
  getAITraces(params) {
3499
3306
  return this.observability.getTraces(params);
3500
3307
  }
3308
+ getScoresBySpan(params) {
3309
+ return this.observability.getScoresBySpan(params);
3310
+ }
3501
3311
  score(params) {
3502
3312
  return this.observability.score(params);
3503
3313
  }