sweagent 0.0.4 → 0.0.6
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/README.md +52 -109
- package/dist/index.cjs +294 -186
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +567 -119
- package/dist/index.d.ts +567 -119
- package/dist/index.js +294 -186
- package/dist/index.js.map +1 -1
- package/dist/stdio.js +226 -126
- package/dist/stdio.js.map +1 -1
- package/package.json +5 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import pino from 'pino';
|
|
3
|
-
import * as ai from 'ai';
|
|
4
|
-
import { LanguageModelUsage, ModelMessage, Tool, FinishReason } from 'ai';
|
|
5
|
-
export { FinishReason, LanguageModelUsage, ModelMessage, Tool, ToolExecutionOptions, jsonSchema, tool } from 'ai';
|
|
6
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
4
|
|
|
8
5
|
/**
|
|
@@ -74,9 +71,96 @@ declare function parseModelJsonResponse<T>(text: string, schema: z.ZodType<T>):
|
|
|
74
71
|
*/
|
|
75
72
|
declare function safeJsonParse(jsonStr: string, label?: string): unknown;
|
|
76
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Provider-agnostic types for messages, tools, and usage.
|
|
76
|
+
* Replaces imports from the Vercel AI SDK.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/** Token usage details (optional per-provider) */
|
|
80
|
+
interface TokenUsageDetails {
|
|
81
|
+
noCacheTokens?: number;
|
|
82
|
+
cacheReadTokens?: number;
|
|
83
|
+
cacheWriteTokens?: number;
|
|
84
|
+
textTokens?: number;
|
|
85
|
+
reasoningTokens?: number;
|
|
86
|
+
}
|
|
87
|
+
/** Token usage returned by model invocations */
|
|
88
|
+
interface LanguageModelUsage {
|
|
89
|
+
inputTokens?: number;
|
|
90
|
+
outputTokens?: number;
|
|
91
|
+
totalTokens?: number;
|
|
92
|
+
promptTokens?: number;
|
|
93
|
+
completionTokens?: number;
|
|
94
|
+
inputTokenDetails?: TokenUsageDetails;
|
|
95
|
+
outputTokenDetails?: TokenUsageDetails;
|
|
96
|
+
}
|
|
97
|
+
/** Why the model stopped generating */
|
|
98
|
+
type FinishReason = 'stop' | 'length' | 'tool-calls' | 'content-filter' | 'error' | 'other' | string;
|
|
99
|
+
/** Content part for multimodal messages */
|
|
100
|
+
type ContentPart = {
|
|
101
|
+
type: 'text';
|
|
102
|
+
text: string;
|
|
103
|
+
} | {
|
|
104
|
+
type: 'image';
|
|
105
|
+
image: string;
|
|
106
|
+
mimeType?: string;
|
|
107
|
+
} | {
|
|
108
|
+
type: 'tool-call';
|
|
109
|
+
toolCallId: string;
|
|
110
|
+
toolName: string;
|
|
111
|
+
input: unknown;
|
|
112
|
+
} | {
|
|
113
|
+
type: 'tool-result';
|
|
114
|
+
toolCallId: string;
|
|
115
|
+
toolName: string;
|
|
116
|
+
output: {
|
|
117
|
+
type: 'text';
|
|
118
|
+
value: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'error-text';
|
|
121
|
+
value: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
/** Single message in a conversation */
|
|
125
|
+
type ModelMessage = {
|
|
126
|
+
role: 'system';
|
|
127
|
+
content: string;
|
|
128
|
+
} | {
|
|
129
|
+
role: 'user';
|
|
130
|
+
content: string | ContentPart[];
|
|
131
|
+
} | {
|
|
132
|
+
role: 'assistant';
|
|
133
|
+
content: string | ContentPart[];
|
|
134
|
+
} | {
|
|
135
|
+
role: 'tool';
|
|
136
|
+
content: ContentPart[];
|
|
137
|
+
};
|
|
138
|
+
/** Options passed to tool execute function */
|
|
139
|
+
interface ToolExecutionOptions {
|
|
140
|
+
toolCallId?: string;
|
|
141
|
+
messages?: ModelMessage[];
|
|
142
|
+
abortSignal?: AbortSignal;
|
|
143
|
+
}
|
|
144
|
+
/** JSON Schema object for tool parameters */
|
|
145
|
+
type JsonSchemaObject = Record<string, unknown>;
|
|
146
|
+
/** Tool definition: description, schema, optional execute */
|
|
147
|
+
interface Tool<TInput = unknown, TOutput = unknown> {
|
|
148
|
+
description: string;
|
|
149
|
+
/** Zod schema or JSON schema for input; adapters convert to provider format */
|
|
150
|
+
parameters?: JsonSchemaObject;
|
|
151
|
+
inputSchema?: z.ZodType<TInput>;
|
|
152
|
+
execute?: (args: TInput, options?: ToolExecutionOptions) => Promise<TOutput>;
|
|
153
|
+
}
|
|
154
|
+
/** Create a tool from config (used by defineTool); inputSchema is Zod */
|
|
155
|
+
interface ToolConfigInput {
|
|
156
|
+
description: string;
|
|
157
|
+
inputSchema: z.ZodType;
|
|
158
|
+
execute?: (args: unknown, options?: ToolExecutionOptions) => Promise<unknown>;
|
|
159
|
+
}
|
|
160
|
+
|
|
77
161
|
/**
|
|
78
162
|
* Common types shared across modules
|
|
79
|
-
* Re-exports
|
|
163
|
+
* Re-exports message types; keeps sweagent-specific ImageInput and Logger
|
|
80
164
|
*/
|
|
81
165
|
|
|
82
166
|
/**
|
|
@@ -151,12 +235,11 @@ declare function sumTokenUsage(usages: (LanguageModelUsage | undefined)[]): Lang
|
|
|
151
235
|
|
|
152
236
|
/**
|
|
153
237
|
* Model-related types
|
|
154
|
-
* Uses
|
|
238
|
+
* Uses in-repo types for messages, tools, usage, and result shape
|
|
155
239
|
*/
|
|
156
240
|
|
|
157
241
|
/**
|
|
158
242
|
* Tool type for model invocation
|
|
159
|
-
* Uses the default Tool type which accepts any input/output schema
|
|
160
243
|
*/
|
|
161
244
|
type ModelTool = Tool;
|
|
162
245
|
/**
|
|
@@ -261,10 +344,25 @@ interface Model {
|
|
|
261
344
|
}
|
|
262
345
|
|
|
263
346
|
/**
|
|
264
|
-
* Tool-related types
|
|
265
|
-
*
|
|
347
|
+
* Tool-related types and helpers
|
|
348
|
+
* Exports Tool, tool(), jsonSchema, ToolExecutionOptions; keeps ToolConfig and ToolContext for defineTool
|
|
266
349
|
*/
|
|
267
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Create a tool from description, inputSchema (Zod), and optional execute.
|
|
353
|
+
* Used by defineTool; adapters use description + parameters (JSON Schema) for provider APIs.
|
|
354
|
+
*/
|
|
355
|
+
declare function tool<TInput = unknown, TOutput = unknown>(config: ToolConfigInput & {
|
|
356
|
+
inputSchema: z.ZodType<TInput>;
|
|
357
|
+
}): Tool<TInput, TOutput>;
|
|
358
|
+
/**
|
|
359
|
+
* Wrap a Zod schema for structured output (e.g. invokeObject).
|
|
360
|
+
* Returns an object adapters can use to request JSON matching the schema.
|
|
361
|
+
*/
|
|
362
|
+
declare function jsonSchema<T>(schema: z.ZodType<T>): {
|
|
363
|
+
schema: z.ZodType<T>;
|
|
364
|
+
jsonSchema: Record<string, unknown>;
|
|
365
|
+
};
|
|
268
366
|
/**
|
|
269
367
|
* Configuration for defining a tool (input to defineTool)
|
|
270
368
|
*/
|
|
@@ -309,6 +407,57 @@ interface ToolExecutionResult<T = unknown> {
|
|
|
309
407
|
error?: string;
|
|
310
408
|
}
|
|
311
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Types for the handleSteps generator pattern.
|
|
412
|
+
* Adapted from redxpilot's AgentDefinition.handleSteps.
|
|
413
|
+
*
|
|
414
|
+
* A generator that yields tool calls (executed programmatically),
|
|
415
|
+
* 'STEP' (one LLM call), 'STEP_ALL' (LLM until done),
|
|
416
|
+
* or GENERATE_N (multiple LLM responses for best-of-N).
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
/** Yield this to run the LLM for exactly one step. */
|
|
420
|
+
type StepOnce = 'STEP';
|
|
421
|
+
/** Yield this to run the LLM until it stops calling tools. */
|
|
422
|
+
type StepAll = 'STEP_ALL';
|
|
423
|
+
/** Yield this to request N parallel LLM responses (best-of-N). */
|
|
424
|
+
interface GenerateN {
|
|
425
|
+
type: 'GENERATE_N';
|
|
426
|
+
n: number;
|
|
427
|
+
}
|
|
428
|
+
/** Yield a tool call for programmatic (non-LLM) execution. */
|
|
429
|
+
interface ProgrammaticToolCall {
|
|
430
|
+
toolName: string;
|
|
431
|
+
input: unknown;
|
|
432
|
+
}
|
|
433
|
+
/** Everything a generator can yield. */
|
|
434
|
+
type HandleStepsYield = ProgrammaticToolCall | StepOnce | StepAll | GenerateN;
|
|
435
|
+
/** Data passed back into the generator after each yield. */
|
|
436
|
+
interface HandleStepsResume {
|
|
437
|
+
/** Current messages in the conversation */
|
|
438
|
+
messages: ModelMessage[];
|
|
439
|
+
/** Result of the last tool call (if the yield was a tool call) */
|
|
440
|
+
toolResult?: unknown;
|
|
441
|
+
/** Whether the LLM indicated it's done (for STEP_ALL) */
|
|
442
|
+
stepsComplete: boolean;
|
|
443
|
+
/** Responses from GENERATE_N */
|
|
444
|
+
nResponses?: string[];
|
|
445
|
+
/** Steps taken so far */
|
|
446
|
+
steps: AgentStep[];
|
|
447
|
+
}
|
|
448
|
+
/** Context passed to the handleSteps generator function. */
|
|
449
|
+
interface HandleStepsContext {
|
|
450
|
+
/** The user's input */
|
|
451
|
+
input: string;
|
|
452
|
+
/** Additional params passed to the agent */
|
|
453
|
+
params?: Record<string, unknown>;
|
|
454
|
+
logger?: Logger;
|
|
455
|
+
}
|
|
456
|
+
/** The generator type for handleSteps. */
|
|
457
|
+
type HandleStepsGenerator = Generator<HandleStepsYield, void, HandleStepsResume>;
|
|
458
|
+
/** The function signature for handleSteps. */
|
|
459
|
+
type HandleStepsFn = (context: HandleStepsContext) => HandleStepsGenerator;
|
|
460
|
+
|
|
312
461
|
/**
|
|
313
462
|
* Agent-related types
|
|
314
463
|
* Uses AI SDK types for messages, tool calls/results, and usage
|
|
@@ -333,9 +482,10 @@ interface AgentToolResult {
|
|
|
333
482
|
* Multiple observers can be attached via AgentConfig.observers.
|
|
334
483
|
*/
|
|
335
484
|
interface AgentObserver {
|
|
336
|
-
onStep?(step: AgentStep): void;
|
|
485
|
+
onStep?(step: AgentStep, cumulativeUsage?: LanguageModelUsage): void;
|
|
337
486
|
onToolExecution?(toolName: string, result: unknown): void;
|
|
338
487
|
onError?(error: Error): void;
|
|
488
|
+
onTokenBudgetWarning?(used: number, budget: number): void;
|
|
339
489
|
}
|
|
340
490
|
/**
|
|
341
491
|
* Configuration for running an agent
|
|
@@ -357,6 +507,14 @@ interface AgentConfig {
|
|
|
357
507
|
observers?: AgentObserver[];
|
|
358
508
|
/** Optional logger for agent execution */
|
|
359
509
|
logger?: Logger;
|
|
510
|
+
/** Max context window tokens; triggers pruning when exceeded (default 200k) */
|
|
511
|
+
maxContextTokens?: number;
|
|
512
|
+
/** Max total tokens (input+output) the agent may consume before stopping */
|
|
513
|
+
tokenBudget?: number;
|
|
514
|
+
/** Generator function for programmatic + LLM hybrid control flow */
|
|
515
|
+
handleSteps?: HandleStepsFn;
|
|
516
|
+
/** Prompt injected before each LLM step (e.g. reminders, constraints) */
|
|
517
|
+
stepPrompt?: string;
|
|
360
518
|
}
|
|
361
519
|
/**
|
|
362
520
|
* A single step in the agent's execution
|
|
@@ -372,6 +530,8 @@ interface AgentStep {
|
|
|
372
530
|
toolResults?: AgentToolResult[];
|
|
373
531
|
/** Token usage for this step */
|
|
374
532
|
usage?: LanguageModelUsage;
|
|
533
|
+
/** Cumulative token usage up to and including this step */
|
|
534
|
+
cumulativeUsage?: LanguageModelUsage;
|
|
375
535
|
}
|
|
376
536
|
/**
|
|
377
537
|
* Result of running an agent
|
|
@@ -412,6 +572,22 @@ interface SubagentConfig {
|
|
|
412
572
|
maxIterations?: number;
|
|
413
573
|
/** Callback for each step */
|
|
414
574
|
onStep?: (step: AgentStep) => void;
|
|
575
|
+
/** Observers forwarded to the agent loop */
|
|
576
|
+
observers?: AgentObserver[];
|
|
577
|
+
/** Prompt shown in the parent's tool description when this subagent is exposed as a tool */
|
|
578
|
+
spawnerPrompt?: string;
|
|
579
|
+
/** If true, prepend the parent's system prompt to the subagent's system prompt */
|
|
580
|
+
inheritParentSystemPrompt?: boolean;
|
|
581
|
+
/** Zod schema for validating the agent's final structured output */
|
|
582
|
+
outputSchema?: z.ZodType;
|
|
583
|
+
/** Prompt injected before each LLM step (reminders, constraints) */
|
|
584
|
+
stepPrompt?: string;
|
|
585
|
+
/** Generator for programmatic + LLM hybrid control */
|
|
586
|
+
handleSteps?: HandleStepsFn;
|
|
587
|
+
/** Max context window tokens; triggers pruning when exceeded */
|
|
588
|
+
maxContextTokens?: number;
|
|
589
|
+
/** Max total tokens the subagent may consume */
|
|
590
|
+
tokenBudget?: number;
|
|
415
591
|
}
|
|
416
592
|
/**
|
|
417
593
|
* Validated subagent definition (returned by defineSubagent)
|
|
@@ -433,26 +609,140 @@ interface SubagentResult extends AgentResult {
|
|
|
433
609
|
*/
|
|
434
610
|
|
|
435
611
|
/**
|
|
436
|
-
* Run an agent
|
|
612
|
+
* Run an agent loop: invoke model, execute tools, repeat until done.
|
|
613
|
+
* Supports context pruning (maxContextTokens) and token budgets.
|
|
614
|
+
*/
|
|
615
|
+
declare function runAgent(config: AgentConfig): Promise<AgentResult>;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Agent loop with handleSteps generator support.
|
|
619
|
+
* Alternates between programmatic steps and LLM steps.
|
|
620
|
+
*/
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Run an agent that uses handleSteps for hybrid programmatic+LLM control.
|
|
624
|
+
* The generator decides when to execute tools and when to hand off to the LLM.
|
|
625
|
+
*/
|
|
626
|
+
declare function runAgentWithSteps(config: AgentConfig): Promise<AgentResult>;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Tools: defineTool, createToolSet, execute, zodToJsonSchema
|
|
630
|
+
*/
|
|
631
|
+
|
|
632
|
+
/** Tool has description (and optional title) in config; name is the key in createToolSet. */
|
|
633
|
+
declare function defineTool<TInput extends z.ZodType, TOutput>(config: ToolConfig<TInput, TOutput>): Tool;
|
|
634
|
+
type ToolSet = Record<string, Tool>;
|
|
635
|
+
/** Pass a record: key = tool name (same as in defineTool config). */
|
|
636
|
+
declare function createToolSet(tools: ToolSet): ToolSet;
|
|
637
|
+
declare function getTools(toolSet: ToolSet): Tool[];
|
|
638
|
+
declare function getTool(toolSet: ToolSet, name: string): Tool | undefined;
|
|
639
|
+
interface ExecuteToolOptions {
|
|
640
|
+
toolCallId?: string;
|
|
641
|
+
abortSignal?: AbortSignal;
|
|
642
|
+
logger?: Logger;
|
|
643
|
+
}
|
|
644
|
+
declare function executeTool<TInput, TOutput>(toolImpl: Tool<TInput, TOutput>, input: TInput, options?: ExecuteToolOptions & {
|
|
645
|
+
toolName?: string;
|
|
646
|
+
}): Promise<ToolExecutionResult<TOutput>>;
|
|
647
|
+
declare function executeToolByName(tools: ToolSet, name: string, input: unknown, options?: ExecuteToolOptions): Promise<ToolExecutionResult>;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Propose-before-finalize tools: propose_output and finalize_output.
|
|
651
|
+
* Adapted from redxpilot's propose_str_replace / propose_write_file pattern.
|
|
437
652
|
*
|
|
438
|
-
*
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
653
|
+
* Agents produce a proposed artifact, review it, then finalize.
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Create the propose/finalize tool pair for a given run.
|
|
658
|
+
* Returns a record with `propose_output`, `finalize_output`, and `list_proposals`.
|
|
659
|
+
*/
|
|
660
|
+
declare function createProposalTools(runId: string): Record<string, Tool>;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Programmatic step engine for the handleSteps generator pattern.
|
|
664
|
+
* Adapted from redxpilot's run-programmatic-step.ts.
|
|
442
665
|
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
666
|
+
* Executes yields from a HandleStepsGenerator:
|
|
667
|
+
* - Tool calls → execute programmatically, resume generator with result
|
|
668
|
+
* - 'STEP' → signal caller to run one LLM step
|
|
669
|
+
* - 'STEP_ALL' → signal caller to run LLM until it ends
|
|
670
|
+
* - GENERATE_N → signal caller to produce N responses
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
type ProgrammaticAction = {
|
|
674
|
+
type: 'step';
|
|
675
|
+
} | {
|
|
676
|
+
type: 'step_all';
|
|
677
|
+
} | {
|
|
678
|
+
type: 'generate_n';
|
|
679
|
+
n: number;
|
|
680
|
+
} | {
|
|
681
|
+
type: 'done';
|
|
682
|
+
};
|
|
683
|
+
interface RunProgrammaticStepOptions {
|
|
684
|
+
generator: HandleStepsGenerator;
|
|
685
|
+
tools: ToolSet;
|
|
686
|
+
messages: ModelMessage[];
|
|
687
|
+
steps: AgentStep[];
|
|
688
|
+
logger?: Logger;
|
|
689
|
+
lastToolResult?: unknown;
|
|
690
|
+
stepsComplete?: boolean;
|
|
691
|
+
nResponses?: string[];
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Advance the generator until it yields a control signal (STEP/STEP_ALL/GENERATE_N)
|
|
695
|
+
* or completes. Tool call yields are executed inline.
|
|
696
|
+
*/
|
|
697
|
+
declare function runProgrammaticStep(opts: RunProgrammaticStepOptions): Promise<ProgrammaticAction>;
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Best-of-N generation: produce multiple LLM responses and select the best.
|
|
701
|
+
* Adapted from redxpilot's GENERATE_N pattern.
|
|
454
702
|
*/
|
|
455
|
-
|
|
703
|
+
|
|
704
|
+
interface GenerateNOptions {
|
|
705
|
+
model: Model;
|
|
706
|
+
messages: ModelMessage[];
|
|
707
|
+
n: number;
|
|
708
|
+
invokeOptions?: InvokeOptions;
|
|
709
|
+
logger?: Logger;
|
|
710
|
+
}
|
|
711
|
+
interface GenerateNResult {
|
|
712
|
+
responses: ModelResponse[];
|
|
713
|
+
texts: string[];
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Generate N independent responses from the model for the same message context.
|
|
717
|
+
* Returns all responses so a selector can choose the best one.
|
|
718
|
+
*/
|
|
719
|
+
declare function generateNResponses(options: GenerateNOptions): Promise<GenerateNResult>;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Response selection strategies for best-of-N generation.
|
|
723
|
+
* Supports heuristic (length-based) and LLM-as-judge selection.
|
|
724
|
+
*/
|
|
725
|
+
|
|
726
|
+
interface SelectionResult {
|
|
727
|
+
selectedIndex: number;
|
|
728
|
+
selectedText: string;
|
|
729
|
+
reason?: string;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Select the longest response (simple heuristic: more detail = better).
|
|
733
|
+
*/
|
|
734
|
+
declare function selectByLength(responses: string[]): SelectionResult;
|
|
735
|
+
interface JudgeOptions {
|
|
736
|
+
model: Model;
|
|
737
|
+
responses: string[];
|
|
738
|
+
criteria: string;
|
|
739
|
+
logger?: Logger;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Use an LLM as a judge to pick the best response based on criteria.
|
|
743
|
+
* The judge sees all candidates and returns the index of the best one.
|
|
744
|
+
*/
|
|
745
|
+
declare function selectByJudge(options: JudgeOptions): Promise<SelectionResult>;
|
|
456
746
|
|
|
457
747
|
/**
|
|
458
748
|
* Create a model instance based on provider
|
|
@@ -477,7 +767,7 @@ declare function runAgent(config: AgentConfig): Promise<AgentResult>;
|
|
|
477
767
|
declare function createModel(config: ModelConfig): Model;
|
|
478
768
|
|
|
479
769
|
/**
|
|
480
|
-
* OpenAI model provider using
|
|
770
|
+
* OpenAI model provider using the official openai package
|
|
481
771
|
*/
|
|
482
772
|
|
|
483
773
|
/**
|
|
@@ -486,7 +776,7 @@ declare function createModel(config: ModelConfig): Model;
|
|
|
486
776
|
declare function createOpenAIModel(config: ModelConfig): Model;
|
|
487
777
|
|
|
488
778
|
/**
|
|
489
|
-
* Anthropic model provider using
|
|
779
|
+
* Anthropic model provider using the official @anthropic-ai/sdk package
|
|
490
780
|
*/
|
|
491
781
|
|
|
492
782
|
/**
|
|
@@ -495,7 +785,7 @@ declare function createOpenAIModel(config: ModelConfig): Model;
|
|
|
495
785
|
declare function createAnthropicModel(config: ModelConfig): Model;
|
|
496
786
|
|
|
497
787
|
/**
|
|
498
|
-
* Google (Gemini) model provider using
|
|
788
|
+
* Google (Gemini) model provider using the official @google/genai package
|
|
499
789
|
*/
|
|
500
790
|
|
|
501
791
|
/**
|
|
@@ -503,58 +793,31 @@ declare function createAnthropicModel(config: ModelConfig): Model;
|
|
|
503
793
|
*/
|
|
504
794
|
declare function createGoogleModel(config: ModelConfig): Model;
|
|
505
795
|
|
|
506
|
-
/**
|
|
507
|
-
* Tools: defineTool, createToolSet, execute, zodToJsonSchema
|
|
508
|
-
*/
|
|
509
|
-
|
|
510
|
-
/** Tool has description (and optional title) in config; name is the key in createToolSet. */
|
|
511
|
-
declare function defineTool<TInput extends z.ZodType, TOutput>(config: ToolConfig<TInput, TOutput>): Tool;
|
|
512
|
-
type ToolSet = Record<string, Tool>;
|
|
513
|
-
/** Pass a record: key = tool name (same as in defineTool config). */
|
|
514
|
-
declare function createToolSet(tools: ToolSet): ToolSet;
|
|
515
|
-
declare function getTools(toolSet: ToolSet): Tool[];
|
|
516
|
-
declare function getTool(toolSet: ToolSet, name: string): Tool | undefined;
|
|
517
|
-
interface ExecuteToolOptions {
|
|
518
|
-
toolCallId?: string;
|
|
519
|
-
abortSignal?: AbortSignal;
|
|
520
|
-
logger?: Logger;
|
|
521
|
-
}
|
|
522
|
-
declare function executeTool<TInput, TOutput>(toolImpl: Tool<TInput, TOutput>, input: TInput, options?: ExecuteToolOptions & {
|
|
523
|
-
toolName?: string;
|
|
524
|
-
}): Promise<ToolExecutionResult<TOutput>>;
|
|
525
|
-
declare function executeToolByName(tools: ToolSet, name: string, input: unknown, options?: ExecuteToolOptions): Promise<ToolExecutionResult>;
|
|
526
|
-
|
|
527
796
|
/**
|
|
528
797
|
* Subagents: define, run, and expose as tools to a parent agent
|
|
529
798
|
*/
|
|
530
799
|
|
|
531
800
|
/**
|
|
532
|
-
* Validates and creates a subagent definition
|
|
533
|
-
* Name must be kebab-case.
|
|
801
|
+
* Validates and creates a subagent definition.
|
|
534
802
|
*/
|
|
535
803
|
declare function defineSubagent(config: SubagentConfig): SubagentDefinition;
|
|
536
804
|
interface RunSubagentOptions {
|
|
537
|
-
/** Parent's tools; used when definition does not specify tools (filtered by disallowedTools) */
|
|
538
805
|
parentTools?: Record<string, AgentTool>;
|
|
539
|
-
/** Parent's model; used when definition does not specify model */
|
|
540
806
|
parentModel?: Model;
|
|
807
|
+
/** Parent's system prompt; used when inheritParentSystemPrompt is true */
|
|
808
|
+
parentSystemPrompt?: string;
|
|
541
809
|
}
|
|
542
810
|
/**
|
|
543
|
-
*
|
|
811
|
+
* Run a subagent. Supports handleSteps, outputSchema validation,
|
|
812
|
+
* inherited system prompts, stepPrompt, and token budgets.
|
|
544
813
|
*/
|
|
545
814
|
declare function runSubagent(definition: SubagentDefinition, input: string, options?: RunSubagentOptions): Promise<SubagentResult>;
|
|
546
815
|
interface CreateSubagentToolOptions {
|
|
547
816
|
parentTools?: Record<string, AgentTool>;
|
|
548
817
|
parentModel?: Model;
|
|
818
|
+
parentSystemPrompt?: string;
|
|
549
819
|
}
|
|
550
|
-
/**
|
|
551
|
-
* Wraps a subagent as an AI SDK Tool so a parent agent can delegate via a tool call.
|
|
552
|
-
* Input: { prompt: string }. Returns the subagent's final output string.
|
|
553
|
-
*/
|
|
554
820
|
declare function createSubagentTool(definition: SubagentDefinition, options?: CreateSubagentToolOptions): AgentTool;
|
|
555
|
-
/**
|
|
556
|
-
* Creates a Record<string, Tool> from multiple subagent definitions, keyed by subagent_<name>.
|
|
557
|
-
*/
|
|
558
821
|
declare function createSubagentToolSet(definitions: SubagentDefinition[], options?: CreateSubagentToolOptions): ToolSet;
|
|
559
822
|
|
|
560
823
|
/**
|
|
@@ -655,6 +918,124 @@ declare function scaffoldProject(config: ScaffoldConfig): Promise<ScaffoldResult
|
|
|
655
918
|
/** Register common Handlebars helpers */
|
|
656
919
|
declare function registerHelpers(): void;
|
|
657
920
|
|
|
921
|
+
/**
|
|
922
|
+
* In-memory store for proposed outputs before finalization.
|
|
923
|
+
* Adapted from redxpilot's proposed-content-store.
|
|
924
|
+
*
|
|
925
|
+
* Keyed by runId + artifact name so multiple proposals can coexist.
|
|
926
|
+
* Consumers call propose() to store a draft, then finalize() to commit it.
|
|
927
|
+
*/
|
|
928
|
+
interface ProposedEntry<T = unknown> {
|
|
929
|
+
artifact: string;
|
|
930
|
+
data: T;
|
|
931
|
+
proposedAt: number;
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Store a proposed artifact for later review/finalization.
|
|
935
|
+
*/
|
|
936
|
+
declare function propose<T>(runId: string, artifact: string, data: T): ProposedEntry<T>;
|
|
937
|
+
/**
|
|
938
|
+
* Retrieve a proposed artifact (returns undefined if not found).
|
|
939
|
+
*/
|
|
940
|
+
declare function getProposed<T = unknown>(runId: string, artifact: string): ProposedEntry<T> | undefined;
|
|
941
|
+
/**
|
|
942
|
+
* List all proposed artifacts for a run.
|
|
943
|
+
*/
|
|
944
|
+
declare function listProposed(runId: string): ProposedEntry[];
|
|
945
|
+
/**
|
|
946
|
+
* Finalize: remove from proposed store and return the data.
|
|
947
|
+
* Returns undefined if not found.
|
|
948
|
+
*/
|
|
949
|
+
declare function finalize(runId: string, artifact: string): unknown | undefined;
|
|
950
|
+
/**
|
|
951
|
+
* Discard a proposal without finalizing.
|
|
952
|
+
*/
|
|
953
|
+
declare function discard(runId: string, artifact: string): boolean;
|
|
954
|
+
/**
|
|
955
|
+
* Clear all proposals for a run (cleanup after run completes).
|
|
956
|
+
*/
|
|
957
|
+
declare function clearRun(runId: string): void;
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Token estimation utilities.
|
|
961
|
+
* Adapted from redxpilot's context-pruner: approximate token count
|
|
962
|
+
* from JSON-serialized length (1 token ≈ 3 characters).
|
|
963
|
+
*/
|
|
964
|
+
/**
|
|
965
|
+
* Estimate the number of tokens in an arbitrary value by serializing to JSON.
|
|
966
|
+
* Useful for budget checks without calling a tokenizer.
|
|
967
|
+
*/
|
|
968
|
+
declare function estimateTokens(value: unknown): number;
|
|
969
|
+
/**
|
|
970
|
+
* Estimate total tokens in a message array (the main context window).
|
|
971
|
+
*/
|
|
972
|
+
declare function estimateMessagesTokens(messages: unknown[]): number;
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Text truncation utilities.
|
|
976
|
+
* Adapted from redxpilot's context-pruner: 80/20 truncation preserves
|
|
977
|
+
* the beginning (most context) and end (most recent) of long text.
|
|
978
|
+
*/
|
|
979
|
+
/**
|
|
980
|
+
* Truncate text that exceeds `limit` characters.
|
|
981
|
+
* Keeps 80% from the start and 20% from the end, with a marker in between.
|
|
982
|
+
*/
|
|
983
|
+
declare function truncateText(text: string, limit: number): string;
|
|
984
|
+
/**
|
|
985
|
+
* Truncate text to a target token count (approximate).
|
|
986
|
+
* Converts token limit to a character limit and delegates to truncateText.
|
|
987
|
+
*/
|
|
988
|
+
declare function truncateToTokens(text: string, maxTokens: number): string;
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* Rule-based message summarization.
|
|
992
|
+
* Adapted from redxpilot's context-pruner: deterministic summarization
|
|
993
|
+
* per message role, keeping errors and key tool results.
|
|
994
|
+
*/
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Summarize a single message based on its role.
|
|
998
|
+
* Returns a plain-text summary string.
|
|
999
|
+
*/
|
|
1000
|
+
declare function summarizeMessage(message: ModelMessage): string;
|
|
1001
|
+
/**
|
|
1002
|
+
* Summarize an array of messages into a single conversation summary string.
|
|
1003
|
+
* Preserves the most recent `keepRecentCount` messages verbatim.
|
|
1004
|
+
*/
|
|
1005
|
+
declare function summarizeMessages(messages: ModelMessage[], keepRecentCount?: number): {
|
|
1006
|
+
summary: string;
|
|
1007
|
+
kept: ModelMessage[];
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Context pruner: automatic context window management.
|
|
1012
|
+
* Adapted from redxpilot's context-pruner. Deterministic (no LLM call).
|
|
1013
|
+
*
|
|
1014
|
+
* When estimated tokens exceed the budget, older messages are replaced
|
|
1015
|
+
* with a compact summary, keeping recent messages and the system prompt intact.
|
|
1016
|
+
*/
|
|
1017
|
+
|
|
1018
|
+
interface PruneOptions {
|
|
1019
|
+
maxContextTokens?: number;
|
|
1020
|
+
keepRecentCount?: number;
|
|
1021
|
+
logger?: Logger;
|
|
1022
|
+
}
|
|
1023
|
+
interface PruneResult {
|
|
1024
|
+
pruned: boolean;
|
|
1025
|
+
beforeTokens: number;
|
|
1026
|
+
afterTokens: number;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Prune a message array in-place when it exceeds the token budget.
|
|
1030
|
+
*
|
|
1031
|
+
* Strategy:
|
|
1032
|
+
* 1. Estimate token count of all messages.
|
|
1033
|
+
* 2. If under budget, return immediately (no-op).
|
|
1034
|
+
* 3. Otherwise, summarize older messages into a compact summary.
|
|
1035
|
+
* 4. Replace the messages array contents with [system, summary, ...recent].
|
|
1036
|
+
*/
|
|
1037
|
+
declare function pruneContext(messages: ModelMessage[], options?: PruneOptions): PruneResult;
|
|
1038
|
+
|
|
658
1039
|
/**
|
|
659
1040
|
* MCP client types - transport, config, and response shapes
|
|
660
1041
|
* for the Model Context Protocol client infrastructure.
|
|
@@ -763,7 +1144,7 @@ declare function findTool(name: string): AgentToolEntry | undefined;
|
|
|
763
1144
|
/**
|
|
764
1145
|
* Hello World tool
|
|
765
1146
|
*/
|
|
766
|
-
declare const helloWorldTool:
|
|
1147
|
+
declare const helloWorldTool: Tool<unknown, unknown>;
|
|
767
1148
|
|
|
768
1149
|
/**
|
|
769
1150
|
* Hello World agent - runs an agent with the hello world tool
|
|
@@ -834,9 +1215,9 @@ declare const FormFieldSchema: z.ZodObject<{
|
|
|
834
1215
|
name: z.ZodString;
|
|
835
1216
|
type: z.ZodEnum<{
|
|
836
1217
|
number: "number";
|
|
837
|
-
date: "date";
|
|
838
1218
|
text: "text";
|
|
839
1219
|
image: "image";
|
|
1220
|
+
date: "date";
|
|
840
1221
|
multiSelect: "multiSelect";
|
|
841
1222
|
email: "email";
|
|
842
1223
|
password: "password";
|
|
@@ -916,9 +1297,9 @@ declare const DrawerSchema: z.ZodObject<{
|
|
|
916
1297
|
name: z.ZodString;
|
|
917
1298
|
type: z.ZodEnum<{
|
|
918
1299
|
number: "number";
|
|
919
|
-
date: "date";
|
|
920
1300
|
text: "text";
|
|
921
1301
|
image: "image";
|
|
1302
|
+
date: "date";
|
|
922
1303
|
multiSelect: "multiSelect";
|
|
923
1304
|
email: "email";
|
|
924
1305
|
password: "password";
|
|
@@ -974,9 +1355,9 @@ declare const AuthPageSchema: z.ZodObject<{
|
|
|
974
1355
|
name: z.ZodString;
|
|
975
1356
|
type: z.ZodEnum<{
|
|
976
1357
|
number: "number";
|
|
977
|
-
date: "date";
|
|
978
1358
|
text: "text";
|
|
979
1359
|
image: "image";
|
|
1360
|
+
date: "date";
|
|
980
1361
|
multiSelect: "multiSelect";
|
|
981
1362
|
email: "email";
|
|
982
1363
|
password: "password";
|
|
@@ -1033,9 +1414,9 @@ declare const ListingPageSchema: z.ZodObject<{
|
|
|
1033
1414
|
name: z.ZodString;
|
|
1034
1415
|
type: z.ZodEnum<{
|
|
1035
1416
|
number: "number";
|
|
1036
|
-
date: "date";
|
|
1037
1417
|
text: "text";
|
|
1038
1418
|
image: "image";
|
|
1419
|
+
date: "date";
|
|
1039
1420
|
multiSelect: "multiSelect";
|
|
1040
1421
|
email: "email";
|
|
1041
1422
|
password: "password";
|
|
@@ -1065,9 +1446,9 @@ declare const ListingPageSchema: z.ZodObject<{
|
|
|
1065
1446
|
name: z.ZodString;
|
|
1066
1447
|
type: z.ZodEnum<{
|
|
1067
1448
|
number: "number";
|
|
1068
|
-
date: "date";
|
|
1069
1449
|
text: "text";
|
|
1070
1450
|
image: "image";
|
|
1451
|
+
date: "date";
|
|
1071
1452
|
multiSelect: "multiSelect";
|
|
1072
1453
|
email: "email";
|
|
1073
1454
|
password: "password";
|
|
@@ -1124,9 +1505,9 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1124
1505
|
name: z.ZodString;
|
|
1125
1506
|
type: z.ZodEnum<{
|
|
1126
1507
|
number: "number";
|
|
1127
|
-
date: "date";
|
|
1128
1508
|
text: "text";
|
|
1129
1509
|
image: "image";
|
|
1510
|
+
date: "date";
|
|
1130
1511
|
multiSelect: "multiSelect";
|
|
1131
1512
|
email: "email";
|
|
1132
1513
|
password: "password";
|
|
@@ -1182,9 +1563,9 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1182
1563
|
name: z.ZodString;
|
|
1183
1564
|
type: z.ZodEnum<{
|
|
1184
1565
|
number: "number";
|
|
1185
|
-
date: "date";
|
|
1186
1566
|
text: "text";
|
|
1187
1567
|
image: "image";
|
|
1568
|
+
date: "date";
|
|
1188
1569
|
multiSelect: "multiSelect";
|
|
1189
1570
|
email: "email";
|
|
1190
1571
|
password: "password";
|
|
@@ -1214,9 +1595,9 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1214
1595
|
name: z.ZodString;
|
|
1215
1596
|
type: z.ZodEnum<{
|
|
1216
1597
|
number: "number";
|
|
1217
|
-
date: "date";
|
|
1218
1598
|
text: "text";
|
|
1219
1599
|
image: "image";
|
|
1600
|
+
date: "date";
|
|
1220
1601
|
multiSelect: "multiSelect";
|
|
1221
1602
|
email: "email";
|
|
1222
1603
|
password: "password";
|
|
@@ -1281,9 +1662,9 @@ declare const ModuleSchema: z.ZodObject<{
|
|
|
1281
1662
|
name: z.ZodString;
|
|
1282
1663
|
type: z.ZodEnum<{
|
|
1283
1664
|
number: "number";
|
|
1284
|
-
date: "date";
|
|
1285
1665
|
text: "text";
|
|
1286
1666
|
image: "image";
|
|
1667
|
+
date: "date";
|
|
1287
1668
|
multiSelect: "multiSelect";
|
|
1288
1669
|
email: "email";
|
|
1289
1670
|
password: "password";
|
|
@@ -1339,9 +1720,9 @@ declare const ModuleSchema: z.ZodObject<{
|
|
|
1339
1720
|
name: z.ZodString;
|
|
1340
1721
|
type: z.ZodEnum<{
|
|
1341
1722
|
number: "number";
|
|
1342
|
-
date: "date";
|
|
1343
1723
|
text: "text";
|
|
1344
1724
|
image: "image";
|
|
1725
|
+
date: "date";
|
|
1345
1726
|
multiSelect: "multiSelect";
|
|
1346
1727
|
email: "email";
|
|
1347
1728
|
password: "password";
|
|
@@ -1371,9 +1752,9 @@ declare const ModuleSchema: z.ZodObject<{
|
|
|
1371
1752
|
name: z.ZodString;
|
|
1372
1753
|
type: z.ZodEnum<{
|
|
1373
1754
|
number: "number";
|
|
1374
|
-
date: "date";
|
|
1375
1755
|
text: "text";
|
|
1376
1756
|
image: "image";
|
|
1757
|
+
date: "date";
|
|
1377
1758
|
multiSelect: "multiSelect";
|
|
1378
1759
|
email: "email";
|
|
1379
1760
|
password: "password";
|
|
@@ -1446,9 +1827,9 @@ declare const ApplicationSchema: z.ZodObject<{
|
|
|
1446
1827
|
name: z.ZodString;
|
|
1447
1828
|
type: z.ZodEnum<{
|
|
1448
1829
|
number: "number";
|
|
1449
|
-
date: "date";
|
|
1450
1830
|
text: "text";
|
|
1451
1831
|
image: "image";
|
|
1832
|
+
date: "date";
|
|
1452
1833
|
multiSelect: "multiSelect";
|
|
1453
1834
|
email: "email";
|
|
1454
1835
|
password: "password";
|
|
@@ -1504,9 +1885,9 @@ declare const ApplicationSchema: z.ZodObject<{
|
|
|
1504
1885
|
name: z.ZodString;
|
|
1505
1886
|
type: z.ZodEnum<{
|
|
1506
1887
|
number: "number";
|
|
1507
|
-
date: "date";
|
|
1508
1888
|
text: "text";
|
|
1509
1889
|
image: "image";
|
|
1890
|
+
date: "date";
|
|
1510
1891
|
multiSelect: "multiSelect";
|
|
1511
1892
|
email: "email";
|
|
1512
1893
|
password: "password";
|
|
@@ -1536,9 +1917,9 @@ declare const ApplicationSchema: z.ZodObject<{
|
|
|
1536
1917
|
name: z.ZodString;
|
|
1537
1918
|
type: z.ZodEnum<{
|
|
1538
1919
|
number: "number";
|
|
1539
|
-
date: "date";
|
|
1540
1920
|
text: "text";
|
|
1541
1921
|
image: "image";
|
|
1922
|
+
date: "date";
|
|
1542
1923
|
multiSelect: "multiSelect";
|
|
1543
1924
|
email: "email";
|
|
1544
1925
|
password: "password";
|
|
@@ -1671,6 +2052,8 @@ interface ReactBuilderAgentConfig {
|
|
|
1671
2052
|
onStep?: (step: AgentStep) => void;
|
|
1672
2053
|
/** Optional logger for execution logs */
|
|
1673
2054
|
logger?: Logger;
|
|
2055
|
+
/** When true, exclude scaffold tools that write files to disk (used in MCP mode) */
|
|
2056
|
+
disableScaffold?: boolean;
|
|
1674
2057
|
}
|
|
1675
2058
|
|
|
1676
2059
|
/**
|
|
@@ -1699,9 +2082,9 @@ declare function buildFeedbackPrompt(userFeedback: string, schemaFile: string):
|
|
|
1699
2082
|
/**
|
|
1700
2083
|
* validate_frontend_config tool - validates JSON against ApplicationSchema (no AI)
|
|
1701
2084
|
*/
|
|
1702
|
-
declare const validateFrontendConfigTool:
|
|
2085
|
+
declare const validateFrontendConfigTool: Tool<unknown, unknown>;
|
|
1703
2086
|
|
|
1704
|
-
declare function createGenerateFrontendTool(model: Model):
|
|
2087
|
+
declare function createGenerateFrontendTool(model: Model): Tool<unknown, unknown>;
|
|
1705
2088
|
|
|
1706
2089
|
interface FeatureBreakdownResult {
|
|
1707
2090
|
summary: string;
|
|
@@ -1709,9 +2092,17 @@ interface FeatureBreakdownResult {
|
|
|
1709
2092
|
operations: string[];
|
|
1710
2093
|
suggestedPages?: string[];
|
|
1711
2094
|
}
|
|
1712
|
-
declare function createGenerateFeatureBreakdownTool(model: Model):
|
|
2095
|
+
declare function createGenerateFeatureBreakdownTool(model: Model): Tool<unknown, unknown>;
|
|
1713
2096
|
|
|
1714
|
-
|
|
2097
|
+
/**
|
|
2098
|
+
* react-builder tools
|
|
2099
|
+
*/
|
|
2100
|
+
|
|
2101
|
+
interface ReactBuilderToolsOptions {
|
|
2102
|
+
/** When true, exclude scaffold tools that write files to disk */
|
|
2103
|
+
disableScaffold?: boolean;
|
|
2104
|
+
}
|
|
2105
|
+
declare function createReactBuilderTools(model: Model, options?: ReactBuilderToolsOptions): ToolSet;
|
|
1715
2106
|
|
|
1716
2107
|
/**
|
|
1717
2108
|
* graphql-analyzer subagent - analyzes GraphQL schemas (no tools)
|
|
@@ -3117,42 +3508,42 @@ declare function buildPromptVariables(input: MongoStructuredInput): Record<strin
|
|
|
3117
3508
|
/**
|
|
3118
3509
|
* validate_schema tool - validates JSON against dataModelDesignSchema (no AI)
|
|
3119
3510
|
*/
|
|
3120
|
-
declare const validateSchemaTool:
|
|
3511
|
+
declare const validateSchemaTool: Tool<unknown, unknown>;
|
|
3121
3512
|
|
|
3122
3513
|
/**
|
|
3123
3514
|
* Creates the design_schema tool. Requires a model for generation.
|
|
3124
3515
|
*/
|
|
3125
|
-
declare function createDesignSchemaTool(model: Model):
|
|
3516
|
+
declare function createDesignSchemaTool(model: Model): Tool<unknown, unknown>;
|
|
3126
3517
|
|
|
3127
3518
|
/**
|
|
3128
3519
|
* Creates the design_schema_pro tool for structured 5-phase data modeling.
|
|
3129
3520
|
*/
|
|
3130
|
-
declare function createDesignSchemaProTool(model: Model):
|
|
3521
|
+
declare function createDesignSchemaProTool(model: Model): Tool<unknown, unknown>;
|
|
3131
3522
|
|
|
3132
3523
|
/**
|
|
3133
3524
|
* Creates the refine_schema tool for iterating on an existing data model.
|
|
3134
3525
|
*/
|
|
3135
|
-
declare function createRefineSchemaTools(model: Model):
|
|
3526
|
+
declare function createRefineSchemaTools(model: Model): Tool<unknown, unknown>;
|
|
3136
3527
|
|
|
3137
3528
|
/**
|
|
3138
3529
|
* validate_schema tool - validates JSON against mongoProjectSchema (merged from db-designer)
|
|
3139
3530
|
*/
|
|
3140
|
-
declare const validateMongoSchemaTool:
|
|
3531
|
+
declare const validateMongoSchemaTool: Tool<unknown, unknown>;
|
|
3141
3532
|
|
|
3142
3533
|
/**
|
|
3143
3534
|
* Creates the design_database tool for MongoDB schema generation.
|
|
3144
3535
|
*/
|
|
3145
|
-
declare function createDesignDatabaseTool(model: Model):
|
|
3536
|
+
declare function createDesignDatabaseTool(model: Model): Tool<unknown, unknown>;
|
|
3146
3537
|
|
|
3147
3538
|
/**
|
|
3148
3539
|
* Creates the design_database_pro tool for structured 5-phase MongoDB analysis.
|
|
3149
3540
|
*/
|
|
3150
|
-
declare function createDesignDatabaseProTool(model: Model):
|
|
3541
|
+
declare function createDesignDatabaseProTool(model: Model): Tool<unknown, unknown>;
|
|
3151
3542
|
|
|
3152
3543
|
/**
|
|
3153
3544
|
* Creates the redesign_database tool for iterating on MongoDB schemas.
|
|
3154
3545
|
*/
|
|
3155
|
-
declare function createRedesignDatabaseTool(model: Model):
|
|
3546
|
+
declare function createRedesignDatabaseTool(model: Model): Tool<unknown, unknown>;
|
|
3156
3547
|
|
|
3157
3548
|
/**
|
|
3158
3549
|
* Create all generic data-modeler tools. Pass the model for AI-backed tools.
|
|
@@ -3252,7 +3643,7 @@ declare const graphqlOperationSchema: z.ZodObject<{
|
|
|
3252
3643
|
declare const apiDesignSchema: z.ZodObject<{
|
|
3253
3644
|
style: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"rest" | "graphql", unknown>>;
|
|
3254
3645
|
baseUrl: z.ZodDefault<z.ZodString>;
|
|
3255
|
-
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3646
|
+
endpoints: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3256
3647
|
id: z.ZodString;
|
|
3257
3648
|
resource: z.ZodString;
|
|
3258
3649
|
method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -3283,8 +3674,8 @@ declare const apiDesignSchema: z.ZodObject<{
|
|
|
3283
3674
|
}, Record<string, unknown>>>;
|
|
3284
3675
|
validation: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodUnknown>>, z.ZodTransform<string[], unknown[]>>;
|
|
3285
3676
|
errorResponses: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodUnknown>>, z.ZodTransform<string[], unknown[]>>;
|
|
3286
|
-
}, z.core.$strip
|
|
3287
|
-
graphqlOperations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3677
|
+
}, z.core.$strip>>>>;
|
|
3678
|
+
graphqlOperations: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3288
3679
|
name: z.ZodString;
|
|
3289
3680
|
type: z.ZodEnum<{
|
|
3290
3681
|
query: "query";
|
|
@@ -3300,7 +3691,7 @@ declare const apiDesignSchema: z.ZodObject<{
|
|
|
3300
3691
|
required: z.ZodCoercedBoolean<unknown>;
|
|
3301
3692
|
}, z.core.$strip>>;
|
|
3302
3693
|
returnType: z.ZodString;
|
|
3303
|
-
}, z.core.$strip
|
|
3694
|
+
}, z.core.$strip>>>>;
|
|
3304
3695
|
}, z.core.$strip>;
|
|
3305
3696
|
type TApiDesign = z.infer<typeof apiDesignSchema>;
|
|
3306
3697
|
|
|
@@ -3364,17 +3755,17 @@ declare const API_DESIGNER_SYSTEM_PROMPT = "You are a senior API architect speci
|
|
|
3364
3755
|
/**
|
|
3365
3756
|
* validate_api tool - validates JSON against apiDesignSchema (no AI)
|
|
3366
3757
|
*/
|
|
3367
|
-
declare const validateApiTool:
|
|
3758
|
+
declare const validateApiTool: Tool<unknown, unknown>;
|
|
3368
3759
|
|
|
3369
3760
|
/**
|
|
3370
3761
|
* Creates the design_api tool for plain text requirements.
|
|
3371
3762
|
*/
|
|
3372
|
-
declare function createDesignApiTool(model: Model):
|
|
3763
|
+
declare function createDesignApiTool(model: Model): Tool<unknown, unknown>;
|
|
3373
3764
|
|
|
3374
3765
|
/**
|
|
3375
3766
|
* Creates the design_api_pro tool for structured API design.
|
|
3376
3767
|
*/
|
|
3377
|
-
declare function createDesignApiProTool(model: Model):
|
|
3768
|
+
declare function createDesignApiProTool(model: Model): Tool<unknown, unknown>;
|
|
3378
3769
|
|
|
3379
3770
|
/**
|
|
3380
3771
|
* Create all api-designer tools. Pass the model for AI-backed tools.
|
|
@@ -3540,12 +3931,12 @@ declare function buildDesignAuthPrompt(requirement: string): string;
|
|
|
3540
3931
|
/**
|
|
3541
3932
|
* validate_auth tool - validates JSON against authDesignSchema (no AI)
|
|
3542
3933
|
*/
|
|
3543
|
-
declare const validateAuthTool:
|
|
3934
|
+
declare const validateAuthTool: Tool<unknown, unknown>;
|
|
3544
3935
|
|
|
3545
3936
|
/**
|
|
3546
3937
|
* Creates the design_auth tool for auth flow generation.
|
|
3547
3938
|
*/
|
|
3548
|
-
declare function createDesignAuthTool(model: Model):
|
|
3939
|
+
declare function createDesignAuthTool(model: Model): Tool<unknown, unknown>;
|
|
3549
3940
|
|
|
3550
3941
|
/**
|
|
3551
3942
|
* Create all auth-designer tools. Pass the model for AI-backed tools.
|
|
@@ -3716,12 +4107,12 @@ declare function buildDesignFrontendPrompt(requirement: string): string;
|
|
|
3716
4107
|
/**
|
|
3717
4108
|
* validate_frontend tool - validates JSON against frontendDesignSchema (no AI)
|
|
3718
4109
|
*/
|
|
3719
|
-
declare const validateFrontendTool:
|
|
4110
|
+
declare const validateFrontendTool: Tool<unknown, unknown>;
|
|
3720
4111
|
|
|
3721
4112
|
/**
|
|
3722
4113
|
* Creates the design_frontend tool for frontend architecture generation.
|
|
3723
4114
|
*/
|
|
3724
|
-
declare function createDesignFrontendTool(model: Model):
|
|
4115
|
+
declare function createDesignFrontendTool(model: Model): Tool<unknown, unknown>;
|
|
3725
4116
|
|
|
3726
4117
|
/**
|
|
3727
4118
|
* Create all frontend-architect tools. Pass the model for AI-backed tools.
|
|
@@ -3874,12 +4265,12 @@ declare function buildCreateExecutionPlanPrompt(context: string): string;
|
|
|
3874
4265
|
/**
|
|
3875
4266
|
* validate_execution_plan tool - validates JSON against executionPlanSchema (no AI)
|
|
3876
4267
|
*/
|
|
3877
|
-
declare const validateExecutionPlanTool:
|
|
4268
|
+
declare const validateExecutionPlanTool: Tool<unknown, unknown>;
|
|
3878
4269
|
|
|
3879
4270
|
/**
|
|
3880
4271
|
* Creates the create_execution_plan tool for generating phased plans.
|
|
3881
4272
|
*/
|
|
3882
|
-
declare function createExecutionPlanTool(model: Model):
|
|
4273
|
+
declare function createExecutionPlanTool(model: Model): Tool<unknown, unknown>;
|
|
3883
4274
|
|
|
3884
4275
|
/**
|
|
3885
4276
|
* Create all execution-planner tools. Pass the model for AI-backed tools.
|
|
@@ -4023,12 +4414,12 @@ declare function buildDesignBackendPrompt(requirement: string): string;
|
|
|
4023
4414
|
/**
|
|
4024
4415
|
* validate_backend tool - validates JSON against backendDesignSchema (no AI)
|
|
4025
4416
|
*/
|
|
4026
|
-
declare const validateBackendTool:
|
|
4417
|
+
declare const validateBackendTool: Tool<unknown, unknown>;
|
|
4027
4418
|
|
|
4028
4419
|
/**
|
|
4029
4420
|
* Creates the design_backend tool for backend architecture generation.
|
|
4030
4421
|
*/
|
|
4031
|
-
declare function createDesignBackendTool(model: Model):
|
|
4422
|
+
declare function createDesignBackendTool(model: Model): Tool<unknown, unknown>;
|
|
4032
4423
|
|
|
4033
4424
|
/**
|
|
4034
4425
|
* Create all backend-architect tools. Pass the model for AI-backed tools.
|
|
@@ -4244,6 +4635,8 @@ interface ApolloBuilderAgentConfig {
|
|
|
4244
4635
|
onStep?: (step: AgentStep) => void;
|
|
4245
4636
|
/** Optional logger for execution logs */
|
|
4246
4637
|
logger?: Logger;
|
|
4638
|
+
/** When true, exclude scaffold tools that write files to disk (used in MCP mode) */
|
|
4639
|
+
disableScaffold?: boolean;
|
|
4247
4640
|
}
|
|
4248
4641
|
|
|
4249
4642
|
/**
|
|
@@ -4260,22 +4653,30 @@ declare function buildDesignSubgraphPrompt(requirement: string): string;
|
|
|
4260
4653
|
/**
|
|
4261
4654
|
* validate_subgraph tool - validates JSON against subgraphConfigSchema (no AI)
|
|
4262
4655
|
*/
|
|
4263
|
-
declare const validateSubgraphTool:
|
|
4656
|
+
declare const validateSubgraphTool: Tool<unknown, unknown>;
|
|
4264
4657
|
|
|
4265
4658
|
/**
|
|
4266
4659
|
* Creates the generate_subgraph tool for Apollo subgraph config generation.
|
|
4267
4660
|
*/
|
|
4268
|
-
declare function createGenerateSubgraphTool(model: Model):
|
|
4661
|
+
declare function createGenerateSubgraphTool(model: Model): Tool<unknown, unknown>;
|
|
4269
4662
|
|
|
4270
4663
|
/**
|
|
4271
4664
|
* scaffold_subgraph tool - compiles .ref/templates/subgraph/ with config
|
|
4272
4665
|
*/
|
|
4273
|
-
declare const scaffoldSubgraphTool:
|
|
4666
|
+
declare const scaffoldSubgraphTool: Tool<unknown, unknown>;
|
|
4274
4667
|
|
|
4668
|
+
/**
|
|
4669
|
+
* apollo-builder tools
|
|
4670
|
+
*/
|
|
4671
|
+
|
|
4672
|
+
interface ApolloBuilderToolsOptions {
|
|
4673
|
+
/** When true, exclude scaffold tools that write files to disk */
|
|
4674
|
+
disableScaffold?: boolean;
|
|
4675
|
+
}
|
|
4275
4676
|
/**
|
|
4276
4677
|
* Create all apollo-builder tools. Pass the model for AI-backed tools.
|
|
4277
4678
|
*/
|
|
4278
|
-
declare function createApolloBuilderTools(model: Model): ToolSet;
|
|
4679
|
+
declare function createApolloBuilderTools(model: Model, options?: ApolloBuilderToolsOptions): ToolSet;
|
|
4279
4680
|
|
|
4280
4681
|
/**
|
|
4281
4682
|
* schema-generator subagent - generates GraphQL type definitions from data model
|
|
@@ -4359,10 +4760,10 @@ declare const modelSchema: z.ZodObject<{
|
|
|
4359
4760
|
}, z.core.$strip>;
|
|
4360
4761
|
declare const middlewareConfigSchema: z.ZodObject<{
|
|
4361
4762
|
name: z.ZodString;
|
|
4362
|
-
type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"
|
|
4363
|
-
validation: "validation";
|
|
4763
|
+
type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"custom" | "auth" | "validation" | "errorHandler" | "cors" | "rateLimit" | "logging", string>>, z.ZodEnum<{
|
|
4364
4764
|
custom: "custom";
|
|
4365
4765
|
auth: "auth";
|
|
4766
|
+
validation: "validation";
|
|
4366
4767
|
errorHandler: "errorHandler";
|
|
4367
4768
|
cors: "cors";
|
|
4368
4769
|
rateLimit: "rateLimit";
|
|
@@ -4410,10 +4811,10 @@ declare const expressConfigSchema: z.ZodObject<{
|
|
|
4410
4811
|
}, z.core.$strip>>>;
|
|
4411
4812
|
middleware: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
4412
4813
|
name: z.ZodString;
|
|
4413
|
-
type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"
|
|
4414
|
-
validation: "validation";
|
|
4814
|
+
type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"custom" | "auth" | "validation" | "errorHandler" | "cors" | "rateLimit" | "logging", string>>, z.ZodEnum<{
|
|
4415
4815
|
custom: "custom";
|
|
4416
4816
|
auth: "auth";
|
|
4817
|
+
validation: "validation";
|
|
4417
4818
|
errorHandler: "errorHandler";
|
|
4418
4819
|
cors: "cors";
|
|
4419
4820
|
rateLimit: "rateLimit";
|
|
@@ -4440,6 +4841,8 @@ interface ExpressBuilderAgentConfig {
|
|
|
4440
4841
|
onStep?: (step: AgentStep) => void;
|
|
4441
4842
|
/** Optional logger for execution logs */
|
|
4442
4843
|
logger?: Logger;
|
|
4844
|
+
/** When true, exclude scaffold tools that write files to disk (used in MCP mode) */
|
|
4845
|
+
disableScaffold?: boolean;
|
|
4443
4846
|
}
|
|
4444
4847
|
|
|
4445
4848
|
/**
|
|
@@ -4456,22 +4859,30 @@ declare function buildDesignExpressPrompt(requirement: string): string;
|
|
|
4456
4859
|
/**
|
|
4457
4860
|
* validate_express tool - validates JSON against expressConfigSchema (no AI)
|
|
4458
4861
|
*/
|
|
4459
|
-
declare const validateExpressTool:
|
|
4862
|
+
declare const validateExpressTool: Tool<unknown, unknown>;
|
|
4460
4863
|
|
|
4461
4864
|
/**
|
|
4462
4865
|
* Creates the generate_express tool for Express config generation.
|
|
4463
4866
|
*/
|
|
4464
|
-
declare function createGenerateExpressTool(model: Model):
|
|
4867
|
+
declare function createGenerateExpressTool(model: Model): Tool<unknown, unknown>;
|
|
4465
4868
|
|
|
4466
4869
|
/**
|
|
4467
4870
|
* scaffold_express tool - compiles .ref/templates/express/ with config
|
|
4468
4871
|
*/
|
|
4469
|
-
declare const scaffoldExpressTool:
|
|
4872
|
+
declare const scaffoldExpressTool: Tool<unknown, unknown>;
|
|
4873
|
+
|
|
4874
|
+
/**
|
|
4875
|
+
* express-builder tools
|
|
4876
|
+
*/
|
|
4470
4877
|
|
|
4878
|
+
interface ExpressBuilderToolsOptions {
|
|
4879
|
+
/** When true, exclude scaffold tools that write files to disk */
|
|
4880
|
+
disableScaffold?: boolean;
|
|
4881
|
+
}
|
|
4471
4882
|
/**
|
|
4472
4883
|
* Create all express-builder tools. Pass the model for AI-backed tools.
|
|
4473
4884
|
*/
|
|
4474
|
-
declare function createExpressBuilderTools(model: Model): ToolSet;
|
|
4885
|
+
declare function createExpressBuilderTools(model: Model, options?: ExpressBuilderToolsOptions): ToolSet;
|
|
4475
4886
|
|
|
4476
4887
|
/**
|
|
4477
4888
|
* route-generator subagent - generates route files from API design
|
|
@@ -4621,12 +5032,12 @@ declare function buildDesignNextjsPrompt(requirement: string): string;
|
|
|
4621
5032
|
/**
|
|
4622
5033
|
* validate_nextjs tool - validates JSON against nextjsConfigSchema (no AI)
|
|
4623
5034
|
*/
|
|
4624
|
-
declare const validateNextjsTool:
|
|
5035
|
+
declare const validateNextjsTool: Tool<unknown, unknown>;
|
|
4625
5036
|
|
|
4626
5037
|
/**
|
|
4627
5038
|
* Creates the generate_nextjs tool for Next.js config generation.
|
|
4628
5039
|
*/
|
|
4629
|
-
declare function createGenerateNextjsTool(model: Model):
|
|
5040
|
+
declare function createGenerateNextjsTool(model: Model): Tool<unknown, unknown>;
|
|
4630
5041
|
|
|
4631
5042
|
/**
|
|
4632
5043
|
* Create all nextjs-builder tools. Pass the model for AI-backed tools.
|
|
@@ -4652,4 +5063,41 @@ declare const apiRouteGeneratorSubagent: SubagentDefinition;
|
|
|
4652
5063
|
*/
|
|
4653
5064
|
declare function runNextjsBuilderAgent(config: NextjsBuilderAgentConfig): Promise<AgentResult>;
|
|
4654
5065
|
|
|
4655
|
-
export { API_DESIGNER_SYSTEM_PROMPT, APOLLO_BUILDER_SYSTEM_PROMPT, AUTH_DESIGNER_SYSTEM_PROMPT, type ActorResult, type ApiDesign as AdApiDesign, type GraphqlOperation as AdGraphqlOperation, type RestEndpoint as AdRestEndpoint, type AgentConfig, AgentError, type AgentObserver, type AgentResult, type AgentStep, type AgentTool, type AgentToolEntry, type AgentToolInput, type AgentToolResult, type ApiDesignerAgentConfig, ApiResponseTypeSchema, type ApiStyle, type ApolloBuilderAgentConfig, AppConfigSchema, type AppInfo, ApplicationSchema, type AuthDesign, type AuthDesignerAgentConfig, type AuthFlow, type AuthFlowStep, type AuthMiddleware, AuthPageApiSchema, AuthPageSchema, type AuthStrategy, BACKEND_ARCHITECT_SYSTEM_PROMPT, type BackendArchitectAgentConfig, BaseMcpClient, type BasicProjectInfo, BrandingSchema, CREATE_EXECUTION_PLAN_PROMPT, type ChatEntry$2 as ChatEntry, type ChatTurnResult, ColumnSchema, type ComponentDesign, type CreateSubagentToolOptions, CreateUserInputSchema, type CrudApi, DATA_MODELER_SYSTEM_PROMPT, MONGODB_SYSTEM_PROMPT as DB_DESIGN_SYSTEM_PROMPT, DESIGN_AUTH_PROMPT, DESIGN_BACKEND_PROMPT, DESIGN_DATABASE_SYSTEM_PROMPT, DESIGN_EXPRESS_PROMPT, DESIGN_FRONTEND_PROMPT, DESIGN_NEXTJS_PROMPT, DESIGN_SUBGRAPH_PROMPT, DISCOVERY_SYSTEM_FRAGMENT, DISCOVERY_USER_PROMPT, type DataEntity, type DataModelDesign, type DataModelerAgentConfig, type DatabaseDesign$1 as DatabaseDesign, type DatabaseEntity$1 as DatabaseEntity, type DatabaseType, type MongoDbDesignerAgentConfig as DbDesignerAgentConfig, type EntityField as DmEntityField, type EntityIndex as DmEntityIndex, type EntityRelation as DmEntityRelation, DrawerSchema, EXAMPLE_GRAPHQL_SCHEMA, EXAMPLE_JSON_OUTPUT, EXECUTION_PLANNER_SYSTEM_PROMPT, EXPRESS_BUILDER_SYSTEM_PROMPT, EXTRACT_ACTORS_PROMPT, EXTRACT_MODULES_PROMPT, type EdgeCase, type EditPlanConfig, type EntityField$2 as EntityField, type EntityIndex$2 as EntityIndex, type EntityRelation$2 as EntityRelation, type ExecutionPlan, type ExecutionPlannerAgentConfig, type ExpressBuilderAgentConfig, type ExtractedModule, FRONTEND_ARCHITECT_SYSTEM_PROMPT, type FeatureBreakdownResult, FieldOptionsSchema, type FinalRequirement, type FlowsResult, ForgotPasswordSchema, type FormField, FormFieldSchema, type FrontendArchitectAgentConfig, type FrontendDesign, GENERATE_FLOWS_PROMPT, GENERATE_STORIES_PROMPT, type HelloWorldAgentConfig, type HttpMethod, type ImageInput, type ImplementationPhase, type InvokeObjectOptions, type InvokeObjectResult, type InvokeOptions, LibraryError, ListingPageApiSchema, ListingPageSchema, type LogLevel, type Logger, type LoggerConfig, LoginInputSchema, MONGODB_SYSTEM_PROMPT, type McpClientConfig, type McpClientInfo, type McpResolveOptions, type McpToolContent, type McpTransport, type Model, type ModelConfig, ModelError, type ModelProvider, type ModelResponse, type ModelTool, type ModelToolCall, type Module, ModuleSchema, type ModulesResult, type MongoActor, type MongoDbDesignerAgentConfig, type MongoExtractedFlow, type MongoExtractedStory, type MongoStructuredInput, type MongoTechnicalRequirements, NEXTJS_BUILDER_SYSTEM_PROMPT, type NextjsBuilderAgentConfig, PLANNING_SYSTEM_PROMPT, type PageAccess, type PageDesign, PageSchema, type PhaseStep, type PlanChatTurnResult, type PlanFromRequirementsConfig, type PlanSections, type PlanStageResult, type PlanningAgentConfig, type PlanningChatConfig, type ChatEntry as PlanningChatEntry, type PlanningContext, PlanningContextBuilder, type Stage as PlanningStage, type ProjectBrief, type Question$1 as Question, REACT_BUILDER_INSTRUCTION, REACT_BUILDER_SYSTEM_PROMPT, REQUIREMENT_GATHERER_SYSTEM_PROMPT, type ReactBuilderAgentConfig, type RequirementChatConfig, type RequirementContext, RequirementContextBuilder, type RequirementGathererAgentConfig, type RequirementSummary$1 as RequirementSummary, ResetPasswordSchema, type RoleDefinition, type RunSubagentOptions, SYNTHESIS_SYSTEM_FRAGMENT, SYNTHESIS_USER_PROMPT, type ScaffoldConfig, type ScaffoldError, type ScaffoldResult, type SecurityPolicy, SpecializationSchema, type Stage$1 as Stage, type StageInput, type StoriesResult, type SubagentConfig, type SubagentDefinition, SubagentError, type SubagentResult, type TApiDesign, type TApiResponseTypeSchema, type TAppConfigSchema, type TApplicationSchema, type TAuthDesign, type TBackendDesign, type TMongoProjectSchema as TBackendProjectSchema, type TBrandingSchema, type TColumnSchema, type TCreateUserInputSchema, type TDataModelDesign, type TExecutionPlan, type TExpressConfig, type TForgotPasswordSchema, type TFormFieldSchema, type TFrontendDesign, type TLoginInputSchema, type TMongoFieldSchema, type TMongoModuleSchema, type TMongoProjectSchema, type TNextjsConfig, TOOL_REGISTRY, type TPageSchema, type TModuleSchema as TReactModuleSchema, type TResetPasswordSchema, type TSpecializationSchema, type TSubgraphConfig, type TUpdateUserInputSchema, type TUserSchema, type TemplateAuth, type TemplateBranding, type TemplateContext, type TemplateField, type TemplateModule, type TemplateOperation, type TestChecklistItem, type ToolConfig, type ToolContext, ToolError, type ToolExecutionResult, type ToolLogger, type ToolSet, UpdateUserInputSchema, UserSchema, ValidationError, ValidationSchema, type VisionOptions, actorSchema, actorsResultSchema, apiDesignSchema as adApiDesignSchema, graphqlOperationSchema as adGraphqlOperationSchema, restEndpointSchema as adRestEndpointSchema, addChatEntry, advanceStage, apiRouteGeneratorSubagent, assemblePlan, authDesignSchema, authFlowSchema, authFlowStepSchema, authMiddlewareSchema, backendDesignSchema, buildCreateExecutionPlanPrompt, buildDesignAuthPrompt, buildDesignBackendPrompt, buildDesignDatabasePrompt, buildDesignExpressPrompt, buildDesignFrontendPrompt, buildDesignNextjsPrompt, buildDesignSubgraphPrompt, buildDiscoveryPrompt, buildExampleShotPrompt, buildExtractActorsPrompt, buildExtractModulesPrompt, buildFeedbackPrompt, buildGenerateFlowsPrompt, buildGenerateStoriesPrompt, buildInstructionPrompt, buildPromptVariables, buildSynthesisPrompt, chatEntrySchema, compileTemplate, componentAnalyzerSubagent, componentDesignSchema, contractDesignerSubagent, convertRequirementToContext, createAnthropicModel, createApiDesignerTools, createApolloBuilderTools, createAuthDesignerTools, createBackendArchitectTools, createConfigValidatorSubagent, createDataModelerTools, createMongoDesignPrompt as createDbDesignPrompt, createDbDesignerTools, createDesignApiProTool, createDesignApiTool, createDesignAuthTool, createDesignBackendTool, createDesignDatabaseProTool, createDesignDatabaseTool, createDesignFrontendTool, createDesignSchemaProTool, createDesignSchemaTool, createExecutionPlanTool, createExecutionPlannerTools, createExpressBuilderTools, createFrontendArchitectTools, createGenerateExpressTool, createGenerateFeatureBreakdownTool, createGenerateFrontendTool, createGenerateNextjsTool, createGenerateSubgraphTool, createGoogleModel, createInitialContext, createLogger, createModel, createMongoDesignPrompt, createMongoProDesignPrompt, createMongoRedesignPrompt, createNextjsBuilderTools, createOpenAIModel, createPlanningContextBuilder, createMongoProDesignPrompt as createProDbDesignPrompt, createReactBuilderTools, createRedesignDatabaseTool, createMongoRedesignPrompt as createRedesignPrompt, createRefineSchemaTools, createRequirementContextBuilder, createSchemaRefinerSubagent, createSubagentTool, createSubagentToolSet, createSweagentServer, createToolSet, crudApiSchema, databaseDesignSchema, databaseEntitySchema, defineSubagent, defineTool, createSchemaRefinerSubagent as dmCreateSchemaRefinerSubagent, dataEntitySchema as dmDataEntitySchema, dataModelDesignSchema as dmDataModelDesignSchema, entityAnalyzerSubagent as dmEntityAnalyzerSubagent, validateSchemaTool as dmValidateSchemaTool, edgeCaseAnalyzerSubagent, edgeCaseSchema, editPlan, endpointAnalyzerSubagent, entityAnalyzerSubagent, entityFieldSchema, entityIndexSchema, entityRelationSchema, executeTool, executeToolByName, executionPlanSchema, expressConfigSchema, extractDataEntities, extractJson, extractRoles, extractedModuleSchema, mongoFieldSchema as fieldSchema, finalRequirementSchema, findTool, flowDesignerSubagent, flowSchema, flowsResultSchema, formFieldSchema, formatTechnicalRequirements, formatUserFlows, formatUserStories, formatUserTypes, frameworkSelectorSubagent, frontendDesignSchema, getTool, getTools, graphqlAnalyzerSubagent, graphqlFieldSchema, graphqlTypeSchema, helloWorldTool, implementationPhaseSchema, loggerConfigFromEnv, mergeStageResult, middlewareConfigSchema, middlewareConfiguratorSubagent, middlewareSchema, modelFieldSchema, modelSchema, mongoModuleSchema as moduleSchema, modulesResultSchema, mongoFieldSchema, mongoModuleSchema, mongoProjectSchema, nextjsApiRouteSchema, nextjsConfigSchema, nextjsLayoutSchema, nextjsPageSchema, pageDesignSchema, pagePlannerSubagent, parseModelJsonResponse, phaseStepSchema, processPlanningChat, processRequirementChat, projectBriefSchema, mongoProjectSchema as projectSchema, questionSchema, registerHelpers, relationshipMapperSubagent, requirementContextSchema, requirementSummarySchema, resolverOperationSchema, resolverPlannerSubagent, roleDefinitionSchema, routeGeneratorSubagent, routeGroupSchema, routePlannerSubagent, routerMethodSchema, routerSchema, runAgent, runApiDesignerAgent, runApolloBuilderAgent, runAuthDesignerAgent, runBackendArchitectAgent, runDataModelerAgent, runDbDesignerAgent, runExecutionPlannerAgent, runExpressBuilderAgent, runFrontendArchitectAgent, runHelloWorldAgent, runNextjsBuilderAgent, runPlanningAgent, runPlanningFromRequirements, runReactBuilderAgent, runRequirementGathererAgent, runSubagent, safeJsonParse, scaffoldExpressTool, scaffoldProject, scaffoldSubgraphTool, schemaGeneratorSubagent, securityAnalyzerSubagent, securityPolicySchema, serverActionSchema, servicePlannerSubagent, serviceSchema, storiesResultSchema, storySchema, subgraphConfigSchema, subgraphModuleSchema, sumTokenUsage, testChecklistItemSchema, testingStrategistSubagent, validateApiTool, validateAuthTool, validateBackendTool, validateExecutionPlanTool, validateExpressTool, validateFrontendConfigTool, validateFrontendTool, validateNextjsTool, validateMongoSchemaTool as validateSchemaTool, validateSubgraphTool, writePlanToFile };
|
|
5066
|
+
/**
|
|
5067
|
+
* Full pipeline types - config and result shapes for the end-to-end pipeline.
|
|
5068
|
+
*/
|
|
5069
|
+
|
|
5070
|
+
/** Configuration for running the full pipeline. */
|
|
5071
|
+
interface FullPipelineConfig {
|
|
5072
|
+
/** Natural language description of the app to build. */
|
|
5073
|
+
input: string;
|
|
5074
|
+
/** Optional model override (defaults to openai/gpt-4o-mini). */
|
|
5075
|
+
model?: ModelConfig;
|
|
5076
|
+
/** Max iterations per agent step (defaults to 15). */
|
|
5077
|
+
maxIterations?: number;
|
|
5078
|
+
/** Callback invoked after each agent step. */
|
|
5079
|
+
onStep?: (step: AgentStep) => void;
|
|
5080
|
+
/** Optional logger for pipeline execution. */
|
|
5081
|
+
logger?: Logger;
|
|
5082
|
+
}
|
|
5083
|
+
/** Result of a single pipeline step. */
|
|
5084
|
+
interface PipelineStepResult {
|
|
5085
|
+
name: string;
|
|
5086
|
+
key: string;
|
|
5087
|
+
output: string;
|
|
5088
|
+
}
|
|
5089
|
+
|
|
5090
|
+
/**
|
|
5091
|
+
* runFullPipelineAgent - orchestrates the full 7-agent pipeline end-to-end.
|
|
5092
|
+
*
|
|
5093
|
+
* Runs: Requirements -> Data Model -> API -> Auth -> Backend -> Frontend -> Execution Plan.
|
|
5094
|
+
* Each agent's output feeds as context into the next.
|
|
5095
|
+
*/
|
|
5096
|
+
|
|
5097
|
+
/**
|
|
5098
|
+
* Run the full pipeline: 7 domain agents chained sequentially.
|
|
5099
|
+
* Returns a combined specification document.
|
|
5100
|
+
*/
|
|
5101
|
+
declare function runFullPipelineAgent(config: FullPipelineConfig): Promise<AgentResult>;
|
|
5102
|
+
|
|
5103
|
+
export { API_DESIGNER_SYSTEM_PROMPT, APOLLO_BUILDER_SYSTEM_PROMPT, AUTH_DESIGNER_SYSTEM_PROMPT, type ActorResult, type ApiDesign as AdApiDesign, type GraphqlOperation as AdGraphqlOperation, type RestEndpoint as AdRestEndpoint, type AgentConfig, AgentError, type AgentObserver, type AgentResult, type AgentStep, type AgentTool, type AgentToolEntry, type AgentToolInput, type AgentToolResult, type ApiDesignerAgentConfig, ApiResponseTypeSchema, type ApiStyle, type ApolloBuilderAgentConfig, AppConfigSchema, type AppInfo, ApplicationSchema, type AuthDesign, type AuthDesignerAgentConfig, type AuthFlow, type AuthFlowStep, type AuthMiddleware, AuthPageApiSchema, AuthPageSchema, type AuthStrategy, BACKEND_ARCHITECT_SYSTEM_PROMPT, type BackendArchitectAgentConfig, BaseMcpClient, type BasicProjectInfo, BrandingSchema, CREATE_EXECUTION_PLAN_PROMPT, type ChatEntry$2 as ChatEntry, type ChatTurnResult, ColumnSchema, type ComponentDesign, type CreateSubagentToolOptions, CreateUserInputSchema, type CrudApi, DATA_MODELER_SYSTEM_PROMPT, MONGODB_SYSTEM_PROMPT as DB_DESIGN_SYSTEM_PROMPT, DESIGN_AUTH_PROMPT, DESIGN_BACKEND_PROMPT, DESIGN_DATABASE_SYSTEM_PROMPT, DESIGN_EXPRESS_PROMPT, DESIGN_FRONTEND_PROMPT, DESIGN_NEXTJS_PROMPT, DESIGN_SUBGRAPH_PROMPT, DISCOVERY_SYSTEM_FRAGMENT, DISCOVERY_USER_PROMPT, type DataEntity, type DataModelDesign, type DataModelerAgentConfig, type DatabaseDesign$1 as DatabaseDesign, type DatabaseEntity$1 as DatabaseEntity, type DatabaseType, type MongoDbDesignerAgentConfig as DbDesignerAgentConfig, type EntityField as DmEntityField, type EntityIndex as DmEntityIndex, type EntityRelation as DmEntityRelation, DrawerSchema, EXAMPLE_GRAPHQL_SCHEMA, EXAMPLE_JSON_OUTPUT, EXECUTION_PLANNER_SYSTEM_PROMPT, EXPRESS_BUILDER_SYSTEM_PROMPT, EXTRACT_ACTORS_PROMPT, EXTRACT_MODULES_PROMPT, type EdgeCase, type EditPlanConfig, type EntityField$2 as EntityField, type EntityIndex$2 as EntityIndex, type EntityRelation$2 as EntityRelation, type ExecutionPlan, type ExecutionPlannerAgentConfig, type ExpressBuilderAgentConfig, type ExtractedModule, FRONTEND_ARCHITECT_SYSTEM_PROMPT, type FeatureBreakdownResult, FieldOptionsSchema, type FinalRequirement, type FinishReason, type FlowsResult, ForgotPasswordSchema, type FormField, FormFieldSchema, type FrontendArchitectAgentConfig, type FrontendDesign, type FullPipelineConfig, GENERATE_FLOWS_PROMPT, GENERATE_STORIES_PROMPT, type GenerateN, type GenerateNOptions, type GenerateNResult, type HandleStepsContext, type HandleStepsFn, type HandleStepsGenerator, type HandleStepsResume, type HandleStepsYield, type HelloWorldAgentConfig, type HttpMethod, type ImageInput, type ImplementationPhase, type InvokeObjectOptions, type InvokeObjectResult, type InvokeOptions, type JudgeOptions, type LanguageModelUsage, LibraryError, ListingPageApiSchema, ListingPageSchema, type LogLevel, type Logger, type LoggerConfig, LoginInputSchema, MONGODB_SYSTEM_PROMPT, type McpClientConfig, type McpClientInfo, type McpResolveOptions, type McpToolContent, type McpTransport, type Model, type ModelConfig, ModelError, type ModelMessage, type ModelProvider, type ModelResponse, type ModelTool, type ModelToolCall, type Module, ModuleSchema, type ModulesResult, type MongoActor, type MongoDbDesignerAgentConfig, type MongoExtractedFlow, type MongoExtractedStory, type MongoStructuredInput, type MongoTechnicalRequirements, NEXTJS_BUILDER_SYSTEM_PROMPT, type NextjsBuilderAgentConfig, PLANNING_SYSTEM_PROMPT, type PageAccess, type PageDesign, PageSchema, type PhaseStep, type PipelineStepResult, type PlanChatTurnResult, type PlanFromRequirementsConfig, type PlanSections, type PlanStageResult, type PlanningAgentConfig, type PlanningChatConfig, type ChatEntry as PlanningChatEntry, type PlanningContext, PlanningContextBuilder, type Stage as PlanningStage, type ProgrammaticAction, type ProgrammaticToolCall, type ProjectBrief, type ProposedEntry, type PruneOptions, type PruneResult, type Question$1 as Question, REACT_BUILDER_INSTRUCTION, REACT_BUILDER_SYSTEM_PROMPT, REQUIREMENT_GATHERER_SYSTEM_PROMPT, type ReactBuilderAgentConfig, type RequirementChatConfig, type RequirementContext, RequirementContextBuilder, type RequirementGathererAgentConfig, type RequirementSummary$1 as RequirementSummary, ResetPasswordSchema, type RoleDefinition, type RunSubagentOptions, SYNTHESIS_SYSTEM_FRAGMENT, SYNTHESIS_USER_PROMPT, type ScaffoldConfig, type ScaffoldError, type ScaffoldResult, type SecurityPolicy, type SelectionResult, SpecializationSchema, type Stage$1 as Stage, type StageInput, type StepAll, type StepOnce, type StoriesResult, type SubagentConfig, type SubagentDefinition, SubagentError, type SubagentResult, type TApiDesign, type TApiResponseTypeSchema, type TAppConfigSchema, type TApplicationSchema, type TAuthDesign, type TBackendDesign, type TMongoProjectSchema as TBackendProjectSchema, type TBrandingSchema, type TColumnSchema, type TCreateUserInputSchema, type TDataModelDesign, type TExecutionPlan, type TExpressConfig, type TForgotPasswordSchema, type TFormFieldSchema, type TFrontendDesign, type TLoginInputSchema, type TMongoFieldSchema, type TMongoModuleSchema, type TMongoProjectSchema, type TNextjsConfig, TOOL_REGISTRY, type TPageSchema, type TModuleSchema as TReactModuleSchema, type TResetPasswordSchema, type TSpecializationSchema, type TSubgraphConfig, type TUpdateUserInputSchema, type TUserSchema, type TemplateAuth, type TemplateBranding, type TemplateContext, type TemplateField, type TemplateModule, type TemplateOperation, type TestChecklistItem, type Tool, type ToolConfig, type ToolContext, ToolError, type ToolExecutionOptions, type ToolExecutionResult, type ToolLogger, type ToolSet, UpdateUserInputSchema, UserSchema, ValidationError, ValidationSchema, type VisionOptions, actorSchema, actorsResultSchema, apiDesignSchema as adApiDesignSchema, graphqlOperationSchema as adGraphqlOperationSchema, restEndpointSchema as adRestEndpointSchema, addChatEntry, advanceStage, apiRouteGeneratorSubagent, assemblePlan, authDesignSchema, authFlowSchema, authFlowStepSchema, authMiddlewareSchema, backendDesignSchema, buildCreateExecutionPlanPrompt, buildDesignAuthPrompt, buildDesignBackendPrompt, buildDesignDatabasePrompt, buildDesignExpressPrompt, buildDesignFrontendPrompt, buildDesignNextjsPrompt, buildDesignSubgraphPrompt, buildDiscoveryPrompt, buildExampleShotPrompt, buildExtractActorsPrompt, buildExtractModulesPrompt, buildFeedbackPrompt, buildGenerateFlowsPrompt, buildGenerateStoriesPrompt, buildInstructionPrompt, buildPromptVariables, buildSynthesisPrompt, chatEntrySchema, clearRun, compileTemplate, componentAnalyzerSubagent, componentDesignSchema, contractDesignerSubagent, convertRequirementToContext, createAnthropicModel, createApiDesignerTools, createApolloBuilderTools, createAuthDesignerTools, createBackendArchitectTools, createConfigValidatorSubagent, createDataModelerTools, createMongoDesignPrompt as createDbDesignPrompt, createDbDesignerTools, createDesignApiProTool, createDesignApiTool, createDesignAuthTool, createDesignBackendTool, createDesignDatabaseProTool, createDesignDatabaseTool, createDesignFrontendTool, createDesignSchemaProTool, createDesignSchemaTool, createExecutionPlanTool, createExecutionPlannerTools, createExpressBuilderTools, createFrontendArchitectTools, createGenerateExpressTool, createGenerateFeatureBreakdownTool, createGenerateFrontendTool, createGenerateNextjsTool, createGenerateSubgraphTool, createGoogleModel, createInitialContext, createLogger, createModel, createMongoDesignPrompt, createMongoProDesignPrompt, createMongoRedesignPrompt, createNextjsBuilderTools, createOpenAIModel, createPlanningContextBuilder, createMongoProDesignPrompt as createProDbDesignPrompt, createProposalTools, createReactBuilderTools, createRedesignDatabaseTool, createMongoRedesignPrompt as createRedesignPrompt, createRefineSchemaTools, createRequirementContextBuilder, createSchemaRefinerSubagent, createSubagentTool, createSubagentToolSet, createSweagentServer, createToolSet, crudApiSchema, databaseDesignSchema, databaseEntitySchema, defineSubagent, defineTool, discard, createSchemaRefinerSubagent as dmCreateSchemaRefinerSubagent, dataEntitySchema as dmDataEntitySchema, dataModelDesignSchema as dmDataModelDesignSchema, entityAnalyzerSubagent as dmEntityAnalyzerSubagent, validateSchemaTool as dmValidateSchemaTool, edgeCaseAnalyzerSubagent, edgeCaseSchema, editPlan, endpointAnalyzerSubagent, entityAnalyzerSubagent, entityFieldSchema, entityIndexSchema, entityRelationSchema, estimateMessagesTokens, estimateTokens, executeTool, executeToolByName, executionPlanSchema, expressConfigSchema, extractDataEntities, extractJson, extractRoles, extractedModuleSchema, mongoFieldSchema as fieldSchema, finalRequirementSchema, finalize, findTool, flowDesignerSubagent, flowSchema, flowsResultSchema, formFieldSchema, formatTechnicalRequirements, formatUserFlows, formatUserStories, formatUserTypes, frameworkSelectorSubagent, frontendDesignSchema, generateNResponses, getProposed, getTool, getTools, graphqlAnalyzerSubagent, graphqlFieldSchema, graphqlTypeSchema, helloWorldTool, implementationPhaseSchema, jsonSchema, listProposed, loggerConfigFromEnv, mergeStageResult, middlewareConfigSchema, middlewareConfiguratorSubagent, middlewareSchema, modelFieldSchema, modelSchema, mongoModuleSchema as moduleSchema, modulesResultSchema, mongoFieldSchema, mongoModuleSchema, mongoProjectSchema, nextjsApiRouteSchema, nextjsConfigSchema, nextjsLayoutSchema, nextjsPageSchema, pageDesignSchema, pagePlannerSubagent, parseModelJsonResponse, phaseStepSchema, processPlanningChat, processRequirementChat, projectBriefSchema, mongoProjectSchema as projectSchema, propose, pruneContext, questionSchema, registerHelpers, relationshipMapperSubagent, requirementContextSchema, requirementSummarySchema, resolverOperationSchema, resolverPlannerSubagent, roleDefinitionSchema, routeGeneratorSubagent, routeGroupSchema, routePlannerSubagent, routerMethodSchema, routerSchema, runAgent, runAgentWithSteps, runApiDesignerAgent, runApolloBuilderAgent, runAuthDesignerAgent, runBackendArchitectAgent, runDataModelerAgent, runDbDesignerAgent, runExecutionPlannerAgent, runExpressBuilderAgent, runFrontendArchitectAgent, runFullPipelineAgent, runHelloWorldAgent, runNextjsBuilderAgent, runPlanningAgent, runPlanningFromRequirements, runProgrammaticStep, runReactBuilderAgent, runRequirementGathererAgent, runSubagent, safeJsonParse, scaffoldExpressTool, scaffoldProject, scaffoldSubgraphTool, schemaGeneratorSubagent, securityAnalyzerSubagent, securityPolicySchema, selectByJudge, selectByLength, serverActionSchema, servicePlannerSubagent, serviceSchema, storiesResultSchema, storySchema, subgraphConfigSchema, subgraphModuleSchema, sumTokenUsage, summarizeMessage, summarizeMessages, testChecklistItemSchema, testingStrategistSubagent, tool, truncateText, truncateToTokens, validateApiTool, validateAuthTool, validateBackendTool, validateExecutionPlanTool, validateExpressTool, validateFrontendConfigTool, validateFrontendTool, validateNextjsTool, validateMongoSchemaTool as validateSchemaTool, validateSubgraphTool, writePlanToFile };
|