@@ -180,7 +180,7 @@ cat > "$FEATURE_DIR/index.ts" << EOF
180180 */
181181
182182import { Tool } from '@modelcontextprotocol/sdk/types.js';
183- import type { HandlerContext } from '../../core/types/index.js';
183+ import type { ResolvedContext } from '../../core/types/index.js';
184184
185185import { ${CAMEL_CASE} ToolDefinitions, ${CAMEL_CASE} ToolHandlers } from './tools.js';
186186EOF
@@ -248,7 +248,7 @@ cat > "$FEATURE_DIR/tools.ts" << EOF
248248 */
249249
250250import { Tool } from '@modelcontextprotocol/sdk/types.js';
251- import type { HandlerContext } from '../../core/types/index .js';
251+ import type { ResolvedContext } from '../../core/types/context .js';
252252
253253import * as handlers from './handlers.js';
254254import { ${CAMEL_CASE} Tools } from './docTools.js';
@@ -315,21 +315,21 @@ export const ${CAMEL_CASE}ToolDefinitions: Tool[] = [
315315 */
316316export const ${CAMEL_CASE} ToolHandlers = [
317317 // get_${FEATURE_KEY} _integration_guide
318- async (args: any, context: HandlerContext ) => {
318+ async (args: any, context: ResolvedContext ) => {
319319 return ${CAMEL_CASE} Tools.getIntegrationWorkflow();
320320 },
321321
322322 // TODO: 添加更多 handlers
323323 // 示例 - save_${FEATURE_KEY} _data handler:
324324 /*
325- async (args: { key: string; value: string }, context: HandlerContext ) => {
325+ async (args: { key: string; value: string }, context: ResolvedContext ) => {
326326 return handlers.saveData(args, context);
327327 },
328328 */
329329
330330 // 示例 - load_${FEATURE_KEY} _data handler:
331331 /*
332- async (args: { key: string }, context: HandlerContext ) => {
332+ async (args: { key: string }, context: ResolvedContext ) => {
333333 return handlers.loadData(args, context);
334334 }
335335 */
@@ -698,15 +698,15 @@ cat > "$FEATURE_DIR/handlers.ts" << EOF
698698 * $FEATURE_NAME Handlers
699699 */
700700
701- import type { HandlerContext } from '../../core/types/index.js';
701+ import type { ResolvedContext } from '../../core/types/index.js';
702702import * as api from './api.js';
703703
704704// TODO: 实现业务逻辑处理器
705705// 示例:
706706/*
707707export async function saveData(
708708 args: { key: string; value: string },
709- context: HandlerContext
709+ context: ResolvedContext
710710): Promise<string> {
711711 const { key, value } = args;
712712
@@ -720,7 +720,7 @@ Value: \${value}\`;
720720
721721export async function loadData(
722722 args: { key: string },
723- context: HandlerContext
723+ context: ResolvedContext
724724): Promise<string> {
725725 const { key } = args;
726726
@@ -745,7 +745,7 @@ cat > "$FEATURE_DIR/api.ts" << EOF
745745
746746import { HttpClient } from '../../core/network/httpClient.js';
747747import { ensureAppInfo } from '../app/api.js'; // 导入应用信息函数
748- import type { HandlerContext } from '../../core/types/index .js';
748+ import type { ResolvedContext } from '../../core/types/context .js';
749749
750750// TODO: 定义接口
751751// 示例:
@@ -777,11 +777,12 @@ export interface LoadDataResponse {
777777/*
778778export async function saveDataToCloud(
779779 args: { key: string; value: string },
780- context: HandlerContext
780+ context: ResolvedContext
781781): Promise<SaveDataResponse> {
782782 const client = new HttpClient();
783783
784784 // 获取应用信息(developer_id, app_id 等)
785+ // 注意:ensureAppInfo 现在接受 projectPath 字符串,从 context.projectPath 获取
785786 const appInfo = await ensureAppInfo(context.projectPath);
786787
787788 const response = await client.post<SaveDataResponse>(
@@ -801,7 +802,7 @@ export async function saveDataToCloud(
801802
802803export async function loadDataFromCloud(
803804 args: { key: string },
804- context: HandlerContext
805+ context: ResolvedContext
805806): Promise<string> {
806807 const client = new HttpClient();
807808
0 commit comments