farseer-cli 1.0.5 → 1.0.8

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.
Files changed (92) hide show
  1. package/docs/api-reference.md +372 -0
  2. package/docs/arquero-patterns.md +158 -0
  3. package/docs/cli-guide.md +160 -0
  4. package/docs/how-farseer-works.md +113 -0
  5. package/docs/import-workflows.md +306 -0
  6. package/docs/model-export.md +95 -0
  7. package/docs/new-app-template.md +240 -0
  8. package/docs/query-formulas.md +97 -0
  9. package/docs/troubleshooting.md +140 -0
  10. package/package.json +3 -3
  11. package/dist/commands/app.js +0 -349
  12. package/dist/commands/app.js.map +0 -7
  13. package/dist/commands/apps.js +0 -111
  14. package/dist/commands/apps.js.map +0 -7
  15. package/dist/commands/checkout.js +0 -166
  16. package/dist/commands/checkout.js.map +0 -7
  17. package/dist/commands/config.js +0 -139
  18. package/dist/commands/config.js.map +0 -7
  19. package/dist/commands/diff.js +0 -183
  20. package/dist/commands/diff.js.map +0 -7
  21. package/dist/commands/dimensions.js +0 -145
  22. package/dist/commands/dimensions.js.map +0 -7
  23. package/dist/commands/files.js +0 -99
  24. package/dist/commands/files.js.map +0 -7
  25. package/dist/commands/install.js +0 -79
  26. package/dist/commands/install.js.map +0 -7
  27. package/dist/commands/list.js +0 -92
  28. package/dist/commands/list.js.map +0 -7
  29. package/dist/commands/login.js +0 -134
  30. package/dist/commands/login.js.map +0 -7
  31. package/dist/commands/logout.js +0 -59
  32. package/dist/commands/logout.js.map +0 -7
  33. package/dist/commands/mcp-server.js +0 -41
  34. package/dist/commands/mcp-server.js.map +0 -7
  35. package/dist/commands/model.js +0 -189
  36. package/dist/commands/model.js.map +0 -7
  37. package/dist/commands/pull.js +0 -287
  38. package/dist/commands/pull.js.map +0 -7
  39. package/dist/commands/push.js +0 -251
  40. package/dist/commands/push.js.map +0 -7
  41. package/dist/commands/run.js +0 -288
  42. package/dist/commands/run.js.map +0 -7
  43. package/dist/commands/status.js +0 -145
  44. package/dist/commands/status.js.map +0 -7
  45. package/dist/commands/variables.js +0 -176
  46. package/dist/commands/variables.js.map +0 -7
  47. package/dist/commands/whoami.js +0 -63
  48. package/dist/commands/whoami.js.map +0 -7
  49. package/dist/index.js +0 -153
  50. package/dist/index.js.map +0 -7
  51. package/dist/mcp/index.js +0 -35
  52. package/dist/mcp/index.js.map +0 -7
  53. package/dist/mcp/prompts/workflows.js +0 -437
  54. package/dist/mcp/prompts/workflows.js.map +0 -7
  55. package/dist/mcp/resources/documentation.js +0 -167
  56. package/dist/mcp/resources/documentation.js.map +0 -7
  57. package/dist/mcp/server.js +0 -52
  58. package/dist/mcp/server.js.map +0 -7
  59. package/dist/mcp/tools/appTools.js +0 -377
  60. package/dist/mcp/tools/appTools.js.map +0 -7
  61. package/dist/mcp/tools/authTools.js +0 -158
  62. package/dist/mcp/tools/authTools.js.map +0 -7
  63. package/dist/mcp/tools/dataTools.js +0 -366
  64. package/dist/mcp/tools/dataTools.js.map +0 -7
  65. package/dist/mcp/tools/modelTools.js +0 -331
  66. package/dist/mcp/tools/modelTools.js.map +0 -7
  67. package/dist/mcp/tools/runTools.js +0 -231
  68. package/dist/mcp/tools/runTools.js.map +0 -7
  69. package/dist/mcp/tools/syncTools.js +0 -382
  70. package/dist/mcp/tools/syncTools.js.map +0 -7
  71. package/dist/mcp/utils/helpers.js +0 -113
  72. package/dist/mcp/utils/helpers.js.map +0 -7
  73. package/dist/services/appSyncService.js +0 -399
  74. package/dist/services/appSyncService.js.map +0 -7
  75. package/dist/services/configService.js +0 -196
  76. package/dist/services/configService.js.map +0 -7
  77. package/dist/services/farseerApi.js +0 -426
  78. package/dist/services/farseerApi.js.map +0 -7
  79. package/dist/services/farseerFactory.js +0 -231
  80. package/dist/services/farseerFactory.js.map +0 -7
  81. package/dist/services/farseerService.js +0 -614
  82. package/dist/services/farseerService.js.map +0 -7
  83. package/dist/services/gitService.js +0 -134
  84. package/dist/services/gitService.js.map +0 -7
  85. package/dist/services/syncService.js +0 -415
  86. package/dist/services/syncService.js.map +0 -7
  87. package/dist/utils/constants.js +0 -49
  88. package/dist/utils/constants.js.map +0 -7
  89. package/dist/utils/helpers.js +0 -433
  90. package/dist/utils/helpers.js.map +0 -7
  91. package/dist/utils/logger.js +0 -76
  92. package/dist/utils/logger.js.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/mcp/prompts/workflows.ts"],
4
- "sourcesContent": ["/**\n * Workflow Prompts\n *\n * Reusable prompt templates for common Farseer workflows.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\n\n// Define schemas outside of prompt registration to avoid deep type instantiation\nconst setupTenantSchema = {\n tenant: z.string().describe('Tenant name to setup'),\n};\n\nconst createAppSchema = {\n tenant: z.string().describe('Tenant name'),\n appName: z.string().describe('Name for the new app'),\n scriptName: z.string().optional().describe('Main script filename (default: index.ts)'),\n};\n\nconst understandModelSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nconst writeImportScriptSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Target variable to import into'),\n};\n\nconst copyAppSchema = {\n tenant: z.string().describe('Tenant name'),\n sourceApp: z.string().describe('Name of app to copy'),\n newAppName: z.string().describe('Name for the new app'),\n};\n\nconst exportDataSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Variable to export'),\n};\n\nconst debugSyncSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nexport function registerWorkflowPrompts(server: McpServer): void {\n // Cast to any to avoid very deep generic type instantiation from the MCP SDK\n const anyServer = server as any;\n // Setup new tenant\n anyServer.prompt(\n 'setup_new_tenant',\n 'Guide for setting up a new Farseer tenant: login, checkout, pull, install dependencies.',\n setupTenantSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `You are setting up a new Farseer tenant \"${tenant}\".\n\nSteps to follow:\n\n1. First, check authentication status with farseer_whoami\n2. If not logged in, inform the user to run \"farseer login\" in terminal (MCP cannot do browser login)\n3. Use farseer_checkout to set \"${tenant}\" as the default tenant (this also pulls files and apps)\n4. Tell user to run \"farseer install ${tenant}\" in terminal to install npm dependencies\n5. Use farseer_list_apps to show available apps\n6. Use farseer_export_model to understand the data structure\n\nAfter setup, the user can:\n- Run apps with farseer_run_app\n- Edit scripts in apps/${tenant}/files/Scripts/\n- Push changes with farseer_push\n- Check model with farseer_get_variable or farseer_get_table`,\n },\n },\n ],\n };\n },\n );\n\n // Create new app\n anyServer.prompt(\n 'create_new_app',\n 'Guide for creating a new Farseer app from scratch.',\n createAppSchema,\n async (params: { tenant: string; appName: string; scriptName?: string }) => {\n const { tenant, appName, scriptName } = params;\n const script = scriptName || 'index.ts';\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Creating a new Farseer app \"${appName}\" for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Check if the script \"${script}\" exists with farseer_status\n2. If script doesn't exist locally:\n - Create the script file at apps/${tenant}/files/Scripts/${script}\n - Push with farseer_push\n\n3. Use farseer_create_app to create the app named \"${appName}\"\n\n4. Use farseer_configure_app to set:\n - entrypoint: \"${script}\"\n - scripts: [\"${script}\"]\n - Add arguments if needed\n\n5. Test with farseer_run_app\n\nScript template to create:\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\nconst args = process.argv.slice(2);\nconsole.log('Arguments:', args);\n\nconst client = new farseer.FarseerClient();\n\nasync function main() {\n await client.initTagMap();\n\n // Your code here\n console.log('App running successfully');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\``,\n },\n },\n ],\n };\n },\n );\n\n // Understand model\n anyServer.prompt(\n 'understand_model',\n 'Explore and understand the data model of a Farseer tenant.',\n understandModelSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Analyzing the data model for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_export_model to get the full model structure\n\n2. Review dimension tables:\n - Use farseer_list_tables for overview\n - Key dimensions usually include: Products, Regions, Time (Months, Years), Versions\n - Check foreign key relationships between tables\n\n3. Review variables:\n - Use farseer_list_variables for overview\n - Use farseer_get_variable for specific variable details\n - Note which dimensions each variable has\n\n4. For import scripts, you need to know:\n - Target variable name\n - All dimensions the variable has\n - Valid members for each dimension\n\nKey concepts:\n- Dimensions structure the data (Product, Region, Month, Year, Version)\n- Variables store values at dimension intersections\n- Formulas calculate values automatically\n- Roll-up types determine aggregation (SUM, AVERAGE, etc.)\n\nCommon dimension tables:\n- Months, Years (time)\n- Versions (Plan, Actual, Forecast)\n- Products, Categories, Brands\n- Regions, Entities, Cost Centers`,\n },\n },\n ],\n };\n },\n );\n\n // Write import script\n anyServer.prompt(\n 'write_import_script',\n 'Guide for writing a data import script.',\n writeImportScriptSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Writing an import script for variable \"${variableName}\" in tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the target variable:\n - What dimensions does it have?\n - What is the roll-up type?\n\n2. Use farseer_get_table for each dimension to see valid members\n\n3. Create the import script with this pattern:\n\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\nconst client = new farseer.FarseerClient();\n\nasync function main() {\n await client.initTagMap();\n\n // Create import job with column definitions\n const importJob = await client.createImportJob({\n title: 'Import ${variableName}',\n columns: [\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Product' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },\n { type: 'VARIABLE', variableName: '${variableName}' },\n ],\n labels: ['auto', 'import-${variableName.toLowerCase().replace(/\\s+/g, '-')}']\n });\n\n // Add rows - each row matches column order\n const rows = [\n ['ProductA', 'Y2025', 'M1', 'Plan', 1000],\n ['ProductB', 'Y2025', 'M1', 'Plan', 2000],\n ];\n\n await importJob.addRows(rows);\n await importJob.flushRows();\n await importJob.undoPrevious(); // Remove previous import\n await importJob.commit();\n\n console.log('Import completed!');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\`\n\n4. Save script to apps/${tenant}/files/Scripts/\n5. Push with farseer_push\n6. Create app with farseer_create_app\n7. Configure with farseer_configure_app\n8. Test with farseer_run_app\n\nALTERNATIVE: For simple imports without a script, use the farseer_create_import_job tool directly.\nIt handles the full workflow (create metadata, add rows, undo previous, commit) in a single call.\nUse farseer_create_import_job when:\n- Data is already available (no need to fetch from external source)\n- The import is a one-time or simple operation\n- You want to quickly import without creating a full script\n\nUse a script when:\n- Data comes from external sources (APIs, databases, files)\n- Complex data transformation is needed\n- The import runs on a schedule as an App`,\n },\n },\n ],\n };\n },\n );\n\n // Copy existing app\n anyServer.prompt(\n 'copy_app',\n 'Guide for copying an existing app to create a new one.',\n copyAppSchema,\n async (params: { tenant: string; sourceApp: string; newAppName: string }) => {\n const { tenant, sourceApp, newAppName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Copying app \"${sourceApp}\" to create \"${newAppName}\" for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Pull latest with farseer_pull to get current app JSON\n\n2. Use farseer_get_app to see the source app configuration\n\n3. The app JSON files are in apps/${tenant}/apps/\n\n Copy the source JSON file and modify:\n - Change \"name\" to \"${newAppName}\"\n - **IMPORTANT: Remove \"_remote\" field** (this makes it a new app)\n - Modify arguments, description as needed\n\n4. JSON format for new app:\n\\`\\`\\`json\n{\n \"name\": \"${newAppName}\",\n \"description\": \"Copied from ${sourceApp}\",\n \"entrypoint\": \"script.ts\",\n \"scripts\": [\"script.ts\"],\n \"arguments\": [\n { \"name\": \"Year\", \"defaultValue\": \"2025\" }\n ]\n}\n\\`\\`\\`\n\nNote: Do NOT include \"_remote\" for new apps - CLI adds it after first push.\n\n5. Push with farseer_push to create the new app\n\n6. Test with farseer_run_app`,\n },\n },\n ],\n };\n },\n );\n\n // Export data\n anyServer.prompt(\n 'export_data',\n 'Guide for exporting variable data from Farseer.',\n exportDataSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Exporting data for variable \"${variableName}\" from tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the variable:\n - What dimensions does it span?\n - What is its data type?\n\n2. Choose export method:\n\n **Option A: Quick export (farseer_export_variable_data)**\n - Uses ExportApi.exportFormula() internally\n - Returns CSV/JSON data inline\n - Good for quick inspection or small datasets\n - Use 'limit' parameter for large datasets\n\n **Option B: Structured export (farseer_load_variable_data)**\n - Uses data.loadFarseerVariable() internally\n - Can specify which dimensions to include as columns\n - Returns structured CSV data\n - Good when you need specific dimension breakdowns\n\n **Option C: CLI export (farseer variable export)**\n - Saves CSV/JSON/XLSX to a local file\n - Best for saving data locally for analysis\n\n3. For analysis:\n - Parse the CSV data returned by the tools\n - Summarize, filter, or transform as needed`,\n },\n },\n ],\n };\n },\n );\n\n // Debug sync issues\n anyServer.prompt(\n 'debug_sync_issues',\n 'Troubleshoot synchronization problems between local and remote.',\n debugSyncSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Debugging sync issues for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Check authentication: farseer_whoami\n - Is JWT valid?\n - Is tenant checked out?\n\n2. Check sync status: farseer_status\n - Are there modified files?\n - Are there only-local or only-remote files?\n\n3. If files show as modified:\n - Use farseer_diff to see differences\n - Decide: pull (accept remote) or push (upload local)\n\n4. Common issues and solutions:\n\n **\"No credentials found\"**\n \u2192 User needs to run \"farseer login\" in terminal\n \u2192 Or configure API key: \"farseer config set ${tenant} --api-key KEY\"\n\n **\"Remote has changes\"**\n \u2192 Pull first with farseer_pull\n \u2192 Then push with farseer_push\n\n **\"Token expired\"**\n \u2192 User needs to run \"farseer login\" again\n\n **Apps not syncing**\n \u2192 Need JWT login (browser), not API key\n \u2192 API key only syncs files, not apps\n\n5. Force resolution:\n - To accept remote: farseer_pull (overwrites local)\n - To accept local: farseer_push with force=true (overwrites remote)\n\n6. Check specific file diff:\n - Use farseer_diff with file parameter to see exact changes`,\n },\n },\n ],\n };\n },\n );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAAkB;AAGlB,MAAM,oBAAoB;AAAA,EACtB,QAAQ,aAAE,OAAO,EAAE,SAAS,sBAAsB;AACtD;AAEA,MAAM,kBAAkB;AAAA,EACpB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,SAAS,aAAE,OAAO,EAAE,SAAS,sBAAsB;AAAA,EACnD,YAAY,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0CAA0C;AACzF;AAEA,MAAM,wBAAwB;AAAA,EAC1B,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAC7C;AAEA,MAAM,0BAA0B;AAAA,EAC5B,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,cAAc,aAAE,OAAO,EAAE,SAAS,gCAAgC;AACtE;AAEA,MAAM,gBAAgB;AAAA,EAClB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,WAAW,aAAE,OAAO,EAAE,SAAS,qBAAqB;AAAA,EACpD,YAAY,aAAE,OAAO,EAAE,SAAS,sBAAsB;AAC1D;AAEA,MAAM,mBAAmB;AAAA,EACrB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,cAAc,aAAE,OAAO,EAAE,SAAS,oBAAoB;AAC1D;AAEA,MAAM,kBAAkB;AAAA,EACpB,QAAQ,aAAE,OAAO,EAAE,SAAS,aA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AM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sDAoB5B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAmB/B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
- "names": []
7
- }
@@ -1,167 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var documentation_exports = {};
29
- __export(documentation_exports, {
30
- registerDocumentationResources: () => registerDocumentationResources
31
- });
32
- module.exports = __toCommonJS(documentation_exports);
33
- var fs = __toESM(require("fs"));
34
- var path = __toESM(require("path"));
35
- const DOCS = [
36
- {
37
- name: "how-farseer-works",
38
- uri: "farseer://docs/how-farseer-works",
39
- title: "How Farseer Works",
40
- description: "Core Farseer concepts: Dimensions, Variables, Formulas, Versions. ESSENTIAL reading for understanding the data model.",
41
- filePath: "../../../docs/how-farseer-works.md"
42
- },
43
- {
44
- name: "cli-guide",
45
- uri: "farseer://docs/cli-guide",
46
- title: "CLI Guide",
47
- description: "Complete guide to Farseer CLI commands: pull, push, apps, run, model, checkout.",
48
- filePath: "../../../docs/cli-guide.md"
49
- },
50
- {
51
- name: "api-reference",
52
- uri: "farseer://docs/api-reference",
53
- title: "farseer-client API Reference",
54
- description: "Full API documentation for farseer-client: FarseerClient, queries, imports, dimensions, variables.",
55
- filePath: "../../../docs/api-reference.md"
56
- },
57
- {
58
- name: "new-app-template",
59
- uri: "farseer://docs/new-app-template",
60
- title: "New App Template",
61
- description: "Template and structure for creating new Farseer apps (Remote Jobs).",
62
- filePath: "../../../docs/new-app-template.md"
63
- },
64
- {
65
- name: "troubleshooting",
66
- uri: "farseer://docs/troubleshooting",
67
- title: "Troubleshooting Guide",
68
- description: "Common issues and solutions: auth errors, sync conflicts, API errors, performance.",
69
- filePath: "../../../docs/troubleshooting.md"
70
- },
71
- {
72
- name: "import-workflows",
73
- uri: "farseer://docs/import-workflows",
74
- title: "Import Workflows",
75
- description: "Patterns for data imports: CSV, Excel, API, batch processing, error handling.",
76
- filePath: "../../../docs/import-workflows.md"
77
- },
78
- {
79
- name: "arquero-patterns",
80
- uri: "farseer://docs/arquero-patterns",
81
- title: "Arquero Data Processing",
82
- description: "Using Arquero for data transformation: filtering, grouping, pivoting, joins.",
83
- filePath: "../../../docs/arquero-patterns.md"
84
- },
85
- {
86
- name: "query-formulas",
87
- uri: "farseer://docs/query-formulas",
88
- title: "Query and Formula Guide",
89
- description: "Querying data and understanding formulas: filters, aggregations, formula syntax.",
90
- filePath: "../../../docs/query-formulas.md"
91
- },
92
- {
93
- name: "model-export",
94
- uri: "farseer://docs/model-export",
95
- title: "Model Export Guide",
96
- description: "Understanding model exports: tables, variables, relationships, folder structure.",
97
- filePath: "../../../docs/model-export.md"
98
- }
99
- ];
100
- function loadDocContent(doc) {
101
- try {
102
- const fullPath = path.resolve(__dirname, doc.filePath);
103
- return fs.readFileSync(fullPath, "utf-8");
104
- } catch (error) {
105
- return `# ${doc.title}
106
-
107
- [Documentation file not found: ${doc.filePath}]
108
-
109
- This may happen if the CLI was installed globally and documentation files were not included in the package.`;
110
- }
111
- }
112
- function registerDocumentationResources(server) {
113
- server.resource(
114
- "farseer-docs-list",
115
- "farseer://docs",
116
- {
117
- description: "List of all available Farseer documentation",
118
- mimeType: "application/json"
119
- },
120
- () => {
121
- return {
122
- contents: [
123
- {
124
- uri: "farseer://docs",
125
- mimeType: "application/json",
126
- text: JSON.stringify(
127
- DOCS.map((doc) => ({
128
- name: doc.name,
129
- uri: doc.uri,
130
- title: doc.title,
131
- description: doc.description
132
- })),
133
- null,
134
- 2
135
- )
136
- }
137
- ]
138
- };
139
- }
140
- );
141
- for (const doc of DOCS) {
142
- server.resource(
143
- doc.name,
144
- doc.uri,
145
- {
146
- description: doc.description,
147
- mimeType: "text/markdown"
148
- },
149
- () => {
150
- return {
151
- contents: [
152
- {
153
- uri: doc.uri,
154
- mimeType: "text/markdown",
155
- text: loadDocContent(doc)
156
- }
157
- ]
158
- };
159
- }
160
- );
161
- }
162
- }
163
- // Annotate the CommonJS export names for ESM import in node:
164
- 0 && (module.exports = {
165
- registerDocumentationResources
166
- });
167
- //# sourceMappingURL=documentation.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/mcp/resources/documentation.ts"],
4
- "sourcesContent": ["/**\n * Documentation Resources\n *\n * Exposes Farseer documentation as MCP resources for AI assistants.\n * Documentation is read from files at runtime (bundled with npm package).\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\ninterface DocResource {\n name: string;\n uri: string;\n title: string;\n description: string;\n filePath: string;\n}\n\n// Documentation metadata - actual content loaded on demand\nconst DOCS: DocResource[] = [\n {\n name: 'how-farseer-works',\n uri: 'farseer://docs/how-farseer-works',\n title: 'How Farseer Works',\n description:\n 'Core Farseer concepts: Dimensions, Variables, Formulas, Versions. ESSENTIAL reading for understanding the data model.',\n filePath: '../../../docs/how-farseer-works.md',\n },\n {\n name: 'cli-guide',\n uri: 'farseer://docs/cli-guide',\n title: 'CLI Guide',\n description: 'Complete guide to Farseer CLI commands: pull, push, apps, run, model, checkout.',\n filePath: '../../../docs/cli-guide.md',\n },\n {\n name: 'api-reference',\n uri: 'farseer://docs/api-reference',\n title: 'farseer-client API Reference',\n description:\n 'Full API documentation for farseer-client: FarseerClient, queries, imports, dimensions, variables.',\n filePath: '../../../docs/api-reference.md',\n },\n {\n name: 'new-app-template',\n uri: 'farseer://docs/new-app-template',\n title: 'New App Template',\n description: 'Template and structure for creating new Farseer apps (Remote Jobs).',\n filePath: '../../../docs/new-app-template.md',\n },\n {\n name: 'troubleshooting',\n uri: 'farseer://docs/troubleshooting',\n title: 'Troubleshooting Guide',\n description: 'Common issues and solutions: auth errors, sync conflicts, API errors, performance.',\n filePath: '../../../docs/troubleshooting.md',\n },\n {\n name: 'import-workflows',\n uri: 'farseer://docs/import-workflows',\n title: 'Import Workflows',\n description: 'Patterns for data imports: CSV, Excel, API, batch processing, error handling.',\n filePath: '../../../docs/import-workflows.md',\n },\n {\n name: 'arquero-patterns',\n uri: 'farseer://docs/arquero-patterns',\n title: 'Arquero Data Processing',\n description: 'Using Arquero for data transformation: filtering, grouping, pivoting, joins.',\n filePath: '../../../docs/arquero-patterns.md',\n },\n {\n name: 'query-formulas',\n uri: 'farseer://docs/query-formulas',\n title: 'Query and Formula Guide',\n description: 'Querying data and understanding formulas: filters, aggregations, formula syntax.',\n filePath: '../../../docs/query-formulas.md',\n },\n {\n name: 'model-export',\n uri: 'farseer://docs/model-export',\n title: 'Model Export Guide',\n description: 'Understanding model exports: tables, variables, relationships, folder structure.',\n filePath: '../../../docs/model-export.md',\n },\n];\n\nfunction loadDocContent(doc: DocResource): string {\n try {\n const fullPath = path.resolve(__dirname, doc.filePath);\n return fs.readFileSync(fullPath, 'utf-8');\n } catch (error) {\n return `# ${doc.title}\\n\\n[Documentation file not found: ${doc.filePath}]\\n\\nThis may happen if the CLI was installed globally and documentation files were not included in the package.`;\n }\n}\n\nexport function registerDocumentationResources(server: McpServer): void {\n // Register list of all docs\n server.resource(\n 'farseer-docs-list',\n 'farseer://docs',\n {\n description: 'List of all available Farseer documentation',\n mimeType: 'application/json',\n },\n () => {\n return {\n contents: [\n {\n uri: 'farseer://docs',\n mimeType: 'application/json',\n text: JSON.stringify(\n DOCS.map((doc) => ({\n name: doc.name,\n uri: doc.uri,\n title: doc.title,\n description: doc.description,\n })),\n null,\n 2\n ),\n },\n ],\n };\n }\n );\n\n // Register each doc individually\n for (const doc of DOCS) {\n server.resource(\n doc.name,\n doc.uri,\n {\n description: doc.description,\n mimeType: 'text/markdown',\n },\n () => {\n return {\n contents: [\n {\n uri: doc.uri,\n mimeType: 'text/markdown',\n text: loadDocContent(doc),\n },\n ],\n };\n }\n );\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAWtB,MAAM,OAAsB;AAAA,EACxB;AAAA,IACI,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aACI;AAAA,IACJ,UAAU;AAAA,EACd;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,EACd;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aACI;AAAA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T,OAAO,IAAI;AAAA,gBACX,aAAa,IAAI;AAAA,cACrB,EAAE;AAAA,cACF;AAAA,cACA;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAGA,aAAW,OAAO,MAAM;AACpB,WAAO;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ;AAAA,QACI,aAAa,IAAI;AAAA,QACjB,UAAU;AAAA,MACd;AAAA,MACA,MAAM;AACF,eAAO;AAAA,UACH,UAAU;AAAA,YACN;AAAA,cACI,KAAK,IAAI;AAAA,cACT,UAAU;AAAA,cACV,MAAM,eAAe,GAAG;AAAA,YAC5B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
- "names": []
7
- }
@@ -1,52 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var server_exports = {};
19
- __export(server_exports, {
20
- createMcpServer: () => createMcpServer
21
- });
22
- module.exports = __toCommonJS(server_exports);
23
- var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
24
- var import_constants = require("../utils/constants");
25
- var import_authTools = require("./tools/authTools");
26
- var import_syncTools = require("./tools/syncTools");
27
- var import_appTools = require("./tools/appTools");
28
- var import_modelTools = require("./tools/modelTools");
29
- var import_runTools = require("./tools/runTools");
30
- var import_dataTools = require("./tools/dataTools");
31
- var import_documentation = require("./resources/documentation");
32
- var import_workflows = require("./prompts/workflows");
33
- function createMcpServer() {
34
- const server = new import_mcp.McpServer({
35
- name: "farseer-cli",
36
- version: import_constants.CLI_VERSION
37
- });
38
- (0, import_authTools.registerAuthTools)(server);
39
- (0, import_syncTools.registerSyncTools)(server);
40
- (0, import_appTools.registerAppTools)(server);
41
- (0, import_modelTools.registerModelTools)(server);
42
- (0, import_runTools.registerRunTools)(server);
43
- (0, import_dataTools.registerDataTools)(server);
44
- (0, import_documentation.registerDocumentationResources)(server);
45
- (0, import_workflows.registerWorkflowPrompts)(server);
46
- return server;
47
- }
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- createMcpServer
51
- });
52
- //# sourceMappingURL=server.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mcp/server.ts"],
4
- "sourcesContent": ["/**\n * MCP Server Configuration\n *\n * Creates and configures the Farseer MCP server with all tools, resources, and prompts.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { CLI_VERSION } from '../utils/constants';\nimport { registerAuthTools } from './tools/authTools';\nimport { registerSyncTools } from './tools/syncTools';\nimport { registerAppTools } from './tools/appTools';\nimport { registerModelTools } from './tools/modelTools';\nimport { registerRunTools } from './tools/runTools';\nimport { registerDataTools } from './tools/dataTools';\nimport { registerDocumentationResources } from './resources/documentation';\nimport { registerWorkflowPrompts } from './prompts/workflows';\n\nexport function createMcpServer(): McpServer {\n const server = new McpServer({\n name: 'farseer-cli',\n version: CLI_VERSION,\n });\n\n // Register all tools\n registerAuthTools(server);\n registerSyncTools(server);\n registerAppTools(server);\n registerModelTools(server);\n registerRunTools(server);\n registerDataTools(server);\n\n // Register resources (documentation)\n registerDocumentationResources(server);\n\n // Register prompts (workflow templates)\n registerWorkflowPrompts(server);\n\n return server;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,iBAA0B;AAC1B,uBAA4B;AAC5B,uBAAkC;AAClC,uBAAkC;AAClC,sBAAiC;AACjC,wBAAmC;AACnC,sBAAiC;AACjC,uBAAkC;AAClC,2BAA+C;AAC/C,uBAAwC;AAEjC,SAAS,kBAA6B;AACzC,QAAM,SAAS,IAAI,qBAAU;AAAA,IACzB,MAAM;AAAA,IACN,SAAS;AAAA,EACb,CAAC;AAGD,0CAAkB,MAAM;AACxB,0CAAkB,MAAM;AACxB,wCAAiB,MAAM;AACvB,4CAAmB,MAAM;AACzB,wCAAiB,MAAM;AACvB,0CAAkB,MAAM;AAGxB,2DAA+B,MAAM;AAGrC,gDAAwB,MAAM;AAE9B,SAAO;AACX;",
6
- "names": []
7
- }