@salesforce/magen-mcp-workflow 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/metadata.d.ts +16 -0
- package/dist/common/metadata.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/services/inputExtractionService.d.ts +4 -1
- package/dist/services/inputExtractionService.js.map +1 -1
- package/dist/tools/orchestrator/config.d.ts +37 -2
- package/dist/tools/orchestrator/index.d.ts +1 -1
- package/dist/tools/orchestrator/index.js.map +1 -1
- package/dist/tools/orchestrator/metadata.d.ts +18 -5
- package/dist/tools/orchestrator/metadata.js +13 -4
- package/dist/tools/orchestrator/metadata.js.map +1 -1
- package/dist/tools/orchestrator/orchestratorTool.d.ts +40 -9
- package/dist/tools/orchestrator/orchestratorTool.js +71 -26
- package/dist/tools/orchestrator/orchestratorTool.js.map +1 -1
- package/package.json +7 -3
|
@@ -80,6 +80,22 @@ export interface NodeGuidanceData<TResultSchema extends z.ZodObject<z.ZodRawShap
|
|
|
80
80
|
* LLM compliance with the expected structure.
|
|
81
81
|
*/
|
|
82
82
|
exampleOutput?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Optional custom guidance for the LLM to return results to the orchestrator.
|
|
85
|
+
*
|
|
86
|
+
* When provided, this replaces the orchestrator's default "return to orchestrator"
|
|
87
|
+
* prompt. The function receives only `workflowStateData` (the runtime session state
|
|
88
|
+
* that the producer doesn't have at construction time). The producer already owns
|
|
89
|
+
* `resultSchema` and `exampleOutput` as sibling properties on this same struct,
|
|
90
|
+
* so they can be captured in the closure if needed.
|
|
91
|
+
*
|
|
92
|
+
* Ensure this custom guidance properly instructs the LLM to return the workflow
|
|
93
|
+
* to the orchestrator, or the workflow will likely be broken.
|
|
94
|
+
*
|
|
95
|
+
* @param workflowStateData - The workflow state data to round-trip back to the orchestrator
|
|
96
|
+
* @returns The return guidance prompt string
|
|
97
|
+
*/
|
|
98
|
+
returnGuidance?: (workflowStateData: WorkflowStateData) => string;
|
|
83
99
|
}
|
|
84
100
|
/**
|
|
85
101
|
* Union type for all interrupt data types.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;CAC7E,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,iBAAiB,EAAE,mBAAmB;IACtC,SAAS,EAAE,WAAW;CACd,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAC9E,kKAAkK,CACnK;CACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;CAC7E,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,iBAAiB,EAAE,mBAAmB;IACtC,SAAS,EAAE,WAAW;CACd,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAC9E,kKAAkK,CACnK;CACF,CAAC,CAAC;AA0EH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAGhC,IAAgD;IAChD,OAAO,cAAc,IAAI,IAAI,IAAI,cAAc,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,CAAC,8EAA8E,CAAC;CAC5F,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export { executeToolWithLogging } from './utils/toolExecutionUtils.js';
|
|
|
9
9
|
export { AbstractTool, AbstractWorkflowTool } from './tools/base/index.js';
|
|
10
10
|
export { GET_INPUT_WORKFLOW_RESULT_SCHEMA } from './tools/utilities/index.js';
|
|
11
11
|
export { type BaseGraphConfig, type WorkflowRunnableConfig } from './common/graphConfig.js';
|
|
12
|
-
export { BaseNode, AbstractToolNode, createGetUserInputNode, createUserInputExtractionNode, type GetUserInputNodeOptions, type UserInputExtractionNodeOptions, } from './nodes/index.js';
|
|
12
|
+
export { BaseNode, AbstractToolNode, UserInputExtractionNode, createGetUserInputNode, createUserInputExtractionNode, type GetUserInputNodeOptions, type UserInputExtractionNodeOptions, } from './nodes/index.js';
|
|
13
13
|
export { CheckPropertiesFulfilledRouter } from './routers/index.js';
|
|
14
|
-
export { AbstractService } from './services/index.js';
|
|
14
|
+
export { AbstractService, InputExtractionService } from './services/index.js';
|
|
15
15
|
export { JsonCheckpointSaver, WorkflowStatePersistence, WorkflowStateManager, type WorkflowStateManagerConfig, type WorkflowEnvironment, } from './checkpointing/index.js';
|
|
16
|
-
export { OrchestratorTool, createOrchestratorToolMetadata, type OrchestratorConfig, type OrchestratorInput, type OrchestratorOutput, type OrchestratorToolMetadata, ORCHESTRATOR_INPUT_SCHEMA, ORCHESTRATOR_OUTPUT_SCHEMA, } from './tools/orchestrator/index.js';
|
|
16
|
+
export { OrchestratorTool, createOrchestratorToolMetadata, type DefaultOrchestratorInputSchema, type OrchestratorConfig, type OrchestratorInput, type OrchestratorOutput, type OrchestratorToolMetadata, ORCHESTRATOR_INPUT_SCHEMA, ORCHESTRATOR_OUTPUT_SCHEMA, } from './tools/orchestrator/index.js';
|
|
17
17
|
export { ProgressReporter, MCPProgressReporter, CommandRunner, DefaultCommandRunner, type Command, type CommandResult, type ProgressParseResult, type ProgressParser, type CommandExecutionOptions, } from './execution/index.js';
|
package/dist/index.js
CHANGED
|
@@ -21,11 +21,11 @@ export { AbstractTool, AbstractWorkflowTool } from './tools/base/index.js';
|
|
|
21
21
|
// Get Input Result Schema (for NodeGuidanceData / direct guidance mode services)
|
|
22
22
|
export { GET_INPUT_WORKFLOW_RESULT_SCHEMA } from './tools/utilities/index.js';
|
|
23
23
|
// Base Node Classes
|
|
24
|
-
export { BaseNode, AbstractToolNode, createGetUserInputNode, createUserInputExtractionNode, } from './nodes/index.js';
|
|
24
|
+
export { BaseNode, AbstractToolNode, UserInputExtractionNode, createGetUserInputNode, createUserInputExtractionNode, } from './nodes/index.js';
|
|
25
25
|
// Routers
|
|
26
26
|
export { CheckPropertiesFulfilledRouter } from './routers/index.js';
|
|
27
27
|
// Base Service Classes
|
|
28
|
-
export { AbstractService } from './services/index.js';
|
|
28
|
+
export { AbstractService, InputExtractionService } from './services/index.js';
|
|
29
29
|
// Checkpointing Infrastructure
|
|
30
30
|
export { JsonCheckpointSaver, WorkflowStatePersistence, WorkflowStateManager, } from './checkpointing/index.js';
|
|
31
31
|
// Orchestrator Tool
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iCAAiC;AACjC,OAAO,EAA6B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,iCAAiC;AACjC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAEhB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAEzC,UAAU;AACV,OAAO,EAEL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,kBAAkB;AAClB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,EAK/B,kBAAkB,GAInB,MAAM,sBAAsB,CAAC;AAU9B,gCAAgC;AAChC,OAAO,EAAqB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEnF,uBAAuB;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,iFAAiF;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAK9E,oBAAoB;AACpB,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,sBAAsB,EACtB,6BAA6B,GAG9B,MAAM,kBAAkB,CAAC;AAE1B,UAAU;AACV,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iCAAiC;AACjC,OAAO,EAA6B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,iCAAiC;AACjC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAEhB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAEzC,UAAU;AACV,OAAO,EAEL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,kBAAkB;AAClB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,EAK/B,kBAAkB,GAInB,MAAM,sBAAsB,CAAC;AAU9B,gCAAgC;AAChC,OAAO,EAAqB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEnF,uBAAuB;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,iFAAiF;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAK9E,oBAAoB;AACpB,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,GAG9B,MAAM,kBAAkB,CAAC;AAE1B,UAAU;AACV,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,+BAA+B;AAC/B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GAGrB,MAAM,0BAA0B,CAAC;AAElC,oBAAoB;AACpB,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAM9B,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAEvC,2BAA2B;AAC3B,OAAO,EAEL,mBAAmB,EAEnB,oBAAoB,GAMrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -51,5 +51,8 @@ export declare class InputExtractionService extends AbstractService implements I
|
|
|
51
51
|
* @param propertiesToExtract - Array of properties to extract
|
|
52
52
|
* @returns The guidance prompt string
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
protected generateTaskGuidance(userUtterance: unknown, propertiesToExtract: Array<{
|
|
55
|
+
propertyName: string;
|
|
56
|
+
description: string;
|
|
57
|
+
}>): string;
|
|
55
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputExtractionService.js","sourceRoot":"","sources":["../../src/services/inputExtractionService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA4BvD;;;;;;GAMG;AACH,MAAM,OAAO,sBACX,SAAQ,eAAe;IAWJ;IARnB;;;;;;OAMG;IACH,YACmB,MAAc,EAC/B,YAA2B,EAC3B,MAAe;QAEf,KAAK,CAAC,wBAAwB,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;QAJrC,WAAM,GAAN,MAAM,CAAQ;IAKjC,CAAC;IAED,iBAAiB,CAAC,SAAkB,EAAE,UAAsC;QAC1E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE;YAChD,SAAS;YACT,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM;SAC9C,CAAC,CAAC;QAEH,MAAM,mBAAmB,GAAG,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;QAEnE,0EAA0E;QAC1E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,MAAM,CAClD,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACZ,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,cAAc,IAAI,CAAC,YAAY,iBAAiB,CAAC;YAC1E,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAA4B,CAC7B,CAAC;QAEF,mDAAmD;QACnD,MAAM,gBAAgB,GAA0C;YAC9D,MAAM,EAAE,I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yBT,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;;;;EAI7B,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCpC,CAAC;IACA,CAAC;CACF"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import z from 'zod';
|
|
1
2
|
import { StateGraph } from '@langchain/langgraph';
|
|
2
3
|
import { Logger } from '../../logging/logger.js';
|
|
3
4
|
import { WorkflowStateManager } from '../../checkpointing/workflowStateManager.js';
|
|
5
|
+
import type { DefaultOrchestratorInputSchema } from './metadata.js';
|
|
4
6
|
/**
|
|
5
7
|
* Orchestrator configuration interface
|
|
6
8
|
*
|
|
7
|
-
*
|
|
9
|
+
* @template TInputSchema - The Zod input schema type for the orchestrator MCP tool.
|
|
10
|
+
* Defaults to the standard ORCHESTRATOR_INPUT_SCHEMA. When providing a custom schema,
|
|
11
|
+
* the OrchestratorTool subclass MUST also override extractUserInput() and
|
|
12
|
+
* extractWorkflowStateData() to map the custom schema's properties to the
|
|
13
|
+
* orchestrator's semantic needs.
|
|
14
|
+
*
|
|
15
|
+
* Example usage (default schema):
|
|
8
16
|
* ```
|
|
9
17
|
* const MyWorkflowState = Annotation.Root({ messages: Annotation<string[]> });
|
|
10
18
|
* const workflow = new StateGraph(MyWorkflowState)
|
|
@@ -19,8 +27,24 @@ import { WorkflowStateManager } from '../../checkpointing/workflowStateManager.j
|
|
|
19
27
|
* workflow,
|
|
20
28
|
* };
|
|
21
29
|
* ```
|
|
30
|
+
*
|
|
31
|
+
* Example usage (custom schema):
|
|
32
|
+
* ```
|
|
33
|
+
* const MY_CUSTOM_SCHEMA = z.object({
|
|
34
|
+
* payload: z.unknown().optional(),
|
|
35
|
+
* sessionState: z.object({ thread_id: z.string() }).default({ thread_id: '' }),
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const config: OrchestratorConfig<typeof MY_CUSTOM_SCHEMA> = {
|
|
39
|
+
* toolId: 'my-orchestrator',
|
|
40
|
+
* title: 'My Orchestrator',
|
|
41
|
+
* description: 'Orchestrates my workflow',
|
|
42
|
+
* workflow,
|
|
43
|
+
* inputSchema: MY_CUSTOM_SCHEMA,
|
|
44
|
+
* };
|
|
45
|
+
* ```
|
|
22
46
|
*/
|
|
23
|
-
export interface OrchestratorConfig {
|
|
47
|
+
export interface OrchestratorConfig<TInputSchema extends z.ZodObject<z.ZodRawShape> = DefaultOrchestratorInputSchema> {
|
|
24
48
|
/** Unique tool identifier for MCP registration */
|
|
25
49
|
toolId: string;
|
|
26
50
|
/** Extended tool title for display */
|
|
@@ -35,6 +59,17 @@ export interface OrchestratorConfig {
|
|
|
35
59
|
* with the appropriate checkpointer.
|
|
36
60
|
*/
|
|
37
61
|
workflow: StateGraph<any, any, any, any, any, any, any, any>;
|
|
62
|
+
/**
|
|
63
|
+
* Custom Zod input schema for the orchestrator MCP tool.
|
|
64
|
+
*
|
|
65
|
+
* Optional - defaults to ORCHESTRATOR_INPUT_SCHEMA, which provides the standard
|
|
66
|
+
* `userInput` and `workflowStateData` properties.
|
|
67
|
+
*
|
|
68
|
+
* When providing a custom schema, the OrchestratorTool subclass MUST also override
|
|
69
|
+
* `extractUserInput()` and `extractWorkflowStateData()` to map the custom schema's
|
|
70
|
+
* properties to the orchestrator's semantic needs.
|
|
71
|
+
*/
|
|
72
|
+
inputSchema?: TInputSchema;
|
|
38
73
|
/**
|
|
39
74
|
* Workflow state manager for checkpointing and persistence
|
|
40
75
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type OrchestratorConfig } from './config.js';
|
|
2
|
-
export { type OrchestratorInput, type OrchestratorOutput, type OrchestratorToolMetadata, ORCHESTRATOR_INPUT_SCHEMA, ORCHESTRATOR_OUTPUT_SCHEMA, createOrchestratorToolMetadata, } from './metadata.js';
|
|
2
|
+
export { type DefaultOrchestratorInputSchema, type OrchestratorInput, type OrchestratorOutput, type OrchestratorToolMetadata, ORCHESTRATOR_INPUT_SCHEMA, ORCHESTRATOR_OUTPUT_SCHEMA, createOrchestratorToolMetadata, } from './metadata.js';
|
|
3
3
|
export { OrchestratorTool } from './orchestratorTool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/orchestrator/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/orchestrator/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAKL,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -85,17 +85,30 @@ export declare const ORCHESTRATOR_OUTPUT_SCHEMA: z.ZodObject<{
|
|
|
85
85
|
orchestrationInstructionsPrompt: string;
|
|
86
86
|
}>;
|
|
87
87
|
export type OrchestratorOutput = z.infer<typeof ORCHESTRATOR_OUTPUT_SCHEMA>;
|
|
88
|
+
/**
|
|
89
|
+
* Type alias for the default orchestrator input schema type.
|
|
90
|
+
*
|
|
91
|
+
* Used as the default generic parameter for OrchestratorConfig, OrchestratorToolMetadata,
|
|
92
|
+
* and OrchestratorTool to avoid circular imports between config.ts and metadata.ts.
|
|
93
|
+
*/
|
|
94
|
+
export type DefaultOrchestratorInputSchema = typeof ORCHESTRATOR_INPUT_SCHEMA;
|
|
88
95
|
/**
|
|
89
96
|
* Orchestrator tool metadata type
|
|
90
97
|
* The metadata for the orchestrator tool (inputs/outputs)
|
|
98
|
+
*
|
|
99
|
+
* @template TInputSchema - The Zod input schema type. Defaults to ORCHESTRATOR_INPUT_SCHEMA.
|
|
91
100
|
*/
|
|
92
|
-
export type OrchestratorToolMetadata = ToolMetadata<
|
|
101
|
+
export type OrchestratorToolMetadata<TInputSchema extends z.ZodObject<z.ZodRawShape> = DefaultOrchestratorInputSchema> = ToolMetadata<TInputSchema, typeof ORCHESTRATOR_OUTPUT_SCHEMA>;
|
|
93
102
|
/**
|
|
94
|
-
* Factory function to create orchestrator tool metadata from configuration
|
|
103
|
+
* Factory function to create orchestrator tool metadata from configuration.
|
|
95
104
|
* Takes the consumer-provided config and creates the tool metadata with
|
|
96
|
-
*
|
|
105
|
+
* the appropriate input/output schemas.
|
|
106
|
+
*
|
|
107
|
+
* When a custom inputSchema is provided in the config, it is used instead of
|
|
108
|
+
* the default ORCHESTRATOR_INPUT_SCHEMA.
|
|
97
109
|
*
|
|
110
|
+
* @template TInputSchema - The Zod input schema type. Defaults to ORCHESTRATOR_INPUT_SCHEMA.
|
|
98
111
|
* @param config - The orchestrator configuration
|
|
99
|
-
* @returns Tool metadata with the specified toolId, title, description
|
|
112
|
+
* @returns Tool metadata with the specified toolId, title, description, and schemas
|
|
100
113
|
*/
|
|
101
|
-
export declare function createOrchestratorToolMetadata(config: OrchestratorConfig): OrchestratorToolMetadata
|
|
114
|
+
export declare function createOrchestratorToolMetadata<TInputSchema extends z.ZodObject<z.ZodRawShape> = DefaultOrchestratorInputSchema>(config: OrchestratorConfig<TInputSchema>): OrchestratorToolMetadata<TInputSchema>;
|
|
@@ -57,19 +57,28 @@ export const ORCHESTRATOR_OUTPUT_SCHEMA = z.object({
|
|
|
57
57
|
.describe('The prompt describing the next workflow action for the LLM to execute.'),
|
|
58
58
|
});
|
|
59
59
|
/**
|
|
60
|
-
* Factory function to create orchestrator tool metadata from configuration
|
|
60
|
+
* Factory function to create orchestrator tool metadata from configuration.
|
|
61
61
|
* Takes the consumer-provided config and creates the tool metadata with
|
|
62
|
-
*
|
|
62
|
+
* the appropriate input/output schemas.
|
|
63
63
|
*
|
|
64
|
+
* When a custom inputSchema is provided in the config, it is used instead of
|
|
65
|
+
* the default ORCHESTRATOR_INPUT_SCHEMA.
|
|
66
|
+
*
|
|
67
|
+
* @template TInputSchema - The Zod input schema type. Defaults to ORCHESTRATOR_INPUT_SCHEMA.
|
|
64
68
|
* @param config - The orchestrator configuration
|
|
65
|
-
* @returns Tool metadata with the specified toolId, title, description
|
|
69
|
+
* @returns Tool metadata with the specified toolId, title, description, and schemas
|
|
66
70
|
*/
|
|
67
71
|
export function createOrchestratorToolMetadata(config) {
|
|
72
|
+
// The cast is necessary because TypeScript cannot prove that when config.inputSchema
|
|
73
|
+
// is undefined, TInputSchema must be DefaultOrchestratorInputSchema (i.e. the generic
|
|
74
|
+
// default and the runtime default independently track the same fallback). The cast is
|
|
75
|
+
// safe: when inputSchema is omitted, TInputSchema defaults to typeof ORCHESTRATOR_INPUT_SCHEMA.
|
|
76
|
+
const effectiveInputSchema = (config.inputSchema ?? ORCHESTRATOR_INPUT_SCHEMA);
|
|
68
77
|
return {
|
|
69
78
|
toolId: config.toolId,
|
|
70
79
|
title: config.title,
|
|
71
80
|
description: config.description,
|
|
72
|
-
inputSchema:
|
|
81
|
+
inputSchema: effectiveInputSchema,
|
|
73
82
|
outputSchema: ORCHESTRATOR_OUTPUT_SCHEMA,
|
|
74
83
|
};
|
|
75
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/tools/orchestrator/metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAGlC;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CACjF,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/B,QAAQ,CAAC,8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E5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,KAAK,CAAC,CAAC,2BAA2B,EAAE,4BAA4B,CAAC,CAAC;KAClE,QAAQ,CACP,uIAAuI,CACxI,CAAC;AAEJ;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACjE,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC;QAC9E,SAAS,EAAE,EAAE;KACd,CAAC,CAAC,QAAQ,CAAC,oFAAoF,CAAC;CAClG,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,+BAA+B,EAAE,CAAC;SAC/B,MAAM,EAAE;SACR,QAAQ,CAAC,wEAAwE,CAAC;CACtF,CAAC,CAAC;AAsBH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,8BAA8B,CAE5C,MAAwC;IACxC,qFAAqF;IACrF,sFAAsF;IACtF,sFAAsF;IACtF,gGAAgG;IAChG,MAAM,oBAAoB,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,yBAAyB,CAAiB,CAAC;IAC/F,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,0BAA0B;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import z from 'zod';
|
|
1
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
3
|
import type { ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js';
|
|
3
4
|
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
4
5
|
import { AbstractTool } from '../base/abstractTool.js';
|
|
6
|
+
import { MCPToolInvocationData, NodeGuidanceData, WorkflowStateData } from '../../common/metadata.js';
|
|
5
7
|
import type { WorkflowRunnableConfig } from '../../common/graphConfig.js';
|
|
6
8
|
import { type ProgressReporter } from '../../execution/progressReporter.js';
|
|
7
|
-
import { OrchestratorConfig } from './config.js';
|
|
8
|
-
import {
|
|
9
|
+
import type { OrchestratorConfig } from './config.js';
|
|
10
|
+
import { type OrchestratorOutput, type OrchestratorToolMetadata, type DefaultOrchestratorInputSchema } from './metadata.js';
|
|
9
11
|
/**
|
|
10
12
|
* Orchestrator Tool
|
|
11
13
|
*
|
|
@@ -19,15 +21,15 @@ import { OrchestratorInput, OrchestratorOutput, OrchestratorToolMetadata } from
|
|
|
19
21
|
*
|
|
20
22
|
* All state management and checkpointing responsibilities are delegated to WorkflowStateManager.
|
|
21
23
|
*/
|
|
22
|
-
export declare class OrchestratorTool extends AbstractTool<OrchestratorToolMetadata
|
|
24
|
+
export declare class OrchestratorTool<TInputSchema extends z.ZodObject<z.ZodRawShape> = DefaultOrchestratorInputSchema> extends AbstractTool<OrchestratorToolMetadata<TInputSchema>> {
|
|
23
25
|
private readonly config;
|
|
24
26
|
private readonly stateManager;
|
|
25
27
|
private currentProgressReporter;
|
|
26
|
-
constructor(server: McpServer, config: OrchestratorConfig);
|
|
28
|
+
constructor(server: McpServer, config: OrchestratorConfig<TInputSchema>);
|
|
27
29
|
/**
|
|
28
30
|
* Handle orchestrator requests - manages workflow state and execution
|
|
29
31
|
*/
|
|
30
|
-
handleRequest: (input:
|
|
32
|
+
handleRequest: (input: z.infer<TInputSchema>, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => Promise<{
|
|
31
33
|
content: {
|
|
32
34
|
type: "text";
|
|
33
35
|
text: string;
|
|
@@ -45,7 +47,7 @@ export declare class OrchestratorTool extends AbstractTool<OrchestratorToolMetad
|
|
|
45
47
|
* @returns A progress reporter instance, or undefined if progress reporting is disabled
|
|
46
48
|
*/
|
|
47
49
|
protected createProgressReporter(extra: RequestHandlerExtra<ServerRequest, ServerNotification>): ProgressReporter | undefined;
|
|
48
|
-
protected processRequest(input:
|
|
50
|
+
protected processRequest(input: z.infer<TInputSchema>): Promise<OrchestratorOutput>;
|
|
49
51
|
/**
|
|
50
52
|
* Create the thread configuration for LangGraph workflow invocation.
|
|
51
53
|
*
|
|
@@ -64,17 +66,46 @@ export declare class OrchestratorTool extends AbstractTool<OrchestratorToolMetad
|
|
|
64
66
|
*/
|
|
65
67
|
protected getProgressReporter(): ProgressReporter | undefined;
|
|
66
68
|
/**
|
|
67
|
-
*
|
|
69
|
+
* Extract the user input value from the orchestrator input.
|
|
70
|
+
*
|
|
71
|
+
* Default implementation assumes the standard ORCHESTRATOR_INPUT_SCHEMA structure
|
|
72
|
+
* and reads the `userInput` property directly. Subclasses with custom input schemas
|
|
73
|
+
* MUST override this method to map their custom properties.
|
|
74
|
+
*
|
|
75
|
+
* @param input - The parsed orchestrator input
|
|
76
|
+
* @returns The user input value, or undefined if not present
|
|
77
|
+
*/
|
|
78
|
+
protected extractUserInput(input: z.infer<TInputSchema>): unknown | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Extract the workflow state data from the orchestrator input.
|
|
81
|
+
*
|
|
82
|
+
* Default implementation assumes the standard ORCHESTRATOR_INPUT_SCHEMA structure
|
|
83
|
+
* and reads the `workflowStateData` property directly. Subclasses with custom input
|
|
84
|
+
* schemas MUST override this method to map their custom properties.
|
|
85
|
+
*
|
|
86
|
+
* @param input - The parsed orchestrator input
|
|
87
|
+
* @returns The workflow state data, or undefined if not present or invalid
|
|
88
|
+
*/
|
|
89
|
+
protected extractWorkflowStateData(input: z.infer<TInputSchema>): WorkflowStateData | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Create orchestration prompt for LLM with embedded tool invocation data and workflow state.
|
|
68
92
|
* Used in delegate mode - instructs LLM to call a separate MCP tool.
|
|
93
|
+
*
|
|
94
|
+
* Subclasses with custom input schemas may override this to adjust property
|
|
95
|
+
* name references in the generated prompt.
|
|
69
96
|
*/
|
|
70
|
-
|
|
97
|
+
protected createOrchestrationPrompt(mcpToolInvocationData: MCPToolInvocationData<z.ZodObject<z.ZodRawShape>>, workflowStateData: WorkflowStateData): string;
|
|
71
98
|
/**
|
|
72
99
|
* Create a direct guidance prompt for the LLM.
|
|
73
100
|
* Used in direct guidance mode - provides guidance inline without an intermediate tool call.
|
|
74
101
|
*
|
|
102
|
+
* Subclasses with custom input schemas may override this to adjust property
|
|
103
|
+
* name references in the generated prompt.
|
|
104
|
+
*
|
|
75
105
|
* @param nodeGuidanceData - The node guidance data containing task guidance and schemas
|
|
76
106
|
* @param workflowStateData - The workflow state data to round-trip back to the orchestrator
|
|
77
107
|
* @returns A prompt with the task guidance and post-task instructions
|
|
78
108
|
*/
|
|
79
|
-
|
|
109
|
+
protected createDirectGuidancePrompt(nodeGuidanceData: NodeGuidanceData<z.ZodObject<z.ZodRawShape>>, workflowStateData: WorkflowStateData): string;
|
|
110
|
+
private defaultReturnGuidance;
|
|
80
111
|
}
|
|
@@ -47,6 +47,9 @@ export class OrchestratorTool extends AbstractTool {
|
|
|
47
47
|
/**
|
|
48
48
|
* Handle orchestrator requests - manages workflow state and execution
|
|
49
49
|
*/
|
|
50
|
+
// @ts-expect-error TS2416 - z.infer<TInputSchema> is structurally equivalent to
|
|
51
|
+
// ShapeOutput<TInputSchema['shape']> (the type ToolCallback resolves to) for Zod object
|
|
52
|
+
// schemas, but TypeScript cannot prove this for generic type parameters.
|
|
50
53
|
handleRequest = async (input, extra) => {
|
|
51
54
|
// Create progress reporter from MCP context
|
|
52
55
|
this.currentProgressReporter = this.createProgressReporter(extra);
|
|
@@ -87,26 +90,29 @@ export class OrchestratorTool extends AbstractTool {
|
|
|
87
90
|
return new MCPProgressReporter(sendNotification, progressToken);
|
|
88
91
|
}
|
|
89
92
|
async processRequest(input) {
|
|
90
|
-
//
|
|
91
|
-
let
|
|
93
|
+
// Resolve workflow state: extract from input or create fresh for a new session
|
|
94
|
+
let workflowStateData;
|
|
92
95
|
try {
|
|
93
96
|
const parsedInput = this.toolMetadata.inputSchema.parse(input);
|
|
94
|
-
|
|
97
|
+
workflowStateData = this.extractWorkflowStateData(parsedInput);
|
|
95
98
|
}
|
|
96
99
|
catch (error) {
|
|
97
100
|
this.logger.error('Error parsing orchestrator input. Starting a new workflow.', error);
|
|
98
101
|
}
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
const isResumption = workflowStateData && workflowStateData.thread_id !== '';
|
|
103
|
+
if (!isResumption) {
|
|
104
|
+
workflowStateData = { thread_id: generateUniqueThreadId() };
|
|
101
105
|
}
|
|
102
|
-
|
|
106
|
+
workflowStateData = workflowStateData;
|
|
107
|
+
// Extract user input using the (overridable) extractor method
|
|
108
|
+
const userInput = this.extractUserInput(input);
|
|
103
109
|
this.logger.info('Processing orchestrator request', {
|
|
104
|
-
threadId,
|
|
105
|
-
hasUserInput: !!
|
|
106
|
-
isResumption
|
|
110
|
+
threadId: workflowStateData.thread_id,
|
|
111
|
+
hasUserInput: !!userInput,
|
|
112
|
+
isResumption,
|
|
107
113
|
});
|
|
108
114
|
// Thread configuration for LangGraph - includes optional progress reporter
|
|
109
|
-
const threadConfig = this.createThreadConfig(
|
|
115
|
+
const threadConfig = this.createThreadConfig(workflowStateData.thread_id, this.getProgressReporter());
|
|
110
116
|
// Get checkpointer from state manager
|
|
111
117
|
const checkpointer = await this.stateManager.createCheckpointer();
|
|
112
118
|
// Compile workflow with checkpointer
|
|
@@ -122,13 +128,13 @@ export class OrchestratorTool extends AbstractTool {
|
|
|
122
128
|
interrupts: interruptedTask.interrupts.length,
|
|
123
129
|
});
|
|
124
130
|
// Resume workflow with user input from previous tool execution
|
|
125
|
-
result = await compiledWorkflow.invoke(new Command({ resume:
|
|
131
|
+
result = await compiledWorkflow.invoke(new Command({ resume: userInput }), threadConfig);
|
|
126
132
|
}
|
|
127
133
|
else {
|
|
128
134
|
// Start new workflow session
|
|
129
135
|
this.logger.info('Starting new workflow execution');
|
|
130
136
|
result = await compiledWorkflow.invoke({
|
|
131
|
-
userInput
|
|
137
|
+
userInput,
|
|
132
138
|
}, threadConfig);
|
|
133
139
|
}
|
|
134
140
|
this.logger.debug('Processing workflow result');
|
|
@@ -194,8 +200,37 @@ export class OrchestratorTool extends AbstractTool {
|
|
|
194
200
|
return this.currentProgressReporter;
|
|
195
201
|
}
|
|
196
202
|
/**
|
|
197
|
-
*
|
|
203
|
+
* Extract the user input value from the orchestrator input.
|
|
204
|
+
*
|
|
205
|
+
* Default implementation assumes the standard ORCHESTRATOR_INPUT_SCHEMA structure
|
|
206
|
+
* and reads the `userInput` property directly. Subclasses with custom input schemas
|
|
207
|
+
* MUST override this method to map their custom properties.
|
|
208
|
+
*
|
|
209
|
+
* @param input - The parsed orchestrator input
|
|
210
|
+
* @returns The user input value, or undefined if not present
|
|
211
|
+
*/
|
|
212
|
+
extractUserInput(input) {
|
|
213
|
+
return input.userInput;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Extract the workflow state data from the orchestrator input.
|
|
217
|
+
*
|
|
218
|
+
* Default implementation assumes the standard ORCHESTRATOR_INPUT_SCHEMA structure
|
|
219
|
+
* and reads the `workflowStateData` property directly. Subclasses with custom input
|
|
220
|
+
* schemas MUST override this method to map their custom properties.
|
|
221
|
+
*
|
|
222
|
+
* @param input - The parsed orchestrator input
|
|
223
|
+
* @returns The workflow state data, or undefined if not present or invalid
|
|
224
|
+
*/
|
|
225
|
+
extractWorkflowStateData(input) {
|
|
226
|
+
return input.workflowStateData;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Create orchestration prompt for LLM with embedded tool invocation data and workflow state.
|
|
198
230
|
* Used in delegate mode - instructs LLM to call a separate MCP tool.
|
|
231
|
+
*
|
|
232
|
+
* Subclasses with custom input schemas may override this to adjust property
|
|
233
|
+
* name references in the generated prompt.
|
|
199
234
|
*/
|
|
200
235
|
createOrchestrationPrompt(mcpToolInvocationData, workflowStateData) {
|
|
201
236
|
return `
|
|
@@ -243,22 +278,17 @@ instructions for continuing the workflow.
|
|
|
243
278
|
* Create a direct guidance prompt for the LLM.
|
|
244
279
|
* Used in direct guidance mode - provides guidance inline without an intermediate tool call.
|
|
245
280
|
*
|
|
281
|
+
* Subclasses with custom input schemas may override this to adjust property
|
|
282
|
+
* name references in the generated prompt.
|
|
283
|
+
*
|
|
246
284
|
* @param nodeGuidanceData - The node guidance data containing task guidance and schemas
|
|
247
285
|
* @param workflowStateData - The workflow state data to round-trip back to the orchestrator
|
|
248
286
|
* @returns A prompt with the task guidance and post-task instructions
|
|
249
287
|
*/
|
|
250
288
|
createDirectGuidancePrompt(nodeGuidanceData, workflowStateData) {
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
? `
|
|
255
|
-
For example, a properly formatted result should look like:
|
|
256
|
-
|
|
257
|
-
\`\`\`json
|
|
258
|
-
${nodeGuidanceData.exampleOutput}
|
|
259
|
-
\`\`\`
|
|
260
|
-
`
|
|
261
|
-
: '';
|
|
289
|
+
const returnGuidance = nodeGuidanceData.returnGuidance
|
|
290
|
+
? nodeGuidanceData.returnGuidance(workflowStateData)
|
|
291
|
+
: this.defaultReturnGuidance(workflowStateData, nodeGuidanceData.resultSchema, nodeGuidanceData.exampleOutput);
|
|
262
292
|
return `
|
|
263
293
|
# ROLE
|
|
264
294
|
|
|
@@ -269,7 +299,22 @@ you with direct guidance for the current task.
|
|
|
269
299
|
|
|
270
300
|
${nodeGuidanceData.taskGuidance}
|
|
271
301
|
|
|
272
|
-
|
|
302
|
+
${returnGuidance}
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
defaultReturnGuidance(workflowStateData, resultSchema, exampleOutput) {
|
|
306
|
+
const resultSchemaJson = JSON.stringify(zodToJsonSchema(resultSchema), null, 2);
|
|
307
|
+
// Build example section if provided
|
|
308
|
+
const exampleSection = exampleOutput
|
|
309
|
+
? `
|
|
310
|
+
For example, a properly formatted result should look like:
|
|
311
|
+
|
|
312
|
+
\`\`\`json
|
|
313
|
+
${exampleOutput}
|
|
314
|
+
\`\`\`
|
|
315
|
+
`
|
|
316
|
+
: '';
|
|
317
|
+
return `# CRITICAL: REQUIRED NEXT STEP
|
|
273
318
|
|
|
274
319
|
After completing the task above, you **MUST** invoke the \`${this.toolMetadata.toolId}\` tool
|
|
275
320
|
to continue the workflow. The workflow CANNOT proceed without this tool call.
|
|
@@ -302,7 +347,7 @@ Here is an example of the EXACT format your tool call should follow:
|
|
|
302
347
|
\`\`\`
|
|
303
348
|
Tool: ${this.toolMetadata.toolId}
|
|
304
349
|
Parameters:
|
|
305
|
-
${WORKFLOW_PROPERTY_NAMES.userInput}: ${
|
|
350
|
+
${WORKFLOW_PROPERTY_NAMES.userInput}: ${exampleOutput ? exampleOutput.replaceAll('\n', '\n ') : '{ /* your result object here */ }'}
|
|
306
351
|
${WORKFLOW_PROPERTY_NAMES.workflowStateData}: ${JSON.stringify(workflowStateData)}
|
|
307
352
|
\`\`\`
|
|
308
353
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratorTool.js","sourceRoot":"","sources":["../../../src/tools/orchestrator/orchestratorTool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAIL,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAyB,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;A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CAAC;QACP,OAAO;;6DAEkD,IAAI,CAAC,YAAY,CAAC,MAAM;;;;;;;;0BAQ3D,IAAI,CAAC,YAAY,CAAC,MAAM;;;;MAI5C,uBAAuB,CAAC,SAAS;MACjC,uBAAuB,CAAC,iBAAiB,UAAU,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;;;;QAIlF,uBAAuB,CAAC,SAAS;;;EAGvC,gBAAgB;;EAEhB,cAAc;;;;;;;QAOR,IAAI,CAAC,YAAY,CAAC,MAAM;;IAE5B,uBAAuB,CAAC,SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,mCAAmC;IACpI,uBAAuB,CAAC,iBAAiB,KAAK,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;;CAElF,CAAC;IACA,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/magen-mcp-workflow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -24,14 +24,18 @@
|
|
|
24
24
|
"lint": "eslint --max-warnings 0 --config ../../eslint.config.mjs \"{src,tests}/**/*.ts\"",
|
|
25
25
|
"format": "prettier --write \"{src,tests}/**/*.ts\""
|
|
26
26
|
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/forcedotcom/mobile-mcp-tools.git"
|
|
30
|
+
},
|
|
27
31
|
"dependencies": {
|
|
28
32
|
"@langchain/langgraph": "^0.4.9",
|
|
29
33
|
"@langchain/langgraph-checkpoint": "^0.0.11",
|
|
30
34
|
"@langchain/core": "^0.3.80",
|
|
31
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
32
36
|
"pino": "^9.9.5",
|
|
33
37
|
"zod": "^3.25.67",
|
|
34
|
-
"zod-to-json-schema": "^3.
|
|
38
|
+
"zod-to-json-schema": "^3.25.1"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@types/node": "^24.8.1",
|