@mastra/core 0.9.1-alpha.2 → 0.9.1-alpha.4
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/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/{base-CzHk9DyB.d.ts → base-CbqdI24A.d.ts} +34 -23
- package/dist/{base-Cg7Gk0F8.d.cts → base-o2dHNbVw.d.cts} +34 -23
- package/dist/{chunk-V7IE36YV.cjs → chunk-33XQ5DGU.cjs} +9 -9
- package/dist/{chunk-4K4DHXRF.js → chunk-3KQ5EXWX.js} +7 -6
- package/dist/{chunk-422BXQRT.cjs → chunk-4BMHVLSO.cjs} +18 -17
- package/dist/{chunk-KWV5ZLOF.js → chunk-52SRR7WR.js} +1 -1
- package/dist/{chunk-TNILINST.cjs → chunk-6KB5CPBV.cjs} +1 -0
- package/dist/{chunk-ZRMY72JX.js → chunk-7IAP7VPO.js} +1 -1
- package/dist/{chunk-YTTBFAQJ.cjs → chunk-7JRVDC7F.cjs} +4 -1
- package/dist/{chunk-SGTFVHOZ.js → chunk-7ZR64JAJ.js} +1 -1
- package/dist/{chunk-CEXM6WP5.cjs → chunk-D2UVF2GF.cjs} +2 -2
- package/dist/{chunk-6AHC67YY.js → chunk-J7WRPNIY.js} +2 -2
- package/dist/{chunk-VMVXIPGW.js → chunk-JFBHRT6O.js} +1 -1
- package/dist/{chunk-7AGAXO6B.cjs → chunk-JGJH3O5O.cjs} +7 -7
- package/dist/{chunk-34622N67.js → chunk-JSUPD5IG.js} +4 -1
- package/dist/{chunk-YZFNMXY4.cjs → chunk-KF5VBC5P.cjs} +6 -6
- package/dist/{chunk-HFOT2NFM.js → chunk-KWYJUFY3.js} +1 -1
- package/dist/{chunk-BU45BMXY.js → chunk-KYULILA6.js} +2 -2
- package/dist/{chunk-U5DGGGS2.cjs → chunk-MAWT75XY.cjs} +2 -2
- package/dist/{chunk-RIBNDTA6.cjs → chunk-MYHX5XVW.cjs} +2 -2
- package/dist/{chunk-FKUPMQZP.cjs → chunk-POEYDVX7.cjs} +2 -2
- package/dist/{chunk-MWLZJBPF.js → chunk-Q6Z2YS6I.js} +1 -1
- package/dist/{chunk-PS2ZF6MA.js → chunk-QY6OVSUL.js} +1 -1
- package/dist/{chunk-ANYT6KP7.js → chunk-SEOWDGC2.js} +1 -0
- package/dist/{chunk-BFF2O6RO.js → chunk-SHDPMWGJ.js} +1 -1
- package/dist/{chunk-FPM2XCMS.cjs → chunk-XNBNJEES.cjs} +19 -19
- package/dist/{chunk-27PAET7X.cjs → chunk-ZKRQS3N5.cjs} +2 -2
- package/dist/{chunk-P6KJ7FZZ.cjs → chunk-ZZRFVSYZ.cjs} +2 -2
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/index.cjs +62 -62
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.d.cts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.d.cts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +4 -4
- package/dist/network/index.d.cts +1 -1
- package/dist/network/index.d.ts +1 -1
- package/dist/network/index.js +2 -2
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +1 -1
- package/dist/relevance/index.d.ts +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/storage/index.cjs +9 -9
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +2 -2
- package/dist/storage/libsql/index.cjs +19 -16
- package/dist/storage/libsql/index.d.cts +12 -17
- package/dist/storage/libsql/index.d.ts +12 -17
- package/dist/storage/libsql/index.js +5 -2
- package/dist/telemetry/index.cjs +6 -6
- package/dist/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.cts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +14 -14
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/index.d.cts +2 -2
- package/dist/voice/index.d.ts +2 -2
- package/dist/voice/index.js +1 -1
- package/dist/workflows/index.cjs +22 -22
- package/dist/workflows/index.d.cts +2 -2
- package/dist/workflows/index.d.ts +2 -2
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/vNext/index.cjs +4 -4
- package/dist/workflows/vNext/index.d.cts +2 -2
- package/dist/workflows/vNext/index.d.ts +2 -2
- package/dist/workflows/vNext/index.js +2 -2
- package/package.json +4 -4
package/dist/agent/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4BMHVLSO_cjs = require('../chunk-4BMHVLSO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Agent", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk4BMHVLSO_cjs.Agent; }
|
|
10
10
|
});
|
package/dist/agent/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
4
|
+
export { H as Agent, I as AgentConfig, b9 as AgentGenerateOptions, ba as AgentStreamOptions, b3 as MastraLanguageModel, b4 as ToolsInput, b8 as ToolsetsInput } from '../base-o2dHNbVw.cjs';
|
|
5
5
|
import '../base-BihKcqDY.cjs';
|
|
6
6
|
import '../types-BtMyV38I.cjs';
|
|
7
7
|
import '../runtime-context/index.cjs';
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
4
|
+
export { H as Agent, I as AgentConfig, b9 as AgentGenerateOptions, ba as AgentStreamOptions, b3 as MastraLanguageModel, b4 as ToolsInput, b8 as ToolsetsInput } from '../base-CbqdI24A.js';
|
|
5
5
|
import '../base-DT2poiVK.js';
|
|
6
6
|
import '../types-BtMyV38I.js';
|
|
7
7
|
import '../runtime-context/index.js';
|
package/dist/agent/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-3KQ5EXWX.js';
|
|
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1484
1484
|
mastra: Mastra;
|
|
1485
1485
|
}): Promise<z.infer<TOutput>>;
|
|
1486
1486
|
getWorkflowRuns(): Promise<WorkflowRuns>;
|
|
1487
|
-
getWorkflowRun(runId: string): Promise<
|
|
1488
|
-
workflowName: string;
|
|
1489
|
-
runId: string;
|
|
1490
|
-
snapshot: WorkflowRunState | string;
|
|
1491
|
-
createdAt: Date;
|
|
1492
|
-
updatedAt: Date;
|
|
1493
|
-
} | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1487
|
+
getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1494
1488
|
}
|
|
1495
1489
|
/**
|
|
1496
1490
|
* Represents a workflow run that can be executed
|
|
@@ -2137,9 +2131,27 @@ type Middleware = MiddlewareHandler | {
|
|
|
2137
2131
|
handler: MiddlewareHandler;
|
|
2138
2132
|
};
|
|
2139
2133
|
type ServerConfig = {
|
|
2134
|
+
/**
|
|
2135
|
+
* Port for the server
|
|
2136
|
+
* @default 4111
|
|
2137
|
+
*/
|
|
2140
2138
|
port?: number;
|
|
2139
|
+
/**
|
|
2140
|
+
* Host for the server
|
|
2141
|
+
* @default 'localhost'
|
|
2142
|
+
*/
|
|
2143
|
+
host?: string;
|
|
2144
|
+
/**
|
|
2145
|
+
* Timeout for the server
|
|
2146
|
+
*/
|
|
2141
2147
|
timeout?: number;
|
|
2148
|
+
/**
|
|
2149
|
+
* Custom API routes for the server
|
|
2150
|
+
*/
|
|
2142
2151
|
apiRoutes?: ApiRoute[];
|
|
2152
|
+
/**
|
|
2153
|
+
* Middleware for the server
|
|
2154
|
+
*/
|
|
2143
2155
|
middleware?: Middleware | Middleware[];
|
|
2144
2156
|
/**
|
|
2145
2157
|
* CORS configuration for the server
|
|
@@ -2443,23 +2455,18 @@ interface StorageColumn {
|
|
|
2443
2455
|
column: string;
|
|
2444
2456
|
};
|
|
2445
2457
|
}
|
|
2446
|
-
interface WorkflowRow {
|
|
2447
|
-
workflow_name: string;
|
|
2448
|
-
run_id: string;
|
|
2449
|
-
snapshot: WorkflowRunState;
|
|
2450
|
-
created_at: Date;
|
|
2451
|
-
updated_at: Date;
|
|
2452
|
-
}
|
|
2453
2458
|
interface WorkflowRuns {
|
|
2454
|
-
runs:
|
|
2455
|
-
workflowName: string;
|
|
2456
|
-
runId: string;
|
|
2457
|
-
snapshot: WorkflowRunState | string;
|
|
2458
|
-
createdAt: Date;
|
|
2459
|
-
updatedAt: Date;
|
|
2460
|
-
}>;
|
|
2459
|
+
runs: WorkflowRun[];
|
|
2461
2460
|
total: number;
|
|
2462
2461
|
}
|
|
2462
|
+
interface WorkflowRun {
|
|
2463
|
+
workflowName: string;
|
|
2464
|
+
runId: string;
|
|
2465
|
+
snapshot: WorkflowRunState | string;
|
|
2466
|
+
createdAt: Date;
|
|
2467
|
+
updatedAt: Date;
|
|
2468
|
+
resourceId?: string;
|
|
2469
|
+
}
|
|
2463
2470
|
type StorageGetMessagesArg = {
|
|
2464
2471
|
threadId: string;
|
|
2465
2472
|
resourceId?: string;
|
|
@@ -2624,13 +2631,17 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2624
2631
|
}): Promise<WorkflowRunState | null>;
|
|
2625
2632
|
abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
2626
2633
|
abstract getWorkflowRuns(args?: {
|
|
2627
|
-
namespace?: string;
|
|
2628
2634
|
workflowName?: string;
|
|
2629
2635
|
fromDate?: Date;
|
|
2630
2636
|
toDate?: Date;
|
|
2631
2637
|
limit?: number;
|
|
2632
2638
|
offset?: number;
|
|
2639
|
+
resourceId?: string;
|
|
2633
2640
|
}): Promise<WorkflowRuns>;
|
|
2641
|
+
abstract getWorkflowRunById(args: {
|
|
2642
|
+
runId: string;
|
|
2643
|
+
workflowName?: string;
|
|
2644
|
+
}): Promise<WorkflowRun | null>;
|
|
2634
2645
|
}
|
|
2635
2646
|
|
|
2636
|
-
export { type
|
|
2647
|
+
export { type CoreAssistantMessage as $, type ApiRoute as A, type ExtractSchemaFromStep as B, CompositeVoice as C, type VariableReference as D, type EvalRow as E, type WatchEvent as F, type ToolAction as G, Agent as H, type AgentConfig as I, MastraMemory as J, type ToolExecutionContext as K, Tool as L, type Methods as M, type NewStep as N, Step as O, type PathsToStringProps as P, Workflow as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowOptions as U, type VoiceEventType as V, type WorkflowRuns as W, type LanguageModel as X, type CoreMessage as Y, type ZodPathType as Z, type CoreSystemMessage as _, Mastra as a, type ExtractSchemaType$1 as a$, type CoreUserMessage as a0, type CoreToolMessage as a1, type EmbedResult as a2, type EmbedManyResult as a3, type BaseStructuredOutputType as a4, type StructuredOutputType as a5, type StructuredOutputArrayItem as a6, type StructuredOutput as a7, type GenerateReturn as a8, type StreamReturn as a9, type RetryConfig as aA, type VariableReference$1 as aB, type BaseCondition as aC, type ActionContext as aD, WhenConditionReturnValue as aE, type StepDef as aF, type StepCondition as aG, type StepConfig as aH, type StepResult$1 as aI, type StepsRecord$1 as aJ, type WorkflowRunResult as aK, type WorkflowContext as aL, type WorkflowLogMessage as aM, type WorkflowEvent as aN, type ResolverFunctionInput as aO, type ResolverFunctionOutput as aP, type SubscriberFunctionOutput as aQ, type DependencyCheckOutput as aR, type StepResolverOutput as aS, type WorkflowActors as aT, type WorkflowActionParams as aU, type WorkflowActions as aV, type WorkflowState as aW, type StepId as aX, type ExtractSchemaFromStep$1 as aY, type ExtractStepResult as aZ, type StepInputType as a_, type OutputType as aa, type DefaultLLMTextOptions as ab, type DefaultLLMTextObjectOptions as ac, type DefaultLLMStreamOptions as ad, type DefaultLLMStreamObjectOptions as ae, type LLMTextOptions as af, type LLMTextObjectOptions as ag, type LLMStreamOptions as ah, type LLMInnerStreamOptions as ai, type LLMStreamObjectOptions as aj, createMockModel as ak, type Config as al, type MessageResponse as am, type MemoryConfig as an, type SharedMemoryConfig as ao, type MemoryProcessorOpts as ap, MemoryProcessor as aq, memoryDefaultOptions as ar, createTool as as, type VercelTool as at, type CoreTool as au, type StepExecutionContext as av, type StepAction as aw, type StepVariableType as ax, type StepNode as ay, type StepGraph as az, MastraVoice as b, type PathsToStringProps$1 as b0, type WorkflowRunState as b1, type WorkflowResumeResult as b2, type MastraLanguageModel as b3, type ToolsInput as b4, type MastraPrimitives as b5, AgentNetwork as b6, type AgentNetworkConfig as b7, type ToolsetsInput as b8, type AgentGenerateOptions as b9, type AgentStreamOptions as ba, TABLE_WORKFLOW_SNAPSHOT as bb, TABLE_EVALS as bc, TABLE_MESSAGES as bd, TABLE_THREADS as be, TABLE_TRACES as bf, TABLE_SCHEMAS as bg, type VoiceEventMap as c, type VoiceConfig as d, MastraStorage as e, type StorageThreadType as f, type MessageType as g, type StorageGetMessagesArg as h, type WorkflowRun as i, ExecutionEngine as j, type ExecutionGraph as k, type StepResult as l, type StepFlowEntry as m, type ExecuteFunction as n, createStep as o, cloneStep as p, createWorkflow as q, cloneWorkflow as r, type WorkflowResult as s, type NewWorkflowConfig as t, NewWorkflow as u, type StepSuccess as v, type StepFailure as w, type StepSuspended as x, type StepsRecord as y, type ExtractSchemaType as z };
|
|
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1484
1484
|
mastra: Mastra;
|
|
1485
1485
|
}): Promise<z.infer<TOutput>>;
|
|
1486
1486
|
getWorkflowRuns(): Promise<WorkflowRuns>;
|
|
1487
|
-
getWorkflowRun(runId: string): Promise<
|
|
1488
|
-
workflowName: string;
|
|
1489
|
-
runId: string;
|
|
1490
|
-
snapshot: WorkflowRunState | string;
|
|
1491
|
-
createdAt: Date;
|
|
1492
|
-
updatedAt: Date;
|
|
1493
|
-
} | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1487
|
+
getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1494
1488
|
}
|
|
1495
1489
|
/**
|
|
1496
1490
|
* Represents a workflow run that can be executed
|
|
@@ -2137,9 +2131,27 @@ type Middleware = MiddlewareHandler | {
|
|
|
2137
2131
|
handler: MiddlewareHandler;
|
|
2138
2132
|
};
|
|
2139
2133
|
type ServerConfig = {
|
|
2134
|
+
/**
|
|
2135
|
+
* Port for the server
|
|
2136
|
+
* @default 4111
|
|
2137
|
+
*/
|
|
2140
2138
|
port?: number;
|
|
2139
|
+
/**
|
|
2140
|
+
* Host for the server
|
|
2141
|
+
* @default 'localhost'
|
|
2142
|
+
*/
|
|
2143
|
+
host?: string;
|
|
2144
|
+
/**
|
|
2145
|
+
* Timeout for the server
|
|
2146
|
+
*/
|
|
2141
2147
|
timeout?: number;
|
|
2148
|
+
/**
|
|
2149
|
+
* Custom API routes for the server
|
|
2150
|
+
*/
|
|
2142
2151
|
apiRoutes?: ApiRoute[];
|
|
2152
|
+
/**
|
|
2153
|
+
* Middleware for the server
|
|
2154
|
+
*/
|
|
2143
2155
|
middleware?: Middleware | Middleware[];
|
|
2144
2156
|
/**
|
|
2145
2157
|
* CORS configuration for the server
|
|
@@ -2443,23 +2455,18 @@ interface StorageColumn {
|
|
|
2443
2455
|
column: string;
|
|
2444
2456
|
};
|
|
2445
2457
|
}
|
|
2446
|
-
interface WorkflowRow {
|
|
2447
|
-
workflow_name: string;
|
|
2448
|
-
run_id: string;
|
|
2449
|
-
snapshot: WorkflowRunState;
|
|
2450
|
-
created_at: Date;
|
|
2451
|
-
updated_at: Date;
|
|
2452
|
-
}
|
|
2453
2458
|
interface WorkflowRuns {
|
|
2454
|
-
runs:
|
|
2455
|
-
workflowName: string;
|
|
2456
|
-
runId: string;
|
|
2457
|
-
snapshot: WorkflowRunState | string;
|
|
2458
|
-
createdAt: Date;
|
|
2459
|
-
updatedAt: Date;
|
|
2460
|
-
}>;
|
|
2459
|
+
runs: WorkflowRun[];
|
|
2461
2460
|
total: number;
|
|
2462
2461
|
}
|
|
2462
|
+
interface WorkflowRun {
|
|
2463
|
+
workflowName: string;
|
|
2464
|
+
runId: string;
|
|
2465
|
+
snapshot: WorkflowRunState | string;
|
|
2466
|
+
createdAt: Date;
|
|
2467
|
+
updatedAt: Date;
|
|
2468
|
+
resourceId?: string;
|
|
2469
|
+
}
|
|
2463
2470
|
type StorageGetMessagesArg = {
|
|
2464
2471
|
threadId: string;
|
|
2465
2472
|
resourceId?: string;
|
|
@@ -2624,13 +2631,17 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2624
2631
|
}): Promise<WorkflowRunState | null>;
|
|
2625
2632
|
abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
2626
2633
|
abstract getWorkflowRuns(args?: {
|
|
2627
|
-
namespace?: string;
|
|
2628
2634
|
workflowName?: string;
|
|
2629
2635
|
fromDate?: Date;
|
|
2630
2636
|
toDate?: Date;
|
|
2631
2637
|
limit?: number;
|
|
2632
2638
|
offset?: number;
|
|
2639
|
+
resourceId?: string;
|
|
2633
2640
|
}): Promise<WorkflowRuns>;
|
|
2641
|
+
abstract getWorkflowRunById(args: {
|
|
2642
|
+
runId: string;
|
|
2643
|
+
workflowName?: string;
|
|
2644
|
+
}): Promise<WorkflowRun | null>;
|
|
2634
2645
|
}
|
|
2635
2646
|
|
|
2636
|
-
export { type
|
|
2647
|
+
export { type CoreAssistantMessage as $, type ApiRoute as A, type ExtractSchemaFromStep as B, CompositeVoice as C, type VariableReference as D, type EvalRow as E, type WatchEvent as F, type ToolAction as G, Agent as H, type AgentConfig as I, MastraMemory as J, type ToolExecutionContext as K, Tool as L, type Methods as M, type NewStep as N, Step as O, type PathsToStringProps as P, Workflow as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowOptions as U, type VoiceEventType as V, type WorkflowRuns as W, type LanguageModel as X, type CoreMessage as Y, type ZodPathType as Z, type CoreSystemMessage as _, Mastra as a, type ExtractSchemaType$1 as a$, type CoreUserMessage as a0, type CoreToolMessage as a1, type EmbedResult as a2, type EmbedManyResult as a3, type BaseStructuredOutputType as a4, type StructuredOutputType as a5, type StructuredOutputArrayItem as a6, type StructuredOutput as a7, type GenerateReturn as a8, type StreamReturn as a9, type RetryConfig as aA, type VariableReference$1 as aB, type BaseCondition as aC, type ActionContext as aD, WhenConditionReturnValue as aE, type StepDef as aF, type StepCondition as aG, type StepConfig as aH, type StepResult$1 as aI, type StepsRecord$1 as aJ, type WorkflowRunResult as aK, type WorkflowContext as aL, type WorkflowLogMessage as aM, type WorkflowEvent as aN, type ResolverFunctionInput as aO, type ResolverFunctionOutput as aP, type SubscriberFunctionOutput as aQ, type DependencyCheckOutput as aR, type StepResolverOutput as aS, type WorkflowActors as aT, type WorkflowActionParams as aU, type WorkflowActions as aV, type WorkflowState as aW, type StepId as aX, type ExtractSchemaFromStep$1 as aY, type ExtractStepResult as aZ, type StepInputType as a_, type OutputType as aa, type DefaultLLMTextOptions as ab, type DefaultLLMTextObjectOptions as ac, type DefaultLLMStreamOptions as ad, type DefaultLLMStreamObjectOptions as ae, type LLMTextOptions as af, type LLMTextObjectOptions as ag, type LLMStreamOptions as ah, type LLMInnerStreamOptions as ai, type LLMStreamObjectOptions as aj, createMockModel as ak, type Config as al, type MessageResponse as am, type MemoryConfig as an, type SharedMemoryConfig as ao, type MemoryProcessorOpts as ap, MemoryProcessor as aq, memoryDefaultOptions as ar, createTool as as, type VercelTool as at, type CoreTool as au, type StepExecutionContext as av, type StepAction as aw, type StepVariableType as ax, type StepNode as ay, type StepGraph as az, MastraVoice as b, type PathsToStringProps$1 as b0, type WorkflowRunState as b1, type WorkflowResumeResult as b2, type MastraLanguageModel as b3, type ToolsInput as b4, type MastraPrimitives as b5, AgentNetwork as b6, type AgentNetworkConfig as b7, type ToolsetsInput as b8, type AgentGenerateOptions as b9, type AgentStreamOptions as ba, TABLE_WORKFLOW_SNAPSHOT as bb, TABLE_EVALS as bc, TABLE_MESSAGES as bd, TABLE_THREADS as be, TABLE_TRACES as bf, TABLE_SCHEMAS as bg, type VoiceEventMap as c, type VoiceConfig as d, MastraStorage as e, type StorageThreadType as f, type MessageType as g, type StorageGetMessagesArg as h, type WorkflowRun as i, ExecutionEngine as j, type ExecutionGraph as k, type StepResult as l, type StepFlowEntry as m, type ExecuteFunction as n, createStep as o, cloneStep as p, createWorkflow as q, cloneWorkflow as r, type WorkflowResult as s, type NewWorkflowConfig as t, NewWorkflow as u, type StepSuccess as v, type StepFailure as w, type StepSuspended as x, type StepsRecord as y, type ExtractSchemaType as z };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZKRQS3N5_cjs = require('./chunk-ZKRQS3N5.cjs');
|
|
4
|
+
var chunkMYHX5XVW_cjs = require('./chunk-MYHX5XVW.cjs');
|
|
5
5
|
var chunkO7IW545H_cjs = require('./chunk-O7IW545H.cjs');
|
|
6
6
|
var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
|
|
7
7
|
|
|
8
8
|
// src/mastra/index.ts
|
|
9
9
|
var _Mastra_decorators, _init;
|
|
10
|
-
_Mastra_decorators = [
|
|
10
|
+
_Mastra_decorators = [chunkMYHX5XVW_cjs.InstrumentClass({
|
|
11
11
|
prefix: "mastra",
|
|
12
12
|
excludeMethods: ["getLogger", "getTelemetry"]
|
|
13
13
|
})];
|
|
@@ -67,14 +67,14 @@ exports.Mastra = class Mastra {
|
|
|
67
67
|
this.#logger = logger;
|
|
68
68
|
let storage = config?.storage;
|
|
69
69
|
if (!storage) {
|
|
70
|
-
storage = new
|
|
70
|
+
storage = new chunkZKRQS3N5_cjs.DefaultProxyStorage({
|
|
71
71
|
config: {
|
|
72
72
|
url: process.env.MASTRA_DEFAULT_STORAGE_URL || `:memory:`
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
storage =
|
|
77
|
-
this.#telemetry =
|
|
76
|
+
storage = chunkZKRQS3N5_cjs.augmentWithInit(storage);
|
|
77
|
+
this.#telemetry = chunkMYHX5XVW_cjs.Telemetry.init(config?.telemetry);
|
|
78
78
|
if (this.#telemetry) {
|
|
79
79
|
this.#storage = this.#telemetry.traceClass(storage, {
|
|
80
80
|
excludeMethods: ["__setTelemetry", "__getTelemetry", "batchTraceInsert"]
|
|
@@ -285,7 +285,7 @@ This is a warning for now, but will throw an error in the future
|
|
|
285
285
|
return this.#vnext_workflows;
|
|
286
286
|
}
|
|
287
287
|
setStorage(storage) {
|
|
288
|
-
if (storage instanceof
|
|
288
|
+
if (storage instanceof chunkZKRQS3N5_cjs.DefaultProxyStorage) {
|
|
289
289
|
this.#logger.warn(`Importing "DefaultStorage" from '@mastra/core/storage/libsql' is deprecated.
|
|
290
290
|
|
|
291
291
|
Instead of:
|
|
@@ -295,7 +295,7 @@ Do:
|
|
|
295
295
|
import { LibSQLStore } from '@mastra/libsql';
|
|
296
296
|
`);
|
|
297
297
|
}
|
|
298
|
-
this.#storage =
|
|
298
|
+
this.#storage = chunkZKRQS3N5_cjs.augmentWithInit(storage);
|
|
299
299
|
}
|
|
300
300
|
setLogger({
|
|
301
301
|
logger
|
|
@@ -327,7 +327,7 @@ Do:
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
setTelemetry(telemetry) {
|
|
330
|
-
this.#telemetry =
|
|
330
|
+
this.#telemetry = chunkMYHX5XVW_cjs.Telemetry.init(telemetry);
|
|
331
331
|
if (this.#agents) {
|
|
332
332
|
Object.keys(this.#agents).forEach(key => {
|
|
333
333
|
if (this.#telemetry) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DefaultVoice } from './chunk-
|
|
2
|
-
import { MastraLLM } from './chunk-
|
|
3
|
-
import { InstrumentClass } from './chunk-
|
|
4
|
-
import { ensureToolProperties, ensureAllMessagesAreCoreMessages, createMastraProxy, makeCoreTool } from './chunk-
|
|
1
|
+
import { DefaultVoice } from './chunk-Q6Z2YS6I.js';
|
|
2
|
+
import { MastraLLM } from './chunk-JFBHRT6O.js';
|
|
3
|
+
import { InstrumentClass } from './chunk-KWYJUFY3.js';
|
|
4
|
+
import { ensureToolProperties, ensureAllMessagesAreCoreMessages, createMastraProxy, makeCoreTool } from './chunk-JSUPD5IG.js';
|
|
5
5
|
import { MastraBase } from './chunk-CLJQYXNM.js';
|
|
6
6
|
import { RegisteredLogger } from './chunk-2BVZNKLX.js';
|
|
7
7
|
import { RuntimeContext } from './chunk-SGGPJWRQ.js';
|
|
@@ -3842,14 +3842,15 @@ var Workflow = class extends MastraBase {
|
|
|
3842
3842
|
}
|
|
3843
3843
|
}
|
|
3844
3844
|
async getWorkflowRuns() {
|
|
3845
|
-
|
|
3845
|
+
const storage = this.#mastra?.getStorage();
|
|
3846
|
+
if (!storage) {
|
|
3846
3847
|
this.logger.debug("Cannot get workflow runs. Mastra engine is not initialized");
|
|
3847
3848
|
return {
|
|
3848
3849
|
runs: [],
|
|
3849
3850
|
total: 0
|
|
3850
3851
|
};
|
|
3851
3852
|
}
|
|
3852
|
-
return
|
|
3853
|
+
return storage.getWorkflowRuns({
|
|
3853
3854
|
workflowName: this.name
|
|
3854
3855
|
});
|
|
3855
3856
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkPOEYDVX7_cjs = require('./chunk-POEYDVX7.cjs');
|
|
4
|
+
var chunkJGJH3O5O_cjs = require('./chunk-JGJH3O5O.cjs');
|
|
5
|
+
var chunkMYHX5XVW_cjs = require('./chunk-MYHX5XVW.cjs');
|
|
6
|
+
var chunk7JRVDC7F_cjs = require('./chunk-7JRVDC7F.cjs');
|
|
7
7
|
var chunkD63P5O4Q_cjs = require('./chunk-D63P5O4Q.cjs');
|
|
8
8
|
var chunkO7IW545H_cjs = require('./chunk-O7IW545H.cjs');
|
|
9
9
|
var chunkLABUWBKX_cjs = require('./chunk-LABUWBKX.cjs');
|
|
@@ -60,7 +60,7 @@ var WhenConditionReturnValue = /* @__PURE__ */(WhenConditionReturnValue2 => {
|
|
|
60
60
|
return WhenConditionReturnValue2;
|
|
61
61
|
})(WhenConditionReturnValue || {});
|
|
62
62
|
var _Agent_decorators, _init, _a;
|
|
63
|
-
_Agent_decorators = [
|
|
63
|
+
_Agent_decorators = [chunkMYHX5XVW_cjs.InstrumentClass({
|
|
64
64
|
prefix: "agent",
|
|
65
65
|
excludeMethods: ["hasOwnMemory", "getMemory", "__primitive", "__setTools", "__setLogger", "__setTelemetry", "log"]
|
|
66
66
|
})];
|
|
@@ -89,7 +89,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
89
89
|
if (!config.model) {
|
|
90
90
|
throw new Error(`LanguageModel is required to create an Agent. Please provide the 'model'.`);
|
|
91
91
|
}
|
|
92
|
-
this.llm = new
|
|
92
|
+
this.llm = new chunkJGJH3O5O_cjs.MastraLLM({
|
|
93
93
|
model: config.model,
|
|
94
94
|
mastra: config.mastra
|
|
95
95
|
});
|
|
@@ -99,7 +99,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
99
99
|
this.metrics = {};
|
|
100
100
|
this.evals = {};
|
|
101
101
|
if (config.tools) {
|
|
102
|
-
this.tools =
|
|
102
|
+
this.tools = chunk7JRVDC7F_cjs.ensureToolProperties(config.tools);
|
|
103
103
|
}
|
|
104
104
|
if (config.mastra) {
|
|
105
105
|
this.__registerMastra(config.mastra);
|
|
@@ -124,7 +124,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
124
124
|
this.voice?.addTools(this.tools);
|
|
125
125
|
this.voice?.addInstructions(config.instructions);
|
|
126
126
|
} else {
|
|
127
|
-
this.voice = new
|
|
127
|
+
this.voice = new chunkPOEYDVX7_cjs.DefaultVoice();
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
hasOwnMemory() {
|
|
@@ -229,7 +229,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
229
229
|
messages: userMessages
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
const newMessages =
|
|
232
|
+
const newMessages = chunk7JRVDC7F_cjs.ensureAllMessagesAreCoreMessages(userMessages);
|
|
233
233
|
const now = Date.now();
|
|
234
234
|
const messages = newMessages.map((u, index) => {
|
|
235
235
|
return {
|
|
@@ -407,7 +407,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
407
407
|
let mastraProxy = void 0;
|
|
408
408
|
const logger = this.logger;
|
|
409
409
|
if (this.#mastra) {
|
|
410
|
-
mastraProxy =
|
|
410
|
+
mastraProxy = chunk7JRVDC7F_cjs.createMastraProxy({
|
|
411
411
|
mastra: this.#mastra,
|
|
412
412
|
logger
|
|
413
413
|
});
|
|
@@ -427,7 +427,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
427
427
|
agentName: this.name,
|
|
428
428
|
runtimeContext
|
|
429
429
|
};
|
|
430
|
-
memo[k] =
|
|
430
|
+
memo[k] = chunk7JRVDC7F_cjs.makeCoreTool(tool, options);
|
|
431
431
|
}
|
|
432
432
|
return memo;
|
|
433
433
|
}, {});
|
|
@@ -492,7 +492,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
492
492
|
agentName: this.name,
|
|
493
493
|
runtimeContext
|
|
494
494
|
};
|
|
495
|
-
const convertedToCoreTool =
|
|
495
|
+
const convertedToCoreTool = chunk7JRVDC7F_cjs.makeCoreTool(toolObj, options, "toolset");
|
|
496
496
|
toolsFromToolsetsConverted[toolName] = convertedToCoreTool;
|
|
497
497
|
});
|
|
498
498
|
});
|
|
@@ -518,7 +518,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
518
518
|
agentName: this.name,
|
|
519
519
|
runtimeContext
|
|
520
520
|
};
|
|
521
|
-
const convertedToCoreTool =
|
|
521
|
+
const convertedToCoreTool = chunk7JRVDC7F_cjs.makeCoreTool(rest, options, "client-tool");
|
|
522
522
|
toolsFromToolsetsConverted[toolName] = convertedToCoreTool;
|
|
523
523
|
});
|
|
524
524
|
}
|
|
@@ -685,7 +685,7 @@ exports.Agent = class Agent extends (_a = chunkD63P5O4Q_cjs.MastraBase) {
|
|
|
685
685
|
const userMessage = this.getMostRecentUserMessage(messages);
|
|
686
686
|
const newMessages = userMessage ? [userMessage] : messages;
|
|
687
687
|
const now = Date.now();
|
|
688
|
-
const threadMessages = this.sanitizeResponseMessages(
|
|
688
|
+
const threadMessages = this.sanitizeResponseMessages(chunk7JRVDC7F_cjs.ensureAllMessagesAreCoreMessages(newMessages)).map((u, index) => {
|
|
689
689
|
return {
|
|
690
690
|
id: this.getMemory()?.generateId(),
|
|
691
691
|
createdAt: new Date(now + index),
|
|
@@ -1746,7 +1746,7 @@ var Machine = class extends EventEmitter__default.default {
|
|
|
1746
1746
|
const logger = this.logger;
|
|
1747
1747
|
let mastraProxy = void 0;
|
|
1748
1748
|
if (this.#mastra) {
|
|
1749
|
-
mastraProxy =
|
|
1749
|
+
mastraProxy = chunk7JRVDC7F_cjs.createMastraProxy({
|
|
1750
1750
|
mastra: this.#mastra,
|
|
1751
1751
|
logger
|
|
1752
1752
|
});
|
|
@@ -3849,14 +3849,15 @@ var Workflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
3849
3849
|
}
|
|
3850
3850
|
}
|
|
3851
3851
|
async getWorkflowRuns() {
|
|
3852
|
-
|
|
3852
|
+
const storage = this.#mastra?.getStorage();
|
|
3853
|
+
if (!storage) {
|
|
3853
3854
|
this.logger.debug("Cannot get workflow runs. Mastra engine is not initialized");
|
|
3854
3855
|
return {
|
|
3855
3856
|
runs: [],
|
|
3856
3857
|
total: 0
|
|
3857
3858
|
};
|
|
3858
3859
|
}
|
|
3859
|
-
return
|
|
3860
|
+
return storage.getWorkflowRuns({
|
|
3860
3861
|
workflowName: this.name
|
|
3861
3862
|
});
|
|
3862
3863
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-
|
|
1
|
+
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-SEOWDGC2.js';
|
|
2
2
|
import { MastraBase } from './chunk-CLJQYXNM.js';
|
|
3
3
|
|
|
4
4
|
// src/storage/base.ts
|
|
@@ -32,7 +32,7 @@ function createTool(opts) {
|
|
|
32
32
|
}
|
|
33
33
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
34
|
function jsonSchemaPropertiesToTSTypes(value) {
|
|
35
|
-
if (!value
|
|
35
|
+
if (!value?.type) {
|
|
36
36
|
return zod.z.object({});
|
|
37
37
|
}
|
|
38
38
|
if (Array.isArray(value.type)) {
|
|
@@ -61,6 +61,9 @@ Examples: ${value.examples.join(", ")}` : ""));
|
|
|
61
61
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
62
62
|
break;
|
|
63
63
|
case "array":
|
|
64
|
+
if (!value.items || !value.items?.type) {
|
|
65
|
+
value.items = value.items ? { ...value.items, type: "string" } : { type: "string" };
|
|
66
|
+
}
|
|
64
67
|
zodType = zod.z.array(jsonSchemaPropertiesToTSTypes(value.items)).describe((value.description || "") + (value.examples ? `
|
|
65
68
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
66
69
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4BMHVLSO_cjs = require('./chunk-4BMHVLSO.cjs');
|
|
4
4
|
var cohereAi = require('cohere-ai');
|
|
5
5
|
|
|
6
6
|
var CohereRelevanceScorer = class {
|
|
@@ -38,7 +38,7 @@ Relevance score (0-1):`;
|
|
|
38
38
|
var MastraAgentRelevanceScorer = class {
|
|
39
39
|
agent;
|
|
40
40
|
constructor(name, model) {
|
|
41
|
-
this.agent = new
|
|
41
|
+
this.agent = new chunk4BMHVLSO_cjs.Agent({
|
|
42
42
|
name: `Relevance Scorer ${name}`,
|
|
43
43
|
instructions: `You are a specialized agent for evaluating the relevance of text to queries.
|
|
44
44
|
Your task is to rate how well a text passage answers a given query.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LibSQLVector } from './chunk-DGL5RCEO.js';
|
|
2
|
-
import { DefaultProxyStorage, augmentWithInit } from './chunk-
|
|
3
|
-
import { deepMerge } from './chunk-
|
|
2
|
+
import { DefaultProxyStorage, augmentWithInit } from './chunk-7ZR64JAJ.js';
|
|
3
|
+
import { deepMerge } from './chunk-JSUPD5IG.js';
|
|
4
4
|
import { MastraBase } from './chunk-CLJQYXNM.js';
|
|
5
5
|
import { existsSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMastraProxy, makeCoreTool, delay } from './chunk-
|
|
1
|
+
import { createMastraProxy, makeCoreTool, delay } from './chunk-JSUPD5IG.js';
|
|
2
2
|
import { MastraBase } from './chunk-CLJQYXNM.js';
|
|
3
3
|
import { RegisteredLogger } from './chunk-2BVZNKLX.js';
|
|
4
4
|
import { jsonSchema, generateText, Output, generateObject, streamText, streamObject } from 'ai';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7JRVDC7F_cjs = require('./chunk-7JRVDC7F.cjs');
|
|
4
4
|
var chunkD63P5O4Q_cjs = require('./chunk-D63P5O4Q.cjs');
|
|
5
5
|
var chunkO7IW545H_cjs = require('./chunk-O7IW545H.cjs');
|
|
6
6
|
var ai = require('ai');
|
|
@@ -129,7 +129,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
129
129
|
let mastraProxy = void 0;
|
|
130
130
|
const logger = this.logger;
|
|
131
131
|
if (this.#mastra) {
|
|
132
|
-
mastraProxy =
|
|
132
|
+
mastraProxy = chunk7JRVDC7F_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
133
133
|
}
|
|
134
134
|
const converted = Object.entries(tools || {}).reduce(
|
|
135
135
|
(memo, value) => {
|
|
@@ -146,7 +146,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
146
146
|
mastra: mastraProxy,
|
|
147
147
|
runtimeContext
|
|
148
148
|
};
|
|
149
|
-
memo[k] =
|
|
149
|
+
memo[k] = chunk7JRVDC7F_cjs.makeCoreTool(tool, options);
|
|
150
150
|
}
|
|
151
151
|
return memo;
|
|
152
152
|
},
|
|
@@ -202,7 +202,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
202
202
|
});
|
|
203
203
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
204
204
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
205
|
-
await
|
|
205
|
+
await chunk7JRVDC7F_cjs.delay(10 * 1e3);
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
...rest
|
|
@@ -273,7 +273,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
273
273
|
});
|
|
274
274
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
275
275
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
276
|
-
await
|
|
276
|
+
await chunk7JRVDC7F_cjs.delay(10 * 1e3);
|
|
277
277
|
}
|
|
278
278
|
},
|
|
279
279
|
...rest
|
|
@@ -348,7 +348,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
348
348
|
});
|
|
349
349
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
350
350
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
351
|
-
await
|
|
351
|
+
await chunk7JRVDC7F_cjs.delay(10 * 1e3);
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
354
|
onFinish: async (props) => {
|
|
@@ -440,7 +440,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
440
440
|
});
|
|
441
441
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
442
442
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
443
|
-
await
|
|
443
|
+
await chunk7JRVDC7F_cjs.delay(10 * 1e3);
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
446
|
onFinish: async (props) => {
|
|
@@ -26,7 +26,7 @@ function createTool(opts) {
|
|
|
26
26
|
}
|
|
27
27
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
28
28
|
function jsonSchemaPropertiesToTSTypes(value) {
|
|
29
|
-
if (!value
|
|
29
|
+
if (!value?.type) {
|
|
30
30
|
return z.object({});
|
|
31
31
|
}
|
|
32
32
|
if (Array.isArray(value.type)) {
|
|
@@ -55,6 +55,9 @@ Examples: ${value.examples.join(", ")}` : ""));
|
|
|
55
55
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
56
56
|
break;
|
|
57
57
|
case "array":
|
|
58
|
+
if (!value.items || !value.items?.type) {
|
|
59
|
+
value.items = value.items ? { ...value.items, type: "string" } : { type: "string" };
|
|
60
|
+
}
|
|
58
61
|
zodType = z.array(jsonSchemaPropertiesToTSTypes(value.items)).describe((value.description || "") + (value.examples ? `
|
|
59
62
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
60
63
|
break;
|