@flowdot.ai/mcp-server 1.0.0 → 1.0.1
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 +214 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +481 -1
- package/dist/api-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -9
- package/dist/server.js.map +1 -1
- 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 +1705 -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/clone-app.js +20 -20
- package/dist/tools/convert-app-to-multifile.d.ts +11 -0
- package/dist/tools/convert-app-to-multifile.d.ts.map +1 -0
- package/dist/tools/convert-app-to-multifile.js +69 -0
- package/dist/tools/convert-app-to-multifile.js.map +1 -0
- 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/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/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/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/index.d.ts.map +1 -1
- package/dist/tools/index.js +214 -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/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-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/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/types.d.ts +426 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +54 -54
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Knowledge Category Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates a new document category in the knowledge base.
|
|
5
|
+
* Can create personal categories or team categories.
|
|
6
|
+
*/
|
|
7
|
+
export const createKnowledgeCategoryToolDef = {
|
|
8
|
+
name: 'create_knowledge_category',
|
|
9
|
+
description: 'Create a new category to organize documents in your knowledge base. Categories help group related documents for targeted RAG queries. Can create personal or team categories.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
name: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Name for the category (max 100 characters)',
|
|
16
|
+
},
|
|
17
|
+
description: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Optional description of what documents belong in this category (max 500 characters)',
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Optional hex color code for the category (e.g., #3B82F6). Default: blue',
|
|
24
|
+
pattern: '^#[0-9A-Fa-f]{6}$',
|
|
25
|
+
},
|
|
26
|
+
team_id: {
|
|
27
|
+
type: 'number',
|
|
28
|
+
description: 'Optional: Team ID to create the category for. If omitted, creates a personal category. Use list_user_teams to see available teams.',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
required: ['name'],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export async function handleCreateKnowledgeCategory(api, args) {
|
|
35
|
+
try {
|
|
36
|
+
const category = await api.createKnowledgeCategory({
|
|
37
|
+
name: args.name,
|
|
38
|
+
description: args.description,
|
|
39
|
+
color: args.color,
|
|
40
|
+
team_id: args.team_id,
|
|
41
|
+
});
|
|
42
|
+
const lines = [
|
|
43
|
+
`## Category Created Successfully`,
|
|
44
|
+
'',
|
|
45
|
+
`**Name:** ${category.name}`,
|
|
46
|
+
`**ID:** ${category.id}`,
|
|
47
|
+
`**Slug:** ${category.slug}`,
|
|
48
|
+
category.description ? `**Description:** ${category.description}` : '',
|
|
49
|
+
`**Color:** ${category.color}`,
|
|
50
|
+
].filter(Boolean);
|
|
51
|
+
if (category.team_id) {
|
|
52
|
+
lines.push(`**Team:** ${category.team_name || 'Unknown'} (ID: ${category.team_id})`);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
lines.push(`**Location:** Personal knowledge base`);
|
|
56
|
+
}
|
|
57
|
+
lines.push('');
|
|
58
|
+
lines.push(`You can now upload documents to this category using the category_id: ${category.id}`);
|
|
59
|
+
return {
|
|
60
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: 'text', text: `Error creating category: ${message}` }],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=create-knowledge-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-knowledge-category.js","sourceRoot":"","sources":["../../src/tools/create-knowledge-category.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,8BAA8B,GAAS;IAClD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,+KAA+K;IACjL,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qFAAqF;aACnG;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yEAAyE;gBACtF,OAAO,EAAE,mBAAmB;aAC7B;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oIAAoI;aAClJ;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,GAAqB,EACrB,IAA8E;IAE9E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,uBAAuB,CAAC;YACjD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YA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CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* delete_app_file Tool
|
|
3
|
+
*
|
|
4
|
+
* Delete a file from a multi-file FlowDot app.
|
|
5
|
+
* Required scope: apps:manage
|
|
6
|
+
*/
|
|
7
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
9
|
+
export declare const deleteAppFileTool: Tool;
|
|
10
|
+
export declare function handleDeleteAppFile(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
11
|
+
//# sourceMappingURL=delete-app-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-app-file.d.ts","sourceRoot":"","sources":["../../src/tools/delete-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,iBAAiB,EAAE,IAqB/B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAwBzB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* delete_app_file Tool
|
|
3
|
+
*
|
|
4
|
+
* Delete a file from a multi-file FlowDot app.
|
|
5
|
+
* Required scope: apps:manage
|
|
6
|
+
*/
|
|
7
|
+
export const deleteAppFileTool = {
|
|
8
|
+
name: 'delete_app_file',
|
|
9
|
+
description: `Delete a file from a multi-file FlowDot app.
|
|
10
|
+
|
|
11
|
+
Permanently removes the file from the app. This action cannot be undone.
|
|
12
|
+
|
|
13
|
+
Note: Deleting the entry point file will require you to set a new entry point using set_app_entry_file.`,
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
app_id: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The app ID (hash)',
|
|
20
|
+
},
|
|
21
|
+
file_path: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The file path to delete (e.g., "OldComponent.jsx")',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['app_id', 'file_path'],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export async function handleDeleteAppFile(client, args) {
|
|
30
|
+
try {
|
|
31
|
+
const appId = String(args.app_id);
|
|
32
|
+
const filePath = String(args.file_path);
|
|
33
|
+
await client.deleteAppFile(appId, filePath);
|
|
34
|
+
const text = `# File Deleted Successfully
|
|
35
|
+
|
|
36
|
+
**Path:** ${filePath}
|
|
37
|
+
**App:** ${appId}
|
|
38
|
+
|
|
39
|
+
The file has been permanently removed from the app.`;
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: 'text', text }],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: 'text', text: `Error deleting app file: ${message}` }],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=delete-app-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-app-file.js","sourceRoot":"","sources":["../../src/tools/delete-app-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;wGAIyF;IACtG,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;aAClE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;KAClC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAwB,EACxB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAExC,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE5C,MAAM,IAAI,GAAG;;YAEL,QAAQ;WACT,KAAK;;oDAEoC,CAAC;QAEjD,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,4BAA4B,OAAO,EAAE,EAAE,CAAC;YACxE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/tools/delete-app.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export const deleteAppTool = {
|
|
8
8
|
name: 'delete_app',
|
|
9
|
-
description: `Permanently delete an app. This action cannot be undone.
|
|
10
|
-
|
|
11
|
-
The app and all its associated data (comments, votes, etc.) will be removed.
|
|
9
|
+
description: `Permanently delete an app. This action cannot be undone.
|
|
10
|
+
|
|
11
|
+
The app and all its associated data (comments, votes, etc.) will be removed.
|
|
12
12
|
Existing clones of the app will continue to work for their owners.`,
|
|
13
13
|
inputSchema: {
|
|
14
14
|
type: 'object',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Knowledge Category Tool
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document category. Documents in the category become uncategorized.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const deleteKnowledgeCategoryToolDef: Tool;
|
|
9
|
+
export declare function handleDeleteKnowledgeCategory(api: FlowDotApiClient, args: {
|
|
10
|
+
category_id: number;
|
|
11
|
+
}): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=delete-knowledge-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-knowledge-category.d.ts","sourceRoot":"","sources":["../../src/tools/delete-knowledge-category.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,8BAA8B,EAAE,IAc5C,CAAC;AAEF,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAAC,cAAc,CAAC,CAmBzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Knowledge Category Tool
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document category. Documents in the category become uncategorized.
|
|
5
|
+
*/
|
|
6
|
+
export const deleteKnowledgeCategoryToolDef = {
|
|
7
|
+
name: 'delete_knowledge_category',
|
|
8
|
+
description: 'Delete a knowledge base category. Documents in the category will become uncategorized (not deleted).',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
category_id: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The ID of the category to delete',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['category_id'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleDeleteKnowledgeCategory(api, args) {
|
|
21
|
+
try {
|
|
22
|
+
const result = await api.deleteKnowledgeCategory(args.category_id);
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: 'text',
|
|
27
|
+
text: result.message || `Category ${args.category_id} deleted successfully.`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: `Error deleting category: ${message}` }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=delete-knowledge-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-knowledge-category.js","sourceRoot":"","sources":["../../src/tools/delete-knowledge-category.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,8BAA8B,GAAS;IAClD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,sGAAsG;IACxG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;aAChD;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,GAAqB,EACrB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEnE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,OAAO,IAAI,YAAY,IAAI,CAAC,WAAW,wBAAwB;iBAC7E;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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,OAAO,EAAE,EAAE,CAAC;YACxE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Knowledge Document Tool
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document from the knowledge base.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const deleteKnowledgeDocumentToolDef: Tool;
|
|
9
|
+
export declare function handleDeleteKnowledgeDocument(api: FlowDotApiClient, args: {
|
|
10
|
+
document_id: number;
|
|
11
|
+
}): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=delete-knowledge-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-knowledge-document.d.ts","sourceRoot":"","sources":["../../src/tools/delete-knowledge-document.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,8BAA8B,EAAE,IAc5C,CAAC;AAEF,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAAC,cAAc,CAAC,CAmBzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Knowledge Document Tool
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document from the knowledge base.
|
|
5
|
+
*/
|
|
6
|
+
export const deleteKnowledgeDocumentToolDef = {
|
|
7
|
+
name: 'delete_knowledge_document',
|
|
8
|
+
description: 'Permanently delete a document from your knowledge base. This removes the file and all associated chunks/embeddings.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
document_id: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The ID of the document to delete',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['document_id'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleDeleteKnowledgeDocument(api, args) {
|
|
21
|
+
try {
|
|
22
|
+
const result = await api.deleteKnowledgeDocument(args.document_id);
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: 'text',
|
|
27
|
+
text: result.message || `Document ${args.document_id} deleted successfully.`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: `Error deleting document: ${message}` }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=delete-knowledge-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-knowledge-document.js","sourceRoot":"","sources":["../../src/tools/delete-knowledge-document.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,8BAA8B,GAAS;IAClD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,qHAAqH;IACvH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;aAChD;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,GAAqB,EACrB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEnE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,OAAO,IAAI,YAAY,IAAI,CAAC,WAAW,wBAAwB;iBAC7E;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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,OAAO,EAAE,EAAE,CAAC;YACxE,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=edit-app-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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
|
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;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yEAAyE;aACvF;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;KAClC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAwB,EACxB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAExC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEtD,kDAAkD;QAClD,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,MAAM,CAAC;QAC/D,MAAM,OAAO,GAA2B;YACtC,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,KAAK;YACV,EAAE,EAAE,YAAY;YAChB,EAAE,EAAE,YAAY;YAChB,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,UAAU;SACf,CAAC;QACF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC;QAEpC,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzD,MAAM,IAAI,GAAG,KAAK,QAAQ,GAAG,UAAU;;YAE/B,IAAI,CAAC,IAAI;mBACF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;eAChC,IAAI,CAAC,UAAU,IAAI,KAAK;eACxB,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"}
|