farseer-cli 1.7.2 → 1.8.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/push.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport inquirer from 'inquirer';\nimport { logger } from '../utils/logger';\nimport { fileLogger } from '../utils/fileLogger';\nimport { getFarseerClientWithFallback, showLoginPrompt, ensureFreshToken } from '../services/farseerFactory';\nimport { SyncService } from '../services/syncService';\nimport { AppSyncService } from '../services/appSyncService';\nimport {\n getTenantFilesDir,\n resolveTenantWithOrgMapping,\n safeResolveWithinBase,\n validateOnlyFilePaths,\n} from '../utils/helpers';\nimport { formatClientError } from '../utils/errorFormatter';\nimport { ValidationFailure, partitionForUpload } from '../utils/fileValidation';\nimport { collectValues, normalizeExtensions } from '../utils/cliOptions';\nimport type { SyncStatus } from '../services/syncService';\nimport * as fs from 'fs';\n\n/**\n * Push semantics (in plain English, since this is the easiest part of the\n * CLI to misunderstand):\n *\n * farseer push\n * 1. Pre-flight: refuse local files that the backend will reject\n * (extension whitelist, name length, empty body). Print them and\n * exit non-zero so the user fixes them before we touch the network.\n * 2. Compare local vs remote (no remote download \u2014 we trust the\n * recorded sync baseline). If remote diverged from baseline,\n * refuse and ask the user to pull first.\n * 3. Show a diff (added / modified / deleted).\n * 4. Confirm.\n * 5. Upload modified files. Re-check each one against current remote\n * right before overwrite to avoid clobbering a concurrent edit.\n *\n * farseer push --force\n * Same as above, but:\n * \u2022 Skip step 2 (allow pushing over remote drift).\n * \u2022 Make remote mirror local: also delete any remote files that\n * have no local counterpart (not just ones you previously pulled).\n * Because --force is destructive, we always show the full plan\n * (including deletions of remote-only files) and require an explicit\n * \"yes\". `-y` won't bypass --force confirmation; you must answer the\n * prompt.\n */\nexport function registerPushCommand(program: Command): void {\n program\n .command('push [org] [tenant]')\n .description(\n 'Push local files to Farseer instance\\n\\nUsage: push <org> <tenant> OR push <tenant> (if org is known)',\n )\n .option(\n '--force',\n 'Force-mirror remote to local: overwrite remote drift AND delete remote files with no local counterpart (always asks for confirmation)',\n )\n .option('-y, --yes', 'Skip confirmation prompt for non-destructive pushes (ignored under --force)')\n .option(\n '--shallow',\n 'Skip the remote-content hash check in the pre-flight (faster on big tenants; trusts the last-pull baseline). Ignored under --force, where deep is required for correct mirror semantics.',\n )\n // Accept `--deep` as a no-op alias so 1.6.1-era scripts keep\n // working \u2014 deep is now the default; see status.ts for context.\n .option('--deep', '(Deprecated; now the default) Force the deep remote-content hash pre-flight')\n .option('--include-ext <ext>', 'Include extra file extension (repeatable)', collectValues, [])\n .option('--include-folder <folder>', 'Include all files in folder (repeatable)', collectValues, [])\n .option(\n '--only <path>',\n 'Only push the listed file(s) (repeatable, paths relative to tenant files dir, e.g. Scripts/foo.ts). Other local edits are not touched; the drift check still fires on these paths if remote has changed them.',\n collectValues,\n [],\n )\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!clientResult) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const filesDir = getTenantFilesDir(tenant);\n\n if (!fs.existsSync(filesDir)) {\n logger.error(`Local folder not found: farseer-apps/${tenant}/files/`);\n logger.dim('Run \"farseer pull <tenant>\" first to initialize the folder.');\n process.exit(1);\n }\n\n const syncService = new SyncService(tenant, clientResult.client);\n const includeExtensions = normalizeExtensions(options.includeExt);\n const includeFolders = options.includeFolder as string[];\n const onlyFiles = (options.only as string[]).map((p) => p.replace(/^\\/+/, ''));\n const syncFilterOptions = {\n includeExtensions: includeExtensions.length > 0 ? includeExtensions : undefined,\n includeFolders: includeFolders.length > 0 ? includeFolders : undefined,\n onlyFiles: onlyFiles.length > 0 ? onlyFiles : undefined,\n };\n\n // --only is a surgical-push escape hatch. Skip the apps path\n // entirely (which has its own drift logic that doesn't know\n // about file whitelists) and skip the remote-drift check \u2014\n // the user has narrowed the blast radius to a known set of\n // files, that's the whole point. Without this short-circuit\n // both the drift gate and apps push could touch things\n // outside the requested scope, defeating --only.\n const onlyMode = onlyFiles.length > 0;\n\n // Pre-flight: every --only path must resolve to a real file\n // under filesDir. Without this check, a typo (wrong case,\n // double slash, deleted file) silently produces \"Nothing to\n // push. Everything is in sync.\" \u2014 same exit code as a real\n // no-op, and the user assumes the push went through.\n // Traversal paths (`--only ../x`) join the same missing list\n // so the user gets one consolidated error.\n if (onlyMode) {\n const { missing } = validateOnlyFilePaths(filesDir, onlyFiles);\n if (missing.length > 0) {\n logger.error(`--only path(s) not found under ${filesDir}:`);\n for (const m of missing) console.log(chalk.red(` ${m}`));\n logger.dim('Paths are relative to the tenant files dir and case-sensitive.');\n process.exit(1);\n }\n }\n\n // Build a single status snapshot \u2014 same buckets the\n // `farseer status` command uses, so the user sees the same\n // categorisation in both places.\n //\n // Run a DEEP pre-flight by default. Shallow status can't see\n // remote-side content drift (it trusts our recorded baseline),\n // so without it we'd silently overwrite remote edits that\n // landed since the last pull. `--shallow` opts out for users\n // who explicitly want the faster path on large tenants.\n //\n // --force ALWAYS implies deep, overriding --shallow. Mirror\n // mode means \"make remote = local\" \u2014 we need to know the\n // current remote content to decide what to overwrite. A\n // shallow status would miss remote-side content drift and\n // silently no-op when local matches the baseline. Force +\n // shallow is a contradiction, so deep wins.\n const deep = !!options.force || !options.shallow;\n const status = await syncService.getStatus({\n ...syncFilterOptions,\n deep,\n });\n\n // Drift gate: non-force push must not silently overwrite\n // remote-side drift. Block here, after deep status has run,\n // so the user sees the actual remote drift paths and can\n // choose between pull (merge remote) or --force (mirror,\n // overwrite remote). All three remote-side buckets count as\n // drift \u2014 adds, deletes, and content edits.\n //\n // Suppressed under --only: that's an explicit narrow-scope\n // push and only fires the block if a remote-drift path\n // overlaps the requested set.\n if (!options.force) {\n const conflictingAdded = onlyMode\n ? status.addedRemotely.filter((p) => onlyFiles.includes(p))\n : status.addedRemotely;\n const conflictingDeleted = onlyMode\n ? status.deletedRemotely.filter((p) => onlyFiles.includes(p))\n : status.deletedRemotely;\n const conflictingModified = onlyMode\n ? status.modifiedRemotely.filter((p) => onlyFiles.includes(p))\n : status.modifiedRemotely;\n const totalConflicts = conflictingAdded.length + conflictingDeleted.length + conflictingModified.length;\n if (totalConflicts > 0) {\n logger.error(`Remote has changes for ${totalConflicts} file(s) since last pull:`);\n if (conflictingAdded.length > 0) {\n console.log(chalk.cyan(' New on remote (need to pull):'));\n for (const f of conflictingAdded) console.log(chalk.cyan(` + ${f}`));\n }\n if (conflictingDeleted.length > 0) {\n console.log(chalk.red(' Removed on remote (need to pull to clean local):'));\n for (const f of conflictingDeleted) console.log(chalk.red(` - ${f}`));\n }\n if (conflictingModified.length > 0) {\n console.log(chalk.yellow(' Modified on remote (need to pull to merge):'));\n for (const f of conflictingModified) console.log(chalk.yellow(` M ${f}`));\n }\n // Echo back the same scope flags the user passed so the\n // suggested pull command actually fetches the files\n // causing the drift. Without this, `farseer pull` runs\n // in default scope and the drift remains blocking.\n const scopeFlags: string[] = [];\n for (const ext of options.includeExt as string[]) scopeFlags.push(`--include-ext ${ext}`);\n for (const folder of options.includeFolder as string[])\n scopeFlags.push(`--include-folder \"${folder}\"`);\n const pullCmd = ['farseer pull', tenant, ...scopeFlags].filter(Boolean).join(' ');\n logger.dim(`Run \\`${pullCmd}\\` to merge remote changes, then push.`);\n logger.dim('Or use --force to mirror (overwrite remote with local).');\n process.exit(1);\n }\n }\n\n const plan = buildPushPlan(status, { force: !!options.force });\n const { filesToUpload, filesToDelete, remoteOnlyFiles, filesToRecreate, filesToOverwrite } = plan;\n\n // Apps are independent of the file pre-flight gate.\n // In --only mode we deliberately don't touch apps at all\n // (the user asked for a file-scoped push). Stub the app\n // status to \"nothing to do\" so downstream code can treat\n // the two modes uniformly.\n const appSyncService = new AppSyncService(tenant, clientResult.client);\n const appStatus = onlyMode\n ? { newLocal: [], newRemote: [], modified: [], synced: [] }\n : await appSyncService.getStatus();\n\n const hasConflicts = status.conflicts.length > 0;\n const hasFileChanges =\n filesToUpload.length > 0 || filesToDelete.length > 0 || remoteOnlyFiles.length > 0 || hasConflicts;\n const hasAppChanges = appStatus.newLocal.length > 0 || appStatus.modified.length > 0;\n\n if (!hasFileChanges && !hasAppChanges) {\n logger.success('Nothing to push. Everything is in sync.');\n return;\n }\n\n console.log();\n logger.header(options.force ? 'Mirror plan (--force):' : 'Changes to push:');\n\n if (status.addedLocally.length > 0) {\n for (const file of status.addedLocally) console.log(chalk.green(` + ${file}`));\n }\n if (status.modifiedLocally.length > 0) {\n for (const file of status.modifiedLocally) console.log(chalk.yellow(` M ${file}`));\n }\n if (filesToDelete.length > 0) {\n for (const file of filesToDelete) console.log(chalk.red(` - ${file}`));\n }\n if (remoteOnlyFiles.length > 0) {\n console.log(chalk.red.bold('Remote-only files that will be DELETED on remote:'));\n for (const file of remoteOnlyFiles) console.log(chalk.red(` - ${file} (remote only)`));\n }\n if (filesToRecreate.length > 0) {\n console.log(chalk.green.bold('Files deleted on remote that will be RECREATED:'));\n for (const file of filesToRecreate) console.log(chalk.green(` + ${file} (re-uploading local copy)`));\n }\n if (filesToOverwrite.length > 0) {\n console.log(chalk.yellow.bold('Files where remote drifted \u2014 local will OVERWRITE:'));\n for (const file of filesToOverwrite)\n console.log(chalk.yellow(` M ${file} (remote content drift; local wins)`));\n }\n\n // Conflicts surface BEFORE the confirmation prompt so the user\n // never confirms a plan that secretly contains skipped files.\n // Without --force these will be skipped (and the user can re-run\n // with `farseer pull` to resolve); under --force the upload step\n // will overwrite local\u2192remote anyway, but the user still deserves\n // to see what's affected.\n if (hasConflicts) {\n const headerText = options.force\n ? 'Conflicts (will be force-overwritten on remote):'\n : 'Conflicts (will be SKIPPED \u2014 pull first to resolve):';\n console.log(chalk.red.bold(headerText));\n for (const conflict of status.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n }\n\n if (appStatus.newLocal.length > 0) {\n console.log(chalk.green('New apps:'));\n for (const app of appStatus.newLocal) console.log(chalk.green(` + ${app}`));\n }\n if (appStatus.modified.length > 0) {\n console.log(chalk.yellow('Modified apps:'));\n for (const app of appStatus.modified) console.log(chalk.yellow(` ~ ${app}`));\n }\n\n // Pre-flight in the preview, BEFORE the confirm prompt. README\n // promises rejections show up in the plan; running pre-flight\n // only inside syncService.push() pushed them to AFTER the user\n // had already said \"yes\". Cost: every upload candidate is read\n // twice (preview + push). For big tenants this is measurable\n // but predictability is the user-visible contract \u2014 they'd\n // rather know about a 256-char-name reject before pressing\n // ENTER on a 200-file mirror push.\n const previewCandidates = [...filesToUpload, ...filesToRecreate, ...filesToOverwrite];\n const previewRejections = previewPushPlan(filesDir, previewCandidates);\n if (previewRejections.length > 0) {\n console.log();\n console.log(chalk.red.bold('Files that pre-flight will reject (skipped from upload):'));\n for (const r of previewRejections) {\n console.log(chalk.red(` \u2717 ${r.filePath}`));\n console.log(chalk.dim(` ${r.detail}`));\n if (r.hint) console.log(chalk.dim(` ${r.hint}`));\n }\n }\n\n console.log();\n\n // filesToUpload already includes filesToRecreate under --force,\n // so don't double-count.\n const totalChanges =\n filesToUpload.length +\n filesToDelete.length +\n remoteOnlyFiles.length +\n appStatus.newLocal.length +\n appStatus.modified.length;\n\n // Step 3: Confirm. --force always confirms (cannot be skipped\n // with -y) because mirror mode includes destructive deletes.\n //\n // Spell out every bucket in the prompt itself, not just the\n // total. A 200-overwrite + 2-delete mirror with the old\n // \"Mirror N change(s) (including K remote deletion(s))\"\n // headline read like \"small change\" \u2014 the eye-catching K\n // hid the bigger blast radius. The plan above the prompt is\n // already explicit; the prompt-line should match it.\n const confirmMessage = options.force\n ? `Mirror to ${tenant}: ${remoteOnlyFiles.length} remote deletion(s), ` +\n `${filesToOverwrite.length} drift overwrite(s), ${filesToRecreate.length} recreation(s), ` +\n `${status.addedLocally.length} new upload(s), ${status.modifiedLocally.length} local edit(s), ` +\n `${filesToDelete.length} local-rm deletion(s). This is destructive.`\n : `Push ${totalChanges} change(s) to ${tenant}?`;\n\n if (options.force || !options.yes) {\n const confirm = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'proceed',\n message: confirmMessage,\n default: !options.force,\n },\n ]);\n\n if (!confirm.proceed) {\n logger.info('Push cancelled.');\n return;\n }\n }\n\n // Ensure token is fresh before push operations (may have expired during user input)\n await ensureFreshToken(clientResult.client);\n\n try {\n // Mirror the service's actual return type so every field is\n // present and non-optional. The earlier hand-rolled inline\n // type marked conflicts/rejected/failed as optional, which\n // forced `?.length ?? 0` defensiveness at every read site\n // even though the service always returns those arrays.\n let result: Awaited<ReturnType<SyncService['push']>> = {\n uploaded: [],\n updated: [],\n deleted: [],\n unchanged: [],\n conflicts: [],\n rejected: [],\n failed: [],\n };\n\n if (hasFileChanges) {\n logger.info(`Pushing files to ${tenant}...`);\n // Pass syncFilterOptions so mirror-mode deletes honour\n // --include-folder / --include-ext scope. Without this\n // the preview's \"remote-only DELETE\" line and the actual\n // mirror step diverged for non-default extensions.\n //\n // Hand `status.remoteHashes` (populated when deep status\n // ran above, i.e. under --force) into service.push so\n // the candidate-content fetch skips files we already\n // have hashes for. Without it, --force re-downloaded\n // every remote file a second time inside push().\n result = await syncService.push({\n force: options.force,\n mirror: options.force,\n ...syncFilterOptions,\n precomputedRemoteHashes: status.remoteHashes,\n });\n\n console.log();\n\n if (result.rejected.length > 0) {\n console.log(chalk.red.bold('Files skipped (backend would reject):'));\n renderRejections(result.rejected);\n }\n\n if (result.conflicts.length > 0) {\n console.log(chalk.red.bold(`${result.conflicts.length} conflict(s) detected:`));\n for (const conflict of result.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n console.log();\n logger.dim(`Resolve conflicts by pulling first: farseer pull ${tenant}`);\n logger.dim('Or use --force to push anyway (overwrites remote and mirrors deletions).');\n console.log();\n }\n\n if (result.uploaded.length > 0) {\n console.log(chalk.green('Uploaded files (new):'));\n for (const file of result.uploaded) console.log(chalk.green(` + ${file}`));\n console.log();\n }\n\n if (result.updated.length > 0) {\n console.log(chalk.yellow('Updated files:'));\n for (const file of result.updated) console.log(chalk.yellow(` M ${file}`));\n console.log();\n }\n\n if (result.deleted.length > 0) {\n console.log(chalk.red('Deleted files:'));\n for (const file of result.deleted) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n if (result.failed.length > 0) {\n // Per-file errors that the backend rejected mid-flight\n // (5xx, validation we couldn't pre-flight, etc.).\n // Distinct from `rejected` (pre-flight) \u2014 these\n // already attempted the call. State for files that\n // succeeded before the failure has been saved.\n console.log(chalk.red.bold(`${result.failed.length} file(s) failed during push:`));\n for (const failure of result.failed) {\n console.log(chalk.red(` ! ${failure.filePath} (${failure.operation})`));\n console.log(chalk.dim(` ${failure.reason}`));\n }\n console.log();\n }\n }\n\n let appResult = {\n created: [] as string[],\n updated: [] as string[],\n deleted: [] as string[],\n unchanged: [] as string[],\n };\n\n if (hasAppChanges) {\n logger.info(`Pushing apps to ${tenant}...`);\n appResult = await appSyncService.push();\n\n if (appResult.created.length > 0) {\n console.log(chalk.green('Created apps:'));\n for (const app of appResult.created) console.log(chalk.green(` + ${app}`));\n console.log();\n }\n\n if (appResult.updated.length > 0) {\n console.log(chalk.yellow('Updated apps:'));\n for (const app of appResult.updated) console.log(chalk.yellow(` ~ ${app}`));\n console.log();\n }\n\n if (appResult.deleted.length > 0) {\n console.log(chalk.red('Deleted apps:'));\n for (const app of appResult.deleted) console.log(chalk.red(` - ${app}`));\n console.log();\n }\n }\n\n console.log();\n const fileSideEffects = result.uploaded.length + result.updated.length + result.deleted.length;\n const appSideEffects = appResult.created.length + appResult.updated.length + appResult.deleted.length;\n const conflictCount = result.conflicts.length;\n const rejectedCount = result.rejected.length;\n const failedCount = result.failed.length;\n if (fileSideEffects + appSideEffects === 0 && (conflictCount > 0 || rejectedCount > 0)) {\n // Nothing was actually pushed (every candidate hit a\n // conflict or pre-flight rejection). Surface as a\n // warning + EXIT 1 so CI and shell scripts can branch\n // \u2014 the bare \"Push complete!\" line was misleading.\n if (rejectedCount > 0 && conflictCount === 0) {\n logger.warning(`Push did nothing \u2014 ${rejectedCount} file(s) rejected by pre-flight.`);\n logger.dim('Fix the issues listed above and re-run `farseer push`.');\n } else if (conflictCount > 0 && rejectedCount === 0) {\n logger.warning(`Push did nothing \u2014 ${conflictCount} conflict(s) blocked the upload.`);\n logger.dim(`Resolve via 'farseer pull ${tenant}' or rerun with --force.`);\n } else {\n logger.warning(\n `Push did nothing \u2014 ${rejectedCount} file(s) rejected and ${conflictCount} conflict(s) blocked the upload.`,\n );\n }\n process.exit(1);\n }\n logger.success('Push complete!');\n logger.dim(`Files: +${result.uploaded.length} ~${result.updated.length} -${result.deleted.length}`);\n logger.dim(\n `Apps: +${appResult.created.length} ~${appResult.updated.length} -${appResult.deleted.length}`,\n );\n if (rejectedCount > 0 || failedCount > 0) {\n // Partial success: at least some side effects landed\n // but some candidates were skipped (rejected pre-flight)\n // or failed mid-push (network/backend error). EXIT 1\n // (not 2 \u2014 the previous split was undocumented and most\n // CI scripts treat any non-zero as failure anyway).\n if (rejectedCount > 0 && failedCount > 0) {\n logger.warning(\n `${rejectedCount} file(s) skipped pre-flight, ${failedCount} failed mid-push \u2014 see above and rerun.`,\n );\n } else if (rejectedCount > 0) {\n logger.warning(`${rejectedCount} file(s) skipped (see above) \u2014 fix and rerun.`);\n } else {\n logger.warning(`${failedCount} file(s) failed during push (see above) \u2014 rerun to retry.`);\n }\n process.exit(1);\n }\n } catch (error) {\n fileLogger.error('push', error, { tenant, organisation });\n logger.error('Push failed.');\n logger.error(await formatClientError(error));\n const logPath = fileLogger.getLogPath();\n if (logPath) {\n logger.dim(`Debug log: ${logPath}`);\n }\n process.exit(1);\n }\n });\n}\n\n/**\n * Translate a SyncStatus + force flag into the buckets the push command\n * actually acts on. Pure: takes a status, returns lists. Lives at the\n * top level (not inside the action closure) so it can be exported and\n * unit-tested directly \u2014 the status engine has its own coverage, and\n * before this extraction the bucket logic was inline in the action and\n * only reachable via mocking commander + inquirer + fs.\n *\n * Default push: upload the added/modified locally, delete the locally-\n * removed. Remote-side activity is not in scope (drift check refuses\n * before we reach this).\n *\n * Force push (mirror): also re-upload files the remote has lost\n * (deletedRemotely \u2192 recreate) and files the remote has drifted away\n * from (modifiedRemotely \u2192 local wins, overwrite). Plus mirror-deletes\n * remote files that have no local counterpart (addedRemotely).\n */\nexport function buildPushPlan(\n status: SyncStatus,\n options: { force: boolean },\n): {\n filesToUpload: string[];\n filesToDelete: string[];\n remoteOnlyFiles: string[];\n filesToRecreate: string[];\n filesToOverwrite: string[];\n} {\n return {\n filesToUpload: [\n ...status.addedLocally,\n ...status.modifiedLocally,\n ...(options.force ? status.deletedRemotely : []),\n ...(options.force ? status.modifiedRemotely : []),\n ],\n filesToDelete: [...status.deletedLocally],\n remoteOnlyFiles: options.force ? [...status.addedRemotely] : [],\n filesToRecreate: options.force ? [...status.deletedRemotely] : [],\n filesToOverwrite: options.force ? [...status.modifiedRemotely] : [],\n };\n}\n\nfunction renderRejections(rejections: ValidationFailure[]): void {\n for (const r of rejections) {\n console.log(chalk.red(` x ${r.filePath}`));\n console.log(chalk.dim(` ${r.detail}`));\n if (r.hint) console.log(chalk.dim(` ${r.hint}`));\n }\n console.log();\n}\n\n/**\n * Run pre-flight against a list of upload candidates and return only the\n * rejections so the preview can show them BEFORE the confirm prompt. We\n * read each file once here; syncService.push() reads them again at upload\n * time. The duplicate read is the price of putting rejections into the\n * confirmation plan \u2014 without this, the user only learned about rejected\n * files after pressing ENTER, which contradicted the README.\n *\n * Files that fail to read (permission errors, race with deletion) get\n * skipped \u2014 push() will surface that as a real failure if the file\n * actually still mattered.\n */\nfunction previewPushPlan(filesDir: string, candidates: string[]): ValidationFailure[] {\n const validationInputs: { filePath: string; size: number; content: Buffer }[] = [];\n for (const filePath of candidates) {\n try {\n const fullPath = safeResolveWithinBase(filesDir, filePath);\n const content = fs.readFileSync(fullPath);\n validationInputs.push({ filePath, size: content.length, content });\n } catch {\n // Race: file disappeared between getStatus and the preview\n // read, or unreadable. Push() will see the same condition\n // and surface a real error. Don't pretend to know more here.\n continue;\n }\n }\n const { rejected } = partitionForUpload(validationInputs);\n return rejected;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,sBAAqB;AACrB,oBAAuB;AACvB,wBAA2B;AAC3B,4BAAgF;AAChF,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAKO;AACP,4BAAkC;AAClC,4BAAsD;AACtD,wBAAmD;AAEnD,SAAoB;AA4Bb,SAAS,oBAAoB,SAAwB;AACxD,UACK,QAAQ,qBAAqB,EAC7B;AAAA,IACG;AAAA,EACJ,EACC;AAAA,IACG;AAAA,IACA;AAAA,EACJ,EACC,OAAO,aAAa,6EAA6E,EACjG;AAAA,IACG;AAAA,IACA;AAAA,EACJ,EAGC,OAAO,UAAU,6EAA6E,EAC9F,OAAO,uBAAuB,6CAA6C,iCAAe,CAAC,CAAC,EAC5F,OAAO,6BAA6B,4CAA4C,iCAAe,CAAC,CAAC,EACjG;AAAA,IACG;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC;AAAA,EACL,EACC,OAAO,OAAO,MAAM,MAAM,YAAY;AACnC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,MAAM,IAAI;AACvE,UAAM,eAAe,UAAM,oDAA6B,cAAc,MAAM;AAE5E,QAAI,CAAC,cAAc;AACf,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,eAAW,kCAAkB,MAAM;AAEzC,QAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC1B,2BAAO,MAAM,wCAAwC,MAAM,SAAS;AACpE,2BAAO,IAAI,6DAA6D;AACxE,cAAQ,KAAK,CAAC;AAAA,IAClB;AA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;AACzD,YAAM,UAAU,GAAG,aAAa,QAAQ;AACxC,uBAAiB,KAAK,EAAE,UAAU,MAAM,QAAQ,QAAQ,QAAQ,CAAC;AAAA,IACrE,QAAQ;AAIJ;AAAA,IACJ;AAAA,EACJ;AACA,QAAM,EAAE,SAAS,QAAI,0CAAmB,gBAAgB;AACxD,SAAO;AACX;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport inquirer from 'inquirer';\nimport { logger } from '../utils/logger';\nimport { fileLogger } from '../utils/fileLogger';\nimport { getFarseerClientWithFallback, showLoginPrompt, ensureFreshToken } from '../services/farseerFactory';\nimport { SyncService } from '../services/syncService';\nimport { AppSyncService } from '../services/appSyncService';\nimport {\n getTenantFilesDir,\n resolveTenantWithOrgMapping,\n safeResolveWithinBase,\n validateOnlyFilePaths,\n displayLocalPath,\n} from '../utils/helpers';\nimport { formatClientError } from '../utils/errorFormatter';\nimport { ValidationFailure, partitionForUpload } from '../utils/fileValidation';\nimport { collectValues, normalizeExtensions, normalizeRelativePath } from '../utils/cliOptions';\nimport { reportIgnoredLocal } from '../utils/syncReporting';\nimport type { SyncStatus } from '../services/syncService';\nimport * as fs from 'fs';\n\n/**\n * Push semantics (in plain English, since this is the easiest part of the\n * CLI to misunderstand):\n *\n * farseer push\n * 1. Pre-flight: refuse local files that the backend will reject\n * (extension whitelist, name length, empty body). Print them and\n * exit non-zero so the user fixes them before we touch the network.\n * 2. Compare local vs remote (no remote download \u2014 we trust the\n * recorded sync baseline). If remote diverged from baseline,\n * refuse and ask the user to pull first.\n * 3. Show a diff (added / modified / deleted).\n * 4. Confirm.\n * 5. Upload modified files. Re-check each one against current remote\n * right before overwrite to avoid clobbering a concurrent edit.\n *\n * farseer push --force\n * Same as above, but:\n * \u2022 Skip step 2 (allow pushing over remote drift).\n * \u2022 Make remote mirror local: also delete any remote files that\n * have no local counterpart (not just ones you previously pulled).\n * Because --force is destructive, we always show the full plan\n * (including deletions of remote-only files) and require an explicit\n * \"yes\". `-y` won't bypass --force confirmation; you must answer the\n * prompt.\n */\nexport function registerPushCommand(program: Command): void {\n program\n .command('push [org] [tenant]')\n .description(\n 'Push local files to Farseer instance\\n\\nUsage: push <org> <tenant> OR push <tenant> (if org is known)',\n )\n .option(\n '--force',\n 'Force-mirror remote to local: overwrite remote drift AND delete remote files with no local counterpart (always asks for confirmation)',\n )\n .option('-y, --yes', 'Skip confirmation prompt for non-destructive pushes (ignored under --force)')\n .option(\n '--shallow',\n 'Skip the remote-content hash check in the pre-flight (faster on big tenants; trusts the last-pull baseline). Ignored under --force, where deep is required for correct mirror semantics.',\n )\n // Accept `--deep` as a no-op alias so 1.6.1-era scripts keep\n // working \u2014 deep is now the default; see status.ts for context.\n .option('--deep', '(Deprecated; now the default) Force the deep remote-content hash pre-flight')\n .option('--include-ext <ext>', 'Include extra file extension (repeatable)', collectValues, [])\n .option('--include-folder <folder>', 'Include all files in folder (repeatable)', collectValues, [])\n .option(\n '--only <path>',\n 'Only push the listed file(s) (repeatable, paths relative to tenant files dir, e.g. Scripts/foo.ts). Other local edits are not touched; the drift check still fires on these paths if remote has changed them.',\n collectValues,\n [],\n )\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!clientResult) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const filesDir = getTenantFilesDir(tenant);\n\n if (!fs.existsSync(filesDir)) {\n logger.error(`Local folder not found: ${displayLocalPath(filesDir)}`);\n logger.dim('Run \"farseer pull <tenant>\" first to initialize the folder.');\n process.exit(1);\n }\n\n const syncService = new SyncService(tenant, clientResult.client);\n const includeExtensions = normalizeExtensions(options.includeExt);\n const includeFolders = options.includeFolder as string[];\n // POSIX-normalise: the sync engine canonicalises every candidate\n // to forward slashes before include/onlyFiles matching, so a\n // Windows user typing `--only Scripts\\foo.ts` would otherwise\n // miss the comparison and the file would silently fall out of\n // scope.\n const onlyFiles = (options.only as string[]).map(normalizeRelativePath);\n const syncFilterOptions = {\n includeExtensions: includeExtensions.length > 0 ? includeExtensions : undefined,\n includeFolders: includeFolders.length > 0 ? includeFolders : undefined,\n onlyFiles: onlyFiles.length > 0 ? onlyFiles : undefined,\n };\n\n // --only is a surgical-push escape hatch. Skip the apps path\n // entirely (which has its own drift logic that doesn't know\n // about file whitelists) and skip the remote-drift check \u2014\n // the user has narrowed the blast radius to a known set of\n // files, that's the whole point. Without this short-circuit\n // both the drift gate and apps push could touch things\n // outside the requested scope, defeating --only.\n const onlyMode = onlyFiles.length > 0;\n\n // Pre-flight: every --only path must resolve to a real file\n // under filesDir. Without this check, a typo (wrong case,\n // double slash, deleted file) silently produces \"Nothing to\n // push. Everything is in sync.\" \u2014 same exit code as a real\n // no-op, and the user assumes the push went through.\n // Traversal paths (`--only ../x`) join the same missing list\n // so the user gets one consolidated error.\n if (onlyMode) {\n const { missing } = validateOnlyFilePaths(filesDir, onlyFiles);\n if (missing.length > 0) {\n logger.error(`--only path(s) not found under ${filesDir}:`);\n for (const m of missing) console.log(chalk.red(` ${m}`));\n logger.dim('Paths are relative to the tenant files dir and case-sensitive.');\n process.exit(1);\n }\n }\n\n // Build a single status snapshot \u2014 same buckets the\n // `farseer status` command uses, so the user sees the same\n // categorisation in both places.\n //\n // Run a DEEP pre-flight by default. Shallow status can't see\n // remote-side content drift (it trusts our recorded baseline),\n // so without it we'd silently overwrite remote edits that\n // landed since the last pull. `--shallow` opts out for users\n // who explicitly want the faster path on large tenants.\n //\n // --force ALWAYS implies deep, overriding --shallow. Mirror\n // mode means \"make remote = local\" \u2014 we need to know the\n // current remote content to decide what to overwrite. A\n // shallow status would miss remote-side content drift and\n // silently no-op when local matches the baseline. Force +\n // shallow is a contradiction, so deep wins.\n const deep = !!options.force || !options.shallow;\n const status = await syncService.getStatus({\n ...syncFilterOptions,\n deep,\n });\n\n // Drift gate: non-force push must not silently overwrite\n // remote-side drift. Block here, after deep status has run,\n // so the user sees the actual remote drift paths and can\n // choose between pull (merge remote) or --force (mirror,\n // overwrite remote). All three remote-side buckets count as\n // drift \u2014 adds, deletes, and content edits.\n //\n // Suppressed under --only: that's an explicit narrow-scope\n // push and only fires the block if a remote-drift path\n // overlaps the requested set.\n if (!options.force) {\n const conflictingAdded = onlyMode\n ? status.addedRemotely.filter((p) => onlyFiles.includes(p))\n : status.addedRemotely;\n const conflictingDeleted = onlyMode\n ? status.deletedRemotely.filter((p) => onlyFiles.includes(p))\n : status.deletedRemotely;\n const conflictingModified = onlyMode\n ? status.modifiedRemotely.filter((p) => onlyFiles.includes(p))\n : status.modifiedRemotely;\n const totalConflicts = conflictingAdded.length + conflictingDeleted.length + conflictingModified.length;\n if (totalConflicts > 0) {\n logger.error(`Remote has changes for ${totalConflicts} file(s) since last pull:`);\n if (conflictingAdded.length > 0) {\n console.log(chalk.cyan(' New on remote (need to pull):'));\n for (const f of conflictingAdded) console.log(chalk.cyan(` + ${f}`));\n }\n if (conflictingDeleted.length > 0) {\n console.log(chalk.red(' Removed on remote (need to pull to clean local):'));\n for (const f of conflictingDeleted) console.log(chalk.red(` - ${f}`));\n }\n if (conflictingModified.length > 0) {\n console.log(chalk.yellow(' Modified on remote (need to pull to merge):'));\n for (const f of conflictingModified) console.log(chalk.yellow(` M ${f}`));\n }\n // Echo back the same scope flags the user passed so the\n // suggested pull command actually fetches the files\n // causing the drift. Without this, `farseer pull` runs\n // in default scope and the drift remains blocking.\n const scopeFlags: string[] = [];\n for (const ext of options.includeExt as string[]) scopeFlags.push(`--include-ext ${ext}`);\n for (const folder of options.includeFolder as string[])\n scopeFlags.push(`--include-folder \"${folder}\"`);\n const pullCmd = ['farseer pull', tenant, ...scopeFlags].filter(Boolean).join(' ');\n logger.dim(`Run \\`${pullCmd}\\` to merge remote changes, then push.`);\n logger.dim('Or use --force to mirror (overwrite remote with local).');\n process.exit(1);\n }\n }\n\n const plan = buildPushPlan(status, { force: !!options.force });\n const { filesToUpload, filesToDelete, remoteOnlyFiles, filesToRecreate, filesToOverwrite } = plan;\n\n // Apps are independent of the file pre-flight gate.\n // In --only mode we deliberately don't touch apps at all\n // (the user asked for a file-scoped push). Stub the app\n // status to \"nothing to do\" so downstream code can treat\n // the two modes uniformly.\n const appSyncService = new AppSyncService(tenant, clientResult.client);\n const appStatus = onlyMode\n ? { newLocal: [], newRemote: [], modified: [], synced: [] }\n : await appSyncService.getStatus();\n\n const hasConflicts = status.conflicts.length > 0;\n const hasFileChanges =\n filesToUpload.length > 0 || filesToDelete.length > 0 || remoteOnlyFiles.length > 0 || hasConflicts;\n const hasAppChanges = appStatus.newLocal.length > 0 || appStatus.modified.length > 0;\n\n if (!hasFileChanges && !hasAppChanges) {\n // Print the out-of-scope warning BEFORE the success line\n // so the \"within current scope\" qualifier reads as a\n // follow-up to the count the user just saw, not a\n // contradiction of a bare \"Nothing to push\" message.\n reportIgnoredLocal(status.ignoredLocal, status.ignoredLocalTotal);\n if (status.ignoredLocalTotal > 0) {\n logger.success('Everything is in sync within current scope.');\n logger.dim(\n `(${status.ignoredLocalTotal} file(s) outside scope were not compared \u2014 see warning above for details.)`,\n );\n } else {\n logger.success('Nothing to push. Everything is in sync.');\n }\n return;\n }\n\n console.log();\n logger.header(options.force ? 'Mirror plan (--force):' : 'Changes to push:');\n\n if (status.addedLocally.length > 0) {\n for (const file of status.addedLocally) console.log(chalk.green(` + ${file}`));\n }\n if (status.modifiedLocally.length > 0) {\n for (const file of status.modifiedLocally) console.log(chalk.yellow(` M ${file}`));\n }\n if (filesToDelete.length > 0) {\n for (const file of filesToDelete) console.log(chalk.red(` - ${file}`));\n }\n if (remoteOnlyFiles.length > 0) {\n console.log(chalk.red.bold('Remote-only files that will be DELETED on remote:'));\n for (const file of remoteOnlyFiles) console.log(chalk.red(` - ${file} (remote only)`));\n }\n if (filesToRecreate.length > 0) {\n console.log(chalk.green.bold('Files deleted on remote that will be RECREATED:'));\n for (const file of filesToRecreate) console.log(chalk.green(` + ${file} (re-uploading local copy)`));\n }\n if (filesToOverwrite.length > 0) {\n console.log(chalk.yellow.bold('Files where remote drifted \u2014 local will OVERWRITE:'));\n for (const file of filesToOverwrite)\n console.log(chalk.yellow(` M ${file} (remote content drift; local wins)`));\n }\n\n // Surface scope-skipped files BEFORE the confirmation prompt so\n // the user never confirms a push thinking it covers everything in\n // the workspace when in fact .md / .json / .py etc. were silently\n // excluded by the default whitelist.\n reportIgnoredLocal(status.ignoredLocal, status.ignoredLocalTotal);\n\n // Conflicts surface BEFORE the confirmation prompt so the user\n // never confirms a plan that secretly contains skipped files.\n // Without --force these will be skipped (and the user can re-run\n // with `farseer pull` to resolve); under --force the upload step\n // will overwrite local\u2192remote anyway, but the user still deserves\n // to see what's affected.\n if (hasConflicts) {\n const headerText = options.force\n ? 'Conflicts (will be force-overwritten on remote):'\n : 'Conflicts (will be SKIPPED \u2014 pull first to resolve):';\n console.log(chalk.red.bold(headerText));\n for (const conflict of status.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n }\n\n if (appStatus.newLocal.length > 0) {\n console.log(chalk.green('New apps:'));\n for (const app of appStatus.newLocal) console.log(chalk.green(` + ${app}`));\n }\n if (appStatus.modified.length > 0) {\n console.log(chalk.yellow('Modified apps:'));\n for (const app of appStatus.modified) console.log(chalk.yellow(` ~ ${app}`));\n }\n\n // Pre-flight in the preview, BEFORE the confirm prompt. README\n // promises rejections show up in the plan; running pre-flight\n // only inside syncService.push() pushed them to AFTER the user\n // had already said \"yes\". Cost: every upload candidate is read\n // twice (preview + push). For big tenants this is measurable\n // but predictability is the user-visible contract \u2014 they'd\n // rather know about a 256-char-name reject before pressing\n // ENTER on a 200-file mirror push.\n const previewCandidates = [...filesToUpload, ...filesToRecreate, ...filesToOverwrite];\n const previewRejections = previewPushPlan(filesDir, previewCandidates);\n if (previewRejections.length > 0) {\n console.log();\n console.log(chalk.red.bold('Files that pre-flight will reject (skipped from upload):'));\n for (const r of previewRejections) {\n console.log(chalk.red(` \u2717 ${r.filePath}`));\n console.log(chalk.dim(` ${r.detail}`));\n if (r.hint) console.log(chalk.dim(` ${r.hint}`));\n }\n }\n\n console.log();\n\n // filesToUpload already includes filesToRecreate under --force,\n // so don't double-count.\n const totalChanges =\n filesToUpload.length +\n filesToDelete.length +\n remoteOnlyFiles.length +\n appStatus.newLocal.length +\n appStatus.modified.length;\n\n // Step 3: Confirm. --force always confirms (cannot be skipped\n // with -y) because mirror mode includes destructive deletes.\n //\n // Spell out every bucket in the prompt itself, not just the\n // total. A 200-overwrite + 2-delete mirror with the old\n // \"Mirror N change(s) (including K remote deletion(s))\"\n // headline read like \"small change\" \u2014 the eye-catching K\n // hid the bigger blast radius. The plan above the prompt is\n // already explicit; the prompt-line should match it.\n const confirmMessage = options.force\n ? `Mirror to ${tenant}: ${remoteOnlyFiles.length} remote deletion(s), ` +\n `${filesToOverwrite.length} drift overwrite(s), ${filesToRecreate.length} recreation(s), ` +\n `${status.addedLocally.length} new upload(s), ${status.modifiedLocally.length} local edit(s), ` +\n `${filesToDelete.length} local-rm deletion(s). This is destructive.`\n : `Push ${totalChanges} change(s) to ${tenant}?`;\n\n if (options.force || !options.yes) {\n const confirm = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'proceed',\n message: confirmMessage,\n default: !options.force,\n },\n ]);\n\n if (!confirm.proceed) {\n logger.info('Push cancelled.');\n return;\n }\n }\n\n // Ensure token is fresh before push operations (may have expired during user input)\n await ensureFreshToken(clientResult.client);\n\n try {\n // Mirror the service's actual return type so every field is\n // present and non-optional. The earlier hand-rolled inline\n // type marked conflicts/rejected/failed as optional, which\n // forced `?.length ?? 0` defensiveness at every read site\n // even though the service always returns those arrays.\n let result: Awaited<ReturnType<SyncService['push']>> = {\n uploaded: [],\n updated: [],\n deleted: [],\n unchanged: [],\n conflicts: [],\n rejected: [],\n failed: [],\n ignoredLocal: [],\n ignoredLocalTotal: 0,\n ignoredLocalTotalByReason: { unsupportedExtension: 0, blocklistedFolder: 0 },\n };\n\n if (hasFileChanges) {\n logger.info(`Pushing files to ${tenant}...`);\n // Pass syncFilterOptions so mirror-mode deletes honour\n // --include-folder / --include-ext scope. Without this\n // the preview's \"remote-only DELETE\" line and the actual\n // mirror step diverged for non-default extensions.\n //\n // Hand `status.remoteHashes` (populated when deep status\n // ran above, i.e. under --force) into service.push so\n // the candidate-content fetch skips files we already\n // have hashes for. Without it, --force re-downloaded\n // every remote file a second time inside push().\n result = await syncService.push({\n force: options.force,\n mirror: options.force,\n ...syncFilterOptions,\n precomputedRemoteHashes: status.remoteHashes,\n });\n\n console.log();\n\n if (result.rejected.length > 0) {\n console.log(chalk.red.bold('Files skipped (backend would reject):'));\n renderRejections(result.rejected);\n }\n\n if (result.conflicts.length > 0) {\n console.log(chalk.red.bold(`${result.conflicts.length} conflict(s) detected:`));\n for (const conflict of result.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n console.log();\n logger.dim(`Resolve conflicts by pulling first: farseer pull ${tenant}`);\n logger.dim('Or use --force to push anyway (overwrites remote and mirrors deletions).');\n console.log();\n }\n\n if (result.uploaded.length > 0) {\n console.log(chalk.green('Uploaded files (new):'));\n for (const file of result.uploaded) console.log(chalk.green(` + ${file}`));\n console.log();\n }\n\n if (result.updated.length > 0) {\n console.log(chalk.yellow('Updated files:'));\n for (const file of result.updated) console.log(chalk.yellow(` M ${file}`));\n console.log();\n }\n\n if (result.deleted.length > 0) {\n console.log(chalk.red('Deleted files:'));\n for (const file of result.deleted) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n if (result.failed.length > 0) {\n // Per-file errors that the backend rejected mid-flight\n // (5xx, validation we couldn't pre-flight, etc.).\n // Distinct from `rejected` (pre-flight) \u2014 these\n // already attempted the call. State for files that\n // succeeded before the failure has been saved.\n console.log(chalk.red.bold(`${result.failed.length} file(s) failed during push:`));\n for (const failure of result.failed) {\n console.log(chalk.red(` ! ${failure.filePath} (${failure.operation})`));\n console.log(chalk.dim(` ${failure.reason}`));\n }\n console.log();\n }\n }\n\n let appResult = {\n created: [] as string[],\n updated: [] as string[],\n deleted: [] as string[],\n unchanged: [] as string[],\n };\n\n if (hasAppChanges) {\n logger.info(`Pushing apps to ${tenant}...`);\n appResult = await appSyncService.push();\n\n if (appResult.created.length > 0) {\n console.log(chalk.green('Created apps:'));\n for (const app of appResult.created) console.log(chalk.green(` + ${app}`));\n console.log();\n }\n\n if (appResult.updated.length > 0) {\n console.log(chalk.yellow('Updated apps:'));\n for (const app of appResult.updated) console.log(chalk.yellow(` ~ ${app}`));\n console.log();\n }\n\n if (appResult.deleted.length > 0) {\n console.log(chalk.red('Deleted apps:'));\n for (const app of appResult.deleted) console.log(chalk.red(` - ${app}`));\n console.log();\n }\n }\n\n console.log();\n const fileSideEffects = result.uploaded.length + result.updated.length + result.deleted.length;\n const appSideEffects = appResult.created.length + appResult.updated.length + appResult.deleted.length;\n const conflictCount = result.conflicts.length;\n const rejectedCount = result.rejected.length;\n const failedCount = result.failed.length;\n if (fileSideEffects + appSideEffects === 0 && (conflictCount > 0 || rejectedCount > 0)) {\n // Nothing was actually pushed (every candidate hit a\n // conflict or pre-flight rejection). Surface as a\n // warning + EXIT 1 so CI and shell scripts can branch\n // \u2014 the bare \"Push complete!\" line was misleading.\n if (rejectedCount > 0 && conflictCount === 0) {\n logger.warning(`Push did nothing \u2014 ${rejectedCount} file(s) rejected by pre-flight.`);\n logger.dim('Fix the issues listed above and re-run `farseer push`.');\n } else if (conflictCount > 0 && rejectedCount === 0) {\n logger.warning(`Push did nothing \u2014 ${conflictCount} conflict(s) blocked the upload.`);\n logger.dim(`Resolve via 'farseer pull ${tenant}' or rerun with --force.`);\n } else {\n logger.warning(\n `Push did nothing \u2014 ${rejectedCount} file(s) rejected and ${conflictCount} conflict(s) blocked the upload.`,\n );\n }\n process.exit(1);\n }\n logger.success('Push complete!');\n logger.dim(`Files: +${result.uploaded.length} ~${result.updated.length} -${result.deleted.length}`);\n logger.dim(\n `Apps: +${appResult.created.length} ~${appResult.updated.length} -${appResult.deleted.length}`,\n );\n if (rejectedCount > 0 || failedCount > 0) {\n // Partial success: at least some side effects landed\n // but some candidates were skipped (rejected pre-flight)\n // or failed mid-push (network/backend error). EXIT 1\n // (not 2 \u2014 the previous split was undocumented and most\n // CI scripts treat any non-zero as failure anyway).\n if (rejectedCount > 0 && failedCount > 0) {\n logger.warning(\n `${rejectedCount} file(s) skipped pre-flight, ${failedCount} failed mid-push \u2014 see above and rerun.`,\n );\n } else if (rejectedCount > 0) {\n logger.warning(`${rejectedCount} file(s) skipped (see above) \u2014 fix and rerun.`);\n } else {\n logger.warning(`${failedCount} file(s) failed during push (see above) \u2014 rerun to retry.`);\n }\n process.exit(1);\n }\n } catch (error) {\n fileLogger.error('push', error, { tenant, organisation });\n logger.error('Push failed.');\n logger.error(await formatClientError(error));\n const logPath = fileLogger.getLogPath();\n if (logPath) {\n logger.dim(`Debug log: ${logPath}`);\n }\n process.exit(1);\n }\n });\n}\n\n/**\n * Translate a SyncStatus + force flag into the buckets the push command\n * actually acts on. Pure: takes a status, returns lists. Lives at the\n * top level (not inside the action closure) so it can be exported and\n * unit-tested directly \u2014 the status engine has its own coverage, and\n * before this extraction the bucket logic was inline in the action and\n * only reachable via mocking commander + inquirer + fs.\n *\n * Default push: upload the added/modified locally, delete the locally-\n * removed. Remote-side activity is not in scope (drift check refuses\n * before we reach this).\n *\n * Force push (mirror): also re-upload files the remote has lost\n * (deletedRemotely \u2192 recreate) and files the remote has drifted away\n * from (modifiedRemotely \u2192 local wins, overwrite). Plus mirror-deletes\n * remote files that have no local counterpart (addedRemotely).\n */\nexport function buildPushPlan(\n status: SyncStatus,\n options: { force: boolean },\n): {\n filesToUpload: string[];\n filesToDelete: string[];\n remoteOnlyFiles: string[];\n filesToRecreate: string[];\n filesToOverwrite: string[];\n} {\n return {\n filesToUpload: [\n ...status.addedLocally,\n ...status.modifiedLocally,\n ...(options.force ? status.deletedRemotely : []),\n ...(options.force ? status.modifiedRemotely : []),\n ],\n filesToDelete: [...status.deletedLocally],\n remoteOnlyFiles: options.force ? [...status.addedRemotely] : [],\n filesToRecreate: options.force ? [...status.deletedRemotely] : [],\n filesToOverwrite: options.force ? [...status.modifiedRemotely] : [],\n };\n}\n\nfunction renderRejections(rejections: ValidationFailure[]): void {\n for (const r of rejections) {\n console.log(chalk.red(` x ${r.filePath}`));\n console.log(chalk.dim(` ${r.detail}`));\n if (r.hint) console.log(chalk.dim(` ${r.hint}`));\n }\n console.log();\n}\n\n/**\n * Run pre-flight against a list of upload candidates and return only the\n * rejections so the preview can show them BEFORE the confirm prompt. We\n * read each file once here; syncService.push() reads them again at upload\n * time. The duplicate read is the price of putting rejections into the\n * confirmation plan \u2014 without this, the user only learned about rejected\n * files after pressing ENTER, which contradicted the README.\n *\n * Files that fail to read (permission errors, race with deletion) get\n * skipped \u2014 push() will surface that as a real failure if the file\n * actually still mattered.\n */\nfunction previewPushPlan(filesDir: string, candidates: string[]): ValidationFailure[] {\n const validationInputs: { filePath: string; size: number; content: Buffer }[] = [];\n for (const filePath of candidates) {\n try {\n const fullPath = safeResolveWithinBase(filesDir, filePath);\n const content = fs.readFileSync(fullPath);\n validationInputs.push({ filePath, size: content.length, content });\n } catch {\n // Race: file disappeared between getStatus and the preview\n // read, or unreadable. Push() will see the same condition\n // and surface a real error. Don't pretend to know more here.\n continue;\n }\n }\n const { rejected } = partitionForUpload(validationInputs);\n return rejected;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,sBAAqB;AACrB,oBAAuB;AACvB,wBAA2B;AAC3B,4BAAgF;AAChF,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAMO;AACP,4BAAkC;AAClC,4BAAsD;AACtD,wBAA0E;AAC1E,2BAAmC;AAEnC,SAAoB;AA4Bb,SAAS,oBAAoB,SAAwB;AACxD,UACK,QAAQ,q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0CAAmB,gBAAgB;AACxD,SAAO;AACX;",
6
6
  "names": ["chalk", "inquirer"]
7
7
  }
@@ -38,11 +38,15 @@ var import_syncService = require("../services/syncService");
38
38
  var import_appSyncService = require("../services/appSyncService");
39
39
  var import_helpers = require("../utils/helpers");
40
40
  var import_cliOptions = require("../utils/cliOptions");
41
+ var import_syncReporting = require("../utils/syncReporting");
41
42
  var fs = __toESM(require("fs"));
42
43
  function registerStatusCommand(program) {
43
44
  program.command("status [org] [tenant]").description(
44
45
  "Show sync status between local and remote\n\nUsage: status <org> <tenant> OR status <tenant> (if org is known)"
45
- ).option("--all", "Show status for all files (default: only scripts .ts, .js)").option(
46
+ ).option(
47
+ "--all",
48
+ "Show status for every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist). Data files (.csv, .xlsx, .parquet, \u2026) are backend-accepted but excluded from default \u2014 opt in via --include-ext .csv or `farseer config include --ext .csv`."
49
+ ).option(
46
50
  "--shallow",
47
51
  "Skip remote-content hashing (faster; trusts the last-sync baseline, will miss edits to existing remote files)"
48
52
  ).option("--deep", "(Deprecated; now the default) Hash remote content to detect remote-side edits").option("--include-ext <ext>", "Include extra file extension (repeatable)", import_cliOptions.collectValues, []).option("--include-folder <folder>", "Include all files in folder (repeatable)", import_cliOptions.collectValues, []).action(async (arg1, arg2, options) => {
@@ -53,12 +57,13 @@ function registerStatusCommand(program) {
53
57
  process.exit(1);
54
58
  }
55
59
  const filesDir = (0, import_helpers.getTenantFilesDir)(tenant);
60
+ const localPathDisplay = (0, import_helpers.displayLocalPath)(filesDir);
56
61
  if (!fs.existsSync(filesDir)) {
57
- import_logger.logger.warning(`Local folder not found: apps/${tenant}/files/`);
62
+ import_logger.logger.warning(`Local folder not found: ${localPathDisplay}`);
58
63
  import_logger.logger.dim('Run "farseer pull <tenant>" to download files from the instance.');
59
64
  return;
60
65
  }
61
- import_logger.logger.info(`Comparing local (apps/${tenant}/files/) with remote (Files/)...`);
66
+ import_logger.logger.info(`Comparing local (${localPathDisplay}) with remote (Files/)...`);
62
67
  console.log();
63
68
  const syncService = new import_syncService.SyncService(tenant, clientResult.client);
64
69
  try {
@@ -76,8 +81,16 @@ function registerStatusCommand(program) {
76
81
  const hasAppChanges = appStatus.newLocal.length > 0 || appStatus.newRemote.length > 0 || appStatus.modified.length > 0;
77
82
  const hasChanges = status.modifiedLocally.length > 0 || status.modifiedRemotely.length > 0 || status.addedLocally.length > 0 || status.addedRemotely.length > 0 || status.deletedLocally.length > 0 || status.deletedRemotely.length > 0 || status.conflicts.length > 0 || hasAppChanges;
78
83
  if (!hasChanges) {
84
+ (0, import_syncReporting.reportIgnoredLocal)(status.ignoredLocal, status.ignoredLocalTotal);
79
85
  if (status.deepCompare) {
80
- import_logger.logger.success("Everything is in sync!");
86
+ if (status.ignoredLocalTotal > 0) {
87
+ import_logger.logger.success("Everything is in sync within current scope.");
88
+ import_logger.logger.dim(
89
+ `(${status.ignoredLocalTotal} file(s) outside scope were not compared \u2014 see warning above for details.)`
90
+ );
91
+ } else {
92
+ import_logger.logger.success("Everything is in sync!");
93
+ }
81
94
  } else {
82
95
  import_logger.logger.info("Local matches the last-pull baseline.");
83
96
  import_logger.logger.dim(
@@ -150,6 +163,7 @@ function registerStatusCommand(program) {
150
163
  import_logger.logger.dim(`${appStatus.synced.length} app(s) in sync.`);
151
164
  }
152
165
  console.log();
166
+ (0, import_syncReporting.reportIgnoredLocal)(status.ignoredLocal, status.ignoredLocalTotal);
153
167
  if (!status.deepCompare) {
154
168
  import_logger.logger.dim("--shallow: remote-content edits to existing files were NOT checked.");
155
169
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/status.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt } from '../services/farseerFactory';\nimport { SyncService } from '../services/syncService';\nimport { AppSyncService } from '../services/appSyncService';\nimport { getTenantFilesDir, resolveTenantWithOrgMapping } from '../utils/helpers';\nimport { collectValues, normalizeExtensions } from '../utils/cliOptions';\nimport * as fs from 'fs';\n\nexport function registerStatusCommand(program: Command): void {\n program\n .command('status [org] [tenant]')\n .description(\n 'Show sync status between local and remote\\n\\nUsage: status <org> <tenant> OR status <tenant> (if org is known)',\n )\n .option('--all', 'Show status for all files (default: only scripts .ts, .js)')\n .option(\n '--shallow',\n 'Skip remote-content hashing (faster; trusts the last-sync baseline, will miss edits to existing remote files)',\n )\n // `--deep` was the opt-IN flag in 1.6.1 and earlier (default was\n // shallow). Deep is now the default, so the flag is a no-op \u2014 but\n // we still accept it so existing scripts that pass `--deep` keep\n // working. Same for push.\n .option('--deep', '(Deprecated; now the default) Hash remote content to detect remote-side edits')\n .option('--include-ext <ext>', 'Include extra file extension (repeatable)', collectValues, [])\n .option('--include-folder <folder>', 'Include all files in folder (repeatable)', collectValues, [])\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!clientResult) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const filesDir = getTenantFilesDir(tenant);\n\n if (!fs.existsSync(filesDir)) {\n logger.warning(`Local folder not found: apps/${tenant}/files/`);\n logger.dim('Run \"farseer pull <tenant>\" to download files from the instance.');\n return;\n }\n\n logger.info(`Comparing local (apps/${tenant}/files/) with remote (Files/)...`);\n console.log();\n\n const syncService = new SyncService(tenant, clientResult.client);\n\n try {\n const includeExtensions = normalizeExtensions(options.includeExt);\n const includeFolders = options.includeFolder as string[];\n // Deep is the default. `--shallow` opts out and reuses the\n // last-pulled baseline as the \"current remote hash\", which\n // cannot detect content edits to existing remote files \u2014\n // surfaced via `status.deepCompare = false` for honest\n // reporting downstream.\n const deep = !options.shallow;\n const status = await syncService.getStatus({\n all: options.all,\n deep,\n includeExtensions: includeExtensions.length > 0 ? includeExtensions : undefined,\n includeFolders: includeFolders.length > 0 ? includeFolders : undefined,\n });\n\n // Fetch app status before the early-return gate; otherwise\n // pure app drift (args diverged on remote, no file changes)\n // reports as \"Everything in sync\".\n const appSyncService = new AppSyncService(tenant, clientResult.client);\n const appStatus = await appSyncService.getStatus();\n const hasAppChanges =\n appStatus.newLocal.length > 0 || appStatus.newRemote.length > 0 || appStatus.modified.length > 0;\n\n const hasChanges =\n status.modifiedLocally.length > 0 ||\n status.modifiedRemotely.length > 0 ||\n status.addedLocally.length > 0 ||\n status.addedRemotely.length > 0 ||\n status.deletedLocally.length > 0 ||\n status.deletedRemotely.length > 0 ||\n status.conflicts.length > 0 ||\n hasAppChanges;\n\n if (!hasChanges) {\n if (status.deepCompare) {\n logger.success('Everything is in sync!');\n } else {\n // Fast mode reuses the last-pulled baseline for remote\n // hashes \u2014 it CANNOT detect content edits to existing\n // remote files. Be honest about what was checked.\n logger.info('Local matches the last-pull baseline.');\n logger.dim(\n 'Remote-side content edits not checked (--shallow). Drop the flag to verify against remote.',\n );\n }\n logger.dim(`${status.inSync.length} file(s) synchronized.`);\n if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) synchronized.`);\n }\n return;\n }\n\n if (\n status.addedLocally.length > 0 ||\n status.modifiedLocally.length > 0 ||\n status.deletedLocally.length > 0\n ) {\n console.log(chalk.bold('Local changes:'));\n for (const file of status.addedLocally) console.log(chalk.green(` + ${file}`));\n for (const file of status.modifiedLocally) console.log(chalk.yellow(` M ${file}`));\n for (const file of status.deletedLocally) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n const syncState = syncService.loadSyncState();\n if (\n status.addedRemotely.length > 0 ||\n status.modifiedRemotely.length > 0 ||\n status.deletedRemotely.length > 0\n ) {\n console.log(chalk.bold('Remote changes:'));\n for (const file of status.addedRemotely) console.log(chalk.cyan(` + ${file}`));\n for (const file of status.modifiedRemotely) {\n // Modified-on-remote rows pick up `(by <name>)` when\n // the recorded sync metadata knows who last uploaded\n // the file. Falls back to email when only that's set.\n const metadata = syncState.files[file]?.metadata;\n const uploaderInfo = metadata?.uploaderName\n ? ` (by ${metadata.uploaderName})`\n : metadata?.uploaderEmail\n ? ` (by ${metadata.uploaderEmail})`\n : '';\n console.log(chalk.cyan(` M ${file}`) + chalk.dim(uploaderInfo));\n }\n for (const file of status.deletedRemotely) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n if (status.conflicts.length > 0) {\n console.log(chalk.red.bold('Conflicts:'));\n for (const conflict of status.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n console.log();\n logger.dim(`Resolve conflicts during pull: farseer pull ${tenant}`);\n console.log();\n }\n\n // App diff (already fetched above so the early-return path\n // can short-circuit correctly). Render only \u2014 no extra API call.\n if (hasAppChanges) {\n console.log(chalk.bold('Apps:'));\n console.log();\n\n if (appStatus.newLocal.length > 0) {\n console.log(chalk.green('New local apps (to be created on remote):'));\n for (const app of appStatus.newLocal) {\n console.log(chalk.green(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.newRemote.length > 0) {\n console.log(chalk.cyan('New remote apps (to be downloaded):'));\n for (const app of appStatus.newRemote) {\n console.log(chalk.cyan(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.modified.length > 0) {\n console.log(chalk.yellow('Modified apps:'));\n for (const app of appStatus.modified) {\n console.log(chalk.yellow(` ~ ${app}`));\n }\n console.log();\n }\n\n if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n } else if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n\n console.log();\n if (!status.deepCompare) {\n // Fast mode skipped the remote-content hash check, so the\n // listing above may be incomplete \u2014 content edits to\n // existing remote files won't appear. Tell the user.\n logger.dim('--shallow: remote-content edits to existing files were NOT checked.');\n }\n logger.dim('Use \"farseer push <tenant>\" to upload local changes.');\n logger.dim('Use \"farseer pull <tenant>\" to download remote changes.');\n } catch (error) {\n logger.error('Failed to check status.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8D;AAC9D,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAA+D;AAC/D,wBAAmD;AACnD,SAAoB;AAEb,SAAS,sBAAsB,SAAwB;AAC1D,UACK,QAAQ,uBAAuB,EAC/B;AAAA,IACG;AAAA,EACJ,EACC,OAAO,SAAS,4DAA4D,EAC5E;AAAA,IACG;AAAA,IACA;AAAA,EACJ,EAKC,OAAO,UAAU,+EAA+E,EAChG,OAAO,uBAAuB,6CAA6C,iCAAe,CAAC,CAAC,EAC5F,OAAO,6BAA6B,4CAA4C,iCAAe,CAAC,CAAC,EACjG,OAAO,OAAO,MAAM,MAAM,YAAY;AACnC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,MAAM,IAAI;AACvE,UAAM,eAAe,UAAM,oDAA6B,cAAc,MAAM;AAE5E,QAAI,CAAC,cAAc;AACf,iDAAgB,MAAM;AACtB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAEA,UAAM,eAAW,kCAAkB,MAAM;AAEzC,QAAI,CAAC,GAAG,WAAW,QAAQ,GAAG;AAC1B,2BAAO,QAAQ,gCAAgC,MAAM,SAAS;AAC9D,2BAAO,IAAI,kEAAkE;AAC7E;AAAA,IACJ;AAEA,yBAAO,KAAK,yBAAyB,MAAM,kCAAkC;AAC7E,YAAQ,IAAI;AAEZ,UAAM,cAAc,IAAI,+BAAY,QAAQ,aAAa,MAAM;AAE/D,QAAI;AACA,YAAM,wBAAoB,uCAAoB,QAAQ,UAAU;AAChE,YAAM,iBAAiB,QAAQ;AAM/B,YAAM,OAAO,CAAC,QAAQ;AACtB,YAAM,SAAS,MAAM,YAAY,UAAU;AAAA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import chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt } from '../services/farseerFactory';\nimport { SyncService } from '../services/syncService';\nimport { AppSyncService } from '../services/appSyncService';\nimport { getTenantFilesDir, resolveTenantWithOrgMapping, displayLocalPath } from '../utils/helpers';\nimport { collectValues, normalizeExtensions } from '../utils/cliOptions';\nimport { reportIgnoredLocal } from '../utils/syncReporting';\nimport * as fs from 'fs';\n\nexport function registerStatusCommand(program: Command): void {\n program\n .command('status [org] [tenant]')\n .description(\n 'Show sync status between local and remote\\n\\nUsage: status <org> <tenant> OR status <tenant> (if org is known)',\n )\n .option(\n '--all',\n 'Show status for every non-hidden, non-blocklisted file (default: developer files (.ts, .js, .py, .yml, .yaml, .md, .json) outside hidden directories and the folder blocklist). Data files (.csv, .xlsx, .parquet, \u2026) are backend-accepted but excluded from default \u2014 opt in via --include-ext .csv or `farseer config include --ext .csv`.',\n )\n .option(\n '--shallow',\n 'Skip remote-content hashing (faster; trusts the last-sync baseline, will miss edits to existing remote files)',\n )\n // `--deep` was the opt-IN flag in 1.6.1 and earlier (default was\n // shallow). Deep is now the default, so the flag is a no-op \u2014 but\n // we still accept it so existing scripts that pass `--deep` keep\n // working. Same for push.\n .option('--deep', '(Deprecated; now the default) Hash remote content to detect remote-side edits')\n .option('--include-ext <ext>', 'Include extra file extension (repeatable)', collectValues, [])\n .option('--include-folder <folder>', 'Include all files in folder (repeatable)', collectValues, [])\n .action(async (arg1, arg2, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(arg1, arg2);\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n\n if (!clientResult) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const filesDir = getTenantFilesDir(tenant);\n const localPathDisplay = displayLocalPath(filesDir);\n\n if (!fs.existsSync(filesDir)) {\n logger.warning(`Local folder not found: ${localPathDisplay}`);\n logger.dim('Run \"farseer pull <tenant>\" to download files from the instance.');\n return;\n }\n\n logger.info(`Comparing local (${localPathDisplay}) with remote (Files/)...`);\n console.log();\n\n const syncService = new SyncService(tenant, clientResult.client);\n\n try {\n const includeExtensions = normalizeExtensions(options.includeExt);\n const includeFolders = options.includeFolder as string[];\n // Deep is the default. `--shallow` opts out and reuses the\n // last-pulled baseline as the \"current remote hash\", which\n // cannot detect content edits to existing remote files \u2014\n // surfaced via `status.deepCompare = false` for honest\n // reporting downstream.\n const deep = !options.shallow;\n const status = await syncService.getStatus({\n all: options.all,\n deep,\n includeExtensions: includeExtensions.length > 0 ? includeExtensions : undefined,\n includeFolders: includeFolders.length > 0 ? includeFolders : undefined,\n });\n\n // Fetch app status before the early-return gate; otherwise\n // pure app drift (args diverged on remote, no file changes)\n // reports as \"Everything in sync\".\n const appSyncService = new AppSyncService(tenant, clientResult.client);\n const appStatus = await appSyncService.getStatus();\n const hasAppChanges =\n appStatus.newLocal.length > 0 || appStatus.newRemote.length > 0 || appStatus.modified.length > 0;\n\n const hasChanges =\n status.modifiedLocally.length > 0 ||\n status.modifiedRemotely.length > 0 ||\n status.addedLocally.length > 0 ||\n status.addedRemotely.length > 0 ||\n status.deletedLocally.length > 0 ||\n status.deletedRemotely.length > 0 ||\n status.conflicts.length > 0 ||\n hasAppChanges;\n\n if (!hasChanges) {\n // Surface the out-of-scope warning BEFORE the success\n // line so the \"within current scope\" qualifier reads\n // as a follow-up to the count the user just saw, not\n // a contradiction of a bare \"Everything is in sync!\".\n reportIgnoredLocal(status.ignoredLocal, status.ignoredLocalTotal);\n if (status.deepCompare) {\n if (status.ignoredLocalTotal > 0) {\n logger.success('Everything is in sync within current scope.');\n logger.dim(\n `(${status.ignoredLocalTotal} file(s) outside scope were not compared \u2014 see warning above for details.)`,\n );\n } else {\n logger.success('Everything is in sync!');\n }\n } else {\n // Fast mode reuses the last-pulled baseline for remote\n // hashes \u2014 it CANNOT detect content edits to existing\n // remote files. Be honest about what was checked.\n logger.info('Local matches the last-pull baseline.');\n logger.dim(\n 'Remote-side content edits not checked (--shallow). Drop the flag to verify against remote.',\n );\n }\n logger.dim(`${status.inSync.length} file(s) synchronized.`);\n if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) synchronized.`);\n }\n return;\n }\n\n if (\n status.addedLocally.length > 0 ||\n status.modifiedLocally.length > 0 ||\n status.deletedLocally.length > 0\n ) {\n console.log(chalk.bold('Local changes:'));\n for (const file of status.addedLocally) console.log(chalk.green(` + ${file}`));\n for (const file of status.modifiedLocally) console.log(chalk.yellow(` M ${file}`));\n for (const file of status.deletedLocally) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n const syncState = syncService.loadSyncState();\n if (\n status.addedRemotely.length > 0 ||\n status.modifiedRemotely.length > 0 ||\n status.deletedRemotely.length > 0\n ) {\n console.log(chalk.bold('Remote changes:'));\n for (const file of status.addedRemotely) console.log(chalk.cyan(` + ${file}`));\n for (const file of status.modifiedRemotely) {\n // Modified-on-remote rows pick up `(by <name>)` when\n // the recorded sync metadata knows who last uploaded\n // the file. Falls back to email when only that's set.\n const metadata = syncState.files[file]?.metadata;\n const uploaderInfo = metadata?.uploaderName\n ? ` (by ${metadata.uploaderName})`\n : metadata?.uploaderEmail\n ? ` (by ${metadata.uploaderEmail})`\n : '';\n console.log(chalk.cyan(` M ${file}`) + chalk.dim(uploaderInfo));\n }\n for (const file of status.deletedRemotely) console.log(chalk.red(` - ${file}`));\n console.log();\n }\n\n if (status.conflicts.length > 0) {\n console.log(chalk.red.bold('Conflicts:'));\n for (const conflict of status.conflicts) {\n console.log(chalk.red(` ! ${conflict.filePath}`));\n console.log(chalk.dim(` ${conflict.description}`));\n }\n console.log();\n logger.dim(`Resolve conflicts during pull: farseer pull ${tenant}`);\n console.log();\n }\n\n // App diff (already fetched above so the early-return path\n // can short-circuit correctly). Render only \u2014 no extra API call.\n if (hasAppChanges) {\n console.log(chalk.bold('Apps:'));\n console.log();\n\n if (appStatus.newLocal.length > 0) {\n console.log(chalk.green('New local apps (to be created on remote):'));\n for (const app of appStatus.newLocal) {\n console.log(chalk.green(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.newRemote.length > 0) {\n console.log(chalk.cyan('New remote apps (to be downloaded):'));\n for (const app of appStatus.newRemote) {\n console.log(chalk.cyan(` + ${app}`));\n }\n console.log();\n }\n\n if (appStatus.modified.length > 0) {\n console.log(chalk.yellow('Modified apps:'));\n for (const app of appStatus.modified) {\n console.log(chalk.yellow(` ~ ${app}`));\n }\n console.log();\n }\n\n if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n } else if (appStatus.synced.length > 0) {\n logger.dim(`${appStatus.synced.length} app(s) in sync.`);\n }\n\n console.log();\n reportIgnoredLocal(status.ignoredLocal, status.ignoredLocalTotal);\n if (!status.deepCompare) {\n // Fast mode skipped the remote-content hash check, so the\n // listing above may be incomplete \u2014 content edits to\n // existing remote files won't appear. Tell the user.\n logger.dim('--shallow: remote-content edits to existing files were NOT checked.');\n }\n logger.dim('Use \"farseer push <tenant>\" to upload local changes.');\n logger.dim('Use \"farseer pull <tenant>\" to download remote changes.');\n } catch (error) {\n logger.error('Failed to check status.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8D;AAC9D,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAAiF;AACjF,wBAAmD;AACnD,2BAAmC;AACnC,SAAoB;AAEb,SAAS,sBAAsB,SAAwB;AAC1D,UACK,QAAQ,uBAAuB,EAC/B;AAAA,IACG;AAAA,EACJ,EACC;AAAA,IACG;AAAA,IACA;AAAA,EACJ,EACC;AAAA,IACG;AAAA,IACA;AAAA,EACJ,EAKC,OAAO,UAAU,+EAA+E,EAChG,OAAO,uBAAuB,6CAA6C,iCAAe,CAAC,CAAC,EAC5F,OAAO,6BAA6B,4CAA4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ACnC,oBAAQ,IAAI,aAAAA,QAAM,KAAK,OAAO,GAAG,EAAE,CAAC;AAAA,UACxC;AACA,kBAAQ,IAAI;AAAA,QAChB;AAEA,YAAI,UAAU,SAAS,SAAS,GAAG;AAC/B,kBAAQ,IAAI,aAAAA,QAAM,OAAO,gBAAgB,CAAC;AAC1C,qBAAW,OAAO,UAAU,UAAU;AAClC,oBAAQ,IAAI,aAAAA,QAAM,OAAO,OAAO,GAAG,EAAE,CAAC;AAAA,UAC1C;AACA,kBAAQ,IAAI;AAAA,QAChB;AAEA,YAAI,UAAU,OAAO,SAAS,GAAG;AAC7B,+BAAO,IAAI,GAAG,UAAU,OAAO,MAAM,kBAAkB;AAAA,QAC3D;AAAA,MACJ,WAAW,UAAU,OAAO,SAAS,GAAG;AACpC,6BAAO,IAAI,GAAG,UAAU,OAAO,MAAM,kBAAkB;AAAA,MAC3D;AAEA,cAAQ,IAAI;AACZ,mDAAmB,OAAO,cAAc,OAAO,iBAAiB;AAChE,UAAI,CAAC,OAAO,aAAa;AAIrB,6BAAO,IAAI,qEAAqE;AAAA,MACpF;AACA,2BAAO,IAAI,sDAAsD;AACjE,2BAAO,IAAI,yDAAyD;AAAA,IACxE,SAAS,OAAO;AACZ,2BAAO,MAAM,yBAAyB;AACtC,UAAI,iBAAiB,OAAO;AACxB,6BAAO,IAAI,MAAM,OAAO;AAAA,MAC5B;AACA,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;",
6
6
  "names": ["chalk"]
7
7
  }
package/dist/index.js CHANGED
@@ -97,7 +97,7 @@ ${import_chalk.default.bold.underline("Configuration")} ${import_chalk.default.
97
97
 
98
98
  ${import_chalk.default.bold.underline("Sync Operations")} ${import_chalk.default.dim("(tenant optional if checked out)")}
99
99
  pull [org] [tenant] Pull files and apps from remote
100
- ${import_chalk.default.dim("--all")} Download all files (not just .ts/.js)
100
+ ${import_chalk.default.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)
101
101
  ${import_chalk.default.dim("--force")} Mirror remote \u2192 local: overwrite local edits AND delete local-only (asks confirmation)
102
102
  ${import_chalk.default.dim("-y, --yes")} Skip confirm when local has uncommitted changes
103
103
  ${import_chalk.default.dim("--include-ext <ext>")} Include extra extension (repeatable)
@@ -109,7 +109,7 @@ ${import_chalk.default.bold.underline("Sync Operations")} ${import_chalk.defaul
109
109
  ${import_chalk.default.dim("--include-ext <ext>")} Include extra extension (repeatable)
110
110
  ${import_chalk.default.dim("--include-folder <folder>")} Include all files in folder (repeatable)
111
111
  status [tenant] Show sync status (local vs remote)
112
- ${import_chalk.default.dim("--all")} Show all files (not just .ts/.js)
112
+ ${import_chalk.default.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)
113
113
  ${import_chalk.default.dim("--shallow")} Skip remote-content hash check (faster, but may miss remote edits)
114
114
  ${import_chalk.default.dim("--include-ext <ext>")} Include extra extension (repeatable)
115
115
  ${import_chalk.default.dim("--include-folder <folder>")} Include all files in folder (repeatable)
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\n\n// Suppress punycode deprecation warning (comes from dependencies like axios)\nconst originalEmit = process.emit;\n// @ts-expect-error - overriding process.emit\nprocess.emit = function (name: string, data: unknown, ...args: unknown[]) {\n if (\n name === 'warning' &&\n typeof data === 'object' &&\n data !== null &&\n 'name' in data &&\n data.name === 'DeprecationWarning' &&\n 'message' in data &&\n typeof data.message === 'string' &&\n data.message.includes('punycode')\n ) {\n return false;\n }\n // @ts-expect-error - calling original emit\n return originalEmit.apply(process, [name, data, ...args]);\n};\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { CLI_VERSION } from './utils/constants';\nimport { fileLogger } from './utils/fileLogger';\n\n// Initialize file logging and crash handlers\nfileLogger.init();\nfileLogger.installCrashHandlers();\nimport { registerLoginCommand } from './commands/login';\nimport { registerLogoutCommand } from './commands/logout';\nimport { registerConfigCommand } from './commands/config';\nimport { registerListCommand } from './commands/list';\nimport { registerFilesCommand } from './commands/files';\nimport { registerStatusCommand } from './commands/status';\nimport { registerDiffCommand } from './commands/diff';\nimport { registerPullCommand } from './commands/pull';\nimport { registerPushCommand } from './commands/push';\nimport { registerRunCommand } from './commands/run';\nimport { registerInstallCommand } from './commands/install';\nimport { registerWhoamiCommand } from './commands/whoami';\nimport { registerAppCommand } from './commands/app';\nimport { registerModelCommand } from './commands/model';\nimport { registerVariablesCommand } from './commands/variables';\nimport { registerDimensionsCommand } from './commands/dimensions';\nimport { registerCheckoutCommand } from './commands/checkout';\nimport { registerMcpServerCommand } from './commands/mcp-server';\nimport { registerSheetsCommand } from './commands/sheets';\nimport { registerDashboardsCommand } from './commands/dashboards';\nimport { registerCellsCommand } from './commands/cells';\nimport { registerFormulaCommand } from './commands/formula';\nimport { checkForUpdates } from './utils/updateCheck';\n\n// Start non-blocking update check (skip for MCP server \u2014 it's a long-lived process)\nconst updateMessagePromise = process.argv.includes('mcp-server') ? null : checkForUpdates();\n\nconst program = new Command();\n\n// Configure help to hide default command list (we show our own custom list)\nprogram.configureHelp({\n visibleCommands: () => [], // Hide all commands from default list\n});\n\nprogram\n .name('farseer')\n .description('CLI tool for syncing Farseer App scripts between local folder and Farseer instances')\n .version(CLI_VERSION)\n .addHelpText(\n 'after',\n `\n${chalk.bold.underline('Tenant Resolution')}\n Most commands accept ${chalk.cyan('[org] [tenant]')} arguments:\n ${chalk.green('$')} farseer checkout ${chalk.cyan('salvus-2 salvus-prodaja')} ${chalk.dim('First time: specify <org> <tenant>')}\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-prodaja')} ${chalk.dim('After that: just <tenant> (org is remembered)')}\n ${chalk.green('$')} farseer push ${chalk.dim('Or omit entirely if checked out')}\n\n${chalk.bold.underline('Authentication')}\n login Login via browser (OAuth)\n logout [tenant] Logout and remove credentials\n whoami Show login status and configured tenants\n checkout [org] [tenant] Set default tenant (verifies auth & pulls)\n ${chalk.dim('--no-pull')} Skip automatic pull\n\n${chalk.bold.underline('Configuration')} ${chalk.dim('(farseer config <command>)')}\n config set <tenant> Set API key for a tenant\n ${chalk.dim('--api-key <key>')} API key (required)\n ${chalk.dim('--org <name>')} Organisation if different from tenant\n config remove <tenant> Remove credentials\n config list List all configured tenants\n config show <tenant> Show full credentials (incl. API key)\n config test <tenant> Test connection to tenant\n config include Manage extra file types to sync\n ${chalk.dim('--ext <ext>')} Add extension (repeatable, e.g., --ext .json)\n ${chalk.dim('--folder <path>')} Add folder (repeatable)\n ${chalk.dim('--remove-ext <ext>')} Remove extension\n ${chalk.dim('--remove-folder <path>')} Remove folder\n ${chalk.dim('--clear')} Remove all sync includes\n\n${chalk.bold.underline('Sync Operations')} ${chalk.dim('(tenant optional if checked out)')}\n pull [org] [tenant] Pull files and apps from remote\n ${chalk.dim('--all')} Download all files (not just .ts/.js)\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 all files (not just .ts/.js)\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\n${chalk.bold.underline('App Management')} ${chalk.dim('(tenant optional if checked out)')}\n app list [tenant] List all apps\n ${chalk.dim('--details')} Show details for each app\n app show [tenant] <name> Show app details\n app create [tenant] <name> Create new app\n app configure [tenant] <name> Configure app\n ${chalk.dim('--entrypoint <script>')} Set main script\n ${chalk.dim('--scripts <list>')} Comma-separated scripts\n ${chalk.dim('--add-arg <Name=Value>')} Add argument (repeatable)\n ${chalk.dim('--description <text>')} Set description\n app delete [tenant] <name> Delete app (requires --force)\n\n${chalk.bold.underline('Running & Development')} ${chalk.dim('(tenant optional if checked out)')}\n run [tenant] <app> Run app locally with injected credentials\n ${chalk.dim('--arg <Name=Value>')} Override argument (repeatable)\n run-script [tenant] <file> Run script directly (no app wrapper)\n install [tenant] Install npm dependencies (npm install)\n\n${chalk.bold.underline('Variables')} ${chalk.dim('(tenant optional if checked out)')}\n variables list [tenant] List all variables\n 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 checked out)')}\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 checked out)')}\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 checked out)')}\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 checked out)')}\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 checked out)')}\n formula eval <expression> Evaluate a formula expression\n ${chalk.dim('--filter <table=member>')} Dimension filter (repeatable)\n\n${chalk.bold.underline('Model Inspection')} ${chalk.dim('(tenant optional if checked out)')}\n model [tenant] Show model structure (dimensions, variables)\n ${chalk.dim('--variables')} List all variables\n ${chalk.dim('--tables')} List all dimension tables\n ${chalk.dim('--variable <name>')} Show dimensions for variable\n\n${chalk.bold.underline('File Management')} ${chalk.dim('(farseer files <command>)')}\n files list [tenant] List files on remote\n ${chalk.dim('--all')} Show all files (not just scripts)\n\n${chalk.bold.underline('MCP Server')} ${chalk.dim('(AI assistant integration)')}\n mcp-server Start MCP server for Claude, Cursor, etc.\n\n${chalk.bold.underline('Examples')}\n ${chalk.green('$')} farseer login ${chalk.dim('Login via browser')}\n ${chalk.green('$')} farseer checkout salvus-2 salvus-prod ${chalk.dim('First time: org + tenant')}\n ${chalk.green('$')} farseer pull salvus-prod ${chalk.dim('Next time: just tenant')}\n ${chalk.green('$')} farseer push ${chalk.dim('If checked out: no args needed')}\n ${chalk.green('$')} farseer push -y ${chalk.dim('Push without confirmation')}\n ${chalk.green('$')} farseer run \"My App\" ${chalk.dim('Run app locally')}\n ${chalk.green('$')} farseer variables list ${chalk.dim('List all variables')}\n ${chalk.green('$')} farseer variable details \"Revenue\" ${chalk.dim('Show variable details')}\n ${chalk.green('$')} farseer dimensions list ${chalk.dim('List dimension tables')}\n`,\n );\n\n// Register all commands (hidden from default help, shown in custom help above)\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterCheckoutCommand(program);\nregisterConfigCommand(program);\nregisterListCommand(program);\nregisterFilesCommand(program);\nregisterAppCommand(program);\nregisterVariablesCommand(program);\nregisterDimensionsCommand(program);\nregisterModelCommand(program);\nregisterStatusCommand(program);\nregisterDiffCommand(program);\nregisterPullCommand(program);\nregisterPushCommand(program);\nregisterRunCommand(program);\nregisterInstallCommand(program);\nregisterWhoamiCommand(program);\nregisterSheetsCommand(program);\nregisterDashboardsCommand(program);\nregisterCellsCommand(program);\nregisterFormulaCommand(program);\nregisterMcpServerCommand(program);\n\n// Display update notification after any command finishes\nif (updateMessagePromise) {\n program.hook('postAction', async () => {\n const message = await updateMessagePromise;\n if (message) {\n process.stderr.write(message + '\\n');\n }\n });\n}\n\n// Parse arguments\nprogram.parse();\n"],
4
+ "sourcesContent": ["#!/usr/bin/env node\n\n// Suppress punycode deprecation warning (comes from dependencies like axios)\nconst originalEmit = process.emit;\n// @ts-expect-error - overriding process.emit\nprocess.emit = function (name: string, data: unknown, ...args: unknown[]) {\n if (\n name === 'warning' &&\n typeof data === 'object' &&\n data !== null &&\n 'name' in data &&\n data.name === 'DeprecationWarning' &&\n 'message' in data &&\n typeof data.message === 'string' &&\n data.message.includes('punycode')\n ) {\n return false;\n }\n // @ts-expect-error - calling original emit\n return originalEmit.apply(process, [name, data, ...args]);\n};\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { CLI_VERSION } from './utils/constants';\nimport { fileLogger } from './utils/fileLogger';\n\n// Initialize file logging and crash handlers\nfileLogger.init();\nfileLogger.installCrashHandlers();\nimport { registerLoginCommand } from './commands/login';\nimport { registerLogoutCommand } from './commands/logout';\nimport { registerConfigCommand } from './commands/config';\nimport { registerListCommand } from './commands/list';\nimport { registerFilesCommand } from './commands/files';\nimport { registerStatusCommand } from './commands/status';\nimport { registerDiffCommand } from './commands/diff';\nimport { registerPullCommand } from './commands/pull';\nimport { registerPushCommand } from './commands/push';\nimport { registerRunCommand } from './commands/run';\nimport { registerInstallCommand } from './commands/install';\nimport { registerWhoamiCommand } from './commands/whoami';\nimport { registerAppCommand } from './commands/app';\nimport { registerModelCommand } from './commands/model';\nimport { registerVariablesCommand } from './commands/variables';\nimport { registerDimensionsCommand } from './commands/dimensions';\nimport { registerCheckoutCommand } from './commands/checkout';\nimport { registerMcpServerCommand } from './commands/mcp-server';\nimport { registerSheetsCommand } from './commands/sheets';\nimport { registerDashboardsCommand } from './commands/dashboards';\nimport { registerCellsCommand } from './commands/cells';\nimport { registerFormulaCommand } from './commands/formula';\nimport { checkForUpdates } from './utils/updateCheck';\n\n// Start non-blocking update check (skip for MCP server \u2014 it's a long-lived process)\nconst updateMessagePromise = process.argv.includes('mcp-server') ? null : checkForUpdates();\n\nconst program = new Command();\n\n// Configure help to hide default command list (we show our own custom list)\nprogram.configureHelp({\n visibleCommands: () => [], // Hide all commands from default list\n});\n\nprogram\n .name('farseer')\n .description('CLI tool for syncing Farseer App scripts between local folder and Farseer instances')\n .version(CLI_VERSION)\n .addHelpText(\n 'after',\n `\n${chalk.bold.underline('Tenant Resolution')}\n Most commands accept ${chalk.cyan('[org] [tenant]')} arguments:\n ${chalk.green('$')} farseer checkout ${chalk.cyan('salvus-2 salvus-prodaja')} ${chalk.dim('First time: specify <org> <tenant>')}\n ${chalk.green('$')} farseer pull ${chalk.cyan('salvus-prodaja')} ${chalk.dim('After that: just <tenant> (org is remembered)')}\n ${chalk.green('$')} farseer push ${chalk.dim('Or omit entirely if checked out')}\n\n${chalk.bold.underline('Authentication')}\n login Login via browser (OAuth)\n logout [tenant] Logout and remove credentials\n whoami Show login status and configured tenants\n checkout [org] [tenant] Set default tenant (verifies auth & pulls)\n ${chalk.dim('--no-pull')} Skip automatic pull\n\n${chalk.bold.underline('Configuration')} ${chalk.dim('(farseer config <command>)')}\n config set <tenant> Set API key for a tenant\n ${chalk.dim('--api-key <key>')} API key (required)\n ${chalk.dim('--org <name>')} Organisation if different from tenant\n config remove <tenant> Remove credentials\n config list List all configured tenants\n config show <tenant> Show full credentials (incl. API key)\n config test <tenant> Test connection to tenant\n config include Manage extra file types to sync\n ${chalk.dim('--ext <ext>')} Add extension (repeatable, e.g., --ext .json)\n ${chalk.dim('--folder <path>')} Add folder (repeatable)\n ${chalk.dim('--remove-ext <ext>')} Remove extension\n ${chalk.dim('--remove-folder <path>')} Remove folder\n ${chalk.dim('--clear')} Remove all sync includes\n\n${chalk.bold.underline('Sync Operations')} ${chalk.dim('(tenant optional if checked out)')}\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\n${chalk.bold.underline('App Management')} ${chalk.dim('(tenant optional if checked out)')}\n app list [tenant] List all apps\n ${chalk.dim('--details')} Show details for each app\n app show [tenant] <name> Show app details\n app create [tenant] <name> Create new app\n app configure [tenant] <name> Configure app\n ${chalk.dim('--entrypoint <script>')} Set main script\n ${chalk.dim('--scripts <list>')} Comma-separated scripts\n ${chalk.dim('--add-arg <Name=Value>')} Add argument (repeatable)\n ${chalk.dim('--description <text>')} Set description\n app delete [tenant] <name> Delete app (requires --force)\n\n${chalk.bold.underline('Running & Development')} ${chalk.dim('(tenant optional if checked out)')}\n run [tenant] <app> Run app locally with injected credentials\n ${chalk.dim('--arg <Name=Value>')} Override argument (repeatable)\n run-script [tenant] <file> Run script directly (no app wrapper)\n install [tenant] Install npm dependencies (npm install)\n\n${chalk.bold.underline('Variables')} ${chalk.dim('(tenant optional if checked out)')}\n variables list [tenant] List all variables\n 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 checked out)')}\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 checked out)')}\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 checked out)')}\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 checked out)')}\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 checked out)')}\n formula eval <expression> Evaluate a formula expression\n ${chalk.dim('--filter <table=member>')} Dimension filter (repeatable)\n\n${chalk.bold.underline('Model Inspection')} ${chalk.dim('(tenant optional if checked out)')}\n model [tenant] Show model structure (dimensions, variables)\n ${chalk.dim('--variables')} List all variables\n ${chalk.dim('--tables')} List all dimension tables\n ${chalk.dim('--variable <name>')} Show dimensions for variable\n\n${chalk.bold.underline('File Management')} ${chalk.dim('(farseer files <command>)')}\n files list [tenant] List files on remote\n ${chalk.dim('--all')} Show all files (not just scripts)\n\n${chalk.bold.underline('MCP Server')} ${chalk.dim('(AI assistant integration)')}\n mcp-server Start MCP server for Claude, Cursor, etc.\n\n${chalk.bold.underline('Examples')}\n ${chalk.green('$')} farseer login ${chalk.dim('Login via browser')}\n ${chalk.green('$')} farseer checkout salvus-2 salvus-prod ${chalk.dim('First time: org + tenant')}\n ${chalk.green('$')} farseer pull salvus-prod ${chalk.dim('Next time: just tenant')}\n ${chalk.green('$')} farseer push ${chalk.dim('If checked out: no args needed')}\n ${chalk.green('$')} farseer push -y ${chalk.dim('Push without confirmation')}\n ${chalk.green('$')} farseer run \"My App\" ${chalk.dim('Run app locally')}\n ${chalk.green('$')} farseer variables list ${chalk.dim('List all variables')}\n ${chalk.green('$')} farseer variable details \"Revenue\" ${chalk.dim('Show variable details')}\n ${chalk.green('$')} farseer dimensions list ${chalk.dim('List dimension tables')}\n`,\n );\n\n// Register all commands (hidden from default help, shown in custom help above)\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterCheckoutCommand(program);\nregisterConfigCommand(program);\nregisterListCommand(program);\nregisterFilesCommand(program);\nregisterAppCommand(program);\nregisterVariablesCommand(program);\nregisterDimensionsCommand(program);\nregisterModelCommand(program);\nregisterStatusCommand(program);\nregisterDiffCommand(program);\nregisterPullCommand(program);\nregisterPushCommand(program);\nregisterRunCommand(program);\nregisterInstallCommand(program);\nregisterWhoamiCommand(program);\nregisterSheetsCommand(program);\nregisterDashboardsCommand(program);\nregisterCellsCommand(program);\nregisterFormulaCommand(program);\nregisterMcpServerCommand(program);\n\n// Display update notification after any command finishes\nif (updateMessagePromise) {\n program.hook('postAction', async () => {\n const message = await updateMessagePromise;\n if (message) {\n process.stderr.write(message + '\\n');\n }\n });\n}\n\n// Parse arguments\nprogram.parse();\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,uBAAwB;AACxB,mBAAkB;AAClB,uBAA4B;AAC5B,wBAA2B;AAK3B,mBAAqC;AACrC,oBAAsC;AACtC,oBAAsC;AACtC,kBAAoC;AACpC,mBAAqC;AACrC,oBAAsC;AACtC,kBAAoC;AACpC,kBAAoC;AACpC,kBAAoC;AACpC,iBAAmC;AACnC,qBAAuC;AACvC,oBAAsC;AACtC,iBAAmC;AACnC,mBAAqC;AACrC,uBAAyC;AACzC,wBAA0C;AAC1C,sBAAwC;AACxC,wBAAyC;AACzC,oBAAsC;AACtC,wBAA0C;AAC1C,mBAAqC;AACrC,qBAAuC;AACvC,yBAAgC;AAjDhC,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,MAA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