@flowdot.ai/mcp-server 1.0.0 → 1.0.2
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/LICENSE +21 -0
- package/README.md +162 -162
- package/bin/flowdot-mcp.js +15 -15
- package/dist/api-client.d.ts +2 -344
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +2 -784
- package/dist/api-client.js.map +1 -1
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +2204 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +19 -10
- package/dist/server.js.map +1 -1
- package/dist/tools/add-recipe-step.d.ts +23 -0
- package/dist/tools/add-recipe-step.d.ts.map +1 -0
- package/dist/tools/add-recipe-step.js +196 -0
- package/dist/tools/add-recipe-step.js.map +1 -0
- package/dist/tools/add-recipe-store.d.ts +19 -0
- package/dist/tools/add-recipe-store.d.ts.map +1 -0
- package/dist/tools/add-recipe-store.js +116 -0
- package/dist/tools/add-recipe-store.js.map +1 -0
- package/dist/tools/agent-toolkits.d.ts +57 -0
- package/dist/tools/agent-toolkits.d.ts.map +1 -0
- package/dist/tools/agent-toolkits.js +1712 -0
- package/dist/tools/agent-toolkits.js.map +1 -0
- package/dist/tools/append-app-code.d.ts +12 -0
- package/dist/tools/append-app-code.d.ts.map +1 -0
- package/dist/tools/append-app-code.js +83 -0
- package/dist/tools/append-app-code.js.map +1 -0
- package/dist/tools/browse-recipes.d.ts +16 -0
- package/dist/tools/browse-recipes.d.ts.map +1 -0
- package/dist/tools/browse-recipes.js +102 -0
- package/dist/tools/browse-recipes.js.map +1 -0
- package/dist/tools/clone-app.js +20 -20
- package/dist/tools/create-app-file.d.ts +11 -0
- package/dist/tools/create-app-file.d.ts.map +1 -0
- package/dist/tools/create-app-file.js +83 -0
- package/dist/tools/create-app-file.js.map +1 -0
- package/dist/tools/create-app.d.ts.map +1 -1
- package/dist/tools/create-app.js +47 -29
- package/dist/tools/create-app.js.map +1 -1
- package/dist/tools/create-knowledge-category.d.ts +16 -0
- package/dist/tools/create-knowledge-category.d.ts.map +1 -0
- package/dist/tools/create-knowledge-category.js +71 -0
- package/dist/tools/create-knowledge-category.js.map +1 -0
- package/dist/tools/create-recipe.d.ts +16 -0
- package/dist/tools/create-recipe.d.ts.map +1 -0
- package/dist/tools/create-recipe.js +92 -0
- package/dist/tools/create-recipe.js.map +1 -0
- package/dist/tools/delete-app-file.d.ts +11 -0
- package/dist/tools/delete-app-file.d.ts.map +1 -0
- package/dist/tools/delete-app-file.js +52 -0
- package/dist/tools/delete-app-file.js.map +1 -0
- package/dist/tools/delete-app.js +3 -3
- package/dist/tools/delete-knowledge-category.d.ts +12 -0
- package/dist/tools/delete-knowledge-category.d.ts.map +1 -0
- package/dist/tools/delete-knowledge-category.js +40 -0
- package/dist/tools/delete-knowledge-category.js.map +1 -0
- package/dist/tools/delete-knowledge-document.d.ts +12 -0
- package/dist/tools/delete-knowledge-document.d.ts.map +1 -0
- package/dist/tools/delete-knowledge-document.js +40 -0
- package/dist/tools/delete-knowledge-document.js.map +1 -0
- package/dist/tools/delete-recipe-step.d.ts +14 -0
- package/dist/tools/delete-recipe-step.d.ts.map +1 -0
- package/dist/tools/delete-recipe-step.js +65 -0
- package/dist/tools/delete-recipe-step.js.map +1 -0
- package/dist/tools/delete-recipe-store.d.ts +14 -0
- package/dist/tools/delete-recipe-store.d.ts.map +1 -0
- package/dist/tools/delete-recipe-store.js +65 -0
- package/dist/tools/delete-recipe-store.js.map +1 -0
- package/dist/tools/delete-recipe.d.ts +13 -0
- package/dist/tools/delete-recipe.d.ts.map +1 -0
- package/dist/tools/delete-recipe.js +59 -0
- package/dist/tools/delete-recipe.js.map +1 -0
- package/dist/tools/edit-app-code.d.ts +12 -0
- package/dist/tools/edit-app-code.d.ts.map +1 -0
- package/dist/tools/edit-app-code.js +110 -0
- package/dist/tools/edit-app-code.js.map +1 -0
- package/dist/tools/favorite-recipe.d.ts +13 -0
- package/dist/tools/favorite-recipe.d.ts.map +1 -0
- package/dist/tools/favorite-recipe.js +53 -0
- package/dist/tools/favorite-recipe.js.map +1 -0
- package/dist/tools/fork-recipe.d.ts +13 -0
- package/dist/tools/fork-recipe.d.ts.map +1 -0
- package/dist/tools/fork-recipe.js +56 -0
- package/dist/tools/fork-recipe.js.map +1 -0
- package/dist/tools/get-app-file.d.ts +11 -0
- package/dist/tools/get-app-file.d.ts.map +1 -0
- package/dist/tools/get-app-file.js +76 -0
- package/dist/tools/get-app-file.js.map +1 -0
- package/dist/tools/get-app-template.d.ts.map +1 -1
- package/dist/tools/get-app-template.js +65 -21
- package/dist/tools/get-app-template.js.map +1 -1
- package/dist/tools/get-app.js +54 -54
- package/dist/tools/get-knowledge-document.d.ts +12 -0
- package/dist/tools/get-knowledge-document.d.ts.map +1 -0
- package/dist/tools/get-knowledge-document.js +71 -0
- package/dist/tools/get-knowledge-document.js.map +1 -0
- package/dist/tools/get-knowledge-storage.d.ts +10 -0
- package/dist/tools/get-knowledge-storage.d.ts.map +1 -0
- package/dist/tools/get-knowledge-storage.js +54 -0
- package/dist/tools/get-knowledge-storage.js.map +1 -0
- package/dist/tools/get-recipe-definition.d.ts +15 -0
- package/dist/tools/get-recipe-definition.d.ts.map +1 -0
- package/dist/tools/get-recipe-definition.js +70 -0
- package/dist/tools/get-recipe-definition.js.map +1 -0
- package/dist/tools/get-recipe.d.ts +12 -0
- package/dist/tools/get-recipe.d.ts.map +1 -0
- package/dist/tools/get-recipe.js +88 -0
- package/dist/tools/get-recipe.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +301 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/insert-app-code.d.ts +12 -0
- package/dist/tools/insert-app-code.d.ts.map +1 -0
- package/dist/tools/insert-app-code.js +97 -0
- package/dist/tools/insert-app-code.js.map +1 -0
- package/dist/tools/link-app-workflow.js +21 -21
- package/dist/tools/link-recipe.d.ts +14 -0
- package/dist/tools/link-recipe.d.ts.map +1 -0
- package/dist/tools/link-recipe.js +76 -0
- package/dist/tools/link-recipe.js.map +1 -0
- package/dist/tools/list-app-files.d.ts +11 -0
- package/dist/tools/list-app-files.d.ts.map +1 -0
- package/dist/tools/list-app-files.js +84 -0
- package/dist/tools/list-app-files.js.map +1 -0
- package/dist/tools/list-apps.js +8 -8
- package/dist/tools/list-knowledge-categories.d.ts +14 -0
- package/dist/tools/list-knowledge-categories.d.ts.map +1 -0
- package/dist/tools/list-knowledge-categories.js +107 -0
- package/dist/tools/list-knowledge-categories.js.map +1 -0
- package/dist/tools/list-knowledge-documents.d.ts +15 -0
- package/dist/tools/list-knowledge-documents.d.ts.map +1 -0
- package/dist/tools/list-knowledge-documents.js +129 -0
- package/dist/tools/list-knowledge-documents.js.map +1 -0
- package/dist/tools/list-recipe-steps.d.ts +12 -0
- package/dist/tools/list-recipe-steps.d.ts.map +1 -0
- package/dist/tools/list-recipe-steps.js +69 -0
- package/dist/tools/list-recipe-steps.js.map +1 -0
- package/dist/tools/list-recipe-stores.d.ts +12 -0
- package/dist/tools/list-recipe-stores.d.ts.map +1 -0
- package/dist/tools/list-recipe-stores.js +87 -0
- package/dist/tools/list-recipe-stores.js.map +1 -0
- package/dist/tools/list-recipes.d.ts +12 -0
- package/dist/tools/list-recipes.d.ts.map +1 -0
- package/dist/tools/list-recipes.js +92 -0
- package/dist/tools/list-recipes.js.map +1 -0
- package/dist/tools/list-user-teams.d.ts +11 -0
- package/dist/tools/list-user-teams.d.ts.map +1 -0
- package/dist/tools/list-user-teams.js +56 -0
- package/dist/tools/list-user-teams.js.map +1 -0
- package/dist/tools/move-document-to-category.d.ts +13 -0
- package/dist/tools/move-document-to-category.d.ts.map +1 -0
- package/dist/tools/move-document-to-category.js +42 -0
- package/dist/tools/move-document-to-category.js.map +1 -0
- package/dist/tools/prepend-app-code.d.ts +12 -0
- package/dist/tools/prepend-app-code.d.ts.map +1 -0
- package/dist/tools/prepend-app-code.js +79 -0
- package/dist/tools/prepend-app-code.js.map +1 -0
- package/dist/tools/publish-app.js +7 -7
- package/dist/tools/query-knowledge-base.d.ts +18 -0
- package/dist/tools/query-knowledge-base.d.ts.map +1 -0
- package/dist/tools/query-knowledge-base.js +144 -0
- package/dist/tools/query-knowledge-base.js.map +1 -0
- package/dist/tools/rename-app-file.d.ts +11 -0
- package/dist/tools/rename-app-file.d.ts.map +1 -0
- package/dist/tools/rename-app-file.js +64 -0
- package/dist/tools/rename-app-file.js.map +1 -0
- package/dist/tools/reprocess-document.d.ts +12 -0
- package/dist/tools/reprocess-document.d.ts.map +1 -0
- package/dist/tools/reprocess-document.js +40 -0
- package/dist/tools/reprocess-document.js.map +1 -0
- package/dist/tools/search-apps.js +13 -13
- package/dist/tools/search.d.ts +14 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +86 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/set-app-entry-file.d.ts +11 -0
- package/dist/tools/set-app-entry-file.d.ts.map +1 -0
- package/dist/tools/set-app-entry-file.js +56 -0
- package/dist/tools/set-app-entry-file.js.map +1 -0
- package/dist/tools/transfer-document-ownership.d.ts +15 -0
- package/dist/tools/transfer-document-ownership.d.ts.map +1 -0
- package/dist/tools/transfer-document-ownership.js +66 -0
- package/dist/tools/transfer-document-ownership.js.map +1 -0
- package/dist/tools/unlink-app-workflow.js +2 -2
- package/dist/tools/unpublish-app.js +2 -2
- package/dist/tools/update-app-file.d.ts +11 -0
- package/dist/tools/update-app-file.d.ts.map +1 -0
- package/dist/tools/update-app-file.js +73 -0
- package/dist/tools/update-app-file.js.map +1 -0
- package/dist/tools/update-app.d.ts.map +1 -1
- package/dist/tools/update-app.js +8 -1
- package/dist/tools/update-app.js.map +1 -1
- package/dist/tools/update-knowledge-category.d.ts +15 -0
- package/dist/tools/update-knowledge-category.d.ts.map +1 -0
- package/dist/tools/update-knowledge-category.js +74 -0
- package/dist/tools/update-knowledge-category.js.map +1 -0
- package/dist/tools/update-recipe-step.d.ts +22 -0
- package/dist/tools/update-recipe-step.d.ts.map +1 -0
- package/dist/tools/update-recipe-step.js +97 -0
- package/dist/tools/update-recipe-step.js.map +1 -0
- package/dist/tools/update-recipe-store.d.ts +20 -0
- package/dist/tools/update-recipe-store.d.ts.map +1 -0
- package/dist/tools/update-recipe-store.js +98 -0
- package/dist/tools/update-recipe-store.js.map +1 -0
- package/dist/tools/update-recipe.d.ts +18 -0
- package/dist/tools/update-recipe.d.ts.map +1 -0
- package/dist/tools/update-recipe.js +98 -0
- package/dist/tools/update-recipe.js.map +1 -0
- package/dist/tools/upload-document-from-url.d.ts +16 -0
- package/dist/tools/upload-document-from-url.d.ts.map +1 -0
- package/dist/tools/upload-document-from-url.js +73 -0
- package/dist/tools/upload-document-from-url.js.map +1 -0
- package/dist/tools/upload-text-document.d.ts +17 -0
- package/dist/tools/upload-text-document.d.ts.map +1 -0
- package/dist/tools/upload-text-document.js +77 -0
- package/dist/tools/upload-text-document.js.map +1 -0
- package/dist/tools/vote-recipe.d.ts +13 -0
- package/dist/tools/vote-recipe.d.ts.map +1 -0
- package/dist/tools/vote-recipe.js +54 -0
- package/dist/tools/vote-recipe.js.map +1 -0
- package/dist/types.d.ts +3 -666
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/script-validator.d.ts.map +1 -1
- package/dist/utils/script-validator.js +5 -1
- package/dist/utils/script-validator.js.map +1 -1
- package/package.json +62 -54
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* delete_recipe MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Permanently deletes an agent recipe.
|
|
5
|
+
*/
|
|
6
|
+
export const deleteRecipeTool = {
|
|
7
|
+
name: 'delete_recipe',
|
|
8
|
+
description: 'Permanently delete an agent recipe. This action cannot be undone.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
hash: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The recipe hash/ID to delete',
|
|
15
|
+
},
|
|
16
|
+
confirm: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
description: 'Must be true to confirm deletion',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: ['hash', 'confirm'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export async function handleDeleteRecipe(api, args) {
|
|
25
|
+
try {
|
|
26
|
+
if (!args.confirm) {
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: 'Deletion cancelled. Set confirm to true to delete the recipe.',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
await api.deleteRecipe(args.hash);
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text',
|
|
41
|
+
text: `Recipe ${args.hash} has been permanently deleted.`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: `Error deleting recipe: ${message}`,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=delete-recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-recipe.js","sourceRoot":"","sources":["../../src/tools/delete-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,mEAAmE;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;aAC5C;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,kCAAkC;aAChD;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;KAC9B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAqB,EACrB,IAAwC;IAExC,IAAI,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,+DAA+D;qBACtE;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElC,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAI,CAAC,IAAI,gCAAgC;iBAC1D;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,OAAO,EAAE;iBAC1C;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* edit_app_code Tool
|
|
3
|
+
*
|
|
4
|
+
* Performs exact string replacement in app code.
|
|
5
|
+
* Similar to find-and-replace - replaces old_string with new_string.
|
|
6
|
+
* Required scope: apps:manage
|
|
7
|
+
*/
|
|
8
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
10
|
+
export declare const editAppCodeTool: Tool;
|
|
11
|
+
export declare function handleEditAppCode(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=edit-app-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-app-code.d.ts","sourceRoot":"","sources":["../../src/tools/edit-app-code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,IAyD7B,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CA+CzB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* edit_app_code Tool
|
|
3
|
+
*
|
|
4
|
+
* Performs exact string replacement in app code.
|
|
5
|
+
* Similar to find-and-replace - replaces old_string with new_string.
|
|
6
|
+
* Required scope: apps:manage
|
|
7
|
+
*/
|
|
8
|
+
export const editAppCodeTool = {
|
|
9
|
+
name: 'edit_app_code',
|
|
10
|
+
description: `Performs exact string replacement in app code. Similar to find-and-replace.
|
|
11
|
+
|
|
12
|
+
CRITICAL: Remember these rules when editing code:
|
|
13
|
+
- NO IMPORTS - React is global
|
|
14
|
+
- MUST include export default at the end: export default MyAppName;
|
|
15
|
+
- NO FORM ELEMENTS - Use div + button with type="button" instead
|
|
16
|
+
- Workflow results: Use getNodeOutput(result, nodeTitle) helper
|
|
17
|
+
- ALL BUTTONS need type="button" attribute
|
|
18
|
+
|
|
19
|
+
Use this tool when you need to:
|
|
20
|
+
- Modify specific sections of existing app code
|
|
21
|
+
- Replace a function, component, or code block
|
|
22
|
+
- Fix bugs or update logic in the code
|
|
23
|
+
|
|
24
|
+
IMPORTANT RULES:
|
|
25
|
+
- old_string must exist EXACTLY in the code (including whitespace/indentation)
|
|
26
|
+
- If old_string appears multiple times, the operation fails unless replace_all=true
|
|
27
|
+
- Provide enough context in old_string to make it unique
|
|
28
|
+
|
|
29
|
+
WORKFLOW FOR BUILDING LARGE APPS:
|
|
30
|
+
1. Create app with minimal code: create_app(name: "MyApp")
|
|
31
|
+
2. Set initial skeleton: update_app(code: "function MyApp() { ... } export default MyApp;")
|
|
32
|
+
3. Use edit_app_code to incrementally replace/expand sections
|
|
33
|
+
4. Use append_app_code to add helper functions before the export
|
|
34
|
+
|
|
35
|
+
Example:
|
|
36
|
+
- old_string: "return <div>Loading...</div>;"
|
|
37
|
+
- new_string: "return <div className=\"p-4\"><h1>Hello World</h1></div>;"`,
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
app_id: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'The app ID (hash) to edit',
|
|
44
|
+
},
|
|
45
|
+
old_string: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'The exact string to find and replace (must exist in code)',
|
|
48
|
+
},
|
|
49
|
+
new_string: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
description: 'The replacement string',
|
|
52
|
+
},
|
|
53
|
+
field: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
enum: ['code', 'mobile_code'],
|
|
56
|
+
description: 'Which code field to edit (default: "code")',
|
|
57
|
+
},
|
|
58
|
+
replace_all: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description: 'If true, replace all occurrences. If false (default), fails when multiple matches found.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ['app_id', 'old_string', 'new_string'],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export async function handleEditAppCode(client, args) {
|
|
67
|
+
try {
|
|
68
|
+
const appId = String(args.app_id);
|
|
69
|
+
const oldString = String(args.old_string);
|
|
70
|
+
const newString = String(args.new_string);
|
|
71
|
+
const field = args.field || 'code';
|
|
72
|
+
const replaceAll = Boolean(args.replace_all);
|
|
73
|
+
const result = await client.editAppCode(appId, {
|
|
74
|
+
old_string: oldString,
|
|
75
|
+
new_string: newString,
|
|
76
|
+
field,
|
|
77
|
+
replace_all: replaceAll,
|
|
78
|
+
});
|
|
79
|
+
const sizeDiff = result.new_length - result.previous_length;
|
|
80
|
+
const sizeChange = sizeDiff >= 0 ? `+${sizeDiff}` : String(sizeDiff);
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `App code edited successfully!
|
|
85
|
+
|
|
86
|
+
App ID: ${result.id}
|
|
87
|
+
Field: ${result.field}
|
|
88
|
+
Previous size: ${result.previous_length} bytes
|
|
89
|
+
New size: ${result.new_length} bytes (${sizeChange} bytes)
|
|
90
|
+
Updated at: ${result.updated_at}`,
|
|
91
|
+
}],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
96
|
+
// Try to extract debug info from error message if it's a JSON parse failure issue
|
|
97
|
+
let debugInfo = '';
|
|
98
|
+
if (message.includes('not found')) {
|
|
99
|
+
debugInfo = '\n\nTroubleshooting tips:\n' +
|
|
100
|
+
'- Ensure old_string matches EXACTLY (including whitespace and line endings)\n' +
|
|
101
|
+
'- Check for CRLF vs LF newline differences\n' +
|
|
102
|
+
'- Use get_app to view the current code and copy the exact string';
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
content: [{ type: 'text', text: `Error editing app code: ${message}${debugInfo}` }],
|
|
106
|
+
isError: true,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL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Tool
|
|
3
|
+
*
|
|
4
|
+
* Add or remove a recipe from favorites.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const favoriteRecipeTool: Tool;
|
|
9
|
+
export declare function handleFavoriteRecipe(api: FlowDotApiClient, args: {
|
|
10
|
+
hash: string;
|
|
11
|
+
favorite: boolean;
|
|
12
|
+
}): Promise<CallToolResult>;
|
|
13
|
+
//# sourceMappingURL=favorite-recipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorite-recipe.d.ts","sourceRoot":"","sources":["../../src/tools/favorite-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,kBAAkB,EAAE,IAiBhC,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACxC,OAAO,CAAC,cAAc,CAAC,CA6BzB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* favorite_recipe MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Add or remove a recipe from favorites.
|
|
5
|
+
*/
|
|
6
|
+
export const favoriteRecipeTool = {
|
|
7
|
+
name: 'favorite_recipe',
|
|
8
|
+
description: 'Add or remove a recipe from your favorites. Favorited recipes can be filtered in list_recipes.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
hash: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The recipe hash/ID',
|
|
15
|
+
},
|
|
16
|
+
favorite: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
description: 'Set to true to add to favorites, false to remove',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: ['hash', 'favorite'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export async function handleFavoriteRecipe(api, args) {
|
|
25
|
+
try {
|
|
26
|
+
const result = await api.favoriteRecipe(args.hash, args.favorite);
|
|
27
|
+
const emoji = args.favorite ? '⭐' : '✓';
|
|
28
|
+
const action = args.favorite ? 'added to' : 'removed from';
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: `${emoji} Recipe ${action} favorites!
|
|
34
|
+
|
|
35
|
+
**Favorited:** ${result.is_favorited ? 'Yes' : 'No'}`,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
42
|
+
return {
|
|
43
|
+
content: [
|
|
44
|
+
{
|
|
45
|
+
type: 'text',
|
|
46
|
+
text: `Error updating favorite: ${message}`,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
isError: true,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=favorite-recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorite-recipe.js","sourceRoot":"","sources":["../../src/tools/favorite-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,gGAAgG;IAC7G,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,QAAQ,EAAE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|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const forkRecipeTool: Tool;
|
|
9
|
+
export declare function handleForkRecipe(api: FlowDotApiClient, args: {
|
|
10
|
+
hash: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}): Promise<CallToolResult>;
|
|
13
|
+
//# sourceMappingURL=fork-recipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fork-recipe.d.ts","sourceRoot":"","sources":["../../src/tools/fork-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,IAiB5B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,OAAO,CAAC,cAAc,CAAC,CA+BzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fork_recipe MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates a copy of a public recipe.
|
|
5
|
+
*/
|
|
6
|
+
export const forkRecipeTool = {
|
|
7
|
+
name: 'fork_recipe',
|
|
8
|
+
description: 'Create a copy of a public recipe into your account. The copy will be private and editable.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
hash: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The recipe hash/ID to fork',
|
|
15
|
+
},
|
|
16
|
+
name: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'Optional new name for the forked recipe',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: ['hash'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export async function handleForkRecipe(api, args) {
|
|
25
|
+
try {
|
|
26
|
+
const result = await api.forkRecipe(args.hash, args.name);
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: `Recipe forked successfully!
|
|
32
|
+
|
|
33
|
+
**New Name:** ${result.name}
|
|
34
|
+
**New Hash:** ${result.hash}
|
|
35
|
+
**Forked From:** ${result.forked_from.name} by ${result.forked_from.user_name}
|
|
36
|
+
**Visibility:** Private
|
|
37
|
+
|
|
38
|
+
You can now edit this recipe and customize it for your needs.`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: `Error forking recipe: ${message}`,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=fork-recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fork-recipe.js","sourceRoot":"","sources":["../../src/tools/fork-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4FAA4F;IACzG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;aAC1C;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAqB,EACrB,IAAqC;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;gBAEA,MAAM,CAAC,IAAI;gBACX,MAAM,CAAC,IAAI;mBACR,MAAM,CAAC,WAAW,CAAC,IAAI,OAAO,MAAM,CAAC,WAAW,CAAC,SAAS;;;8DAGf;iBACrD;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yBAAyB,OAAO,EAAE;iBACzC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_app_file Tool
|
|
3
|
+
*
|
|
4
|
+
* Get a specific file from a multi-file FlowDot app.
|
|
5
|
+
* Required scope: apps:read
|
|
6
|
+
*/
|
|
7
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
9
|
+
export declare const getAppFileTool: Tool;
|
|
10
|
+
export declare function handleGetAppFile(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
11
|
+
//# sourceMappingURL=get-app-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-app-file.d.ts","sourceRoot":"","sources":["../../src/tools/get-app-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAE,IAyB5B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CA8CzB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_app_file Tool
|
|
3
|
+
*
|
|
4
|
+
* Get a specific file from a multi-file FlowDot app.
|
|
5
|
+
* Required scope: apps:read
|
|
6
|
+
*/
|
|
7
|
+
export const getAppFileTool = {
|
|
8
|
+
name: 'get_app_file',
|
|
9
|
+
description: `Get the content and details of a specific file in a multi-file FlowDot app.
|
|
10
|
+
|
|
11
|
+
Returns the file's:
|
|
12
|
+
- Path
|
|
13
|
+
- Content (full source code)
|
|
14
|
+
- Type (component, hook, utility, page, context, style)
|
|
15
|
+
- Entry point status
|
|
16
|
+
|
|
17
|
+
Use list_app_files first to see available files in the app.`,
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
app_id: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The app ID (hash)',
|
|
24
|
+
},
|
|
25
|
+
file_path: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'The file path within the app (e.g., "App.jsx", "components/Button.jsx")',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ['app_id', 'file_path'],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export async function handleGetAppFile(client, args) {
|
|
34
|
+
try {
|
|
35
|
+
const appId = String(args.app_id);
|
|
36
|
+
const filePath = String(args.file_path);
|
|
37
|
+
const file = await client.getAppFile(appId, filePath);
|
|
38
|
+
// Determine file language for syntax highlighting
|
|
39
|
+
const ext = filePath.split('.').pop()?.toLowerCase() || 'text';
|
|
40
|
+
const langMap = {
|
|
41
|
+
jsx: 'jsx',
|
|
42
|
+
tsx: 'tsx',
|
|
43
|
+
js: 'javascript',
|
|
44
|
+
ts: 'typescript',
|
|
45
|
+
css: 'css',
|
|
46
|
+
json: 'json',
|
|
47
|
+
md: 'markdown',
|
|
48
|
+
};
|
|
49
|
+
const lang = langMap[ext] || 'text';
|
|
50
|
+
const entryBadge = file.is_entry ? ' [ENTRY POINT]' : '';
|
|
51
|
+
const text = `# ${filePath}${entryBadge}
|
|
52
|
+
|
|
53
|
+
**Type:** ${file.type}
|
|
54
|
+
**Entry Point:** ${file.is_entry ? 'Yes' : 'No'}
|
|
55
|
+
**Created:** ${file.created_at || 'N/A'}
|
|
56
|
+
**Updated:** ${file.updated_at || 'N/A'}
|
|
57
|
+
|
|
58
|
+
## Content
|
|
59
|
+
|
|
60
|
+
\`\`\`${lang}
|
|
61
|
+
${file.content}
|
|
62
|
+
\`\`\`
|
|
63
|
+
`;
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: 'text', text }],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: 'text', text: `Error getting app file: ${message}` }],
|
|
72
|
+
isError: true,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=get-app-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-app-file.js","sourceRoot":"","sources":["../../src/tools/get-app-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;4DAQ6C;IAC1D,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB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,IAAI,CAAC,UAAU,IAAI,KAAK;;;;QAI/B,IAAI;EACV,IAAI,CAAC,OAAO;;CAEb,CAAC;QAEE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SAClC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,OAAO,EAAE,EAAE,CAAC;YACvE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-app-template.d.ts","sourceRoot":"","sources":["../../src/tools/get-app-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE1E,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"get-app-template.d.ts","sourceRoot":"","sources":["../../src/tools/get-app-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAE1E,eAAO,MAAM,kBAAkB,EAAE,IAoFhC,CAAC;AA+pBF,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAkJzB"}
|