@polka-codes/core 0.9.38 → 0.9.40

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.
@@ -71,23 +71,6 @@ export { AgentBaseConfig }
71
71
  export { AgentBaseConfig as AgentBaseConfig_alias_1 }
72
72
  export { AgentBaseConfig as AgentBaseConfig_alias_2 }
73
73
 
74
- declare type AgentContextParameters = {
75
- toolFormat?: ToolFormat;
76
- os?: string;
77
- policies?: AgentPolicy[];
78
- modelParameters?: Record<string, any>;
79
- scripts?: Record<string, string | {
80
- command: string;
81
- description: string;
82
- }>;
83
- retryCount?: number;
84
- requestTimeoutSeconds?: number;
85
- usageMeter?: UsageMeter;
86
- };
87
- export { AgentContextParameters }
88
- export { AgentContextParameters as AgentContextParameters_alias_1 }
89
- export { AgentContextParameters as AgentContextParameters_alias_2 }
90
-
91
74
  declare type AgentInfo = {
92
75
  name: string;
93
76
  responsibilities: string[];
@@ -122,23 +105,6 @@ export { agentsPrompt }
122
105
  export { agentsPrompt as agentsPrompt_alias_1 }
123
106
  export { agentsPrompt as agentsPrompt_alias_2 }
124
107
 
125
- declare type AgentStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> = BaseStepSpec<TInput, TOutput> & {
126
- type: 'agent';
127
- messages: (UserContent_2 | TemplatedString<TInput>)[];
128
- outputSchema?: z.ZodType<TOutput>;
129
- parseOutput?: (raw: string) => ParseOutputResult<TOutput>;
130
- provider?: string;
131
- model?: string;
132
- modelParameters?: Record<string, any>;
133
- toolFormat?: ToolFormat;
134
- agent?: AgentNameType;
135
- tools?: FullToolInfoV2[];
136
- systemPrompt?: string | TemplatedString<TInput>;
137
- };
138
- export { AgentStepSpec }
139
- export { AgentStepSpec as AgentStepSpec_alias_1 }
140
- export { AgentStepSpec as AgentStepSpec_alias_2 }
141
-
142
108
  declare type AiToolDefinition<Input, Output = string> = {
143
109
  name: string;
144
110
  description: string;
@@ -225,42 +191,6 @@ export declare const basePrompt = "You are a highly skilled software engineer sp
225
191
 
226
192
  export declare const basePrompt_alias_1 = "You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.";
227
193
 
228
- declare type BaseStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> = {
229
- id: string;
230
- type: string;
231
- inputSchema?: z.ZodType<TInput>;
232
- outputSchema?: z.ZodType<TOutput>;
233
- };
234
- export { BaseStepSpec }
235
- export { BaseStepSpec as BaseStepSpec_alias_1 }
236
- export { BaseStepSpec as BaseStepSpec_alias_2 }
237
-
238
- declare interface BranchStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> extends BaseStepSpec<TInput, TOutput> {
239
- type: 'branch';
240
- branches: {
241
- id: string;
242
- when: (input: TInput & {
243
- $: Record<string, Record<string, Json>>;
244
- }, context: WorkflowContext) => boolean | Promise<boolean>;
245
- step: BaseStepSpec<TInput, TOutput>;
246
- }[];
247
- otherwise?: BaseStepSpec<TInput, TOutput>;
248
- }
249
- export { BranchStepSpec }
250
- export { BranchStepSpec as BranchStepSpec_alias_1 }
251
- export { BranchStepSpec as BranchStepSpec_alias_2 }
252
-
253
- declare const branchStepSpecHandler: StepSpecHandler;
254
- export { branchStepSpecHandler }
255
- export { branchStepSpecHandler as branchStepSpecHandler_alias_1 }
256
- export { branchStepSpecHandler as branchStepSpecHandler_alias_2 }
257
- export { branchStepSpecHandler as branchStepSpecHandler_alias_3 }
258
-
259
- declare const builder: <TInput extends Record<string, Json>>() => StepsBuilder<TInput, TInput>;
260
- export { builder }
261
- export { builder as builder_alias_1 }
262
- export { builder as builder_alias_2 }
263
-
264
194
  declare const capabilities: (_toolNamePrefix: string) => string;
265
195
  export { capabilities }
266
196
  export { capabilities as capabilities_alias_1 }
@@ -322,22 +252,6 @@ export { CoderAgentOptions }
322
252
  export { CoderAgentOptions as CoderAgentOptions_alias_1 }
323
253
  export { CoderAgentOptions as CoderAgentOptions_alias_2 }
324
254
 
325
- declare const combineHandlers: <THandlers extends StepSpecHandler[]>(...handlers: THandlers) => (step: BaseStepSpec, rootHandler: StepSpecHandlerFn<any, any>) => StepSpecRaw;
326
- export { combineHandlers }
327
- export { combineHandlers as combineHandlers_alias_1 }
328
- export { combineHandlers as combineHandlers_alias_2 }
329
-
330
- declare const command: (id: string, ...command: (string | TemplatedString)[]) => CommandStepSpec;
331
- export { command }
332
- export { command as command_alias_1 }
333
- export { command as command_alias_2 }
334
-
335
- declare type CommandOutput = {
336
- stdout?: string;
337
- stderr?: string;
338
- exitCode?: number;
339
- };
340
-
341
255
  declare type CommandProvider = {
342
256
  executeCommand?: (command: string, needApprove: boolean) => Promise<{
343
257
  stdout: string;
@@ -350,21 +264,6 @@ export { CommandProvider }
350
264
  export { CommandProvider as CommandProvider_alias_1 }
351
265
  export { CommandProvider as CommandProvider_alias_2 }
352
266
 
353
- declare interface CommandStepSpec extends BaseStepSpec<Record<string, string>, CommandOutput> {
354
- type: 'command';
355
- command: (string | TemplatedString)[];
356
- outputs?: ('stdout' | 'stderr' | 'exitCode')[];
357
- }
358
- export { CommandStepSpec }
359
- export { CommandStepSpec as CommandStepSpec_alias_1 }
360
- export { CommandStepSpec as CommandStepSpec_alias_2 }
361
-
362
- declare const commandStepSpecHandler: StepSpecHandler;
363
- export { commandStepSpecHandler }
364
- export { commandStepSpecHandler as commandStepSpecHandler_alias_1 }
365
- export { commandStepSpecHandler as commandStepSpecHandler_alias_2 }
366
- export { commandStepSpecHandler as commandStepSpecHandler_alias_3 }
367
-
368
267
  /**
369
268
  * Utility to compute exponential backoff delays for rate-limit handling. generated by polka.codes
370
269
  *
@@ -467,22 +366,6 @@ export { customScripts }
467
366
  export { customScripts as customScripts_alias_1 }
468
367
  export { customScripts as customScripts_alias_2 }
469
368
 
470
- declare interface CustomStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> extends BaseStepSpec<TInput, TOutput> {
471
- type: 'custom';
472
- run: (input: TInput & {
473
- $: Record<string, Record<string, Json>>;
474
- }, context: WorkflowContext, resumedState?: any) => Promise<StepRunResult<TOutput>>;
475
- }
476
- export { CustomStepSpec }
477
- export { CustomStepSpec as CustomStepSpec_alias_1 }
478
- export { CustomStepSpec as CustomStepSpec_alias_2 }
479
-
480
- declare const customStepSpecHandler: StepSpecHandler;
481
- export { customStepSpecHandler }
482
- export { customStepSpecHandler as customStepSpecHandler_alias_1 }
483
- export { customStepSpecHandler as customStepSpecHandler_alias_2 }
484
- export { customStepSpecHandler as customStepSpecHandler_alias_3 }
485
-
486
369
  declare const _default: {
487
370
  handler: ToolHandler<{
488
371
  readonly name: "ask_followup_question";
@@ -506,7 +389,7 @@ declare const _default: {
506
389
  };
507
390
  export { _default as askFollowupQuestion }
508
391
  export { _default as askFollowupQuestion_alias_1 }
509
- export { _default as default_alias_2 }
392
+ export { _default as default_alias_1 }
510
393
 
511
394
  declare const _default_10: {
512
395
  handler: ToolHandler<{
@@ -523,7 +406,7 @@ declare const _default_10: {
523
406
  path: z.ZodString;
524
407
  }, z.core.$strip>;
525
408
  };
526
- export { _default_10 as default_alias_11 }
409
+ export { _default_10 as default_alias_10 }
527
410
  export { _default_10 as removeFile }
528
411
  export { _default_10 as removeFile_alias_1 }
529
412
 
@@ -544,7 +427,7 @@ declare const _default_11: {
544
427
  target_path: z.ZodString;
545
428
  }, z.core.$strip>;
546
429
  };
547
- export { _default_11 as default_alias_12 }
430
+ export { _default_11 as default_alias_11 }
548
431
  export { _default_11 as renameFile }
549
432
  export { _default_11 as renameFile_alias_1 }
550
433
 
@@ -565,7 +448,7 @@ declare const _default_12: {
565
448
  diff: z.ZodString;
566
449
  }, z.core.$strip>;
567
450
  };
568
- export { _default_12 as default_alias_13 }
451
+ export { _default_12 as default_alias_12 }
569
452
  export { _default_12 as replaceInFile }
570
453
  export { _default_12 as replaceInFile_alias_1 }
571
454
 
@@ -588,7 +471,7 @@ declare const _default_13: {
588
471
  filePattern: z.ZodOptional<z.ZodString>;
589
472
  }, z.core.$strip>;
590
473
  };
591
- export { _default_13 as default_alias_14 }
474
+ export { _default_13 as default_alias_13 }
592
475
  export { _default_13 as searchFiles }
593
476
  export { _default_13 as searchFiles_alias_1 }
594
477
 
@@ -609,7 +492,7 @@ declare const _default_14: {
609
492
  content: z.ZodString;
610
493
  }, z.core.$strip>;
611
494
  };
612
- export { _default_14 as default_alias_15 }
495
+ export { _default_14 as default_alias_14 }
613
496
  export { _default_14 as writeToFile }
614
497
  export { _default_14 as writeToFile_alias_1 }
615
498
 
@@ -630,7 +513,7 @@ declare const _default_2: {
630
513
  };
631
514
  export { _default_2 as attemptCompletion }
632
515
  export { _default_2 as attemptCompletion_alias_1 }
633
- export { _default_2 as default_alias_3 }
516
+ export { _default_2 as default_alias_2 }
634
517
 
635
518
  declare const _default_3: {
636
519
  handler: ToolHandler<{
@@ -653,7 +536,7 @@ declare const _default_3: {
653
536
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
654
537
  }, z.core.$strip>;
655
538
  };
656
- export { _default_3 as default_alias_4 }
539
+ export { _default_3 as default_alias_3 }
657
540
  export { _default_3 as delegate }
658
541
  export { _default_3 as delegate_alias_1 }
659
542
 
@@ -674,7 +557,7 @@ declare const _default_4: {
674
557
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
675
558
  }, z.core.$strip>;
676
559
  };
677
- export { _default_4 as default_alias_5 }
560
+ export { _default_4 as default_alias_4 }
678
561
  export { _default_4 as executeCommand }
679
562
  export { _default_4 as executeCommand_alias_1 }
680
563
 
@@ -693,7 +576,7 @@ declare const _default_5: {
693
576
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
694
577
  }, z.core.$strip>;
695
578
  };
696
- export { _default_5 as default_alias_6 }
579
+ export { _default_5 as default_alias_5 }
697
580
  export { _default_5 as fetchUrl }
698
581
  export { _default_5 as fetchUrl_alias_1 }
699
582
 
@@ -718,7 +601,7 @@ declare const _default_6: {
718
601
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
719
602
  }, z.core.$strip>;
720
603
  };
721
- export { _default_6 as default_alias_7 }
604
+ export { _default_6 as default_alias_6 }
722
605
  export { _default_6 as handOver }
723
606
  export { _default_6 as handOver_alias_1 }
724
607
 
@@ -743,7 +626,7 @@ declare const _default_7: {
743
626
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
744
627
  }, z.core.$strip>;
745
628
  };
746
- export { _default_7 as default_alias_8 }
629
+ export { _default_7 as default_alias_7 }
747
630
  export { _default_7 as listFiles }
748
631
  export { _default_7 as listFiles_alias_1 }
749
632
 
@@ -762,7 +645,7 @@ declare const _default_8: {
762
645
  url: z.ZodString;
763
646
  }, z.core.$strip>;
764
647
  };
765
- export { _default_8 as default_alias_9 }
648
+ export { _default_8 as default_alias_8 }
766
649
  export { _default_8 as readBinaryFile }
767
650
  export { _default_8 as readBinaryFile_alias_1 }
768
651
 
@@ -783,7 +666,7 @@ declare const _default_9: {
783
666
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
784
667
  }, z.core.$strip>;
785
668
  };
786
- export { _default_9 as default_alias_10 }
669
+ export { _default_9 as default_alias_9 }
787
670
  export { _default_9 as readFile }
788
671
  export { _default_9 as readFile_alias_1 }
789
672
 
@@ -800,19 +683,6 @@ export declare const default_alias: {
800
683
  readonly agent: "architect";
801
684
  };
802
685
 
803
- /**
804
- * AI tool for analyzing project files and generating polkacodes config sections.
805
- * Generated by polka.codes
806
- */
807
- export declare const default_alias_1: {
808
- readonly name: "generateProjectConfig";
809
- readonly description: "Analyzes project files to generate polkacodes config sections";
810
- readonly prompt: "\nRole: Analyzer agent\nGoal: Produce a valid polkacodes YAML configuration for the project.\n\nWorkflow\n1. Scan project files with tool_read_file and identify:\n - Package/build tool (npm, bun, pnpm, etc.)\n - Test framework and patterns (snapshot tests, coverage, etc.)\n - Formatter / linter and their rules\n - Folder structure and naming conventions\n - CI / development workflows\n\n2. Build a YAML config with three root keys:\n\n```yaml\nscripts: # derive from package.json and CI\n format: # code formatter\n command: \"<formatter cmd>\"\n description: \"Format code\"\n check: # linter / type checker\n command: \"<linter cmd>\"\n description: \"Static checks\"\n test: # test runner\n command: \"<test cmd>\"\n description: \"Run tests\"\n # add any other meaningful project scripts\n\nrules: # bullet list of key conventions/tools\n\nexcludeFiles: # only files likely to hold secrets\n - \".env\"\n - \".env.*\"\n - \".npmrc\"\n # do NOT list build artifacts, lockfiles, or paths already in .gitignore\n```\n\n3. Return the YAML exactly once, wrapped like:\n\n<tool_attempt_completion>\n<tool_parameter_result>\n# YAML (2-space indents, double-quoted commands)\n</tool_parameter_result>\n</tool_attempt_completion>\n";
811
- readonly formatInput: () => string;
812
- readonly parseOutput: (output: string) => string;
813
- readonly agent: "analyzer";
814
- };
815
-
816
686
  /**
817
687
  * Returns the directory portion of a path string.
818
688
  * Strips trailing slashes, then takes everything up to the last slash.
@@ -911,10 +781,6 @@ declare type FullToolInfoV2 = ToolInfoV2 & {
911
781
  export { FullToolInfoV2 }
912
782
  export { FullToolInfoV2 as FullToolInfoV2_alias_1 }
913
783
 
914
- declare const generateProjectConfig: (agent: MultiAgent, params: unknown) => Promise<string>;
915
- export { generateProjectConfig }
916
- export { generateProjectConfig as generateProjectConfig_alias_1 }
917
-
918
784
  export declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
919
785
 
920
786
  /**
@@ -978,11 +844,6 @@ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, Files
978
844
 
979
845
  export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
980
846
 
981
- declare type InputType = {
982
- $: Record<string, Record<string, Json>>;
983
- [key: string]: Json;
984
- };
985
-
986
847
  declare type InteractionProvider = {
987
848
  askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
988
849
  attemptCompletion?: (result: string) => Promise<string | undefined>;
@@ -1024,68 +885,6 @@ export declare const isAvailable_alias_9: (provider: FilesystemProvider) => bool
1024
885
  */
1025
886
  export declare function join(...parts: string[]): string;
1026
887
 
1027
- declare type Json = boolean | number | string | Json[] | {
1028
- [k: string]: Json;
1029
- };
1030
- export { Json }
1031
- export { Json as Json_alias_1 }
1032
- export { Json as Json_alias_2 }
1033
-
1034
- declare interface LoopAccumulatorSpec<TInput extends Record<string, Json>, TIterationOutput extends Record<string, Json>, TAccumulator extends Record<string, Json>> {
1035
- initial: TAccumulator | (() => TAccumulator);
1036
- update: (state: LoopStepState<TInput, TIterationOutput, TAccumulator> & {
1037
- result: TIterationOutput;
1038
- }, context: WorkflowContext) => TAccumulator | Promise<TAccumulator>;
1039
- }
1040
- export { LoopAccumulatorSpec }
1041
- export { LoopAccumulatorSpec as LoopAccumulatorSpec_alias_1 }
1042
- export { LoopAccumulatorSpec as LoopAccumulatorSpec_alias_2 }
1043
-
1044
- declare type LoopStepOutput<TIterationOutput extends Record<string, Json> = Record<string, Json>, TAccumulator extends Record<string, Json> = Record<string, Json>> = {
1045
- results: TIterationOutput[];
1046
- last?: TIterationOutput;
1047
- accumulator?: TAccumulator;
1048
- };
1049
- export { LoopStepOutput }
1050
- export { LoopStepOutput as LoopStepOutput_alias_1 }
1051
- export { LoopStepOutput as LoopStepOutput_alias_2 }
1052
-
1053
- declare interface LoopStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TIterationInput extends Record<string, Json> = TInput, TIterationOutput extends Record<string, Json> = Record<string, Json>, TAccumulator extends Record<string, Json> = Record<string, Json>> extends BaseStepSpec<TInput, LoopStepOutput<TIterationOutput, TAccumulator>> {
1054
- type: 'loop';
1055
- step: BaseStepSpec<TIterationInput, TIterationOutput>;
1056
- while?: (state: LoopStepState<TInput, TIterationOutput, TAccumulator>, context: WorkflowContext) => boolean | Promise<boolean>;
1057
- until?: (state: LoopStepState<TInput, TIterationOutput, TAccumulator>, context: WorkflowContext) => boolean | Promise<boolean>;
1058
- maxIterations?: number;
1059
- mapInput?: (state: LoopStepState<TInput, TIterationOutput, TAccumulator>, context: WorkflowContext) => TIterationInput | Promise<TIterationInput>;
1060
- accumulator?: LoopAccumulatorSpec<TInput, TIterationOutput, TAccumulator>;
1061
- }
1062
- export { LoopStepSpec }
1063
- export { LoopStepSpec as LoopStepSpec_alias_1 }
1064
- export { LoopStepSpec as LoopStepSpec_alias_2 }
1065
-
1066
- declare const loopStepSpecHandler: StepSpecHandler;
1067
- export { loopStepSpecHandler }
1068
- export { loopStepSpecHandler as loopStepSpecHandler_alias_1 }
1069
- export { loopStepSpecHandler as loopStepSpecHandler_alias_2 }
1070
- export { loopStepSpecHandler as loopStepSpecHandler_alias_3 }
1071
-
1072
- declare type LoopStepState<TInput extends Record<string, Json> = Record<string, Json>, TIterationOutput extends Record<string, Json> = Record<string, Json>, TAccumulator extends Record<string, Json> = Record<string, Json>> = {
1073
- iteration: number;
1074
- input: TInput;
1075
- results: TIterationOutput[];
1076
- last?: TIterationOutput;
1077
- accumulator?: TAccumulator;
1078
- };
1079
- export { LoopStepState }
1080
- export { LoopStepState as LoopStepState_alias_1 }
1081
- export { LoopStepState as LoopStepState_alias_2 }
1082
-
1083
- declare const makeAgentStepSpecHandler: (getModelFn: (step: AgentStepSpec, context: WorkflowContext) => Promise<LanguageModelV2>) => StepSpecHandler;
1084
- export { makeAgentStepSpecHandler }
1085
- export { makeAgentStepSpecHandler as makeAgentStepSpecHandler_alias_1 }
1086
- export { makeAgentStepSpecHandler as makeAgentStepSpecHandler_alias_2 }
1087
- export { makeAgentStepSpecHandler as makeAgentStepSpecHandler_alias_3 }
1088
-
1089
888
  declare const makeAgentTool: <T extends AiToolDefinitionWithAgent<any, any>>(definition: T) => (options: SharedAgentOptions, params: GetInput<T>) => Promise<GetOutput<T>>;
1090
889
  export { makeAgentTool }
1091
890
  export { makeAgentTool as makeAgentTool_alias_1 }
@@ -1154,20 +953,6 @@ export { MultiAgentConfig as MultiAgentConfig_alias_2 }
1154
953
 
1155
954
  export declare const objectives: (toolNamePrefix: string) => string;
1156
955
 
1157
- declare interface ParallelStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> extends BaseStepSpec<Record<string, Json>, Record<string, Json>> {
1158
- type: 'parallel';
1159
- step: BaseStepSpec<TInput, TOutput>;
1160
- }
1161
- export { ParallelStepSpec }
1162
- export { ParallelStepSpec as ParallelStepSpec_alias_1 }
1163
- export { ParallelStepSpec as ParallelStepSpec_alias_2 }
1164
-
1165
- declare const parallelStepSpecHandler: StepSpecHandler;
1166
- export { parallelStepSpecHandler }
1167
- export { parallelStepSpecHandler as parallelStepSpecHandler_alias_1 }
1168
- export { parallelStepSpecHandler as parallelStepSpecHandler_alias_2 }
1169
- export { parallelStepSpecHandler as parallelStepSpecHandler_alias_3 }
1170
-
1171
956
  /**
1172
957
  * Parse an assistant's message into an array of text content and tool use content.
1173
958
  *
@@ -1271,12 +1056,6 @@ declare type ReplaceResult = {
1271
1056
  export { ReplaceResult }
1272
1057
  export { ReplaceResult as ReplaceResult_alias_1 }
1273
1058
 
1274
- export declare const resolveTemplatedString: (templatedString: string | TemplatedString<{
1275
- [k: string]: Json;
1276
- }>, input: {
1277
- [k: string]: Json;
1278
- }) => string;
1279
-
1280
1059
  declare const responsePrompts: {
1281
1060
  readonly errorInvokeTool: (tool: string, error: unknown) => string;
1282
1061
  readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
@@ -1288,36 +1067,10 @@ export { responsePrompts }
1288
1067
  export { responsePrompts as responsePrompts_alias_1 }
1289
1068
  export { responsePrompts as responsePrompts_alias_2 }
1290
1069
 
1291
- declare const resume: <TInput extends Record<string, Json>, TOutput extends Record<string, Json>>(workflow: WorkflowSpec<TInput, TOutput>, context: WorkflowContext, handler: StepSpecHandlerFn<any, any>, state: any, input: TInput) => Promise<WorkflowRunResult<TOutput>>;
1292
- export { resume }
1293
- export { resume as resume_alias_1 }
1294
- export { resume as resume_alias_2 }
1295
-
1296
1070
  export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before Retrying\n - Analyze previous attempt's failure\n - Consider alternative approaches\n - Check if similar issues were fixed\n - Verify no new issues were introduced\n\n2. When to Retry\n - Error message changed but issue persists\n - New information available about the root cause\n - Different fixing strategy available\n - Previous attempt partially successful\n\n3. When to Stop\n - Maximum retry limit reached\n - Same error occurs repeatedly\n - Fix would require major refactoring\n - Issue requires human intervention\n\n4. After Maximum Retries\n - Document attempted solutions\n - Explain why the issue remains\n - Suggest manual intervention steps\n - Report any partial improvements";
1297
1071
 
1298
1072
  export declare const rules: (toolNamePrefix: string) => string;
1299
1073
 
1300
- declare const run: <TInput extends Record<string, Json>, TOutput extends Record<string, Json>>(workflow: WorkflowSpec<TInput, TOutput>, context: WorkflowContext, handler: StepSpecHandlerFn<any, any>, input: TInput) => Promise<WorkflowRunResult<TOutput>>;
1301
- export { run }
1302
- export { run as run_alias_1 }
1303
- export { run as run_alias_2 }
1304
-
1305
- export declare const runStep: (step: StepSpecRaw, input: Record<string, Json>, context: WorkflowContext, resumedState: any | undefined, allOutputs: Record<string, Record<string, Json>>) => Promise<StepRunResult<Record<string, Json>>>;
1306
-
1307
- declare interface SequentialStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>, TStepSpec extends BaseStepSpec = BaseStepSpec> extends BaseStepSpec<TInput, TOutput> {
1308
- type: 'sequential';
1309
- steps: TStepSpec[];
1310
- }
1311
- export { SequentialStepSpec }
1312
- export { SequentialStepSpec as SequentialStepSpec_alias_1 }
1313
- export { SequentialStepSpec as SequentialStepSpec_alias_2 }
1314
-
1315
- declare const sequentialStepSpecHandler: StepSpecHandler;
1316
- export { sequentialStepSpecHandler }
1317
- export { sequentialStepSpecHandler as sequentialStepSpecHandler_alias_1 }
1318
- export { sequentialStepSpecHandler as sequentialStepSpecHandler_alias_2 }
1319
- export { sequentialStepSpecHandler as sequentialStepSpecHandler_alias_3 }
1320
-
1321
1074
  declare type SharedAgentOptions = {
1322
1075
  ai: LanguageModelV2;
1323
1076
  os: string;
@@ -1342,77 +1095,6 @@ export { SharedAgentOptions }
1342
1095
  export { SharedAgentOptions as SharedAgentOptions_alias_1 }
1343
1096
  export { SharedAgentOptions as SharedAgentOptions_alias_2 }
1344
1097
 
1345
- declare function step<TInput extends Record<string, Json>, TOutput extends Record<string, Json>>(id: string, run: CustomStepSpec<TInput, TOutput>['run']): CustomStepSpec<TInput, TOutput>;
1346
- export { step }
1347
- export { step as step_alias_1 }
1348
- export { step as step_alias_2 }
1349
-
1350
- declare type StepRunResult<T extends Record<string, Json>> = StepRunResultSuccess<T> | StepRunResultPaused | StepRunResultError;
1351
- export { StepRunResult }
1352
- export { StepRunResult as StepRunResult_alias_1 }
1353
- export { StepRunResult as StepRunResult_alias_2 }
1354
-
1355
- declare type StepRunResultError = {
1356
- type: 'error';
1357
- error: any;
1358
- };
1359
- export { StepRunResultError }
1360
- export { StepRunResultError as StepRunResultError_alias_1 }
1361
- export { StepRunResultError as StepRunResultError_alias_2 }
1362
-
1363
- declare type StepRunResultPaused = {
1364
- type: 'paused';
1365
- state: any;
1366
- };
1367
- export { StepRunResultPaused }
1368
- export { StepRunResultPaused as StepRunResultPaused_alias_1 }
1369
- export { StepRunResultPaused as StepRunResultPaused_alias_2 }
1370
-
1371
- declare type StepRunResultSuccess<T extends Record<string, Json>> = {
1372
- type: 'success';
1373
- output: T;
1374
- };
1375
- export { StepRunResultSuccess }
1376
- export { StepRunResultSuccess as StepRunResultSuccess_alias_1 }
1377
- export { StepRunResultSuccess as StepRunResultSuccess_alias_2 }
1378
-
1379
- declare class StepsBuilder<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> {
1380
- #private;
1381
- build(): BaseStepSpec<TInput, TOutput>;
1382
- step<TStepOutput extends Record<string, Json>, TStepSpec extends BaseStepSpec<TOutput, TStepOutput>>(step: TStepSpec): StepsBuilder<TInput, TStepOutput>;
1383
- parallel<TStepOutput extends Record<string, Json>>(id: string, step: BaseStepSpec<TOutput, TStepOutput>): StepsBuilder<TInput, TStepOutput>;
1384
- loop<TIterationInput extends Record<string, Json> = TOutput, TIterationOutput extends Record<string, Json> = Record<string, Json>, TAccumulator extends Record<string, Json> = Record<string, Json>>(id: string, config: Omit<LoopStepSpec<TOutput, TIterationInput, TIterationOutput, TAccumulator>, 'id' | 'type'>): StepsBuilder<TInput, LoopStepOutput<TIterationOutput, TAccumulator>>;
1385
- custom<TStepOutput extends Record<string, Json>>(spec: CustomStepSpec<TOutput, TStepOutput>): StepsBuilder<TInput, TStepOutput>;
1386
- custom<TStepOutput extends Record<string, Json>>(id: string, run: CustomStepSpec<TOutput, TStepOutput>['run']): StepsBuilder<TInput, TStepOutput>;
1387
- workflow<TWorkflowInput extends Record<string, Json> = TOutput, TWorkflowOutput extends Record<string, Json> = Record<string, Json>, TStepOutput extends Record<string, Json> = TWorkflowOutput>(id: string, config: Omit<WorkflowStepSpec<TOutput, TWorkflowInput, TWorkflowOutput, TStepOutput>, 'id' | 'type'>): StepsBuilder<TInput, TStepOutput>;
1388
- agent<TStepOutput extends Record<string, Json>>(id: string, spec: Omit<AgentStepSpec<TOutput, TStepOutput>, 'id' | 'type'>): StepsBuilder<TInput, TStepOutput>;
1389
- branch<TStepOutput extends Record<string, Json>>(id: string, config: Omit<BranchStepSpec<TOutput, TStepOutput>, 'id' | 'type'>): StepsBuilder<TInput, TStepOutput>;
1390
- }
1391
-
1392
- declare type StepSpecHandler = {
1393
- type: string;
1394
- handler: StepSpecHandlerFn<any, any>;
1395
- };
1396
- export { StepSpecHandler }
1397
- export { StepSpecHandler as StepSpecHandler_alias_1 }
1398
- export { StepSpecHandler as StepSpecHandler_alias_2 }
1399
-
1400
- declare type StepSpecHandlerFn<TStepSpec extends BaseStepSpec, TRootStepSpec extends BaseStepSpec> = (step: TStepSpec, rootHandler: StepSpecHandlerFn<TRootStepSpec, TRootStepSpec>) => StepSpecRaw;
1401
- export { StepSpecHandlerFn }
1402
- export { StepSpecHandlerFn as StepSpecHandlerFn_alias_1 }
1403
- export { StepSpecHandlerFn as StepSpecHandlerFn_alias_2 }
1404
-
1405
- declare type StepSpecRaw = {
1406
- id: string;
1407
- type: string;
1408
- inputSchema?: z.ZodType<any>;
1409
- outputSchema?: z.ZodType<any>;
1410
- run: (input: InputType, context: WorkflowContext, resumedState?: any) => Promise<StepRunResult<Record<string, Json>>>;
1411
- };
1412
- export { StepSpecRaw }
1413
- export { StepSpecRaw as StepSpecRaw_alias_1 }
1414
- export { StepSpecRaw as StepSpecRaw_alias_2 }
1415
-
1416
1098
  declare const systemInformation: (info: {
1417
1099
  os: string;
1418
1100
  }) => string;
@@ -1599,19 +1281,6 @@ export { TaskEventUsageExceeded }
1599
1281
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
1600
1282
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
1601
1283
 
1602
- declare type TemplatedString<T = {
1603
- [k: string]: Json;
1604
- }> = {
1605
- type: 'template';
1606
- template: string;
1607
- } | {
1608
- type: 'function';
1609
- fn: (input: T) => string;
1610
- };
1611
- export { TemplatedString }
1612
- export { TemplatedString as TemplatedString_alias_1 }
1613
- export { TemplatedString as TemplatedString_alias_2 }
1614
-
1615
1284
  declare interface TextContent {
1616
1285
  type: 'text';
1617
1286
  content: string;
@@ -2028,86 +1697,4 @@ export { WebProvider }
2028
1697
  export { WebProvider as WebProvider_alias_1 }
2029
1698
  export { WebProvider as WebProvider_alias_2 }
2030
1699
 
2031
- declare type WorkflowContext = {
2032
- provider: ToolProvider;
2033
- parameters: Record<string, any>;
2034
- verbose?: number;
2035
- agentCallback?: TaskEventCallback;
2036
- logger?: Console;
2037
- };
2038
- export { WorkflowContext }
2039
- export { WorkflowContext as WorkflowContext_alias_1 }
2040
- export { WorkflowContext as WorkflowContext_alias_2 }
2041
-
2042
- declare type WorkflowRunResult<T extends Record<string, Json>> = WorkflowRunResultSuccess<T> | WorkflowRunResultError | WorkflowRunResultPaused;
2043
- export { WorkflowRunResult }
2044
- export { WorkflowRunResult as WorkflowRunResult_alias_1 }
2045
- export { WorkflowRunResult as WorkflowRunResult_alias_2 }
2046
-
2047
- declare type WorkflowRunResultError = {
2048
- type: 'error';
2049
- error: any;
2050
- };
2051
- export { WorkflowRunResultError }
2052
- export { WorkflowRunResultError as WorkflowRunResultError_alias_1 }
2053
- export { WorkflowRunResultError as WorkflowRunResultError_alias_2 }
2054
-
2055
- declare type WorkflowRunResultPaused = {
2056
- type: 'paused';
2057
- state: any;
2058
- };
2059
- export { WorkflowRunResultPaused }
2060
- export { WorkflowRunResultPaused as WorkflowRunResultPaused_alias_1 }
2061
- export { WorkflowRunResultPaused as WorkflowRunResultPaused_alias_2 }
2062
-
2063
- declare type WorkflowRunResultSuccess<T extends Record<string, Json>> = {
2064
- type: 'success';
2065
- output: T;
2066
- };
2067
- export { WorkflowRunResultSuccess }
2068
- export { WorkflowRunResultSuccess as WorkflowRunResultSuccess_alias_1 }
2069
- export { WorkflowRunResultSuccess as WorkflowRunResultSuccess_alias_2 }
2070
-
2071
- declare interface WorkflowSpec<TInput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = Record<string, Json>> {
2072
- name: string;
2073
- description?: string;
2074
- step: BaseStepSpec<TInput, TOutput>;
2075
- }
2076
- export { WorkflowSpec }
2077
- export { WorkflowSpec as WorkflowSpec_alias_1 }
2078
- export { WorkflowSpec as WorkflowSpec_alias_2 }
2079
-
2080
- declare interface WorkflowSpecRaw {
2081
- name: string;
2082
- description?: string;
2083
- step: StepSpecRaw;
2084
- }
2085
- export { WorkflowSpecRaw }
2086
- export { WorkflowSpecRaw as WorkflowSpecRaw_alias_1 }
2087
- export { WorkflowSpecRaw as WorkflowSpecRaw_alias_2 }
2088
-
2089
- declare interface WorkflowStepSpec<TInput extends Record<string, Json> = Record<string, Json>, TWorkflowInput extends Record<string, Json> = TInput, TWorkflowOutput extends Record<string, Json> = Record<string, Json>, TOutput extends Record<string, Json> = TWorkflowOutput> extends BaseStepSpec<TInput, TOutput> {
2090
- type: 'workflow';
2091
- workflow: WorkflowSpec<TWorkflowInput, TWorkflowOutput>;
2092
- mapInput?: (input: TInput & {
2093
- $: Record<string, Record<string, Json>>;
2094
- }, context: WorkflowContext) => TWorkflowInput | Promise<TWorkflowInput>;
2095
- mapOutput?: (params: {
2096
- input: TInput & {
2097
- $: Record<string, Record<string, Json>>;
2098
- };
2099
- workflowInput: TWorkflowInput;
2100
- workflowOutput: TWorkflowOutput;
2101
- }, context: WorkflowContext) => TOutput | Promise<TOutput>;
2102
- }
2103
- export { WorkflowStepSpec }
2104
- export { WorkflowStepSpec as WorkflowStepSpec_alias_1 }
2105
- export { WorkflowStepSpec as WorkflowStepSpec_alias_2 }
2106
-
2107
- declare const workflowStepSpecHandler: StepSpecHandler;
2108
- export { workflowStepSpecHandler }
2109
- export { workflowStepSpecHandler as workflowStepSpecHandler_alias_1 }
2110
- export { workflowStepSpecHandler as workflowStepSpecHandler_alias_2 }
2111
- export { workflowStepSpecHandler as workflowStepSpecHandler_alias_3 }
2112
-
2113
1700
  export { }