farseer-cli 1.12.0 → 1.14.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.
Files changed (101) hide show
  1. package/README.md +51 -18
  2. package/dist/commands/login.js +60 -26
  3. package/dist/commands/login.js.map +2 -2
  4. package/dist/commands/logout.js +37 -12
  5. package/dist/commands/logout.js.map +3 -3
  6. package/dist/commands/pipeline.js +158 -0
  7. package/dist/commands/pipeline.js.map +7 -0
  8. package/dist/commands/run.js +10 -27
  9. package/dist/commands/run.js.map +2 -2
  10. package/dist/commands/variables.js +17 -8
  11. package/dist/commands/variables.js.map +2 -2
  12. package/dist/commands/whoami.js +10 -14
  13. package/dist/commands/whoami.js.map +2 -2
  14. package/dist/index.js +40 -46
  15. package/dist/index.js.map +2 -2
  16. package/dist/mcp/prompts/workflows.js +13 -68
  17. package/dist/mcp/prompts/workflows.js.map +2 -2
  18. package/dist/mcp/resources/documentation.js +14 -0
  19. package/dist/mcp/resources/documentation.js.map +2 -2
  20. package/dist/mcp/server.js +14 -2
  21. package/dist/mcp/server.js.map +2 -2
  22. package/dist/mcp/skills.js +59 -0
  23. package/dist/mcp/skills.js.map +7 -0
  24. package/dist/mcp/tools/appTools.js +4 -0
  25. package/dist/mcp/tools/appTools.js.map +2 -2
  26. package/dist/mcp/tools/authTools.js +5 -2
  27. package/dist/mcp/tools/authTools.js.map +2 -2
  28. package/dist/mcp/tools/dataTools.js +2 -0
  29. package/dist/mcp/tools/dataTools.js.map +2 -2
  30. package/dist/mcp/tools/modelTools.js +6 -41
  31. package/dist/mcp/tools/modelTools.js.map +2 -2
  32. package/dist/mcp/tools/pipelineContract.js +317 -0
  33. package/dist/mcp/tools/pipelineContract.js.map +7 -0
  34. package/dist/mcp/tools/pipelineTools.js +111 -0
  35. package/dist/mcp/tools/pipelineTools.js.map +7 -0
  36. package/dist/mcp/tools/runTools.js +7 -18
  37. package/dist/mcp/tools/runTools.js.map +2 -2
  38. package/dist/mcp/tools/syncTools.js +4 -0
  39. package/dist/mcp/tools/syncTools.js.map +2 -2
  40. package/dist/mcp/utils/helpers.js +16 -6
  41. package/dist/mcp/utils/helpers.js.map +3 -3
  42. package/dist/mcp/utils/session.js +14 -9
  43. package/dist/mcp/utils/session.js.map +2 -2
  44. package/dist/pipeline/compatibility.js +53 -0
  45. package/dist/pipeline/compatibility.js.map +7 -0
  46. package/dist/pipeline/connect.js +139 -0
  47. package/dist/pipeline/connect.js.map +7 -0
  48. package/dist/pipeline/create.js +158 -0
  49. package/dist/pipeline/create.js.map +7 -0
  50. package/dist/pipeline/errors.js +45 -0
  51. package/dist/pipeline/errors.js.map +7 -0
  52. package/dist/pipeline/generated-reference.json +115 -0
  53. package/dist/pipeline/guide.js +33 -0
  54. package/dist/pipeline/guide.js.map +7 -0
  55. package/dist/pipeline/init.js +204 -0
  56. package/dist/pipeline/init.js.map +7 -0
  57. package/dist/pipeline/operations.js +103 -0
  58. package/dist/pipeline/operations.js.map +7 -0
  59. package/dist/pipeline/query.js +103 -0
  60. package/dist/pipeline/query.js.map +7 -0
  61. package/dist/pipeline/queryWorker.js +119 -0
  62. package/dist/pipeline/queryWorker.js.map +7 -0
  63. package/dist/pipeline/readiness.js +55 -0
  64. package/dist/pipeline/readiness.js.map +7 -0
  65. package/dist/pipeline/reference.js +72 -0
  66. package/dist/pipeline/reference.js.map +7 -0
  67. package/dist/pipeline/requests.js +122 -0
  68. package/dist/pipeline/requests.js.map +7 -0
  69. package/dist/pipeline/runArguments.js +68 -0
  70. package/dist/pipeline/runArguments.js.map +7 -0
  71. package/dist/pipeline/runtime.js +105 -0
  72. package/dist/pipeline/runtime.js.map +7 -0
  73. package/dist/pipeline/service.js +967 -0
  74. package/dist/pipeline/service.js.map +7 -0
  75. package/dist/services/agentApprovalFetch.js +86 -0
  76. package/dist/services/agentApprovalFetch.js.map +7 -0
  77. package/dist/services/authErrors.js +2 -2
  78. package/dist/services/authErrors.js.map +2 -2
  79. package/dist/services/configService.js +74 -9
  80. package/dist/services/configService.js.map +2 -2
  81. package/dist/services/credentials.js +12 -7
  82. package/dist/services/credentials.js.map +2 -2
  83. package/dist/services/farseerService.js +94 -39
  84. package/dist/services/farseerService.js.map +2 -2
  85. package/dist/services/preflight.js +7 -2
  86. package/dist/services/preflight.js.map +2 -2
  87. package/dist/services/realms.js +67 -0
  88. package/dist/services/realms.js.map +7 -0
  89. package/dist/services/syncService.js +6 -0
  90. package/dist/services/syncService.js.map +2 -2
  91. package/dist/skills/pipeline.js +71 -0
  92. package/dist/skills/pipeline.js.map +7 -0
  93. package/dist/utils/helpers.js +2 -1
  94. package/dist/utils/helpers.js.map +2 -2
  95. package/dist/utils/variableValues.js +78 -0
  96. package/dist/utils/variableValues.js.map +7 -0
  97. package/docs/pipeline-client-guide.md +67 -0
  98. package/docs/pipeline-reference.md +2064 -0
  99. package/package.json +5 -1
  100. package/skills/pipeline-authoring/SKILL.md +95 -0
  101. package/skills/pipeline-authoring/practices.md +325 -0
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 (\n name === 'warning' &&\n typeof data === 'object' &&\n data !== null &&\n 'name' in data &&\n data.name === 'DeprecationWarning' &&\n 'message' in data &&\n typeof data.message === 'string' &&\n data.message.includes('punycode')\n ) {\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 { fileLogger } from './utils/fileLogger';\n\n// Initialize file logging and crash handlers\nfileLogger.init();\nfileLogger.installCrashHandlers();\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 { registerRefreshCommand } from './commands/refresh';\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 { registerMcpServerCommand } from './commands/mcp-server';\nimport { registerSheetsCommand } from './commands/sheets';\nimport { registerDashboardsCommand } from './commands/dashboards';\nimport { registerCellsCommand } from './commands/cells';\nimport { registerFormulaCommand } from './commands/formula';\nimport { checkForUpdates } from './utils/updateCheck';\n\n// Start non-blocking update check (skip for MCP server \u2014 it's a long-lived process)\nconst updateMessagePromise = process.argv.includes('mcp-server') ? null : checkForUpdates();\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(\n 'after',\n `\n${chalk.bold.underline('Tenant Resolution')} ${chalk.dim('(explicit arg > FARSEER_TENANT env > error \u2014 never a global default)')}\n Most commands accept ${chalk.cyan('[org] [tenant]')} arguments:\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-2 salvus-prodaja')} ${chalk.dim('First time: set up the workspace (org + tenant)')}\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-prodaja')} ${chalk.dim('After that: just the tenant (org is remembered)')}\n Or set it once per shell and omit it:\n ${chalk.green('$')} export FARSEER_TENANT=salvus-prodaja ${chalk.dim('(+ FARSEER_ORG=salvus-2 if org differs)')}\n ${chalk.green('$')} farseer push ${chalk.dim('Targets FARSEER_TENANT; errors if unset')}\n Each shell is independent \u2014 different terminals can target different tenants.\n\n${chalk.bold.underline('Workspace Layout')} ${chalk.dim('(created by farseer pull)')}\n ${chalk.dim('farseer-apps/<tenant>/files/')} Your scripts and data \u2014 sync source\n ${chalk.dim('farseer-apps/<tenant>/apps/')} App configs (mirrored remote Apps)\n ${chalk.dim('farseer-apps/<tenant>/.farseer-sync.json')} Per-machine diff baseline (do not commit; gitignored)\n ${chalk.dim('farseer-apps/<tenant>/package.json')} Node deps for run / install\n If the baseline drifts out of step, ${chalk.cyan('farseer refresh')} rebuilds it from a fresh remote hash fetch and current local files.\n\n${chalk.bold.underline('Authentication')}\n login Login via browser (OAuth)\n logout [tenant] Logout and remove credentials\n whoami Show active target, login status, configured tenants\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 config include Manage extra file types to sync\n ${chalk.dim('--ext <ext>')} Add extension (repeatable, e.g., --ext .json)\n ${chalk.dim('--folder <path>')} Add folder (repeatable)\n ${chalk.dim('--remove-ext <ext>')} Remove extension\n ${chalk.dim('--remove-folder <path>')} Remove folder\n ${chalk.dim('--clear')} Remove all sync includes\n\n${chalk.bold.underline('Sync Operations')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n pull [org] [tenant] Pull files and apps from remote\n ${chalk.dim('--all')} Download every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist)\n ${chalk.dim('--force')} Mirror remote \u2192 local: overwrite local edits AND delete local-only (asks confirmation)\n ${chalk.dim('-y, --yes')} Skip confirm when local has uncommitted changes\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n push [org] [tenant] Push local changes to remote\n ${chalk.dim('-y, --yes')} Skip confirmation for non-destructive pushes\n ${chalk.dim('--force')} Mirror local \u2192 remote: overwrite drift AND delete remote-only (asks confirmation)\n ${chalk.dim('--shallow')} Skip remote-content hash pre-flight (faster, but may miss remote edits)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n status [tenant] Show sync status (local vs remote)\n ${chalk.dim('--all')} Show every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist)\n ${chalk.dim('--shallow')} Skip remote-content hash check (faster, but may miss remote edits)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n diff [tenant] [file] Show file differences\n refresh [org] [tenant] Rebuild the local sync baseline (.farseer-sync.json)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n\n${chalk.bold.underline('App Management')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\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 FARSEER_TENANT set)')}\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 FARSEER_TENANT set)')}\n variables list [tenant] List all variables\n variables create [tenant] Create a new variable\n ${chalk.dim('--name <name>')} Variable name (required)\n ${chalk.dim('--dimensions <csv>')} Comma-separated dimension tables\n ${chalk.dim('--formula <expr>')} Formula expression\n ${chalk.dim('--rollup <type>')} Rollup type (Sum, Average, etc.)\n ${chalk.dim('--data-type <type>')} Data type (Decimal, Integer, Text)\n ${chalk.dim('--description <text>')} Description\n variables update [tenant] Update an existing variable\n ${chalk.dim('--name <name>')} Variable name (required)\n ${chalk.dim('--formula <expr>')} New formula\n ${chalk.dim('--rollup <type>')} New rollup type\n ${chalk.dim('--description <text>')} New description\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 FARSEER_TENANT set)')}\n dimensions list [tenant] List all dimension tables\n dimensions members <table> List all members of a dimension table\n ${chalk.dim('--limit <n>')} Limit number of members shown\n dimensions create-member Create a new dimension member\n ${chalk.dim('--table <name>')} Dimension table name\n ${chalk.dim('--name <name>')} New member name\n ${chalk.dim('--parent <name>')} Parent member name (optional)\n dimensions delete-member Delete a dimension member\n ${chalk.dim('--table <name> --name <name>')} Table and member to delete\n ${chalk.dim('-y')} Skip confirmation\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('Sheets')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n sheets list [tenant] List all sheets\n sheets show <nameOrId> Show sheet configuration\n sheets data <nameOrId> Get sheet data\n ${chalk.dim('--limit <n>')} Limit cells returned\n sheets set-data Set sheet data from JSON file\n ${chalk.dim('--sheet <nameOrId>')} Sheet name or ID\n ${chalk.dim('--input <file>')} JSON data file\n ${chalk.dim('-y')} Skip confirmation\n\n${chalk.bold.underline('Dashboards')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n dashboards list [tenant] List all dashboards\n dashboards show <nameOrId> Show dashboard details\n ${chalk.dim('--tiles')} Include tile details\n\n${chalk.bold.underline('Cells')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n cells query Query cell values\n ${chalk.dim('--variable <name>')} Variable name (required)\n ${chalk.dim('--dimension <table=member>')} Dimension filter (repeatable)\n cells update Update a cell value\n ${chalk.dim('--variable <name>')} Variable name (required)\n ${chalk.dim('--dimension <table=member>')} Dimension filter (repeatable)\n ${chalk.dim('--value <number>')} New value (required)\n ${chalk.dim('-y')} Skip confirmation\n\n${chalk.bold.underline('Formula')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n formula eval <expression> Evaluate a formula expression\n ${chalk.dim('--filter <table=member>')} Dimension filter (repeatable)\n\n${chalk.bold.underline('Model Inspection')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\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 --tenant <slug> Start MCP server bound to a tenant (Claude, Cursor, etc.)\n ${chalk.dim('--org <org>')} Organisation subdomain (default: saved mapping, else tenant)\n\n${chalk.bold.underline('Examples')}\n ${chalk.green('$')} farseer login ${chalk.dim('Login via browser')}\n ${chalk.green('$')} farseer pull salvus-2 salvus-prod ${chalk.dim('First time: set up the workspace (org + tenant)')}\n ${chalk.green('$')} export FARSEER_TENANT=salvus-prod ${chalk.dim('Set the target for this shell')}\n ${chalk.green('$')} farseer push ${chalk.dim('With FARSEER_TENANT set: no tenant arg')}\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\n// Register all commands (hidden from default help, shown in custom help above)\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterConfigCommand(program);\nregisterListCommand(program);\nregisterFilesCommand(program);\nregisterAppCommand(program);\nregisterVariablesCommand(program);\nregisterDimensionsCommand(program);\nregisterModelCommand(program);\nregisterStatusCommand(program);\nregisterDiffCommand(program);\nregisterPullCommand(program);\nregisterPushCommand(program);\nregisterRefreshCommand(program);\nregisterRunCommand(program);\nregisterInstallCommand(program);\nregisterWhoamiCommand(program);\nregisterSheetsCommand(program);\nregisterDashboardsCommand(program);\nregisterCellsCommand(program);\nregisterFormulaCommand(program);\nregisterMcpServerCommand(program);\n\n// Display update notification after any command finishes\nif (updateMessagePromise) {\n program.hook('postAction', async () => {\n const message = await updateMessagePromise;\n if (message) {\n process.stderr.write(message + '\\n');\n }\n });\n}\n\n// Parse arguments\nprogram.parse();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,uBAAwB;AACxB,mBAAkB;AAClB,uBAA4B;AAC5B,wBAA2B;AAK3B,mBAAqC;AACrC,oBAAsC;AACtC,oBAAsC;AACtC,kBAAoC;AACpC,mBAAqC;AACrC,oBAAsC;AACtC,kBAAoC;AACpC,kBAAoC;AACpC,kBAAoC;AACpC,qBAAuC;AACvC,iBAAmC;AACnC,qBAAuC;AACvC,oBAAsC;AACtC,iBAAmC;AACnC,mBAAqC;AACrC,uBAAyC;AACzC,wBAA0C;AAC1C,wBAAyC;AACzC,oBAAsC;AACtC,wBAA0C;AAC1C,mBAAqC;AACrC,qBAAuC;AACvC,yBAAgC;AAjDhC,MAAM,eAAe,QAAQ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AAA,IAC7B,qCAAsB,OAAO;AAAA,IAC7B,6CAA0B,OAAO;AAAA,IACjC,mCAAqB,OAAO;AAAA,IAC5B,uCAAuB,OAAO;AAAA,IAC9B,4CAAyB,OAAO;AAGhC,IAAI,sBAAsB;AACtB,UAAQ,KAAK,cAAc,YAAY;AACnC,UAAM,UAAU,MAAM;AACtB,QAAI,SAAS;AACT,cAAQ,OAAO,MAAM,UAAU,IAAI;AAAA,IACvC;AAAA,EACJ,CAAC;AACL;AAGA,QAAQ,MAAM;",
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 (\n name === 'warning' &&\n typeof data === 'object' &&\n data !== null &&\n 'name' in data &&\n data.name === 'DeprecationWarning' &&\n 'message' in data &&\n typeof data.message === 'string' &&\n data.message.includes('punycode')\n ) {\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 { fileLogger } from './utils/fileLogger';\nimport { AGENT_API_KEY_PREFIX } from './services/configService';\nimport { installAgentApprovalFetch } from './services/agentApprovalFetch';\n\n// Agent writes wait for approval in chat; CLI commands and the MCP server share this transport.\ninstallAgentApprovalFetch();\n\n// Initialize file logging and crash handlers\nfileLogger.init();\nfileLogger.installCrashHandlers();\nimport { checkForUpdates } from './utils/updateCheck';\n\n// Agent sandboxes cannot install updates and have no route to npm.\n// Do not make their commands wait for a registry timeout after the real work is done.\nconst updateMessagePromise =\n !process.env.FARSEER_API_KEY?.startsWith(AGENT_API_KEY_PREFIX) && !process.argv.includes('mcp-server')\n ? checkForUpdates()\n : null;\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 .usage('[options] [command]')\n .description('CLI tool for syncing Farseer App scripts between local folder and Farseer instances')\n .version(CLI_VERSION)\n .addHelpText(\n 'after',\n `\n${chalk.bold.underline('Tenant Resolution')} ${chalk.dim('(explicit arg > FARSEER_TENANT env > error \u2014 never a global default)')}\n Most commands accept ${chalk.cyan('[org] [tenant]')} arguments:\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-2 salvus-prodaja')} ${chalk.dim('First time: set up the workspace (org + tenant)')}\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-prodaja')} ${chalk.dim('After that: just the tenant (org is remembered)')}\n Or set it once per shell and omit it:\n ${chalk.green('$')} export FARSEER_TENANT=salvus-prodaja ${chalk.dim('(+ FARSEER_ORG=salvus-2 if org differs)')}\n ${chalk.green('$')} farseer push ${chalk.dim('Targets FARSEER_TENANT; errors if unset')}\n Each shell is independent \u2014 different terminals can target different tenants.\n\n${chalk.bold.underline('Workspace Layout')} ${chalk.dim('(created by farseer pull)')}\n ${chalk.dim('farseer-apps/<tenant>/files/')} Your scripts and data \u2014 sync source\n ${chalk.dim('farseer-apps/<tenant>/apps/')} App configs (mirrored remote Apps)\n ${chalk.dim('farseer-apps/<tenant>/.farseer-sync.json')} Per-machine diff baseline (do not commit; gitignored)\n ${chalk.dim('farseer-apps/<tenant>/package.json')} Node deps for run / install\n If the baseline drifts out of step, ${chalk.cyan('farseer refresh')} rebuilds it from a fresh remote hash fetch and current local files.\n\n${chalk.bold.underline('Authentication')}\n login Login via browser (OAuth)\n logout [tenant] Logout and remove credentials\n whoami Show active target, login status, configured tenants\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 config include Manage extra file types to sync\n ${chalk.dim('--ext <ext>')} Add extension (repeatable, e.g., --ext .json)\n ${chalk.dim('--folder <path>')} Add folder (repeatable)\n ${chalk.dim('--remove-ext <ext>')} Remove extension\n ${chalk.dim('--remove-folder <path>')} Remove folder\n ${chalk.dim('--clear')} Remove all sync includes\n\n${chalk.bold.underline('Pipeline')}\n pipeline guide Read the prepared-workspace authoring guide\n pipeline <operation> init, check, pull, push, run, runs, inspect, inspect-import, query, versions, restore, terminate, recover, unlock (see --help)\n\n${chalk.bold.underline('Sync Operations')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n pull [org] [tenant] Pull files and apps from remote\n ${chalk.dim('--all')} Download every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist)\n ${chalk.dim('--force')} Mirror remote \u2192 local: overwrite local edits AND delete local-only (asks confirmation)\n ${chalk.dim('-y, --yes')} Skip confirm when local has uncommitted changes\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n push [org] [tenant] Push local changes to remote\n ${chalk.dim('-y, --yes')} Skip confirmation for non-destructive pushes\n ${chalk.dim('--force')} Mirror local \u2192 remote: overwrite drift AND delete remote-only (asks confirmation)\n ${chalk.dim('--shallow')} Skip remote-content hash pre-flight (faster, but may miss remote edits)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n status [tenant] Show sync status (local vs remote)\n ${chalk.dim('--all')} Show every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist)\n ${chalk.dim('--shallow')} Skip remote-content hash check (faster, but may miss remote edits)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n diff [tenant] [file] Show file differences\n refresh [org] [tenant] Rebuild the local sync baseline (.farseer-sync.json)\n ${chalk.dim('--include-ext <ext>')} Include extra extension (repeatable)\n ${chalk.dim('--include-folder <folder>')} Include all files in folder (repeatable)\n\n${chalk.bold.underline('App Management')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\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 FARSEER_TENANT set)')}\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 FARSEER_TENANT set)')}\n variables list [tenant] List all variables\n variables create [tenant] Create a new variable\n ${chalk.dim('--name <name>')} Variable name (required)\n ${chalk.dim('--dimensions <csv>')} Comma-separated dimension tables\n ${chalk.dim('--formula <expr>')} Formula expression\n ${chalk.dim('--rollup <type>')} Rollup type (Sum, Average, etc.)\n ${chalk.dim('--data-type <type>')} Data type (Decimal, Integer, Text)\n ${chalk.dim('--description <text>')} Description\n variables update [tenant] Update an existing variable\n ${chalk.dim('--name <name>')} Variable name (required)\n ${chalk.dim('--formula <expr>')} New formula\n ${chalk.dim('--rollup <type>')} New rollup type\n ${chalk.dim('--description <text>')} New description\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 FARSEER_TENANT set)')}\n dimensions list [tenant] List all dimension tables\n dimensions members <table> List all members of a dimension table\n ${chalk.dim('--limit <n>')} Limit number of members shown\n dimensions create-member Create a new dimension member\n ${chalk.dim('--table <name>')} Dimension table name\n ${chalk.dim('--name <name>')} New member name\n ${chalk.dim('--parent <name>')} Parent member name (optional)\n dimensions delete-member Delete a dimension member\n ${chalk.dim('--table <name> --name <name>')} Table and member to delete\n ${chalk.dim('-y')} Skip confirmation\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('Sheets')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n sheets list [tenant] List all sheets\n sheets show <nameOrId> Show sheet configuration\n sheets data <nameOrId> Get sheet data\n ${chalk.dim('--limit <n>')} Limit cells returned\n sheets set-data Set sheet data from JSON file\n ${chalk.dim('--sheet <nameOrId>')} Sheet name or ID\n ${chalk.dim('--input <file>')} JSON data file\n ${chalk.dim('-y')} Skip confirmation\n\n${chalk.bold.underline('Dashboards')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n dashboards list [tenant] List all dashboards\n dashboards show <nameOrId> Show dashboard details\n ${chalk.dim('--tiles')} Include tile details\n\n${chalk.bold.underline('Cells')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n cells query Query cell values\n ${chalk.dim('--variable <name>')} Variable name (required)\n ${chalk.dim('--dimension <table=member>')} Dimension filter (repeatable)\n cells update Update a cell value\n ${chalk.dim('--variable <name>')} Variable name (required)\n ${chalk.dim('--dimension <table=member>')} Dimension filter (repeatable)\n ${chalk.dim('--value <number>')} New value (required)\n ${chalk.dim('-y')} Skip confirmation\n\n${chalk.bold.underline('Formula')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\n formula eval <expression> Evaluate a formula expression\n ${chalk.dim('--filter <table=member>')} Dimension filter (repeatable)\n\n${chalk.bold.underline('Model Inspection')} ${chalk.dim('(tenant optional if FARSEER_TENANT set)')}\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 --tenant <slug> Start MCP server bound to a tenant (Claude, Cursor, etc.)\n ${chalk.dim('--org <org>')} Organisation subdomain (default: saved mapping, else tenant)\n\n${chalk.bold.underline('Examples')}\n ${chalk.green('$')} farseer login ${chalk.dim('Login via browser')}\n ${chalk.green('$')} farseer pull salvus-2 salvus-prod ${chalk.dim('First time: set up the workspace (org + tenant)')}\n ${chalk.green('$')} export FARSEER_TENANT=salvus-prod ${chalk.dim('Set the target for this shell')}\n ${chalk.green('$')} farseer push ${chalk.dim('With FARSEER_TENANT set: no tenant arg')}\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\n// Load only the selected command's implementation. In particular, normal CLI\n// calls must not pay for registering every MCP tool and pipeline dependency.\nconst registrations: [string[], () => void][] = [\n [['login'], () => require('./commands/login').registerLoginCommand(program)],\n [['logout'], () => require('./commands/logout').registerLogoutCommand(program)],\n [['config'], () => require('./commands/config').registerConfigCommand(program)],\n [['list'], () => require('./commands/list').registerListCommand(program)],\n [['files'], () => require('./commands/files').registerFilesCommand(program)],\n [['app'], () => require('./commands/app').registerAppCommand(program)],\n [['variables', 'variable'], () => require('./commands/variables').registerVariablesCommand(program)],\n [['dimensions', 'dimension'], () => require('./commands/dimensions').registerDimensionsCommand(program)],\n [['model'], () => require('./commands/model').registerModelCommand(program)],\n [['status'], () => require('./commands/status').registerStatusCommand(program)],\n [['diff'], () => require('./commands/diff').registerDiffCommand(program)],\n [['pull'], () => require('./commands/pull').registerPullCommand(program)],\n [['push'], () => require('./commands/push').registerPushCommand(program)],\n [['refresh'], () => require('./commands/refresh').registerRefreshCommand(program)],\n [['run', 'run-script'], () => require('./commands/run').registerRunCommand(program)],\n [['install'], () => require('./commands/install').registerInstallCommand(program)],\n [['whoami'], () => require('./commands/whoami').registerWhoamiCommand(program)],\n [['sheets'], () => require('./commands/sheets').registerSheetsCommand(program)],\n [['dashboards'], () => require('./commands/dashboards').registerDashboardsCommand(program)],\n [['cells'], () => require('./commands/cells').registerCellsCommand(program)],\n [['formula'], () => require('./commands/formula').registerFormulaCommand(program)],\n [['pipeline'], () => require('./commands/pipeline').registerPipelineCommand(program)],\n [['mcp-server'], () => require('./commands/mcp-server').registerMcpServerCommand(program)],\n];\nconst command = process.argv[2] === 'help' ? process.argv[3] : process.argv[2];\nconst selected = registrations.find(([names]) => names.includes(command));\nif (selected) selected[1]();\nelse if (!['--version', '-V', '--help', '-h'].includes(command)) {\n // Keep the full command tree for bare invocation and unknown-command suggestions.\n for (const [, register] of registrations) register();\n}\n\n// Display update notification after any command finishes\nif (updateMessagePromise) {\n program.hook('postAction', async () => {\n const message = await updateMessagePromise;\n if (message) {\n process.stderr.write(message + '\\n');\n }\n });\n}\n\n// Parse arguments\nprogram.parse();\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,uBAAwB;AACxB,mBAAkB;AAClB,uBAA4B;AAC5B,wBAA2B;AAC3B,2BAAqC;AACrC,gCAA0C;AAQ1C,yBAAgC;AAhChC,MAAM,eAAe,QAAQ;AAE7B,QAAQ,OAAO,SAAU,MAAc,SAAkB,MAAiB;AACtE,MACI,SAAS,aACT,OAAO,SAAS,YAChB,SAAS,QACT,UAAU,QACV,KAAK,SAAS,wBACd,aAAa,QACb,O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C,OAAO,GAAG,MAAM,QAAQ,kBAAkB,EAAE,qBAAqB,OAAO,CAAC;AAAA,EAC3E,CAAC,CAAC,SAAS,GAAG,MAAM,QAAQ,oBAAoB,EAAE,uBAAuB,OAAO,CAAC;AAAA,EACjF,CAAC,CAAC,UAAU,GAAG,MAAM,QAAQ,qBAAqB,EAAE,wBAAwB,OAAO,CAAC;AAAA,EACpF,CAAC,CAAC,YAAY,GAAG,MAAM,QAAQ,uBAAuB,EAAE,yBAAyB,OAAO,CAAC;AAC7F;AACA,MAAM,UAAU,QAAQ,KAAK,CAAC,MAAM,SAAS,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC;AAC7E,MAAM,WAAW,cAAc,KAAK,CAAC,CAAC,KAAK,MAAM,MAAM,SAAS,OAAO,CAAC;AACxE,IAAI,SAAU,UAAS,CAAC,EAAE;AAAA,SACjB,CAAC,CAAC,aAAa,MAAM,UAAU,IAAI,EAAE,SAAS,OAAO,GAAG;AAE7D,aAAW,CAAC,EAAE,QAAQ,KAAK,cAAe,UAAS;AACvD;AAGA,IAAI,sBAAsB;AACtB,UAAQ,KAAK,cAAc,YAAY;AACnC,UAAM,UAAU,MAAM;AACtB,QAAI,SAAS;AACT,cAAQ,OAAO,MAAM,UAAU,IAAI;AAAA,IACvC;AAAA,EACJ,CAAC;AACL;AAGA,QAAQ,MAAM;",
6
6
  "names": ["chalk"]
7
7
  }
@@ -76,6 +76,7 @@ Steps to follow:
76
76
  7. Use farseer_export_model to understand the data structure
77
77
 
78
78
  After setup, the user can:
79
+ - Author repeatable data extraction, transformation and loading with farseer_pipeline; start with operation=guide topic=method, then check the prepared setup
79
80
  - Run apps with farseer_run_app
80
81
  - Edit scripts in apps/${tenant}/files/Scripts/
81
82
  - Push changes with farseer_push
@@ -88,7 +89,7 @@ After setup, the user can:
88
89
  );
89
90
  anyServer.prompt(
90
91
  "create_new_app",
91
- "Guide for creating a new Farseer app from scratch.",
92
+ "Guide for creating a non-pipeline app. All new repeatable pipelines must use Simple Pipelines; preserve existing TypeScript apps.",
92
93
  createAppSchema,
93
94
  async (params) => {
94
95
  const { tenant, appName, scriptName } = params;
@@ -101,6 +102,8 @@ After setup, the user can:
101
102
  type: "text",
102
103
  text: `Creating a new Farseer app "${appName}" for tenant "${tenant}".
103
104
 
105
+ All new repeatable pipelines must use Simple Pipelines through farseer_pipeline operation=guide topic=method, even when TypeScript is requested. Inspect existing apps and source first. For an existing TypeScript pipeline, use the app tools for targeted maintenance and preserve its implementation; migration requires an explicit migration request. The creation steps below apply only to non-pipeline apps. Missing pipeline setup is not a reason to create a TypeScript pipeline.
106
+
104
107
  IMPORTANT: A Farseer App = a TypeScript script + an app config that tells Farseer which script to run and with what arguments.
105
108
  The script uses \`farseer-client\` to interact with the Farseer API.
106
109
  Authentication is automatic - \`new FarseerClient()\` reads credentials from environment variables injected by the CLI.
@@ -203,7 +206,7 @@ Common dimension tables:
203
206
  );
204
207
  anyServer.prompt(
205
208
  "write_import_script",
206
- "Guide for writing a data import script.",
209
+ "Guide for maintaining an existing TypeScript import or authoring a new Simple Pipeline. Requested one-off direct imports remain supported.",
207
210
  writeImportScriptSchema,
208
211
  async (params) => {
209
212
  const { tenant, variableName } = params;
@@ -213,73 +216,13 @@ Common dimension tables:
213
216
  role: "user",
214
217
  content: {
215
218
  type: "text",
216
- text: `Writing an import script for variable "${variableName}" in tenant "${tenant}".
217
-
218
- Steps to follow:
219
-
220
- 1. Use farseer_get_variable to understand the target variable:
221
- - What dimensions does it have?
222
- - What is the roll-up type?
223
-
224
- 2. Use farseer_get_table for each dimension to see valid members
225
-
226
- 3. Create the import script with this pattern:
227
-
228
- \`\`\`typescript
229
- import * as farseer from 'farseer-client';
230
-
231
- const client = new farseer.FarseerClient();
232
-
233
- async function main() {
234
- await client.initTagMap();
235
-
236
- // Create import job with column definitions
237
- const importJob = await client.createImportJob({
238
- title: 'Import ${variableName}',
239
- columns: [
240
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Product' },
241
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },
242
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },
243
- { type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },
244
- { type: 'VARIABLE', variableName: '${variableName}' },
245
- ],
246
- labels: ['auto', 'import-${variableName.toLowerCase().replace(/\s+/g, "-")}']
247
- });
248
-
249
- // Add rows - each row matches column order
250
- const rows = [
251
- ['ProductA', 'Y2025', 'M1', 'Plan', 1000],
252
- ['ProductB', 'Y2025', 'M1', 'Plan', 2000],
253
- ];
254
-
255
- await importJob.addRows(rows);
256
- await importJob.flushRows();
257
- await importJob.undoPrevious(); // Remove previous import
258
- await importJob.commit();
259
-
260
- console.log('Import completed!');
261
- }
219
+ text: `Work on the import for variable "${variableName}" in tenant "${tenant}".
262
220
 
263
- main().catch(farseer.handleUnknownError);
264
- \`\`\`
265
-
266
- 4. Save script to apps/${tenant}/files/Scripts/
267
- 5. Push with farseer_push
268
- 6. Create app with farseer_create_app
269
- 7. Configure with farseer_configure_app
270
- 8. Test with farseer_run_app
271
-
272
- ALTERNATIVE: For simple imports without a script, use the farseer_create_import_job tool directly.
273
- It handles the full workflow (create metadata, add rows, undo previous, commit) in a single call.
274
- Use farseer_create_import_job when:
275
- - Data is already available (no need to fetch from external source)
276
- - The import is a one-time or simple operation
277
- - You want to quickly import without creating a full script
278
-
279
- Use a script when:
280
- - Data comes from external sources (APIs, databases, files)
281
- - Complex data transformation is needed
282
- - The import runs on a schedule as an App`
221
+ 1. Inspect existing apps and source with farseer_list_apps, farseer_get_app and farseer_pull. Identify the app responsible for this variable before choosing a workflow.
222
+ 2. If the request concerns an existing TypeScript app, preserve it. Inspect, run, debug and make targeted fixes through the app tools without requiring the user to explicitly say TypeScript. Read its current source, arguments, schedule and runner configuration before editing. Push only the intended changes and verify through the existing app workflow.
223
+ 3. All new repeatable pipelines must use Simple Pipelines, even when TypeScript is requested. Read farseer_pipeline operation=guide topic=method, then practices and grammar; discover the variable and dimension tables before authoring. Missing pipeline setup is not a reason to create a TypeScript pipeline.
224
+ 4. Migration requires an explicit migration request. A request to fix or extend an existing import does not authorize replacing its source folder, entrypoint, runner image or schedule, or creating a duplicate pipeline. An existing TypeScript app is not missing Simple Pipelines setup.
225
+ 5. For a requested one-off direct import of data already available, use farseer_create_import_job. This does not authorize a new TypeScript pipeline.`
283
226
  }
284
227
  }
285
228
  ]
@@ -300,6 +243,8 @@ Use a script when:
300
243
  type: "text",
301
244
  text: `Copying app "${sourceApp}" to create "${newAppName}" for tenant "${tenant}".
302
245
 
246
+ Inspect the source first. All new repeatable pipelines must use Simple Pipelines; do not use this copy workflow to create a new TypeScript pipeline. Preserve an existing TypeScript pipeline and use targeted maintenance when the request is to fix or extend it. Migration requires an explicit migration request. The steps below apply to non-pipeline apps.
247
+
303
248
  Steps to follow:
304
249
 
305
250
  1. Pull latest with farseer_pull to get current app JSON
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 getting started on the tenant this server is bound to: verify login, 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. Check authentication and the bound tenant with farseer_whoami\n2. If not logged in, inform the user to run \"farseer login\" in terminal (MCP cannot do browser login)\n3. If farseer_whoami does not show \"${tenant}\", tell the user to set --tenant ${tenant} in this MCP server's config and reconnect \u2014 MCP tools cannot change the tenant\n4. Pull files and apps with farseer_pull\n5. Tell user to run \"farseer install ${tenant}\" in terminal to install npm dependencies\n6. Use farseer_list_apps to show available apps\n7. 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\nIMPORTANT: A Farseer App = a TypeScript script + an app config that tells Farseer which script to run and with what arguments.\nThe script uses \\`farseer-client\\` to interact with the Farseer API.\nAuthentication is automatic - \\`new FarseerClient()\\` reads credentials from environment variables injected by the CLI.\nYou NEVER hardcode credentials in scripts.\n\nSteps to follow:\n\n1. Write the script file at farseer-apps/${tenant}/files/Scripts/${script}\n Use the template below as a starting point.\n\n2. Push the script to remote with farseer_push\n (Scripts must exist on remote before they can be assigned to an app)\n\n3. Create the app with farseer_create_app (name: \"${appName}\")\n\n4. Configure the app with farseer_configure_app:\n - sourceFolder: \"Scripts\"\n - entrypoint: \"${script}\"\n - arguments: Add any arguments the script expects (they arrive via process.argv)\n\n5. Test with farseer_run_app\n The CLI injects auth credentials as env vars and runs the script with npx tsx.\n\nScript template:\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\n// FarseerClient auto-configures from env vars injected by \"farseer run\"\n// NEVER hardcode credentials - just use the empty constructor\nconst client = new farseer.FarseerClient();\n\n// Arguments come via process.argv in the order defined by app config\nconst args = process.argv.slice(2);\n\nasync function main() {\n // Load dimension/variable metadata\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 - Set \"schedule\" to null, unless the user asked for the copy to run on the\n same schedule \u2014 otherwise both apps run at the same moment\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 - Which tenant is this server bound to (via --tenant)?\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 all remote changes: farseer_pull with force=true (overwrites local)\n - To accept all local changes: farseer_push with force=true (overwrites remote)\n - For selective resolution: farseer_pull without force will skip conflicts (resolve via CLI)\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": ";;;;;;;;;;;;;;;;;;AA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ACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
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 getting started on the tenant this server is bound to: verify login, 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. Check authentication and the bound tenant with farseer_whoami\n2. If not logged in, inform the user to run \"farseer login\" in terminal (MCP cannot do browser login)\n3. If farseer_whoami does not show \"${tenant}\", tell the user to set --tenant ${tenant} in this MCP server's config and reconnect \u2014 MCP tools cannot change the tenant\n4. Pull files and apps with farseer_pull\n5. Tell user to run \"farseer install ${tenant}\" in terminal to install npm dependencies\n6. Use farseer_list_apps to show available apps\n7. Use farseer_export_model to understand the data structure\n\nAfter setup, the user can:\n- Author repeatable data extraction, transformation and loading with farseer_pipeline; start with operation=guide topic=method, then check the prepared setup\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 non-pipeline app. All new repeatable pipelines must use Simple Pipelines; preserve existing TypeScript apps.',\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\nAll new repeatable pipelines must use Simple Pipelines through farseer_pipeline operation=guide topic=method, even when TypeScript is requested. Inspect existing apps and source first. For an existing TypeScript pipeline, use the app tools for targeted maintenance and preserve its implementation; migration requires an explicit migration request. The creation steps below apply only to non-pipeline apps. Missing pipeline setup is not a reason to create a TypeScript pipeline.\n\nIMPORTANT: A Farseer App = a TypeScript script + an app config that tells Farseer which script to run and with what arguments.\nThe script uses \\`farseer-client\\` to interact with the Farseer API.\nAuthentication is automatic - \\`new FarseerClient()\\` reads credentials from environment variables injected by the CLI.\nYou NEVER hardcode credentials in scripts.\n\nSteps to follow:\n\n1. Write the script file at farseer-apps/${tenant}/files/Scripts/${script}\n Use the template below as a starting point.\n\n2. Push the script to remote with farseer_push\n (Scripts must exist on remote before they can be assigned to an app)\n\n3. Create the app with farseer_create_app (name: \"${appName}\")\n\n4. Configure the app with farseer_configure_app:\n - sourceFolder: \"Scripts\"\n - entrypoint: \"${script}\"\n - arguments: Add any arguments the script expects (they arrive via process.argv)\n\n5. Test with farseer_run_app\n The CLI injects auth credentials as env vars and runs the script with npx tsx.\n\nScript template:\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\n// FarseerClient auto-configures from env vars injected by \"farseer run\"\n// NEVER hardcode credentials - just use the empty constructor\nconst client = new farseer.FarseerClient();\n\n// Arguments come via process.argv in the order defined by app config\nconst args = process.argv.slice(2);\n\nasync function main() {\n // Load dimension/variable metadata\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 maintaining an existing TypeScript import or authoring a new Simple Pipeline. Requested one-off direct imports remain supported.',\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: `Work on the import for variable \"${variableName}\" in tenant \"${tenant}\".\n\n1. Inspect existing apps and source with farseer_list_apps, farseer_get_app and farseer_pull. Identify the app responsible for this variable before choosing a workflow.\n2. If the request concerns an existing TypeScript app, preserve it. Inspect, run, debug and make targeted fixes through the app tools without requiring the user to explicitly say TypeScript. Read its current source, arguments, schedule and runner configuration before editing. Push only the intended changes and verify through the existing app workflow.\n3. All new repeatable pipelines must use Simple Pipelines, even when TypeScript is requested. Read farseer_pipeline operation=guide topic=method, then practices and grammar; discover the variable and dimension tables before authoring. Missing pipeline setup is not a reason to create a TypeScript pipeline.\n4. Migration requires an explicit migration request. A request to fix or extend an existing import does not authorize replacing its source folder, entrypoint, runner image or schedule, or creating a duplicate pipeline. An existing TypeScript app is not missing Simple Pipelines setup.\n5. For a requested one-off direct import of data already available, use farseer_create_import_job. This does not authorize a new TypeScript pipeline.`,\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\nInspect the source first. All new repeatable pipelines must use Simple Pipelines; do not use this copy workflow to create a new TypeScript pipeline. Preserve an existing TypeScript pipeline and use targeted maintenance when the request is to fix or extend it. Migration requires an explicit migration request. The steps below apply to non-pipeline apps.\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 - Set \"schedule\" to null, unless the user asked for the copy to run on the\n same schedule \u2014 otherwise both apps run at the same moment\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 - Which tenant is this server bound to (via --tenant)?\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 all remote changes: farseer_pull with force=true (overwrites local)\n - To accept all local changes: farseer_push with force=true (overwrites remote)\n - For selective resolution: farseer_pull without force will skip conflicts (resolve via CLI)\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;AA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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAoB/B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
6
6
  "names": []
7
7
  }
@@ -34,6 +34,20 @@ module.exports = __toCommonJS(documentation_exports);
34
34
  var fs = __toESM(require("fs"));
35
35
  var path = __toESM(require("path"));
36
36
  const DOCS = [
37
+ {
38
+ name: "pipeline-reference",
39
+ uri: "farseer://docs/pipeline-reference",
40
+ title: "Pipeline YAML Reference",
41
+ description: "Pydantic-generated reference for the bundled pipeline engine. Use farseer_pipeline operation=guide for the method and individual grammar topics. Does not detect a job runtime.",
42
+ filePath: "../../../docs/pipeline-reference.md"
43
+ },
44
+ {
45
+ name: "pipeline-client-guide",
46
+ uri: "farseer://docs/pipeline-client-guide",
47
+ title: "Pipeline Authoring for Your Organisation",
48
+ description: "For a customer tenant admin and IT: what data leaves the tenant, the two supported ways to work, permissions, updates, and moving a pipeline to production.",
49
+ filePath: "../../../docs/pipeline-client-guide.md"
50
+ },
37
51
  {
38
52
  name: "how-farseer-works",
39
53
  uri: "farseer://docs/how-farseer-works",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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.',\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,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,aAAa;AAAA,IACb,UAAU;AAAA,EACd;AAAA,EACA;AAAA,I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I;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;",
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: 'pipeline-reference',\n uri: 'farseer://docs/pipeline-reference',\n title: 'Pipeline YAML Reference',\n description:\n 'Pydantic-generated reference for the bundled pipeline engine. Use farseer_pipeline operation=guide for the method and individual grammar topics. Does not detect a job runtime.',\n filePath: '../../../docs/pipeline-reference.md',\n },\n {\n name: 'pipeline-client-guide',\n uri: 'farseer://docs/pipeline-client-guide',\n title: 'Pipeline Authoring for Your Organisation',\n description:\n 'For a customer tenant admin and IT: what data leaves the tenant, the two supported ways to work, permissions, updates, and moving a pipeline to production.',\n filePath: '../../../docs/pipeline-client-guide.md',\n },\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.',\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,aACI;AAAA,IACJ,UAAU;AAAA,EACd;AAAA,EACA;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,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,aAAa;AAAA,IACb,UAAU;AAAA,EACd;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,KAAK;AAA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;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
6
  "names": []
7
7
  }
@@ -27,6 +27,7 @@ var import_authTools = require("./tools/authTools");
27
27
  var import_syncTools = require("./tools/syncTools");
28
28
  var import_appTools = require("./tools/appTools");
29
29
  var import_modelTools = require("./tools/modelTools");
30
+ var import_pipelineTools = require("./tools/pipelineTools");
30
31
  var import_runTools = require("./tools/runTools");
31
32
  var import_dataTools = require("./tools/dataTools");
32
33
  var import_sheetTools = require("./tools/sheetTools");
@@ -35,11 +36,20 @@ var import_cellTools = require("./tools/cellTools");
35
36
  var import_folderTools = require("./tools/folderTools");
36
37
  var import_documentation = require("./resources/documentation");
37
38
  var import_workflows = require("./prompts/workflows");
38
- const SERVER_INSTRUCTIONS = `This MCP server works on a single Farseer tenant per session \u2014 one tenant for the whole session, never switched.
39
+ var import_skills = require("./skills");
40
+ const SERVER_INSTRUCTIONS = `Author all new repeatable data pipelines with Simple Pipelines. Do not create new TypeScript pipelines, including when TypeScript is requested; explain the supported authoring path. Before choosing a workflow, inspect the relevant existing apps and source with farseer_list_apps, farseer_get_app and farseer_pull.
41
+
42
+ Preserve existing TypeScript apps. Inspect, run, debug and make targeted fixes through the existing app tools without requiring the user to explicitly say TypeScript. A request to fix or extend an existing import is maintenance, not permission to migrate it, replace its source folder, entrypoint, runner image or schedule, or create a duplicate pipeline. Migration to Simple Pipelines requires an explicit migration request. An existing TypeScript app is not missing Simple Pipelines setup; do not reconfigure it to make pipeline commands pass. Apply this per app, including on tenants with both implementations.
43
+
44
+ For new or existing Simple Pipelines, load the pipeline-authoring skill at skill://farseer/pipeline-authoring/SKILL.md. If skill loading is unavailable, call farseer_pipeline operation=guide topic=method for the same instructions. Then read topic=grammar and the relevant Pydantic model topics; use operation=check to verify the prepared setup. If the required job, profile or source setup is missing, explain what needs preparing instead of implementing a TypeScript pipeline or direct import as a fallback. A requested one-off direct import is still supported; it does not authorize a new TypeScript pipeline.
45
+
46
+ For pipeline authoring, use the pipeline operations for sync and execution. Coordinate shared source edits with colleagues; this pipeline has no authoring ownership sessions. A refused run accepted no new run; read the reason and do not automatically retry a refusal. If compatibility requires a CLI update, tell the author to update and restart this MCP connection before continuing.
47
+
48
+ This MCP server works on a single Farseer tenant per session \u2014 one tenant for the whole session, never switched.
39
49
 
40
50
  - If it was launched with a tenant (\`--tenant <slug>\` or the \`FARSEER_TENANT\` env), it is locked to that tenant. Tools take no tenant/organisation argument; they always act on the bound tenant. Do not use farseer CLI commands to change it.
41
51
  - If no tenant is set yet, bind it once: when the user says which tenant/client to work on, call \`farseer_select_tenant\`. After that first selection the tenant is locked for the session; to use a different tenant, start a new session.
42
- - Use \`farseer_whoami\` to see the active tenant. Do not call other tools before a tenant is set.`;
52
+ - Use \`farseer_whoami\` to see the active tenant. Tenant operations require a bound tenant; offline guidance can be read before selection.`;
43
53
  function createMcpServer() {
44
54
  const server = new import_mcp.McpServer(
45
55
  {
@@ -53,12 +63,14 @@ function createMcpServer() {
53
63
  (0, import_appTools.registerAppTools)(server);
54
64
  (0, import_modelTools.registerModelTools)(server);
55
65
  (0, import_runTools.registerRunTools)(server);
66
+ (0, import_pipelineTools.registerPipelineTools)(server);
56
67
  (0, import_dataTools.registerDataTools)(server);
57
68
  (0, import_sheetTools.registerSheetTools)(server);
58
69
  (0, import_dashboardTools.registerDashboardTools)(server);
59
70
  (0, import_cellTools.registerCellTools)(server);
60
71
  (0, import_folderTools.registerFolderTools)(server);
61
72
  (0, import_documentation.registerDocumentationResources)(server);
73
+ (0, import_skills.registerSkills)(server);
62
74
  (0, import_workflows.registerWorkflowPrompts)(server);
63
75
  return server;
64
76
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 { registerSheetTools } from './tools/sheetTools';\nimport { registerDashboardTools } from './tools/dashboardTools';\nimport { registerCellTools } from './tools/cellTools';\nimport { registerFolderTools } from './tools/folderTools';\nimport { registerDocumentationResources } from './resources/documentation';\nimport { registerWorkflowPrompts } from './prompts/workflows';\n\n// Surfaced to the model at connect time (MCP `instructions`). It sets the\n// mental model up front so an agent doesn't try to \"check out\" or authenticate\n// a tenant through CLI commands \u2014 which live on a different code path and do\n// not affect this server.\nconst SERVER_INSTRUCTIONS = `This MCP server works on a single Farseer tenant per session \u2014 one tenant for the whole session, never switched.\n\n- If it was launched with a tenant (\\`--tenant <slug>\\` or the \\`FARSEER_TENANT\\` env), it is locked to that tenant. Tools take no tenant/organisation argument; they always act on the bound tenant. Do not use farseer CLI commands to change it.\n- If no tenant is set yet, bind it once: when the user says which tenant/client to work on, call \\`farseer_select_tenant\\`. After that first selection the tenant is locked for the session; to use a different tenant, start a new session.\n- Use \\`farseer_whoami\\` to see the active tenant. Do not call other tools before a tenant is set.`;\n\nexport function createMcpServer(): McpServer {\n const server = new McpServer(\n {\n name: 'farseer-cli',\n version: CLI_VERSION,\n },\n { instructions: SERVER_INSTRUCTIONS },\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 registerSheetTools(server);\n registerDashboardTools(server);\n registerCellTools(server);\n registerFolderTools(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,wBAAmC;AACnC,4BAAuC;AACvC,uBAAkC;AAClC,yBAAoC;AACpC,2BAA+C;AAC/C,uBAAwC;AAMxC,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAMrB,SAAS,kBAA6B;AACzC,QAAM,SAAS,IAAI;AAAA,IACf;AAAA,MACI,MAAM;AAAA,MACN,SAAS;AAAA,IACb;AAAA,IACA,EAAE,cAAc,oBAAoB;AAAA,EACxC;AAGA,0CAAkB,MAAM;AACxB,0CAAkB,MAAM;AACxB,wCAAiB,MAAM;AACvB,4CAAmB,MAAM;AACzB,wCAAiB,MAAM;AACvB,0CAAkB,MAAM;AACxB,4CAAmB,MAAM;AACzB,oDAAuB,MAAM;AAC7B,0CAAkB,MAAM;AACxB,8CAAoB,MAAM;AAG1B,2DAA+B,MAAM;AAGrC,gDAAwB,MAAM;AAE9B,SAAO;AACX;",
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 { registerPipelineTools } from './tools/pipelineTools';\nimport { registerRunTools } from './tools/runTools';\nimport { registerDataTools } from './tools/dataTools';\nimport { registerSheetTools } from './tools/sheetTools';\nimport { registerDashboardTools } from './tools/dashboardTools';\nimport { registerCellTools } from './tools/cellTools';\nimport { registerFolderTools } from './tools/folderTools';\nimport { registerDocumentationResources } from './resources/documentation';\nimport { registerWorkflowPrompts } from './prompts/workflows';\nimport { registerSkills } from './skills';\n\n// Surfaced to the model at connect time (MCP `instructions`). It sets the\n// mental model up front so an agent doesn't try to \"check out\" or authenticate\n// a tenant through CLI commands \u2014 which live on a different code path and do\n// not affect this server.\nconst SERVER_INSTRUCTIONS = `Author all new repeatable data pipelines with Simple Pipelines. Do not create new TypeScript pipelines, including when TypeScript is requested; explain the supported authoring path. Before choosing a workflow, inspect the relevant existing apps and source with farseer_list_apps, farseer_get_app and farseer_pull.\n\nPreserve existing TypeScript apps. Inspect, run, debug and make targeted fixes through the existing app tools without requiring the user to explicitly say TypeScript. A request to fix or extend an existing import is maintenance, not permission to migrate it, replace its source folder, entrypoint, runner image or schedule, or create a duplicate pipeline. Migration to Simple Pipelines requires an explicit migration request. An existing TypeScript app is not missing Simple Pipelines setup; do not reconfigure it to make pipeline commands pass. Apply this per app, including on tenants with both implementations.\n\nFor new or existing Simple Pipelines, load the pipeline-authoring skill at skill://farseer/pipeline-authoring/SKILL.md. If skill loading is unavailable, call farseer_pipeline operation=guide topic=method for the same instructions. Then read topic=grammar and the relevant Pydantic model topics; use operation=check to verify the prepared setup. If the required job, profile or source setup is missing, explain what needs preparing instead of implementing a TypeScript pipeline or direct import as a fallback. A requested one-off direct import is still supported; it does not authorize a new TypeScript pipeline.\n\nFor pipeline authoring, use the pipeline operations for sync and execution. Coordinate shared source edits with colleagues; this pipeline has no authoring ownership sessions. A refused run accepted no new run; read the reason and do not automatically retry a refusal. If compatibility requires a CLI update, tell the author to update and restart this MCP connection before continuing.\n\nThis MCP server works on a single Farseer tenant per session \u2014 one tenant for the whole session, never switched.\n\n- If it was launched with a tenant (\\`--tenant <slug>\\` or the \\`FARSEER_TENANT\\` env), it is locked to that tenant. Tools take no tenant/organisation argument; they always act on the bound tenant. Do not use farseer CLI commands to change it.\n- If no tenant is set yet, bind it once: when the user says which tenant/client to work on, call \\`farseer_select_tenant\\`. After that first selection the tenant is locked for the session; to use a different tenant, start a new session.\n- Use \\`farseer_whoami\\` to see the active tenant. Tenant operations require a bound tenant; offline guidance can be read before selection.`;\n\nexport function createMcpServer(): McpServer {\n const server = new McpServer(\n {\n name: 'farseer-cli',\n version: CLI_VERSION,\n },\n { instructions: SERVER_INSTRUCTIONS },\n );\n\n // Register all tools\n registerAuthTools(server);\n registerSyncTools(server);\n registerAppTools(server);\n registerModelTools(server);\n registerRunTools(server);\n registerPipelineTools(server);\n registerDataTools(server);\n registerSheetTools(server);\n registerDashboardTools(server);\n registerCellTools(server);\n registerFolderTools(server);\n\n // Register resources (documentation)\n registerDocumentationResources(server);\n registerSkills(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,2BAAsC;AACtC,sBAAiC;AACjC,uBAAkC;AAClC,wBAAmC;AACnC,4BAAuC;AACvC,uBAAkC;AAClC,yBAAoC;AACpC,2BAA+C;AAC/C,uBAAwC;AACxC,oBAA+B;AAM/B,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcrB,SAAS,kBAA6B;AACzC,QAAM,SAAS,IAAI;AAAA,IACf;AAAA,MACI,MAAM;AAAA,MACN,SAAS;AAAA,IACb;AAAA,IACA,EAAE,cAAc,oBAAoB;AAAA,EACxC;AAGA,0CAAkB,MAAM;AACxB,0CAAkB,MAAM;AACxB,wCAAiB,MAAM;AACvB,4CAAmB,MAAM;AACzB,wCAAiB,MAAM;AACvB,kDAAsB,MAAM;AAC5B,0CAAkB,MAAM;AACxB,4CAAmB,MAAM;AACzB,oDAAuB,MAAM;AAC7B,0CAAkB,MAAM;AACxB,8CAAoB,MAAM;AAG1B,2DAA+B,MAAM;AACrC,oCAAe,MAAM;AAGrB,gDAAwB,MAAM;AAE9B,SAAO;AACX;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var skills_exports = {};
20
+ __export(skills_exports, {
21
+ registerSkills: () => registerSkills
22
+ });
23
+ module.exports = __toCommonJS(skills_exports);
24
+ var import_types = require("@modelcontextprotocol/sdk/types.js");
25
+ var import_v4 = require("zod/v4");
26
+ var import_pipeline = require("../skills/pipeline");
27
+ const listRequest = import_types.PaginatedRequestSchema.extend({ method: import_v4.z.literal("skills/list") });
28
+ const getRequest = import_types.RequestSchema.extend({
29
+ method: import_v4.z.literal("skills/get")
30
+ });
31
+ const cache = { resultType: "complete", ttlMs: 3e5, cacheScope: "public" };
32
+ function registerSkills(server) {
33
+ server.server.registerCapabilities({ extensions: { "io.modelcontextprotocol/skills": {} } });
34
+ for (const [uri, text] of import_pipeline.pipelineSkill.files) {
35
+ const isSkill = uri === import_pipeline.PIPELINE_SKILL_URI;
36
+ server.resource(
37
+ isSkill ? import_pipeline.pipelineSkill.entry.frontmatter.name : `${import_pipeline.pipelineSkill.entry.frontmatter.name}/${uri.split("/").pop()}`,
38
+ uri,
39
+ {
40
+ description: isSkill ? import_pipeline.pipelineSkill.entry.frontmatter.description : "Part of the pipeline-authoring skill; SKILL.md says when to read it.",
41
+ mimeType: "text/markdown"
42
+ },
43
+ () => ({ ...cache, contents: [{ uri, mimeType: "text/markdown", text }] })
44
+ );
45
+ }
46
+ server.server.setRequestHandler(listRequest, async ({ params }) => {
47
+ if (params?.cursor !== void 0) throw new import_types.McpError(import_types.ErrorCode.InvalidParams, "Unknown skills cursor");
48
+ return { ...cache, skills: [import_pipeline.pipelineSkill.entry] };
49
+ });
50
+ server.server.setRequestHandler(getRequest, async ({ params }) => {
51
+ if (params?.uri !== import_pipeline.PIPELINE_SKILL_URI) throw new import_types.McpError(import_types.ErrorCode.InvalidParams, "Unknown skill URI");
52
+ return { ...cache, skill: import_pipeline.pipelineSkill.entry };
53
+ });
54
+ }
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ registerSkills
58
+ });
59
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/mcp/skills.ts"],
4
+ "sourcesContent": ["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { ErrorCode, McpError, PaginatedRequestSchema, RequestSchema } from '@modelcontextprotocol/sdk/types.js';\nimport { z } from 'zod/v4';\nimport { pipelineSkill, PIPELINE_SKILL_URI } from '../skills/pipeline';\n\n// Optional extension; legacy clients continue using resources or the guide tool.\n// https://skills.extensions.modelcontextprotocol.io/specification/stable/skills\nconst listRequest = PaginatedRequestSchema.extend({ method: z.literal('skills/list') });\nconst getRequest = RequestSchema.extend({\n method: z.literal('skills/get'),\n});\nconst cache = { resultType: 'complete' as const, ttlMs: 300_000, cacheScope: 'public' as const };\n\nexport function registerSkills(server: McpServer): void {\n server.server.registerCapabilities({ extensions: { 'io.modelcontextprotocol/skills': {} } });\n // Every file the manifest lists is served; SKILL.md carries the skill's name and description.\n for (const [uri, text] of pipelineSkill.files) {\n const isSkill = uri === PIPELINE_SKILL_URI;\n server.resource(\n isSkill\n ? pipelineSkill.entry.frontmatter.name\n : `${pipelineSkill.entry.frontmatter.name}/${uri.split('/').pop()}`,\n uri,\n {\n description: isSkill\n ? pipelineSkill.entry.frontmatter.description\n : 'Part of the pipeline-authoring skill; SKILL.md says when to read it.',\n mimeType: 'text/markdown',\n },\n () => ({ ...cache, contents: [{ uri, mimeType: 'text/markdown', text }] }),\n );\n }\n server.server.setRequestHandler(listRequest, async ({ params }) => {\n // The complete static catalogue fits on one page, so no cursor is issued.\n if (params?.cursor !== undefined) throw new McpError(ErrorCode.InvalidParams, 'Unknown skills cursor');\n return { ...cache, skills: [pipelineSkill.entry] };\n });\n server.server.setRequestHandler(getRequest, async ({ params }) => {\n if (params?.uri !== PIPELINE_SKILL_URI) throw new McpError(ErrorCode.InvalidParams, 'Unknown skill URI');\n return { ...cache, skill: pipelineSkill.entry };\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA2E;AAC3E,gBAAkB;AAClB,sBAAkD;AAIlD,MAAM,cAAc,oCAAuB,OAAO,EAAE,QAAQ,YAAE,QAAQ,aAAa,EAAE,CAAC;AACtF,MAAM,aAAa,2BAAc,OAAO;AAAA,EACpC,QAAQ,YAAE,QAAQ,YAAY;AAClC,CAAC;AACD,MAAM,QAAQ,EAAE,YAAY,YAAqB,OAAO,KAAS,YAAY,SAAkB;AAExF,SAAS,eAAe,QAAyB;AACpD,SAAO,OAAO,qBAAqB,EAAE,YAAY,EAAE,kCAAkC,CAAC,EAAE,EAAE,CAAC;AAE3F,aAAW,CAAC,KAAK,IAAI,KAAK,8BAAc,OAAO;AAC3C,UAAM,UAAU,QAAQ;AACxB,WAAO;AAAA,MACH,UACM,8BAAc,MAAM,YAAY,OAChC,GAAG,8BAAc,MAAM,YAAY,IAAI,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,CAAC;AAAA,MACrE;AAAA,MACA;AAAA,QACI,aAAa,UACP,8BAAc,MAAM,YAAY,cAChC;AAAA,QACN,UAAU;AAAA,MACd;AAAA,MACA,OAAO,EAAE,GAAG,OAAO,UAAU,CAAC,EAAE,KAAK,UAAU,iBAAiB,KAAK,CAAC,EAAE;AAAA,IAC5E;AAAA,EACJ;AACA,SAAO,OAAO,kBAAkB,aAAa,OAAO,EAAE,OAAO,MAAM;AAE/D,QAAI,QAAQ,WAAW,OAAW,OAAM,IAAI,sBAAS,uBAAU,eAAe,uBAAuB;AACrG,WAAO,EAAE,GAAG,OAAO,QAAQ,CAAC,8BAAc,KAAK,EAAE;AAAA,EACrD,CAAC;AACD,SAAO,OAAO,kBAAkB,YAAY,OAAO,EAAE,OAAO,MAAM;AAC9D,QAAI,QAAQ,QAAQ,mCAAoB,OAAM,IAAI,sBAAS,uBAAU,eAAe,mBAAmB;AACvG,WAAO,EAAE,GAAG,OAAO,OAAO,8BAAc,MAAM;AAAA,EAClD,CAAC;AACL;",
6
+ "names": []
7
+ }
@@ -209,6 +209,8 @@ Returns:
209
209
  "farseer_create_app",
210
210
  `Create a new Farseer app.
211
211
 
212
+ All new repeatable data pipelines must use Simple Pipelines through farseer_pipeline operation=guide topic=method, even when TypeScript is requested. Inspect existing apps first; do not create a replacement or duplicate to fix an existing TypeScript app. This creation workflow is for non-pipeline apps. Maintain existing TypeScript pipelines with the app tools; migration requires an explicit migration request.
213
+
212
214
  A Farseer App is a named configuration that points to a TypeScript script and defines its arguments.
213
215
  The script uses farseer-client to interact with the Farseer API (import data, export reports, etc.).
214
216
 
@@ -248,6 +250,8 @@ Scripts should use \`new FarseerClient()\` with no arguments - credentials are i
248
250
  "farseer_configure_app",
249
251
  `Configure an existing Farseer app.
250
252
 
253
+ Preserve existing TypeScript apps during maintenance. Do not change their source folder, entrypoint, runner image or schedule to satisfy Simple Pipelines setup. Migration requires an explicit migration request; use the existing app tools for targeted fixes.
254
+
251
255
  You can set:
252
256
  - sourceFolder: Folder under Files/ the app's scripts come from (e.g. "Scripts/MyApp")
253
257
  - entrypoint: Main script to execute \u2014 must be a file in the source folder (e.g., "index.ts")