farseer-cli 1.0.6 → 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 (90) 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 +2 -1
  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 -141
  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 -212
  38. package/dist/commands/pull.js.map +0 -7
  39. package/dist/commands/push.js +0 -201
  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 -164
  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 -329
  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 -381
  70. package/dist/mcp/tools/syncTools.js.map +0 -7
  71. package/dist/mcp/utils/helpers.js +0 -135
  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/syncService.js +0 -415
  84. package/dist/services/syncService.js.map +0 -7
  85. package/dist/utils/constants.js +0 -46
  86. package/dist/utils/constants.js.map +0 -7
  87. package/dist/utils/helpers.js +0 -413
  88. package/dist/utils/helpers.js.map +0 -7
  89. package/dist/utils/logger.js +0 -76
  90. package/dist/utils/logger.js.map +0 -7
package/dist/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\n\n// Suppress punycode deprecation warning (comes from dependencies like axios)\nconst originalEmit = process.emit;\n// @ts-expect-error - overriding process.emit\nprocess.emit = function (name: string, data: unknown, ...args: unknown[]) {\n if (name === 'warning' && typeof data === 'object' && data !== null && 'name' in data && data.name === 'DeprecationWarning' && 'message' in data && typeof data.message === 'string' && data.message.includes('punycode')) {\n return false;\n }\n // @ts-expect-error - calling original emit\n return originalEmit.apply(process, [name, data, ...args]);\n};\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { CLI_VERSION } from './utils/constants';\nimport { registerLoginCommand } from './commands/login';\nimport { registerLogoutCommand } from './commands/logout';\nimport { registerConfigCommand } from './commands/config';\nimport { registerListCommand } from './commands/list';\nimport { registerFilesCommand } from './commands/files';\nimport { registerStatusCommand } from './commands/status';\nimport { registerDiffCommand } from './commands/diff';\nimport { registerPullCommand } from './commands/pull';\nimport { registerPushCommand } from './commands/push';\nimport { registerRunCommand } from './commands/run';\nimport { registerInstallCommand } from './commands/install';\nimport { registerWhoamiCommand } from './commands/whoami';\nimport { registerAppCommand } from './commands/app';\nimport { registerModelCommand } from './commands/model';\nimport { registerVariablesCommand } from './commands/variables';\nimport { registerDimensionsCommand } from './commands/dimensions';\nimport { registerCheckoutCommand } from './commands/checkout';\nimport { registerMcpServerCommand } from './commands/mcp-server';\n\nconst program = new Command();\n\n// Configure help to hide default command list (we show our own custom list)\nprogram.configureHelp({\n visibleCommands: () => [], // Hide all commands from default list\n});\n\nprogram\n .name('farseer')\n .description('CLI tool for syncing Farseer App scripts between local folder and Farseer instances')\n .version(CLI_VERSION)\n .addHelpText('after', `\n${chalk.bold.underline('Tenant Resolution')}\n Most commands accept ${chalk.cyan('[org] [tenant]')} arguments:\n ${chalk.green('$')} farseer checkout ${chalk.cyan('salvus-2 salvus-prodaja')} ${chalk.dim('First time: specify <org> <tenant>')}\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-prodaja')} ${chalk.dim('After that: just <tenant> (org is remembered)')}\n ${chalk.green('$')} farseer push ${chalk.dim('Or omit entirely if checked out')}\n\n${chalk.bold.underline('Authentication')}\n login Login via browser (OAuth)\n logout [tenant] Logout and remove credentials\n whoami Show login status and configured tenants\n checkout [org] [tenant] Set default tenant (verifies auth & pulls)\n ${chalk.dim('--no-pull')} Skip automatic pull\n\n${chalk.bold.underline('Configuration')} ${chalk.dim('(farseer config <command>)')}\n config set <tenant> Set API key for a tenant\n ${chalk.dim('--api-key <key>')} API key (required)\n ${chalk.dim('--org <name>')} Organisation if different from tenant\n config remove <tenant> Remove credentials\n config list List all configured tenants\n config show <tenant> Show full credentials (incl. API key)\n config test <tenant> Test connection to tenant\n\n${chalk.bold.underline('Sync Operations')} ${chalk.dim('(tenant optional if checked out)')}\n pull [org] [tenant] Pull files and apps from remote\n ${chalk.dim('--all')} Download all files (not just .ts/.js)\n push [org] [tenant] Push local changes to remote\n ${chalk.dim('-y, --yes')} Skip confirmation prompt\n ${chalk.dim('--force')} Push even if remote has changes\n status [tenant] Show sync status (local vs remote)\n ${chalk.dim('--all')} Show all files (not just .ts/.js)\n diff [tenant] [file] Show file differences\n\n${chalk.bold.underline('App Management')} ${chalk.dim('(tenant optional if checked out)')}\n app list [tenant] List all apps\n ${chalk.dim('--details')} Show details for each app\n app show [tenant] <name> Show app details\n app create [tenant] <name> Create new app\n app configure [tenant] <name> Configure app\n ${chalk.dim('--entrypoint <script>')} Set main script\n ${chalk.dim('--scripts <list>')} Comma-separated scripts\n ${chalk.dim('--add-arg <Name=Value>')} Add argument (repeatable)\n ${chalk.dim('--description <text>')} Set description\n app delete [tenant] <name> Delete app (requires --force)\n\n${chalk.bold.underline('Running & Development')} ${chalk.dim('(tenant optional if checked out)')}\n run [tenant] <app> Run app locally with injected credentials\n ${chalk.dim('--arg <Name=Value>')} Override argument (repeatable)\n run-script [tenant] <file> Run script directly (no app wrapper)\n install [tenant] Install npm dependencies (npm install)\n\n${chalk.bold.underline('Variables')} ${chalk.dim('(tenant optional if checked out)')}\n variables list [tenant] List all variables\n variable details <name> Show variable details (dimensions, formula, etc.)\n variable export <name> Export variable data to CSV\n ${chalk.dim('--output <file>')} Output file path\n ${chalk.dim('--format <csv|json|xlsx>')} Output format (default: csv)\n ${chalk.dim('--limit <n>')} Limit number of rows\n\n${chalk.bold.underline('Dimensions')} ${chalk.dim('(tenant optional if checked out)')}\n dimensions list [tenant] List all dimension tables\n dimension details <name> Show table details (columns, members)\n ${chalk.dim('--members <n>')} Number of sample members (default: 10)\n\n${chalk.bold.underline('Model Inspection')} ${chalk.dim('(tenant optional if checked out)')}\n model [tenant] Show model structure (dimensions, variables)\n ${chalk.dim('--variables')} List all variables\n ${chalk.dim('--tables')} List all dimension tables\n ${chalk.dim('--variable <name>')} Show dimensions for variable\n\n${chalk.bold.underline('File Management')} ${chalk.dim('(farseer files <command>)')}\n files list [tenant] List files on remote\n ${chalk.dim('--all')} Show all files (not just scripts)\n\n${chalk.bold.underline('MCP Server')} ${chalk.dim('(AI assistant integration)')}\n mcp-server Start MCP server for Claude, Cursor, etc.\n\n${chalk.bold.underline('Examples')}\n ${chalk.green('$')} farseer login ${chalk.dim('Login via browser')}\n ${chalk.green('$')} farseer checkout salvus-2 salvus-prod ${chalk.dim('First time: org + tenant')}\n ${chalk.green('$')} farseer pull salvus-prod ${chalk.dim('Next time: just tenant')}\n ${chalk.green('$')} farseer push ${chalk.dim('If checked out: no args needed')}\n ${chalk.green('$')} farseer push -y ${chalk.dim('Push without confirmation')}\n ${chalk.green('$')} farseer run \"My App\" ${chalk.dim('Run app locally')}\n ${chalk.green('$')} farseer variables list ${chalk.dim('List all variables')}\n ${chalk.green('$')} farseer variable details \"Revenue\" ${chalk.dim('Show variable details')}\n ${chalk.green('$')} farseer dimensions list ${chalk.dim('List dimension tables')}\n`);\n\n// Register all commands (hidden from default help, shown in custom help above)\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterCheckoutCommand(program);\nregisterConfigCommand(program);\nregisterListCommand(program);\nregisterFilesCommand(program);\nregisterAppCommand(program);\nregisterVariablesCommand(program);\nregisterDimensionsCommand(program);\nregisterModelCommand(program);\nregisterStatusCommand(program);\nregisterDiffCommand(program);\nregisterPullCommand(program);\nregisterPushCommand(program);\nregisterRunCommand(program);\nregisterInstallCommand(program);\nregisterWhoamiCommand(program);\nregisterMcpServerCommand(program);\n\n// Parse arguments\nprogram.parse();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAaA,uBAAwB;AACxB,mBAAkB;AAClB,uBAA4B;AAC5B,mBAAqC;AACrC,oBAAsC;AACtC,oBAAsC;AACtC,kBAAoC;AACpC,mBAAqC;AACrC,oBAAsC;AACtC,kBAAoC;AACpC,kBAAoC;AACpC,kBAAoC;AACpC,iBAAmC;AACnC,qBAAuC;AACvC,oBAAsC;AACtC,iBAAmC;AACnC,mBAAqC;AACrC,uBAAyC;AACzC,wBAA0C;AAC1C,sBAAwC;AACxC,wBAAyC;AA9BzC,MAAM,eAAe,QAAQ;AAE7B,QAAQ,OAAO,SAAU,MAAc,SAAkB,MAAiB;AACtE,MAAI,SAAS,aAAa,OAAO,SAAS,YAAY,SAAS,QAAQ,UAAU,QAAQ,KAAK,SAAS,wBAAwB,aAAa,QAAQ,OAAO,KAAK,YAAY,YAAY,KAAK,QAAQ,SAAS,UAAU,GAAG;AACvN,WAAO;AAAA,EACX;AAEA,SAAO,aAAa,MAAM,SAAS,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC;AAC5D;AAwBA,MAAM,UAAU,IAAI,yBAAQ;AAG5B,QAAQ,cAAc;AAAA,EAClB,iBAAiB,MAAM,CA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C,mCAAqB,OAAO;AAAA,IAC5B,qCAAsB,OAAO;AAAA,IAC7B,iCAAoB,OAAO;AAAA,IAC3B,iCAAoB,OAAO;AAAA,IAC3B,iCAAoB,OAAO;AAAA,IAC3B,+BAAmB,OAAO;AAAA,IAC1B,uCAAuB,OAAO;AAAA,IAC9B,qCAAsB,OAAO;AAAA,IAC7B,4CAAyB,OAAO;AAGhC,QAAQ,MAAM;",
6
- "names": ["chalk"]
7
- }
package/dist/mcp/index.js DELETED
@@ -1,35 +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 mcp_exports = {};
19
- __export(mcp_exports, {
20
- startMcpServer: () => startMcpServer
21
- });
22
- module.exports = __toCommonJS(mcp_exports);
23
- var import_server = require("./server");
24
- var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
25
- async function startMcpServer() {
26
- const server = (0, import_server.createMcpServer)();
27
- const transport = new import_stdio.StdioServerTransport();
28
- await server.connect(transport);
29
- console.error("Farseer MCP server started");
30
- }
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- startMcpServer
34
- });
35
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mcp/index.ts"],
4
- "sourcesContent": ["/**\n * MCP Server Entry Point\n *\n * Starts the Farseer MCP server for AI assistant integration.\n * Uses stdio transport for CLI compatibility.\n */\n\nimport { createMcpServer } from './server';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nexport async function startMcpServer(): Promise<void> {\n const server = createMcpServer();\n\n // Use stdio transport for CLI integration\n const transport = new StdioServerTransport();\n await server.connect(transport);\n\n // Log to stderr since stdout is reserved for MCP protocol\n console.error('Farseer MCP server started');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,oBAAgC;AAChC,mBAAqC;AAErC,eAAsB,iBAAgC;AAClD,QAAM,aAAS,+BAAgB;AAG/B,QAAM,YAAY,IAAI,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAG9B,UAAQ,MAAM,4BAA4B;AAC9C;",
6
- "names": []
7
- }
@@ -1,437 +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 workflows_exports = {};
19
- __export(workflows_exports, {
20
- registerWorkflowPrompts: () => registerWorkflowPrompts
21
- });
22
- module.exports = __toCommonJS(workflows_exports);
23
- var import_zod = require("zod");
24
- const setupTenantSchema = {
25
- tenant: import_zod.z.string().describe("Tenant name to setup")
26
- };
27
- const createAppSchema = {
28
- tenant: import_zod.z.string().describe("Tenant name"),
29
- appName: import_zod.z.string().describe("Name for the new app"),
30
- scriptName: import_zod.z.string().optional().describe("Main script filename (default: index.ts)")
31
- };
32
- const understandModelSchema = {
33
- tenant: import_zod.z.string().describe("Tenant name")
34
- };
35
- const writeImportScriptSchema = {
36
- tenant: import_zod.z.string().describe("Tenant name"),
37
- variableName: import_zod.z.string().describe("Target variable to import into")
38
- };
39
- const copyAppSchema = {
40
- tenant: import_zod.z.string().describe("Tenant name"),
41
- sourceApp: import_zod.z.string().describe("Name of app to copy"),
42
- newAppName: import_zod.z.string().describe("Name for the new app")
43
- };
44
- const exportDataSchema = {
45
- tenant: import_zod.z.string().describe("Tenant name"),
46
- variableName: import_zod.z.string().describe("Variable to export")
47
- };
48
- const debugSyncSchema = {
49
- tenant: import_zod.z.string().describe("Tenant name")
50
- };
51
- function registerWorkflowPrompts(server) {
52
- const anyServer = server;
53
- anyServer.prompt(
54
- "setup_new_tenant",
55
- "Guide for setting up a new Farseer tenant: login, checkout, pull, install dependencies.",
56
- setupTenantSchema,
57
- async (params) => {
58
- const { tenant } = params;
59
- return {
60
- messages: [
61
- {
62
- role: "user",
63
- content: {
64
- type: "text",
65
- text: `You are setting up a new Farseer tenant "${tenant}".
66
-
67
- Steps to follow:
68
-
69
- 1. First, check authentication status with farseer_whoami
70
- 2. If not logged in, inform the user to run "farseer login" in terminal (MCP cannot do browser login)
71
- 3. Use farseer_checkout to set "${tenant}" as the default tenant (this also pulls files and apps)
72
- 4. Tell user to run "farseer install ${tenant}" in terminal to install npm dependencies
73
- 5. Use farseer_list_apps to show available apps
74
- 6. Use farseer_export_model to understand the data structure
75
-
76
- After setup, the user can:
77
- - Run apps with farseer_run_app
78
- - Edit scripts in apps/${tenant}/files/Scripts/
79
- - Push changes with farseer_push
80
- - Check model with farseer_get_variable or farseer_get_table`
81
- }
82
- }
83
- ]
84
- };
85
- }
86
- );
87
- anyServer.prompt(
88
- "create_new_app",
89
- "Guide for creating a new Farseer app from scratch.",
90
- createAppSchema,
91
- async (params) => {
92
- const { tenant, appName, scriptName } = params;
93
- const script = scriptName || "index.ts";
94
- return {
95
- messages: [
96
- {
97
- role: "user",
98
- content: {
99
- type: "text",
100
- text: `Creating a new Farseer app "${appName}" for tenant "${tenant}".
101
-
102
- Steps to follow:
103
-
104
- 1. Check if the script "${script}" exists with farseer_status
105
- 2. If script doesn't exist locally:
106
- - Create the script file at apps/${tenant}/files/Scripts/${script}
107
- - Push with farseer_push
108
-
109
- 3. Use farseer_create_app to create the app named "${appName}"
110
-
111
- 4. Use farseer_configure_app to set:
112
- - entrypoint: "${script}"
113
- - scripts: ["${script}"]
114
- - Add arguments if needed
115
-
116
- 5. Test with farseer_run_app
117
-
118
- Script template to create:
119
- \`\`\`typescript
120
- import * as farseer from 'farseer-client';
121
-
122
- const args = process.argv.slice(2);
123
- console.log('Arguments:', args);
124
-
125
- const client = new farseer.FarseerClient();
126
-
127
- async function main() {
128
- await client.initTagMap();
129
-
130
- // Your code here
131
- console.log('App running successfully');
132
- }
133
-
134
- main().catch(farseer.handleUnknownError);
135
- \`\`\``
136
- }
137
- }
138
- ]
139
- };
140
- }
141
- );
142
- anyServer.prompt(
143
- "understand_model",
144
- "Explore and understand the data model of a Farseer tenant.",
145
- understandModelSchema,
146
- async (params) => {
147
- const { tenant } = params;
148
- return {
149
- messages: [
150
- {
151
- role: "user",
152
- content: {
153
- type: "text",
154
- text: `Analyzing the data model for tenant "${tenant}".
155
-
156
- Steps to follow:
157
-
158
- 1. Use farseer_export_model to get the full model structure
159
-
160
- 2. Review dimension tables:
161
- - Use farseer_list_tables for overview
162
- - Key dimensions usually include: Products, Regions, Time (Months, Years), Versions
163
- - Check foreign key relationships between tables
164
-
165
- 3. Review variables:
166
- - Use farseer_list_variables for overview
167
- - Use farseer_get_variable for specific variable details
168
- - Note which dimensions each variable has
169
-
170
- 4. For import scripts, you need to know:
171
- - Target variable name
172
- - All dimensions the variable has
173
- - Valid members for each dimension
174
-
175
- Key concepts:
176
- - Dimensions structure the data (Product, Region, Month, Year, Version)
177
- - Variables store values at dimension intersections
178
- - Formulas calculate values automatically
179
- - Roll-up types determine aggregation (SUM, AVERAGE, etc.)
180
-
181
- Common dimension tables:
182
- - Months, Years (time)
183
- - Versions (Plan, Actual, Forecast)
184
- - Products, Categories, Brands
185
- - Regions, Entities, Cost Centers`
186
- }
187
- }
188
- ]
189
- };
190
- }
191
- );
192
- anyServer.prompt(
193
- "write_import_script",
194
- "Guide for writing a data import script.",
195
- writeImportScriptSchema,
196
- async (params) => {
197
- const { tenant, variableName } = params;
198
- return {
199
- messages: [
200
- {
201
- role: "user",
202
- content: {
203
- type: "text",
204
- text: `Writing an import script for variable "${variableName}" in tenant "${tenant}".
205
-
206
- Steps to follow:
207
-
208
- 1. Use farseer_get_variable to understand the target variable:
209
- - What dimensions does it have?
210
- - What is the roll-up type?
211
-
212
- 2. Use farseer_get_table for each dimension to see valid members
213
-
214
- 3. Create the import script with this pattern:
215
-
216
- \`\`\`typescript
217
- import * as farseer from 'farseer-client';
218
-
219
- const client = new farseer.FarseerClient();
220
-
221
- async function main() {
222
- await client.initTagMap();
223
-
224
- // Create import job with column definitions
225
- const importJob = await client.createImportJob({
226
- title: 'Import ${variableName}',
227
- columns: [
228
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Product' },
229
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },
230
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },
231
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },
232
- { type: 'VARIABLE', variableName: '${variableName}' },
233
- ],
234
- labels: ['auto', 'import-${variableName.toLowerCase().replace(/\s+/g, "-")}']
235
- });
236
-
237
- // Add rows - each row matches column order
238
- const rows = [
239
- ['ProductA', 'Y2025', 'M1', 'Plan', 1000],
240
- ['ProductB', 'Y2025', 'M1', 'Plan', 2000],
241
- ];
242
-
243
- await importJob.addRows(rows);
244
- await importJob.flushRows();
245
- await importJob.undoPrevious(); // Remove previous import
246
- await importJob.commit();
247
-
248
- console.log('Import completed!');
249
- }
250
-
251
- main().catch(farseer.handleUnknownError);
252
- \`\`\`
253
-
254
- 4. Save script to apps/${tenant}/files/Scripts/
255
- 5. Push with farseer_push
256
- 6. Create app with farseer_create_app
257
- 7. Configure with farseer_configure_app
258
- 8. Test with farseer_run_app
259
-
260
- ALTERNATIVE: For simple imports without a script, use the farseer_create_import_job tool directly.
261
- It handles the full workflow (create metadata, add rows, undo previous, commit) in a single call.
262
- Use farseer_create_import_job when:
263
- - Data is already available (no need to fetch from external source)
264
- - The import is a one-time or simple operation
265
- - You want to quickly import without creating a full script
266
-
267
- Use a script when:
268
- - Data comes from external sources (APIs, databases, files)
269
- - Complex data transformation is needed
270
- - The import runs on a schedule as an App`
271
- }
272
- }
273
- ]
274
- };
275
- }
276
- );
277
- anyServer.prompt(
278
- "copy_app",
279
- "Guide for copying an existing app to create a new one.",
280
- copyAppSchema,
281
- async (params) => {
282
- const { tenant, sourceApp, newAppName } = params;
283
- return {
284
- messages: [
285
- {
286
- role: "user",
287
- content: {
288
- type: "text",
289
- text: `Copying app "${sourceApp}" to create "${newAppName}" for tenant "${tenant}".
290
-
291
- Steps to follow:
292
-
293
- 1. Pull latest with farseer_pull to get current app JSON
294
-
295
- 2. Use farseer_get_app to see the source app configuration
296
-
297
- 3. The app JSON files are in apps/${tenant}/apps/
298
-
299
- Copy the source JSON file and modify:
300
- - Change "name" to "${newAppName}"
301
- - **IMPORTANT: Remove "_remote" field** (this makes it a new app)
302
- - Modify arguments, description as needed
303
-
304
- 4. JSON format for new app:
305
- \`\`\`json
306
- {
307
- "name": "${newAppName}",
308
- "description": "Copied from ${sourceApp}",
309
- "entrypoint": "script.ts",
310
- "scripts": ["script.ts"],
311
- "arguments": [
312
- { "name": "Year", "defaultValue": "2025" }
313
- ]
314
- }
315
- \`\`\`
316
-
317
- Note: Do NOT include "_remote" for new apps - CLI adds it after first push.
318
-
319
- 5. Push with farseer_push to create the new app
320
-
321
- 6. Test with farseer_run_app`
322
- }
323
- }
324
- ]
325
- };
326
- }
327
- );
328
- anyServer.prompt(
329
- "export_data",
330
- "Guide for exporting variable data from Farseer.",
331
- exportDataSchema,
332
- async (params) => {
333
- const { tenant, variableName } = params;
334
- return {
335
- messages: [
336
- {
337
- role: "user",
338
- content: {
339
- type: "text",
340
- text: `Exporting data for variable "${variableName}" from tenant "${tenant}".
341
-
342
- Steps to follow:
343
-
344
- 1. Use farseer_get_variable to understand the variable:
345
- - What dimensions does it span?
346
- - What is its data type?
347
-
348
- 2. Choose export method:
349
-
350
- **Option A: Quick export (farseer_export_variable_data)**
351
- - Uses ExportApi.exportFormula() internally
352
- - Returns CSV/JSON data inline
353
- - Good for quick inspection or small datasets
354
- - Use 'limit' parameter for large datasets
355
-
356
- **Option B: Structured export (farseer_load_variable_data)**
357
- - Uses data.loadFarseerVariable() internally
358
- - Can specify which dimensions to include as columns
359
- - Returns structured CSV data
360
- - Good when you need specific dimension breakdowns
361
-
362
- **Option C: CLI export (farseer variable export)**
363
- - Saves CSV/JSON/XLSX to a local file
364
- - Best for saving data locally for analysis
365
-
366
- 3. For analysis:
367
- - Parse the CSV data returned by the tools
368
- - Summarize, filter, or transform as needed`
369
- }
370
- }
371
- ]
372
- };
373
- }
374
- );
375
- anyServer.prompt(
376
- "debug_sync_issues",
377
- "Troubleshoot synchronization problems between local and remote.",
378
- debugSyncSchema,
379
- async (params) => {
380
- const { tenant } = params;
381
- return {
382
- messages: [
383
- {
384
- role: "user",
385
- content: {
386
- type: "text",
387
- text: `Debugging sync issues for tenant "${tenant}".
388
-
389
- Steps to follow:
390
-
391
- 1. Check authentication: farseer_whoami
392
- - Is JWT valid?
393
- - Is tenant checked out?
394
-
395
- 2. Check sync status: farseer_status
396
- - Are there modified files?
397
- - Are there only-local or only-remote files?
398
-
399
- 3. If files show as modified:
400
- - Use farseer_diff to see differences
401
- - Decide: pull (accept remote) or push (upload local)
402
-
403
- 4. Common issues and solutions:
404
-
405
- **"No credentials found"**
406
- \u2192 User needs to run "farseer login" in terminal
407
- \u2192 Or configure API key: "farseer config set ${tenant} --api-key KEY"
408
-
409
- **"Remote has changes"**
410
- \u2192 Pull first with farseer_pull
411
- \u2192 Then push with farseer_push
412
-
413
- **"Token expired"**
414
- \u2192 User needs to run "farseer login" again
415
-
416
- **Apps not syncing**
417
- \u2192 Need JWT login (browser), not API key
418
- \u2192 API key only syncs files, not apps
419
-
420
- 5. Force resolution:
421
- - To accept remote: farseer_pull (overwrites local)
422
- - To accept local: farseer_push with force=true (overwrites remote)
423
-
424
- 6. Check specific file diff:
425
- - Use farseer_diff with file parameter to see exact changes`
426
- }
427
- }
428
- ]
429
- };
430
- }
431
- );
432
- }
433
- // Annotate the CommonJS export names for ESM import in node:
434
- 0 && (module.exports = {
435
- registerWorkflowPrompts
436
- });
437
- //# sourceMappingURL=workflows.js.map
@@ -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,g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