@mastra/client-js 0.0.0-transpile-packages-20250724123433 → 0.0.0-transpile-packages-20250730132657

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.
@@ -24,7 +24,9 @@ export class BaseResource {
24
24
  const response = await fetch(`${baseUrl.replace(/\/$/, '')}${path}`, {
25
25
  ...options,
26
26
  headers: {
27
- ...(options.body && (options.method === 'POST' || options.method === 'PUT')
27
+ ...(options.body &&
28
+ !(options.body instanceof FormData) &&
29
+ (options.method === 'POST' || options.method === 'PUT')
28
30
  ? { 'content-type': 'application/json' }
29
31
  : {}),
30
32
  ...headers,
@@ -28,9 +28,10 @@ export class Network extends BaseResource {
28
28
  * @param params - Generation parameters including prompt
29
29
  * @returns Promise containing the generated response
30
30
  */
31
- generate<T extends JSONSchema7 | ZodSchema | undefined = undefined>(
32
- params: GenerateParams<T>,
33
- ): Promise<GenerateReturn<T>> {
31
+ generate<
32
+ Output extends JSONSchema7 | ZodSchema | undefined = undefined,
33
+ StructuredOutput extends JSONSchema7 | ZodSchema | undefined = undefined,
34
+ >(params: GenerateParams<Output>): Promise<GenerateReturn<any, Output, StructuredOutput>> {
34
35
  const processedParams = {
35
36
  ...params,
36
37
  output: zodToJsonSchema(params.output),
package/src/types.ts CHANGED
@@ -16,6 +16,7 @@ import type { BaseLogMessage, LogLevel } from '@mastra/core/logger';
16
16
 
17
17
  import type { MCPToolType, ServerInfo } from '@mastra/core/mcp';
18
18
  import type { RuntimeContext } from '@mastra/core/runtime-context';
19
+ import type { MastraScorer, MastraScorerEntry, ScoreRowData } from '@mastra/core/scores';
19
20
  import type { Workflow, WatchEvent, WorkflowResult } from '@mastra/core/workflows';
20
21
  import type {
21
22
  StepAction,
@@ -445,3 +446,57 @@ export interface McpToolInfo {
445
446
  export interface McpServerToolListResponse {
446
447
  tools: McpToolInfo[];
447
448
  }
449
+
450
+ export type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
451
+ createdAt: string;
452
+ updatedAt: string;
453
+ };
454
+
455
+ // Scores-related types
456
+ export interface GetScoresByRunIdParams {
457
+ runId: string;
458
+ page?: number;
459
+ perPage?: number;
460
+ }
461
+
462
+ export interface GetScoresByScorerIdParams {
463
+ scorerId: string;
464
+ entityId?: string;
465
+ entityType?: string;
466
+ page?: number;
467
+ perPage?: number;
468
+ }
469
+
470
+ export interface GetScoresByEntityIdParams {
471
+ entityId: string;
472
+ entityType: string;
473
+ page?: number;
474
+ perPage?: number;
475
+ }
476
+
477
+ export interface SaveScoreParams {
478
+ score: ScoreRowData;
479
+ }
480
+
481
+ export interface GetScoresResponse {
482
+ pagination: {
483
+ total: number;
484
+ page: number;
485
+ perPage: number;
486
+ hasMore: boolean;
487
+ };
488
+ scores: ClientScoreRowData[];
489
+ }
490
+
491
+ export interface SaveScoreResponse {
492
+ score: ClientScoreRowData;
493
+ }
494
+
495
+ export type GetScorerResponse = MastraScorerEntry & {
496
+ agentIds: string[];
497
+ workflowIds: string[];
498
+ };
499
+
500
+ export interface GetScorersResponse {
501
+ scorers: Array<GetScorerResponse>;
502
+ }
@@ -1,4 +1,4 @@
1
- import { isVercelTool } from '@mastra/core/tools';
1
+ import { isVercelTool } from '@mastra/core/tools/is-vercel-tool';
2
2
  import { zodToJsonSchema } from './zod-to-json-schema';
3
3
  import type { ToolsInput } from '@mastra/core/agent';
4
4
 
@@ -1,19 +0,0 @@
1
-
2
- > @mastra/client-js@0.10.15-alpha.1 build /home/runner/work/mastra/mastra/client-sdks/client-js
3
- > tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.0
8
- CLI Target: es2022
9
- CLI Cleaning output folder
10
- ESM Build start
11
- CJS Build start
12
- CJS dist/index.cjs 72.52 KB
13
- CJS ⚡️ Build success in 2114ms
14
- ESM dist/index.js 72.22 KB
15
- ESM ⚡️ Build success in 2121ms
16
- DTS Build start
17
- DTS ⚡️ Build success in 18228ms
18
- DTS dist/index.d.ts 43.48 KB
19
- DTS dist/index.d.cts 43.48 KB