Skip to content

Commit 42b2570

Browse files
committed
feat: Remove outdated documentation and scripts; clean up import maps and code structure for improved maintainability
1 parent 3e9b955 commit 42b2570

File tree

10 files changed

+64
-419
lines changed

10 files changed

+64
-419
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
# Build
2-
3-
On Apple Slliocon:
4-
5-
```bash
6-
nix build --impure --option system-features nixos-test,benchmark,big-parallel,kvm .#packages.aarch64-linux.default
7-
```
8-
9-
Other distos:
10-
11-
```bash
12-
nix build --impure .
13-
```
14-
15-
# Debug
16-
17-
deno run -A packages/core/src/server.ts

TESTING_SUMMARY.md

Lines changed: 0 additions & 159 deletions
This file was deleted.

import_map.json

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/core/src/app.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ export const server = await mcpc([
1313

1414
export const createApp = () => {
1515
const app = new OpenAPIHono();
16-
// Register middleware
17-
// TODO: fix this, after enable it, will return none text/stream
18-
// app.use(loggingMiddleware());
19-
16+
2017
// Register routes
2118
registerAgent(app);
2219

packages/core/src/executors/sampling/workflow-sampling-executor.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
2525
private createArgsDef: ArgsDefCreator,
2626
server: ComposableMCPServer,
2727
private predefinedSteps?: MCPCStep[],
28-
config?: SamplingConfig,
28+
config?: SamplingConfig
2929
) {
3030
super(
3131
name,
3232
description,
3333
allToolNames,
3434
toolNameToDetailList,
3535
server,
36-
config,
36+
config
3737
);
3838

3939
// Create WorkflowExecutor for workflow management
@@ -43,14 +43,14 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
4343
toolNameToDetailList as [string, unknown][],
4444
createArgsDef,
4545
server,
46-
predefinedSteps,
46+
predefinedSteps
4747
);
4848
}
4949

5050
async executeWorkflowSampling(
5151
args: Record<string, unknown>,
5252
schema: Record<string, unknown>,
53-
state: WorkflowState,
53+
state: WorkflowState
5454
): Promise<CallToolResult> {
5555
const validationResult = this.validateSchema(args, schema);
5656
if (!validationResult.valid) {
@@ -66,14 +66,18 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
6666
isError: true,
6767
};
6868
}
69-
70-
return this.runSamplingLoop(() => this.buildWorkflowSystemPrompt(args, state), schema, state);
69+
70+
return this.runSamplingLoop(
71+
() => this.buildWorkflowSystemPrompt(args, state),
72+
schema,
73+
state
74+
);
7175
}
7276

7377
protected async processAction<TState>(
7478
parsedData: Record<string, unknown>,
7579
_schema: Record<string, unknown>,
76-
state?: TState,
80+
state?: TState
7781
): Promise<CallToolResult> {
7882
const workflowState = state as WorkflowState;
7983
if (!workflowState) {
@@ -84,36 +88,37 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
8488
// Use WorkflowExecutor to handle all workflow logic
8589
const workflowResult = await this.workflowExecutor.execute(
8690
parsedData,
87-
workflowState,
91+
workflowState
8892
);
8993

9094
// Extract result text using the same approach as WorkflowExecutor
91-
const resultText = workflowResult.content
92-
?.filter((content) => content.type === "text")
93-
?.map((content) => content.text)
94-
?.join("\n") || "No result";
95+
const resultText =
96+
workflowResult.content
97+
?.filter((content) => content.type === "text")
98+
?.map((content) => content.text)
99+
?.join("\n") || "No result";
95100

96101
// Check if workflow is completed - use same completion pattern as WorkflowExecutor
97102
if (workflowState.isCompleted()) {
98103
// Use similar completion message format as WorkflowExecutor with progress
99104
const progressDisplay = PromptUtils.formatWorkflowProgress(
100-
workflowState.getProgressData(),
105+
workflowState.getProgressData()
101106
);
102107
return this.createCompletionResult(
103-
`## Workflow Completed via Sampling\n\n${resultText}\n\n## Final Workflow Progress\n${progressDisplay}\n\n**Summary:**\n- Total steps: ${workflowState.getSteps().length}\n- Completion method: Agentic Sampling`,
108+
`## Workflow Completed via Sampling\n\n${resultText}\n\n## Final Workflow Progress\n${progressDisplay}\n\n**Summary:**\n- Total steps: ${
109+
workflowState.getSteps().length
110+
}\n- Completion method: Agentic Sampling`
104111
);
105112
}
106113

107114
// Add conversation history updates following agentic pattern
108-
this.conversationHistory.push(
109-
{
110-
role: "assistant",
111-
content: {
112-
type: "text",
113-
text: resultText,
114-
},
115+
this.conversationHistory.push({
116+
role: "assistant",
117+
content: {
118+
type: "text",
119+
text: resultText,
115120
},
116-
);
121+
});
117122

118123
return workflowResult;
119124
} catch (error) {
@@ -124,7 +129,7 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
124129

125130
private buildWorkflowSystemPrompt(
126131
args: Record<string, unknown>,
127-
state: WorkflowState,
132+
state: WorkflowState
128133
): string {
129134
// Get the current workflow schema from WorkflowExecutor
130135
const workflowSchema = this.createArgsDef.forCurrentState(state);
@@ -133,14 +138,11 @@ export class WorkflowSamplingExecutor extends BaseSamplingExecutor {
133138
const basePrompt = CompiledPrompts.samplingWorkflowExecution({
134139
toolName: this.name,
135140
description: this.description,
136-
toolList: `Workflow execution parameters: ${
137-
JSON.stringify(workflowSchema, null, 2)
138-
}`,
141+
workflowSchema: `${JSON.stringify(workflowSchema, null, 2)}`,
139142
});
140143

141144
// Create workflow-specific sampling prompt using existing patterns
142-
const workflowPrompt =
143-
`Current Task: <user_request>${args.userRequest}</user_request>`;
145+
const workflowPrompt = `\n\nCurrent Task: <user_request>${args.userRequest}</user_request>`;
144146

145147
// Use JSON instruction injection pattern
146148
return this.injectJsonInstruction({

0 commit comments

Comments
 (0)