farseer-cli 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commands/app.js.map +0 -1
- package/dist/commands/apps.js.map +0 -1
- package/dist/commands/cells.js.map +0 -1
- package/dist/commands/code.js.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/dashboards.js.map +0 -1
- package/dist/commands/diff.js.map +0 -1
- package/dist/commands/dimensions.js.map +0 -1
- package/dist/commands/files.js.map +0 -1
- package/dist/commands/formula.js.map +0 -1
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +1 -2
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp-server.js.map +0 -1
- package/dist/commands/model.js.map +0 -1
- package/dist/commands/pipeline.js.map +0 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/pull.js.map +1 -2
- package/dist/commands/push.js +2 -2
- package/dist/commands/push.js.map +1 -2
- package/dist/commands/refresh.js.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/sheets.js.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/tool.js.map +0 -1
- package/dist/commands/variables.js.map +0 -1
- package/dist/commands/whoami.js.map +0 -1
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -2
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/prompts/workflows.js.map +0 -1
- package/dist/mcp/resources/documentation.js.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/skills.js.map +0 -1
- package/dist/mcp/tools/appTools.js.map +0 -1
- package/dist/mcp/tools/authTools.js +1 -1
- package/dist/mcp/tools/authTools.js.map +1 -2
- package/dist/mcp/tools/cellTools.js.map +0 -1
- package/dist/mcp/tools/dashboardTools.js.map +0 -1
- package/dist/mcp/tools/dataTools.js.map +0 -1
- package/dist/mcp/tools/folderTools.js.map +0 -1
- package/dist/mcp/tools/modelTools.js.map +0 -1
- package/dist/mcp/tools/pipelineContract.js.map +0 -1
- package/dist/mcp/tools/pipelineTools.js.map +0 -1
- package/dist/mcp/tools/runTools.js.map +0 -1
- package/dist/mcp/tools/sheetTools.js.map +0 -1
- package/dist/mcp/tools/syncTools.js +2 -2
- package/dist/mcp/tools/syncTools.js.map +1 -2
- package/dist/mcp/utils/helpers.js.map +0 -1
- package/dist/mcp/utils/launchPin.js.map +0 -1
- package/dist/mcp/utils/registerTool.js.map +0 -1
- package/dist/mcp/utils/session.js.map +0 -1
- package/dist/mcp/utils/tenantPin.js.map +0 -1
- package/dist/pipeline/compatibility.js.map +0 -1
- package/dist/pipeline/connect.js.map +0 -1
- package/dist/pipeline/create.js.map +0 -1
- package/dist/pipeline/errors.js.map +0 -1
- package/dist/pipeline/generated-reference.json +22 -10
- package/dist/pipeline/guide.js.map +0 -1
- package/dist/pipeline/init.js.map +0 -1
- package/dist/pipeline/operations.js.map +0 -1
- package/dist/pipeline/query.js.map +0 -1
- package/dist/pipeline/queryDownloads.js.map +0 -1
- package/dist/pipeline/queryWorker.js.map +0 -1
- package/dist/pipeline/readiness.js.map +0 -1
- package/dist/pipeline/reference.js.map +0 -1
- package/dist/pipeline/requests.js.map +0 -1
- package/dist/pipeline/runArguments.js.map +0 -1
- package/dist/pipeline/runtime.js.map +0 -1
- package/dist/pipeline/service.js.map +0 -1
- package/dist/services/agentApprovalFetch.js +7 -3
- package/dist/services/agentApprovalFetch.js.map +1 -2
- package/dist/services/appSyncService.js.map +0 -1
- package/dist/services/apps.js.map +0 -1
- package/dist/services/authErrors.js.map +0 -1
- package/dist/services/codefirst/api.js +38 -5
- package/dist/services/codefirst/api.js.map +1 -2
- package/dist/services/codefirst/binaryDisk.js.map +0 -1
- package/dist/services/codefirst/byteHashes.js +5 -0
- package/dist/services/codefirst/byteHashes.js.map +1 -2
- package/dist/services/codefirst/documents.js +41 -15
- package/dist/services/codefirst/documents.js.map +1 -2
- package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
- package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
- package/dist/services/codefirst/layoutCompose.js +44 -38
- package/dist/services/codefirst/layoutCompose.js.map +1 -2
- package/dist/services/codefirst/layoutCore.js +14 -1
- package/dist/services/codefirst/layoutCore.js.map +1 -2
- package/dist/services/codefirst/layoutPaths.js +80 -4
- package/dist/services/codefirst/layoutPaths.js.map +1 -2
- package/dist/services/codefirst/layoutProjection.js +73 -39
- package/dist/services/codefirst/layoutProjection.js.map +1 -2
- package/dist/services/codefirst/layoutReadback.js +357 -130
- package/dist/services/codefirst/layoutReadback.js.map +2 -3
- package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
- package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
- package/dist/services/codefirst/layoutReceipt.js +283 -243
- package/dist/services/codefirst/layoutReceipt.js.map +2 -3
- package/dist/services/codefirst/layoutScan.js +208 -110
- package/dist/services/codefirst/layoutScan.js.map +1 -2
- package/dist/services/codefirst/output.js +76 -10
- package/dist/services/codefirst/output.js.map +1 -2
- package/dist/services/codefirst/types.js.map +0 -1
- package/dist/services/codefirst/workflow.js +65 -29
- package/dist/services/codefirst/workflow.js.map +2 -3
- package/dist/services/codefirst/workspace.js.map +0 -1
- package/dist/services/codefirst/workspaceLock.js.map +0 -1
- package/dist/services/codefirst/workspaceRoot.js +2 -1
- package/dist/services/codefirst/workspaceRoot.js.map +1 -2
- package/dist/services/configService.js.map +0 -1
- package/dist/services/credentials.js.map +0 -1
- package/dist/services/farseerService.js +3 -1
- package/dist/services/farseerService.js.map +1 -2
- package/dist/services/httpError.js.map +0 -1
- package/dist/services/modelExport.js.map +0 -1
- package/dist/services/organisation.js.map +0 -1
- package/dist/services/preflight.js.map +0 -1
- package/dist/services/realms.js.map +0 -1
- package/dist/services/syncService.js +3 -3
- package/dist/services/syncService.js.map +1 -2
- package/dist/skills/pipeline.js.map +0 -1
- package/dist/utils/agentSandbox.js.map +0 -1
- package/dist/utils/cliOptions.js.map +0 -1
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/entityResolver.js.map +0 -1
- package/dist/utils/errorFormatter.js +59 -11
- package/dist/utils/errorFormatter.js.map +1 -2
- package/dist/utils/fileLogger.js.map +0 -1
- package/dist/utils/fileValidation.js.map +0 -1
- package/dist/utils/folderMatch.js.map +0 -1
- package/dist/utils/formulaFilters.js.map +0 -1
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/nameResolver.js.map +0 -1
- package/dist/utils/packageManager.js.map +0 -1
- package/dist/utils/syncReporting.js.map +0 -1
- package/dist/utils/syncScope.js.map +0 -1
- package/dist/utils/updateCheck.js.map +0 -1
- package/dist/utils/variableValues.js.map +0 -1
- package/dist/utils/workspace.js.map +0 -1
- package/docs/cli-guide.md +1 -1
- package/docs/import-workflows.md +14 -14
- package/docs/new-app-template.md +1 -1
- package/docs/pipeline-client-guide.md +1 -1
- package/docs/pipeline-reference.md +292 -3
- package/package.json +2 -2
- package/skills/farseer-analysis/SKILL.md +132 -0
- package/skills/farseer-dashboards/SKILL.md +40 -0
- package/skills/farseer-formulas/SKILL.md +165 -0
- package/skills/farseer-model/SKILL.md +119 -0
- package/skills/pipeline-authoring/SKILL.md +6 -4
- package/skills/pipeline-authoring/practices.md +6 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/variables.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { matchByName, formatAmbiguous } from '../utils/nameResolver';\nimport { showLoginPrompt, isAuthError } from '../services/authErrors';\nimport { preflight } from '../services/preflight';\nimport { formatClientError } from '../utils/errorFormatter';\nimport { normalizeDataType, normalizeRollupType, writableVariable } from '../utils/variableValues';\nimport { formatVariableMembers } from '../services/modelExport';\n\nexport function registerVariablesCommand(program: Command): void {\n // farseer variables list\n const variablesCmd = program.command('variables').description('List and manage variables');\n\n variablesCmd\n .command('list [org] [tenant]')\n .description('List all variables')\n .option('--json', 'Output raw JSON')\n .action(async (first, second, options) => {\n const { tenant, client } = await preflight(first, second);\n\n try {\n // VAR-only \u2014 pulling the full dimension member matrix\n // breaks the response limit on large tenants.\n const model = await client.exportModel({ types: ['VAR'] });\n\n if (options.json) {\n console.log(JSON.stringify(model.variables, null, 2));\n return;\n }\n\n logger.header(`Variables (${model.variables.length})`);\n console.log();\n for (const variable of model.variables) {\n const flags = [];\n if (variable.readonly) flags.push('readonly');\n if (variable.calculateOnDemand) flags.push('on-demand');\n const flagStr = flags.length > 0 ? chalk.dim(` [${flags.join(', ')}]`) : '';\n\n console.log(` ${chalk.bold(variable.name)}${flagStr}`);\n console.log(` Dimensions: ${variable.tables.join(', ')}`);\n console.log(` Rollup: ${variable.rollupType} | Type: ${variable.dataType}`);\n if (variable.formula) {\n console.log(\n ` Formula: ${chalk.dim(variable.formula.substring(0, 80))}${variable.formula.length > 80 ? '...' : ''}`,\n );\n }\n console.log();\n }\n } catch (error) {\n handleModelError(error, tenant);\n }\n });\n\n // farseer variable details / export (singular)\n const variableCmd = program.command('variable').description('Variable details and export');\n\n variableCmd\n .command('details <name>')\n .description('Show variable details (dimensions, formula, rollup, etc.)')\n .option('--json', 'Output raw JSON')\n .action(async (name, options) => {\n const { tenant, client } = await preflight();\n\n try {\n const model = await client.exportModel({ types: ['VAR'] });\n const matches = matchByName(model.variables, name);\n if (matches.length > 1) {\n logger.error(formatAmbiguous('variables', name, matches, (v) => String(v.gid ?? v.name)));\n process.exit(1);\n }\n const variable = matches[0];\n\n if (!variable) {\n logger.error(`Variable \"${name}\" not found.`);\n logger.dim('Available variables:');\n model.variables.slice(0, 10).forEach((v) => logger.dim(` - ${v.name}`));\n if (model.variables.length > 10) {\n logger.dim(` ... and ${model.variables.length - 10} more`);\n }\n process.exit(1);\n }\n\n if (options.json) {\n console.log(JSON.stringify(variable, null, 2));\n return;\n }\n\n logger.header(`Variable: ${variable.name}`);\n console.log();\n if (variable.description) {\n console.log(` Description: ${variable.description}`);\n }\n if (variable.formula) {\n console.log(` Formula: ${variable.formula}`);\n }\n console.log(` Dimensions: ${variable.tables.join(', ')}`);\n if (variable.members.length > 0) {\n console.log(` Specific members: ${formatVariableMembers(variable.members)}`);\n }\n console.log(` Roll-up type: ${variable.rollupType}`);\n console.log(` Data type: ${variable.dataType}`);\n if (variable.numberFormat) {\n console.log(\n ` Format: ${variable.numberFormat.type}${variable.numberFormat.formatString ? ` (${variable.numberFormat.formatString})` : ''}`,\n );\n }\n console.log(` Readonly: ${variable.readonly}`);\n console.log(` Calculate on demand: ${variable.calculateOnDemand}`);\n if (variable.folderPath) {\n console.log(` Folder: ${variable.folderPath.join(' / ')}`);\n }\n } catch (error) {\n handleModelError(error, tenant);\n }\n });\n\n // farseer variables create [org] [tenant]\n variablesCmd\n .command('create [org] [tenant]')\n .description('Create a new variable')\n .requiredOption('--name <name>', 'Variable name')\n .option('--dimensions <csv>', 'Comma-separated dimension table names')\n .option('--formula <expr>', 'Formula expression')\n .option(\n '--rollup <type>',\n 'Rollup type (Sum, Average, Min, Max, None, Formula, Closing State, Beginning State)',\n )\n .option('--data-type <type>', 'Data type (Decimal, Integer)', 'Decimal')\n .option('--description <text>', 'Variable description')\n .option('--readonly', 'Set variable as read-only')\n .action(async (first, second, options) => {\n const { native: nativeClient } = await preflight(first, second);\n\n try {\n await nativeClient.initTagMap();\n\n // Resolve dimension table names to IDs\n const tableGids: number[] = [];\n if (options.dimensions) {\n const tableNames = options.dimensions.split(',').map((s: string) => s.trim());\n for (const tableName of tableNames) {\n const table = await nativeClient.getDimensionTable(tableName);\n tableGids.push(table.id);\n }\n }\n\n const createEntity: any = {\n type: 'VAR',\n meta: {\n name: options.name,\n description: options.description || null,\n },\n variable: {\n tableGids,\n rollupType: normalizeRollupType(options.rollup || 'Sum'),\n dataType: normalizeDataType(options.dataType || 'Decimal'),\n readonly: options.readonly || false,\n },\n };\n\n if (options.formula) {\n createEntity.calculation = { formula: options.formula };\n }\n\n const result = await nativeClient.entities.mutate({ created: [createEntity] });\n logger.success(`Created variable \"${options.name}\".`);\n if ((result as any).created?.length > 0) {\n logger.dim(` ID: ${(result as any).created[0].id}`);\n }\n } catch (error) {\n const errorMessage = await formatClientError(error);\n logger.error(`Failed to create variable \"${options.name}\".`);\n logger.dim(errorMessage);\n process.exit(1);\n }\n });\n\n // farseer variables update [org] [tenant]\n variablesCmd\n .command('update [org] [tenant]')\n .description('Update an existing variable')\n .requiredOption('--name <name>', 'Variable name')\n .option('--dimensions <csv>', 'New comma-separated dimension table names (replaces all)')\n .option('--formula <expr>', 'New formula expression')\n .option('--rollup <type>', 'New rollup type')\n .option('--description <text>', 'New description')\n .option('--readonly', 'Set as read-only')\n .option('--no-readonly', 'Set as editable')\n .action(async (first, second, options) => {\n const { native: nativeClient } = await preflight(first, second);\n\n try {\n await nativeClient.initTagMap();\n const variable = await nativeClient.getVariable(options.name);\n\n const updateEntity: any = {\n id: variable.id,\n type: 'VAR',\n };\n\n if (options.description !== undefined) {\n updateEntity.meta = { name: variable.name, description: options.description };\n }\n\n const current = await nativeClient.entities.getSingle(variable.id, 'VAR' as any);\n const variableUpdate: any = writableVariable((current as any).variable);\n if (options.dimensions) {\n const tableNames = options.dimensions.split(',').map((s: string) => s.trim());\n const tableGids: number[] = [];\n for (const tableName of tableNames) {\n const table = await nativeClient.getDimensionTable(tableName);\n tableGids.push(table.id);\n }\n variableUpdate.tableGids = tableGids;\n }\n if (options.rollup) variableUpdate.rollupType = normalizeRollupType(options.rollup);\n if (options.readonly !== undefined) variableUpdate.readonly = options.readonly;\n if (Object.keys(variableUpdate).length > 0) {\n updateEntity.variable = variableUpdate;\n }\n\n if (options.formula !== undefined) {\n updateEntity.calculation = {\n formula: options.formula,\n type: (current as any).calculation?.type ?? 'VARIABLE',\n };\n }\n\n await nativeClient.entities.mutate({ updated: [updateEntity] });\n logger.success(`Updated variable \"${options.name}\".`);\n } catch (error) {\n const errorMessage = await formatClientError(error);\n logger.error(`Failed to update variable \"${options.name}\".`);\n logger.dim(errorMessage);\n process.exit(1);\n }\n });\n\n variableCmd\n .command('export <name>')\n .description('Export variable data to CSV file')\n .option('--output <file>', 'Output file path')\n .option('--format <format>', 'Output format: csv, json, xlsx', 'csv')\n .option('--limit <n>', 'Limit number of rows', parseInt)\n .action(async (name, options) => {\n const { native: nativeClient, tenant } = await preflight();\n\n try {\n logger.info(`Exporting variable \"${name}\" from ${tenant}...`);\n\n const exportRequest: any = {\n formula: `\"${name}\"`,\n format: options.format || 'csv',\n };\n if (options.limit) {\n exportRequest.limit = options.limit;\n }\n\n const blob = await nativeClient.export.exportFormula(exportRequest);\n const content = await blob.text();\n\n const outputFile =\n options.output || `${name.replace(/[^a-zA-Z0-9_-]/g, '_')}.${options.format || 'csv'}`;\n fs.writeFileSync(outputFile, content, 'utf-8');\n\n logger.success(`Exported to ${outputFile}`);\n const lines = content.split('\\n').filter((l) => l.trim()).length;\n logger.dim(`${lines - 1} data rows`);\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n logger.error(`Failed to export variable \"${name}\".`);\n logger.dim(errorMessage);\n process.exit(1);\n }\n });\n}\n\nfunction handleModelError(error: unknown, tenant: string): void {\n const errorMessage = error instanceof Error ? error.message : String(error);\n\n if (isAuthError(error)) {\n showLoginPrompt(tenant);\n } else if (errorMessage.includes('404')) {\n logger.error(`Tenant \"${tenant}\" not found or not accessible.`);\n } else if (errorMessage.includes('ENOTFOUND') || errorMessage.includes('ECONNREFUSED')) {\n logger.error('Failed to connect to Farseer.');\n } else {\n logger.error('Failed to fetch model.');\n logger.dim(errorMessage);\n }\n process.exit(1);\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,SAAoB;AAEpB,mBA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AACnD,2BAAO,IAAI,YAAY;AACvB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;AAEA,SAAS,iBAAiB,OAAgB,QAAsB;AAC5D,QAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAE1E,UAAI,+BAAY,KAAK,GAAG;AACpB,2CAAgB,MAAM;AAAA,EAC1B,WAAW,aAAa,SAAS,KAAK,GAAG;AACrC,yBAAO,MAAM,WAAW,MAAM,gCAAgC;AAAA,EAClE,WAAW,aAAa,SAAS,WAAW,KAAK,aAAa,SAAS,cAAc,GAAG;AACpF,yBAAO,MAAM,+BAA+B;AAAA,EAChD,OAAO;AACH,yBAAO,MAAM,wBAAwB;AACrC,yBAAO,IAAI,YAAY;AAAA,EAC3B;AACA,UAAQ,KAAK,CAAC;AAClB;",
|
|
6
5
|
"names": ["chalk"]
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/whoami.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { logger } from '../utils/logger';\nimport {\n DEFAULT_REALM,\n getTenantOrg,\n isUserAuthValid,\n listCredentials,\n listUserAuths,\n} from '../services/configService';\n\nexport function registerWhoamiCommand(program: Command): void {\n program\n .command('whoami')\n .description('Show current login status and configured tenants')\n .action(async () => {\n logger.header('Farseer Status');\n\n // Active target for THIS shell \u2014 what a command run with no tenant\n // argument will operate on. Resolved from FARSEER_TENANT (+\n // FARSEER_ORG / the saved mapping), mirroring the command\n // resolvers. There is no machine-global default any more, so if\n // this is unset every command needs an explicit tenant argument.\n const envTenant = process.env.FARSEER_TENANT;\n if (envTenant) {\n const envOrg = process.env.FARSEER_ORG || getTenantOrg(envTenant) || envTenant;\n logger.info('Active target (this shell):');\n console.log(` ${envTenant}${envOrg !== envTenant ? ` (org: ${envOrg})` : ''}`);\n logger.dim(' from FARSEER_TENANT');\n } else {\n logger.info('Active target (this shell): none');\n logger.dim(' Pass a tenant per command, or set: export FARSEER_TENANT=<tenant>');\n }\n\n console.log();\n\n // Browser logins, one per Keycloak realm\n const logins = Object.entries(listUserAuths());\n if (logins.length === 0) {\n logger.dim('Not logged in via browser');\n }\n for (const [realm, login] of logins) {\n if (isUserAuthValid(login)) {\n logger.success(`Logged in via browser (realm: ${realm})`);\n logger.dim(`Token expires: ${new Date(login.expiresAt).toLocaleString()}`);\n } else {\n logger.warning(`Browser login expired (realm: ${realm})`);\n logger.dim(`Run: farseer login${realm === DEFAULT_REALM ? '' : ` --realm ${realm}`}`);\n }\n }\n\n console.log();\n\n // List configured tenants (API key)\n const credentials = listCredentials();\n const tenants = Object.keys(credentials);\n\n if (tenants.length > 0) {\n logger.info(`Configured tenants (${tenants.length}):`);\n for (const tenant of tenants) {\n const cred = credentials[tenant];\n const keyPreview = cred.apiKey.substring(0, 8) + '...';\n console.log(` ${tenant}`);\n console.log(` Base: ${cred.basePath}`);\n console.log(` Key: ${keyPreview}`);\n }\n } else {\n logger.dim('No tenants configured');\n logger.dim('Run: farseer config set <tenant> --api-key <key>');\n }\n });\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AACvB,2BAMO;AAEA,SAAS,sBAAsB,SAAwB;AAC1D,UACK,QAAQ,QAAQ,EAChB,YAAY,kDAAkD,EAC9D,OAAO,YAAY;AAChB,yBAAO,OAAO,gBAAgB;AAO9B,UAAM,YAAY,QAAQ,IAAI;AAC9B,QAAI,WAAW;AACX,YAAM,SAAS,QAAQ,IAAI,mBAAe,mCAAa,SAAS,KAAK;AACrE,2BAAO,KAAK,6BAA6B;AACzC,cAAQ,IAAI,KAAK,SAAS,GAAG,WAAW,YAAY,UAAU,MAAM,MAAM,EAAE,EAAE;AAC9E,2BAAO,IAAI,uBAAuB;AAAA,IACtC,OAAO;AACH,2BAAO,KAAK,kCAAkC;AAC9C,2BAAO,IAAI,qEAAqE;AAAA,IACpF;AAEA,YAAQ,IAAI;AAGZ,UAAM,SAAS,OAAO,YAAQ,oCAAc,CAAC;AAC7C,QAAI,OAAO,WAAW,GAAG;AACrB,2BAAO,IAAI,2BAA2B;AAAA,IAC1C;AACA,eAAW,CAAC,OAAO,KAAK,KAAK,QAAQ;AACjC,cAAI,sCAAgB,KAAK,GAAG;AACxB,6BAAO,QAAQ,iCAAiC,KAAK,GAAG;AACxD,6BAAO,IAAI,kBAAkB,IAAI,KAAK,MAAM,SAAS,EAAE,eAAe,CAAC,EAAE;AAAA,MAC7E,OAAO;AACH,6BAAO,QAAQ,iCAAiC,KAAK,GAAG;AACxD,6BAAO,IAAI,qBAAqB,UAAU,qCAAgB,KAAK,YAAY,KAAK,EAAE,EAAE;AAAA,MACxF;AAAA,IACJ;AAEA,YAAQ,IAAI;AAGZ,UAAM,kBAAc,sCAAgB;AACpC,UAAM,UAAU,OAAO,KAAK,WAAW;AAEvC,QAAI,QAAQ,SAAS,GAAG;AACpB,2BAAO,KAAK,uBAAuB,QAAQ,MAAM,IAAI;AACrD,iBAAW,UAAU,SAAS;AAC1B,cAAM,OAAO,YAAY,MAAM;AAC/B,cAAM,aAAa,KAAK,OAAO,UAAU,GAAG,CAAC,IAAI;AACjD,gBAAQ,IAAI,KAAK,MAAM,EAAE;AACzB,gBAAQ,IAAI,aAAa,KAAK,QAAQ,EAAE;AACxC,gBAAQ,IAAI,aAAa,UAAU,EAAE;AAAA,MACzC;AAAA,IACJ,OAAO;AACH,2BAAO,IAAI,uBAAuB;AAClC,2BAAO,IAAI,kDAAkD;AAAA,IACjE;AAAA,EACJ,CAAC;AACT;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
package/dist/index.js
CHANGED
|
@@ -50,10 +50,10 @@ program.name("farseer").usage("[options] [command]").description("CLI tool for s
|
|
|
50
50
|
`
|
|
51
51
|
${import_chalk.default.bold.underline("Tenant Resolution")} ${import_chalk.default.dim("(explicit arg > FARSEER_TENANT env > error \u2014 never a global default)")}
|
|
52
52
|
Most commands accept ${import_chalk.default.cyan("[org] [tenant]")} arguments:
|
|
53
|
-
${import_chalk.default.green("$")} farseer pull ${import_chalk.default.cyan("
|
|
54
|
-
${import_chalk.default.green("$")} farseer pull ${import_chalk.default.cyan("
|
|
53
|
+
${import_chalk.default.green("$")} farseer pull ${import_chalk.default.cyan("acme acme-prod")} ${import_chalk.default.dim("First time: set up the workspace (org + tenant)")}
|
|
54
|
+
${import_chalk.default.green("$")} farseer pull ${import_chalk.default.cyan("acme-prod")} ${import_chalk.default.dim("After that: just the tenant (org is remembered)")}
|
|
55
55
|
Or set it once per shell and omit it:
|
|
56
|
-
${import_chalk.default.green("$")} export FARSEER_TENANT=
|
|
56
|
+
${import_chalk.default.green("$")} export FARSEER_TENANT=acme-prod ${import_chalk.default.dim("(+ FARSEER_ORG=acme if org differs)")}
|
|
57
57
|
${import_chalk.default.green("$")} farseer push ${import_chalk.default.dim("Targets FARSEER_TENANT; errors if unset")}
|
|
58
58
|
Each shell is independent \u2014 different terminals can target different tenants.
|
|
59
59
|
|
|
@@ -121,8 +121,9 @@ ${import_chalk.default.bold.underline("Farseer as code (experimental)")} ${impo
|
|
|
121
121
|
Every command except ${import_chalk.default.cyan("checkout")} runs inside the workspace: it walks up from the current
|
|
122
122
|
directory to the nearest ${import_chalk.default.dim(".fscode/state.json")}, which names the tenant, organisation and server.
|
|
123
123
|
${import_chalk.default.dim("<tenant>/tree/")} Item containment: folders and the items inside them
|
|
124
|
+
${import_chalk.default.dim("<tenant>/shared/")} Folders and items under a folder you cannot see
|
|
124
125
|
${import_chalk.default.dim("<tenant>/access/")} Shares, user groups, CLASS grants, labels
|
|
125
|
-
${import_chalk.default.dim("<tenant>/definitions/")} Settings, datasets, export configurations
|
|
126
|
+
${import_chalk.default.dim("<tenant>/definitions/")} Settings, global locks, datasets, export configurations
|
|
126
127
|
${import_chalk.default.dim("<tenant>/detached/")} Resources whose normal placement cannot be represented
|
|
127
128
|
${import_chalk.default.dim("<tenant>/.fscode/")} Baseline, routes and receipts (gitignored)
|
|
128
129
|
|
|
@@ -130,18 +131,29 @@ ${import_chalk.default.bold.underline("App Management")} ${import_chalk.default
|
|
|
130
131
|
app list [tenant] List all apps
|
|
131
132
|
${import_chalk.default.dim("--details")} Show details for each app
|
|
132
133
|
app show [tenant] <name> Show app details
|
|
134
|
+
${import_chalk.default.dim("--id <id>")} Select the app by numeric id (when names collide)
|
|
133
135
|
app create [tenant] <name> Create new app
|
|
134
136
|
app configure [tenant] <name> Configure app
|
|
135
|
-
${import_chalk.default.dim("--
|
|
136
|
-
${import_chalk.default.dim("--
|
|
137
|
-
${import_chalk.default.dim("--add-arg <Name=Value>")} Add argument (repeatable)
|
|
137
|
+
${import_chalk.default.dim("--source-folder <path>")} Folder under Files/ the app's scripts come from
|
|
138
|
+
${import_chalk.default.dim("--entrypoint <script>")} Set main script (a file in the source folder)
|
|
139
|
+
${import_chalk.default.dim("--add-arg <Name=Value>")} Add argument, or set its default (repeatable)
|
|
138
140
|
${import_chalk.default.dim("--description <text>")} Set description
|
|
141
|
+
${import_chalk.default.dim("--name <name>")} Rename the app
|
|
142
|
+
${import_chalk.default.dim("--schedule <cron>")} Cron schedule, e.g. "0 6 * * *" ("none" clears)
|
|
143
|
+
${import_chalk.default.dim("--runner <name>")} Jobrunner that runs the app ("none" clears)
|
|
144
|
+
${import_chalk.default.dim("--runner-image <image>")} Container image, <repository>:<tag> ("none" clears)
|
|
145
|
+
${import_chalk.default.dim("--compute <choice>")} Where a run executes: local, batch, batch:s|m|l|xl
|
|
146
|
+
${import_chalk.default.dim("--id <id>")} Select the app by numeric id (when names collide)
|
|
139
147
|
app delete [tenant] <name> Delete app (requires --force)
|
|
148
|
+
${import_chalk.default.dim("--id <id>")} Select the app by numeric id (when names collide)
|
|
140
149
|
|
|
141
150
|
${import_chalk.default.bold.underline("Running & Development")} ${import_chalk.default.dim("(tenant optional if FARSEER_TENANT set)")}
|
|
142
151
|
run [tenant] <app> Run app locally with injected credentials
|
|
143
152
|
${import_chalk.default.dim("--arg <Name=Value>")} Override argument (repeatable)
|
|
153
|
+
${import_chalk.default.dim("--id <id>")} Select the app by numeric id (when names collide)
|
|
154
|
+
${import_chalk.default.dim("--tenant-id <id>")} Override the TENANT_ID the script gets
|
|
144
155
|
run-script [tenant] <file> Run script directly (no app wrapper)
|
|
156
|
+
${import_chalk.default.dim("--tenant-id <id>")} Override the TENANT_ID the script gets
|
|
145
157
|
install [tenant] Install npm dependencies (npm install)
|
|
146
158
|
|
|
147
159
|
${import_chalk.default.bold.underline("Variables")} ${import_chalk.default.dim("(tenant optional if FARSEER_TENANT set)")}
|
|
@@ -211,7 +223,9 @@ ${import_chalk.default.bold.underline("Model Inspection")} ${import_chalk.defau
|
|
|
211
223
|
model [tenant] Show model structure (dimensions, variables)
|
|
212
224
|
${import_chalk.default.dim("--variables")} List all variables
|
|
213
225
|
${import_chalk.default.dim("--tables")} List all dimension tables
|
|
214
|
-
${import_chalk.default.dim("--variable <name>")} Show dimensions
|
|
226
|
+
${import_chalk.default.dim("--variable <name>")} Show one variable (dimensions, formula, roll-up, type)
|
|
227
|
+
${import_chalk.default.dim("--table <name>")} Show one table (columns, member count, sample members)
|
|
228
|
+
${import_chalk.default.dim("--json")} Output raw JSON
|
|
215
229
|
|
|
216
230
|
${import_chalk.default.bold.underline("File Management")} ${import_chalk.default.dim("(farseer files <command>)")}
|
|
217
231
|
files list [tenant] List files on remote
|
|
@@ -225,8 +239,8 @@ ${import_chalk.default.bold.underline("MCP Server")} ${import_chalk.default.dim
|
|
|
225
239
|
|
|
226
240
|
${import_chalk.default.bold.underline("Examples")}
|
|
227
241
|
${import_chalk.default.green("$")} farseer login ${import_chalk.default.dim("Login via browser")}
|
|
228
|
-
${import_chalk.default.green("$")} farseer pull
|
|
229
|
-
${import_chalk.default.green("$")} export FARSEER_TENANT=
|
|
242
|
+
${import_chalk.default.green("$")} farseer pull acme acme-prod ${import_chalk.default.dim("First time: set up the workspace (org + tenant)")}
|
|
243
|
+
${import_chalk.default.green("$")} export FARSEER_TENANT=acme-prod ${import_chalk.default.dim("Set the target for this shell")}
|
|
230
244
|
${import_chalk.default.green("$")} farseer push ${import_chalk.default.dim("With FARSEER_TENANT set: no tenant arg")}
|
|
231
245
|
${import_chalk.default.green("$")} farseer push -y ${import_chalk.default.dim("Push without confirmation")}
|
|
232
246
|
${import_chalk.default.green("$")} farseer run "My App" ${import_chalk.default.dim("Run app locally")}
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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';\nimport { inAgentSandbox } from './utils/agentSandbox';\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 = !inAgentSandbox() && !process.argv.includes('mcp-server') ? checkForUpdates() : 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('Farseer as code (experimental)')} ${chalk.dim('(farseer code <command>; its own workspace, separate from the sync above)')}\n code checkout [org] [tenant] Create ./<tenant>/ and check the model out into it\n code pull Fast-forward the workspace to the current model head\n ${chalk.dim('--force')} Reset tracked resources to the head; new local files stay\n code plan Compose the workspace and save a plan for its changes\n code apply <planId> Apply a saved plan (also resumes pending attempts)\n ${chalk.dim('--wait-seconds <seconds>')} Wait for pending work, default 120 (on every code command)\n Every command except ${chalk.cyan('checkout')} runs inside the workspace: it walks up from the current\n directory to the nearest ${chalk.dim('.fscode/state.json')}, which names the tenant, organisation and server.\n ${chalk.dim('<tenant>/tree/')} Item containment: folders and the items inside them\n ${chalk.dim('<tenant>/access/')} Shares, user groups, CLASS grants, labels\n ${chalk.dim('<tenant>/definitions/')} Settings, datasets, export configurations\n ${chalk.dim('<tenant>/detached/')} Resources whose normal placement cannot be represented\n ${chalk.dim('<tenant>/.fscode/')} Baseline, routes and receipts (gitignored)\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 on a single variable name (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 tool list|show|call Run the MCP server's tools from a terminal (--tenant, --org as above)\n ${chalk.dim('call <name> --args <json>')} Run one tool and print its result; exits 1 when it refuses\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 [['code'], () => require('./commands/code').registerCodeCommand(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 [['tool'], () => require('./commands/tool').registerToolCommand(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// A stored credential is sent to the override, while `config test` and `whoami` still show the\n// stored host, so every command says where its requests go.\nif (process.env.FARSEER_API_URL)\n program.hook('preAction', () => {\n process.stderr.write(`FARSEER_API_URL is set: requests go to ${process.env.FARSEER_API_URL}\\n`);\n });\n\n// Parse arguments\nprogram.parse();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,uBAAwB;AACxB,mBAAkB;AAClB,uBAA4B;AAC5B,wBAA2B;AAC3B,0BAA+B;AAC/B,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,OAAO,KAAK,YAAY,YACxB,KAAK,QAAQ,SAAS,UAAU,GAClC;AACE,WAAO;AAAA,EACX;AAEA,SAAO,aAAa,MAAM,SAAS,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC;AAC5D;AAAA,IAUA,qDAA0B;AAG1B,6BAAW,KAAK;AAChB,6BAAW,qBAAqB;AAKhC,MAAM,uBA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U,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;AAIA,IAAI,QAAQ,IAAI;AACZ,UAAQ,KAAK,aAAa,MAAM;AAC5B,YAAQ,OAAO,MAAM,0CAA0C,QAAQ,IAAI,eAAe;AAAA,CAAI;AAAA,EAClG,CAAC;AAGL,QAAQ,MAAM;",
|
|
6
5
|
"names": ["chalk"]
|
|
7
6
|
}
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mcp/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * MCP Server Entry Point\n *\n * Starts the Farseer MCP server for AI assistant integration.\n * Uses stdio transport for CLI compatibility.\n */\n\nimport { createMcpServer } from './server';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { setLaunchTenant } from './utils/tenantPin';\nimport { resolveLaunchPin } from './utils/launchPin';\nimport type { McpServerOptions } from './utils/launchPin';\nimport { fileLogger } from '../utils/fileLogger';\n\nexport type { McpServerOptions };\n\nexport async function startMcpServer(options: McpServerOptions = {}): Promise<void> {\n // Signal MCP context so logger and progress output avoid stdout\n process.env.FARSEER_MCP = '1';\n\n // Initialize file logging (crash handlers especially important for long-lived MCP process)\n fileLogger.init();\n // Each tool already answers its caller, so a rejection that got past one is\n // logged rather than made fatal to every other conversation in the session.\n fileLogger.installCrashHandlers({ exitOnRejection: false });\n fileLogger.log('mcp', 'MCP server starting');\n\n // Bind this server to a single tenant for its lifetime if one was supplied at\n // launch \u2014 via --tenant/--org, or the FARSEER_TENANT/FARSEER_ORG env (the\n // channel Mindseer already uses). The pin lives only in memory; the global\n // checkout in ~/.farseer/config.json is never read or written, so it can't\n // collide with the CLI or with other concurrent servers. Launched without a\n // tenant, the server connects unbound and an agent binds it once via\n // farseer_select_tenant.\n const pin = resolveLaunchPin(options, process.env);\n if (pin) {\n setLaunchTenant(pin);\n fileLogger.log('mcp', `Launch-pinned to tenant ${pin.tenant} (org ${pin.organisation})`);\n } else {\n fileLogger.log('mcp', 'Started without a tenant; awaiting farseer_select_tenant');\n }\n\n const server = createMcpServer();\n\n // Use stdio transport for CLI integration\n const transport = new StdioServerTransport();\n await server.connect(transport);\n\n fileLogger.log('mcp', 'MCP server connected');\n // Log to stderr since stdout is reserved for MCP protocol\n console.error('Farseer MCP server started');\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,oBAAgC;AAChC,mBAAqC;AACrC,uBAAgC;AAChC,uBAAiC;AAEjC,wBAA2B;AAI3B,eAAsB,eAAe,UAA4B,CAAC,GAAkB;AAEhF,UAAQ,IAAI,cAAc;AAG1B,+BAAW,KAAK;AAGhB,+BAAW,qBAAqB,EAAE,iBAAiB,MAAM,CAAC;AAC1D,+BAAW,IAAI,OAAO,qBAAqB;AAS3C,QAAM,UAAM,mCAAiB,SAAS,QAAQ,GAAG;AACjD,MAAI,KAAK;AACL,0CAAgB,GAAG;AACnB,iCAAW,IAAI,OAAO,2BAA2B,IAAI,MAAM,SAAS,IAAI,YAAY,GAAG;AAAA,EAC3F,OAAO;AACH,iCAAW,IAAI,OAAO,0DAA0D;AAAA,EACpF;AAEA,QAAM,aAAS,+BAAgB;AAG/B,QAAM,YAAY,IAAI,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAE9B,+BAAW,IAAI,OAAO,sBAAsB;AAE5C,UAAQ,MAAM,4BAA4B;AAC9C;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
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- 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
4
|
"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,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sDAoB5B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAoB/B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
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: '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
4
|
"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;AAA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A,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAGA,aAAW,OAAO,MAAM;AACpB,WAAO;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ;AAAA,QACI,aAAa,IAAI;AAAA,QACjB,UAAU;AAAA,MACd;AAAA,MACA,MAAM;AACF,eAAO;AAAA,UACH,UAAU;AAAA,YACN;AAAA,cACI,KAAK,IAAI;AAAA,cACT,UAAU;AAAA,cACV,MAAM,eAAe,GAAG;AAAA,YAC5B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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 { 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
4
|
"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
5
|
"names": []
|
|
7
6
|
}
|
package/dist/mcp/skills.js.map
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;A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
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/mcp/tools/appTools.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * App Management Tools\n *\n * Tools for managing Farseer apps (Remote Jobs).\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { registerTool } from '../utils/registerTool';\nimport { z } from 'zod';\nimport { requireSession } from '../utils/session';\nimport {\n APP_COMPUTE_CHOICES,\n AppArgument,\n AppDeleteRefusedError,\n AppPredefinedAction,\n AppUpdateChanges,\n CLEAR_SETTING,\n applyRunSettings,\n applySourceFolderChange,\n formatCompute,\n redactActionValues,\n restoreRedactedValues,\n} from '../../services/apps';\nimport { successResponse, errorResponse, resolveAppItemForMcp, resolveAppForMcp } from '../utils/helpers';\nimport { matchByName } from '../../utils/nameResolver';\nimport { formatClientError } from '../../utils/errorFormatter';\n\n// Define schemas outside of tool registration to avoid deep type instantiation\nconst listAppsSchema = {\n details: z.boolean().optional().describe('Include full details for each app'),\n};\n\nconst getAppSchema = {\n appName: z.string().optional().describe('Name of the app (can include spaces). Omit if using appId.'),\n appId: z.string().optional().describe('Numeric app id \u2014 use instead of appName when names collide.'),\n};\n\nconst createAppSchema = {\n appName: z.string().describe('Name for the new app'),\n};\n\nexport const argumentSchema = z\n .object({\n name: z.string(),\n dataType: z.enum(['string', 'boolean']).optional().describe('Data type. Defaults to \"string\" if omitted.'),\n fixed: z\n .boolean()\n .optional()\n .describe('Lock the value at run time so users cannot override it (admin sets, user reads only).'),\n options: z\n .array(z.string())\n .optional()\n .describe('Closed allowed-value set. Only meaningful for string dataType.'),\n defaultValue: z.string().optional(),\n secret: z.boolean().optional().describe('Mask the value in inputs and logs.'),\n })\n // Cross-axis checks mirror the backend's `validateExpectedArguments` so an\n // LLM caller gets pre-request feedback. Backend stays authoritative \u2014 these\n // catch the same shapes earlier, they don't replace the validator.\n .refine(\n (a) => a.dataType !== 'boolean' || a.defaultValue === undefined || ['true', 'false'].includes(a.defaultValue),\n {\n message: 'Boolean argument defaultValue must be \"true\" or \"false\"',\n path: ['defaultValue'],\n },\n )\n .refine((a) => !a.options || a.defaultValue === undefined || a.options.includes(a.defaultValue), {\n message: 'defaultValue must be one of the options',\n path: ['defaultValue'],\n });\n\nexport const predefinedActionSchema = z.object({\n name: z.string(),\n runArguments: z.record(z.string()).describe('Argument name to the value this action runs with.'),\n});\n\nconst configureAppSchema = {\n appName: z.string().optional().describe('Name of the app to configure. Omit if using appId.'),\n appId: z.string().optional().describe('Numeric app id \u2014 use instead of appName when names collide.'),\n entrypoint: z\n .string()\n .optional()\n .describe('Main script filename \u2014 must be a file in the app\\'s source folder (e.g., \"index.ts\")'),\n sourceFolder: z\n .string()\n .optional()\n .describe('Source folder the app\\'s scripts come from (path under Files/, e.g. \"Scripts/MyApp\")'),\n description: z.string().optional().describe('App description'),\n arguments: z.array(argumentSchema).optional().describe('App arguments with default values'),\n newName: z.string().optional().describe('Rename the app'),\n schedule: z\n .string()\n .optional()\n .describe(`Cron expression to run the app on, e.g. \"0 6 * * *\". Pass \"${CLEAR_SETTING}\" to clear it.`),\n runner: z\n .string()\n .optional()\n .describe(`Name of the jobrunner that runs the app. Pass \"${CLEAR_SETTING}\" to let any runner take it.`),\n runnerImage: z\n .string()\n .optional()\n .describe(\n `Container image the app runs in, as \"<repository>:<tag>\" (e.g. \"runner-typescript:latest\") or a full registry reference. Pass \"${CLEAR_SETTING}\" for the tenant default.`,\n ),\n compute: z\n .enum(APP_COMPUTE_CHOICES as unknown as [string, ...string[]])\n .optional()\n .describe(\n 'Where a run executes: \"local\" is a container on the jobrunner\\'s own machine, \"batch\" a machine created for that run. The size suffix picks how much machine; bare \"batch\" takes the deployment\\'s default size.',\n ),\n predefinedActions: z\n .array(predefinedActionSchema)\n .optional()\n .describe('Named argument presets offered as buttons in the UI. Replaces the existing list wholesale.'),\n};\n\nconst deleteAppSchema = {\n appName: z.string().optional().describe('Name of the app to delete. Omit if using appId.'),\n appId: z.string().optional().describe('Numeric app id \u2014 use instead of appName when names collide.'),\n};\n\nexport function registerAppTools(server: McpServer): void {\n // Cast to avoid TS2589 deep type instantiation with MCP SDK + Zod generics\n const s: any = server;\n\n // farseer_list_apps - List all apps\n s.tool(\n 'farseer_list_apps',\n `List all apps (Remote Jobs) configured on a Farseer tenant.\n\nApps are executable script configurations that include:\n- Entry point script\n- List of included scripts\n- Expected arguments with default values\n\nUse details=true to include full information for each app.`,\n listAppsSchema,\n async (params: { details?: boolean }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, client } = gate.session;\n\n try {\n const appList = await client.listApps();\n\n if (!params.details) {\n return successResponse({\n tenant,\n totalApps: appList.length,\n apps: appList.map((a) => ({\n name: a.name,\n reference: a.reference,\n })),\n });\n }\n\n // Get full details for each app\n const appsWithDetails = [];\n for (const item of appList) {\n const app = await client.getApp(item.reference);\n if (app) {\n const appScripts = app.scriptFiles ?? [];\n const mainScript = appScripts.find((s) => s.id === app.mainScriptFileId);\n appsWithDetails.push({\n name: app.name,\n id: app.id,\n description: app.description || '',\n entrypoint: mainScript?.name || null,\n scripts: appScripts.map((s) => s.name),\n arguments: app.expectedArguments.map((a) => ({\n name: a.name,\n dataType: a.dataType,\n ...(a.fixed !== undefined ? { fixed: a.fixed } : {}),\n ...(a.options !== undefined ? { options: a.options } : {}),\n ...(a.defaultValue !== undefined ? { defaultValue: a.defaultValue } : {}),\n ...(a.secret !== undefined ? { secret: a.secret } : {}),\n })),\n });\n }\n }\n\n return successResponse({\n tenant,\n totalApps: appsWithDetails.length,\n apps: appsWithDetails,\n });\n } catch (error) {\n return errorResponse(`List apps failed: ${await formatClientError(error)}`, 'NETWORK_ERROR');\n }\n },\n );\n\n // farseer_get_app - Get app details\n s.tool(\n 'farseer_get_app',\n `Get detailed information about a specific Farseer app.\n\nReturns:\n- App name and description\n- Entry point script (main script that runs)\n- List of all included scripts\n- Expected arguments with their default values\n- Schedule, runner, runner image and compute selection\n- Predefined actions (named argument presets)`,\n getAppSchema,\n async (params: { appName?: string; appId?: string }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, client } = gate.session;\n\n try {\n const resolution = await resolveAppForMcp(client, {\n appName: params.appName,\n id: params.appId,\n });\n if ('error' in resolution) {\n return resolution.error;\n }\n const app = resolution.app;\n\n const getAppScripts = app.scriptFiles ?? [];\n const mainScript = getAppScripts.find((s) => s.id === app.mainScriptFileId);\n\n return successResponse({\n tenant,\n app: {\n id: app.id,\n name: app.name,\n description: app.description || '',\n entrypoint: mainScript?.name || null,\n scripts: getAppScripts.map((s) => ({\n id: s.id,\n name: s.name,\n isEntrypoint: s.id === app.mainScriptFileId,\n })),\n arguments: app.expectedArguments.map((a) => ({\n name: a.name,\n dataType: a.dataType,\n ...(a.fixed !== undefined ? { fixed: a.fixed } : {}),\n ...(a.options !== undefined ? { options: a.options } : {}),\n ...(a.defaultValue !== undefined ? { defaultValue: a.defaultValue } : {}),\n ...(a.secret !== undefined ? { secret: a.secret } : {}),\n })),\n status: app.status,\n lastHeartbeat: app.lastHeartbeat,\n schedule: app.schedule ?? null,\n runner: app.runnerName ?? null,\n runnerImage: app.runnerImage ?? null,\n compute: formatCompute(app.compute),\n predefinedActions: redactActionValues(app.predefinedActions ?? [], app.expectedArguments),\n },\n });\n } catch (error) {\n return errorResponse(`Get app failed: ${await formatClientError(error)}`, 'NETWORK_ERROR');\n }\n },\n );\n\n // farseer_create_app - Create new app\n s.tool(\n 'farseer_create_app',\n `Create a new Farseer app.\n\nAll 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.\n\nA Farseer App is a named configuration that points to a TypeScript script and defines its arguments.\nThe script uses farseer-client to interact with the Farseer API (import data, export reports, etc.).\n\nWorkflow to create a new app:\n1. Write the script at farseer-apps/<tenant>/files/Scripts/<name>.ts\n2. Push the script to remote with farseer_push (scripts must exist on remote first)\n3. Create the app with this tool (farseer_create_app)\n4. Configure it with farseer_configure_app (set entrypoint, scripts, arguments)\n5. Run it with farseer_run_app (CLI injects auth credentials automatically)\n\nScripts should use \\`new FarseerClient()\\` with no arguments - credentials are injected via environment variables by the CLI at runtime.`,\n createAppSchema,\n async (params: { appName: string }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, client } = gate.session;\n\n try {\n // Any name match means the name is taken \u2014 a collision still counts.\n const existing = matchByName(await client.listApps(), params.appName);\n if (existing.length > 0) {\n return errorResponse(`App \"${params.appName}\" already exists`, 'VALIDATION_ERROR');\n }\n\n const app = await client.createApp(params.appName);\n\n return successResponse({\n tenant,\n app: {\n id: app.id,\n name: app.name,\n },\n message: `App \"${params.appName}\" created. Use farseer_configure_app to set entrypoint, scripts, and arguments.`,\n });\n } catch (error) {\n return errorResponse(`Create app failed: ${await formatClientError(error)}`, 'NETWORK_ERROR');\n }\n },\n );\n\n // farseer_configure_app - Configure app settings\n s.tool(\n 'farseer_configure_app',\n `Configure an existing Farseer app.\n\nPreserve 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.\n\nYou can set:\n- sourceFolder: Folder under Files/ the app's scripts come from (e.g. \"Scripts/MyApp\")\n- entrypoint: Main script to execute \u2014 must be a file in the source folder (e.g., \"index.ts\")\n- description: App description\n- arguments: List of expected arguments. Each has a name, optional dataType\n ('string' | 'boolean' \u2014 defaults to 'string'), optional fixed (locks the\n value at run time), optional options (closed allowed-value set, string\n dataType only), optional defaultValue, and optional secret.\n- newName: Rename the app\n- schedule: Cron expression the app runs on (e.g. \"0 6 * * *\")\n- runner: Which jobrunner runs the app\n- runnerImage: Container image, as \"<repository>:<tag>\" or a full registry reference\n- compute: Where a run executes \u2014 'local', 'batch', or 'batch:<size>' with size s, m, l or xl\n- predefinedActions: Named argument presets offered as buttons in the UI. The\n list you pass replaces the app's whole list. farseer_get_app shows a secret\n argument's value as \"<secret>\"; send \"<secret>\" back to keep the stored value\n of the action with exactly that name. Where two actions share a name, give\n the real value.\n\nImportant:\n- The app's scripts are derived from its source folder; the entrypoint must be\n one of those files. To use a script from another folder, set sourceFolder first.\n- Changing sourceFolder to a folder that doesn't contain the current entrypoint\n requires passing entrypoint in the same call.\n- Settings you don't pass are preserved (this only changes what you specify).\n- Pass \"${CLEAR_SETTING}\" to schedule, runner or runnerImage to clear it.\n- Arguments are passed to the script as a JSON-encoded FARSEER_ARGS env var\n- Boolean dataType requires defaultValue \u2208 { \"true\", \"false\" }; defaultValue\n must be one of options when options is set`,\n configureAppSchema,\n async (params: {\n appName?: string;\n appId?: string;\n entrypoint?: string;\n sourceFolder?: string;\n description?: string;\n arguments?: Array<{\n name: string;\n dataType?: 'string' | 'boolean';\n fixed?: boolean;\n options?: string[];\n defaultValue?: string;\n secret?: boolean;\n }>;\n newName?: string;\n schedule?: string;\n runner?: string;\n runnerImage?: string;\n compute?: string;\n predefinedActions?: AppPredefinedAction[];\n }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, client } = gate.session;\n\n try {\n const resolution = await resolveAppForMcp(client, {\n appName: params.appName,\n id: params.appId,\n });\n if ('error' in resolution) {\n return resolution.error;\n }\n const app = resolution.app;\n\n // The set of changes. updateApp merges these onto the app's\n // current state, so anything left out here is preserved.\n const changes: AppUpdateChanges = {};\n\n if (params.newName) {\n changes.name = params.newName;\n }\n\n if (params.description !== undefined) {\n changes.description = params.description;\n }\n\n if (params.arguments) {\n // PUT semantics on the backend: this `expectedArguments`\n // array replaces the existing one wholesale. So if the\n // caller supplies a name but omits axes (dataType, fixed,\n // options, secret), we look up the existing arg by name\n // and carry those fields over. Without this merge, a\n // configure_app call that only re-sets defaultValue would\n // silently clear the secret flag or demote a dropdown\n // back to a plain string variable.\n //\n // Lookup is case-insensitive for convenience (caller\n // shouldn't have to remember exact casing to update an\n // existing arg), but on the write we keep the backend's\n // stored casing: validateExpectedArguments on the server\n // is case-sensitive (seen.has(arg.name)), so writing\n // back caller-supplied case would silently rename the\n // arg (e.g. jobName \u2192 JOBNAME) and break the next push.\n const existingByName = new Map(app.expectedArguments.map((e) => [e.name.toLowerCase(), e]));\n changes.expectedArguments = params.arguments.map((a) => {\n const existing = existingByName.get(a.name.toLowerCase());\n const arg: AppArgument = {\n name: existing?.name ?? a.name,\n dataType: a.dataType ?? existing?.dataType ?? 'string',\n };\n const fixed = a.fixed ?? existing?.fixed;\n if (fixed !== undefined) arg.fixed = fixed;\n const options = a.options ?? existing?.options;\n if (options !== undefined) arg.options = options;\n const defaultValue = a.defaultValue ?? existing?.defaultValue;\n if (defaultValue !== undefined) arg.defaultValue = defaultValue;\n const secret = a.secret ?? existing?.secret;\n if (secret !== undefined) arg.secret = secret;\n return arg;\n });\n }\n\n // Source folder + entrypoint. An app's scripts derive from its\n // source folder, and the entrypoint must be one of those files.\n // The decision lives in applySourceFolderChange (shared with the\n // CLI `app configure` command); the 'mcp' caller gets a plain,\n // param-worded error string.\n const sourceFolderError = await applySourceFolderChange(\n client,\n app,\n changes,\n { sourceFolder: params.sourceFolder, entrypoint: params.entrypoint },\n 'mcp',\n );\n if (sourceFolderError) {\n return errorResponse(sourceFolderError, 'VALIDATION_ERROR');\n }\n\n if (params.predefinedActions) {\n const restored = restoreRedactedValues(params.predefinedActions, app.predefinedActions ?? []);\n if ('error' in restored) {\n return errorResponse(restored.error, 'VALIDATION_ERROR');\n }\n changes.predefinedActions = restored.actions;\n }\n\n // Schedule, runner, image and compute. Shared with the CLI\n // `app configure` command so both surfaces take the same vocabulary.\n const runSettings = await applyRunSettings(client, app, changes, {\n schedule: params.schedule,\n runner: params.runner,\n runnerImage: params.runnerImage,\n compute: params.compute,\n });\n if ('error' in runSettings) {\n return errorResponse(runSettings.error, 'VALIDATION_ERROR');\n }\n\n const reference = app.id.toString();\n const updated = await client.updateApp(reference, changes, app);\n\n return successResponse({\n tenant,\n appName: params.newName || app.name,\n updated: Object.keys(changes),\n compute: formatCompute(updated.compute),\n warnings: runSettings.warnings,\n message: `App \"${app.name}\" configured successfully`,\n });\n } catch (error) {\n return errorResponse(`Configure app failed: ${await formatClientError(error)}`, 'NETWORK_ERROR');\n }\n },\n );\n\n // farseer_delete_app - Delete app\n s.tool(\n 'farseer_delete_app',\n `Delete an app from a Farseer tenant.\n\nWARNING: This is irreversible - the app will be permanently removed from the remote instance.\n\nThis does NOT delete the script files, only the app configuration.`,\n deleteAppSchema,\n async (params: { appName?: string; appId?: string }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, client } = gate.session;\n\n try {\n const resolution = await resolveAppItemForMcp(client, {\n appName: params.appName,\n id: params.appId,\n });\n if ('error' in resolution) {\n return resolution.error;\n }\n const appItem = resolution.item;\n\n await client.deleteApp(appItem.reference);\n\n // The folder API 200s even when nothing was deleted; confirm.\n const remaining = await client.listApps();\n if (remaining.some((a) => a.reference === appItem.reference)) {\n return errorResponse(\n `Delete reported success but \"${appItem.name}\" is still present`,\n 'NETWORK_ERROR',\n );\n }\n\n return successResponse({\n tenant,\n deletedApp: appItem.name,\n message: `App \"${appItem.name}\" has been deleted`,\n });\n } catch (error) {\n // A guard refusal is not retryable \u2014 nothing was deleted and a\n // retry cannot change that. Don't let it read as a transport blip.\n return errorResponse(\n `Delete app failed: ${await formatClientError(error)}`,\n error instanceof AppDeleteRefusedError ? 'VALIDATION_ERROR' : 'NETWORK_ERROR',\n );\n }\n },\n );\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,iBAAkB;AAClB,qBAA+B;AAC/B,kBAYO;AACP,qBAAuF;AACvF,0BAA4B;AAC5B,4BAAkC;AAGlC,MAAM,iBAAiB;AAAA,EACnB,SAAS,aAAE,QAAQ,EAAE,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
|
30
30
|
var import_tenantPin = require("../utils/tenantPin");
|
|
31
31
|
const selectTenantSchema = {
|
|
32
|
-
tenant: import_zod.z.string().describe(`Tenant to bind this session to (e.g. "
|
|
32
|
+
tenant: import_zod.z.string().describe(`Tenant to bind this session to (e.g. "acme-prod"), from the user's request.`),
|
|
33
33
|
organisation: import_zod.z.string().optional().describe("Organisation subdomain. Defaults to the saved mapping for the tenant, else the tenant name.")
|
|
34
34
|
};
|
|
35
35
|
function registerAuthTools(server) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/mcp/tools/authTools.ts"],
|
|
4
|
-
"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA6B;AAC7B,iBAAkB;AAClB,2BAA6B;AAC7B,uBAAkC;AAClC,qBAMO;AACP,qBAAmD;AACnD,uBAA2D;AAG3D,MAAM,qBAAqB;AAAA,EACvB,QAAQ,aAAE,OAAO,EAAE,SAAS,kFAAmF;AAAA,EAC/G,cAAc,aACT,OAAO,EACP,SAAS,EACT,SAAS,6FAA6F;AAC/G;AAEO,SAAS,kBAAkB,QAAyB;AAEvD;AAAA,IACI;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,CAAC;AAAA,IACD,YAAY;AACR,YAAM,aAAS,8BAAc;AAC7B,YAAM,MAAM,OAAO;AACnB,YAAM,UAAU,CAAC,MACX,wIACA,OAAO,eACL,qCAAqC,IAAI,MAAM,WAAW,IAAI,YAAY,wBAC1E,sCAAsC,IAAI,MAAM,WAAW,IAAI,YAAY;AACnF,YAAM,cAAU,kCAAkB;AAClC,iBAAO,gCAAgB;AAAA,QACnB,UAAU,OAAO;AAAA,QACjB,cAAc,OAAO;AAAA,QACrB,UAAU,OAAO;AAAA,QACjB,QAAQ,OAAO;AAAA,QACf,QAAQ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a,IAAI;AAIjC,cAAI,iCAAe,GAAG;AAClB,mBAAO;AAAA,UACH,wCAAoC,+BAAa,EAAG,MAAM;AAAA,UAC1D;AAAA,QACJ;AAAA,MACJ;AACA,YAAM,YAAQ,+BAAa;AAC3B,UAAI,OAAO;AACP,mBAAO;AAAA,UACH,8CAA8C,MAAM,MAAM;AAAA,UAC1D;AAAA,QACJ;AAAA,MACJ;AAEA,YAAM,MAAM,oBAAgB,mCAAa,MAAM,KAAK;AAIpD,YAAM,UAAU,UAAM,oCAAkB,KAAK,MAAM;AACnD,UAAI,CAAC,QAAQ,IAAI;AACb,mBAAO,uCAAuB,QAAQ,SAAS,kDAAkD;AAAA,MACrG;AAEA,YAAM,aAAS,+BAAa,EAAE,cAAc,KAAK,OAAO,CAAC;AACzD,UAAI,CAAC,OAAO,IAAI;AAGZ,mBAAO;AAAA,UACH,8CAA8C,OAAO,QAAQ,MAAM;AAAA,UACnE;AAAA,QACJ;AAAA,MACJ;AAIA,0CAAgB,OAAO,UAAU,QAAQ,MAAM,QAAQ,OAAO;AAE9D,YAAM,WAAW,oBAAoB,OAAO,SAAS,MAAM,WAAW,OAAO,SAAS,YAAY;AAClG,iBAAO,gCAAgB;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,SAAS,QAAQ,eAAW,uCAAuB,QAAQ,OAAO;AAAA,QAClE,SAAS,QAAQ,UAAU,GAAG,QAAQ,QAAI,uCAAuB,QAAQ,OAAO,CAAC,KAAK;AAAA,MAC1F,CAAC;AAAA,IACL;AAAA,EACJ;AACJ;",
|
|
6
5
|
"names": []
|
|
7
6
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/mcp/tools/cellTools.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Cell Tools\n *\n * MCP tools for querying cell values in Farseer.\n * For writing data, use farseer_create_import_job which provides audit trail and undo support.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { registerTool } from '../utils/registerTool';\nimport { z } from 'zod';\nimport { requireSession } from '../utils/session';\nimport { successResponse, errorResponse } from '../utils/helpers';\nimport { formatClientError } from '../../utils/errorFormatter';\n\n// Shared dimension schema\nconst dimensionSchema = z.object({\n dimensionTable: z.string().describe('Dimension table name (e.g., \"Years\", \"Product\")'),\n dimensionValue: z.string().describe('Dimension member value (e.g., \"2024\", \"Widget A\")'),\n});\n\n// Define schemas outside of tool registration to avoid TS2589\nconst queryCellsSchema = {\n queries: z\n .array(\n z.object({\n variable: z.string().describe('Variable name'),\n dimensions: z.array(dimensionSchema).describe('Dimension filters'),\n }),\n )\n .describe('Array of cell queries to execute'),\n};\n\nexport function registerCellTools(server: McpServer): void {\n // farseer_query_cells\n registerTool(\n server,\n 'farseer_query_cells',\n `Query cell values from a Farseer tenant.\n\nEach query specifies a variable name and dimension filters to locate specific cells.\nMultiple queries can be batched in a single call.\n\nExample query:\n{\n \"variable\": \"Revenue\",\n \"dimensions\": [\n { \"dimensionTable\": \"Years\", \"dimensionValue\": \"Y2025\" },\n { \"dimensionTable\": \"Product\", \"dimensionValue\": \"Widget A\" }\n ]\n}\n\nReturns the value for each queried cell along with its dimension coordinates.\n\nTo write data, use farseer_create_import_job instead \u2014 it provides audit trail and undo support.`,\n queryCellsSchema,\n async (params: {\n queries: Array<{\n variable: string;\n dimensions: Array<{ dimensionTable: string; dimensionValue: string }>;\n }>;\n }) => {\n const gate = await requireSession();\n if (!gate.ok) return gate.response;\n const { tenant, native: nativeClient } = gate.session;\n\n try {\n const results = await nativeClient.cells.query(params.queries);\n\n return successResponse({\n tenant,\n queryCount: params.queries.length,\n results,\n });\n } catch (error) {\n return errorResponse(`Query cells failed: ${await formatClientError(error)}`, 'NETWORK_ERROR');\n }\n },\n );\n}\n"],
|
|
5
4
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,0BAA6B;AAC7B,iBAAkB;AAClB,q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