farseer-cli 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -473,7 +473,6 @@ Output:
473
473
  "name": "My Import App",
474
474
  "description": "Imports sales data",
475
475
  "entrypoint": "import-sales.ts",
476
- "scripts": ["import-sales.ts", "helpers.ts"],
477
476
  "arguments": [
478
477
  { "name": "Year", "defaultValue": "2025" },
479
478
  { "name": "Version", "defaultValue": "Plan" }
@@ -495,9 +494,15 @@ Creates JSON file in `apps/<tenant>/apps/`. Use `push` to upload to instance.
495
494
 
496
495
  Configure app settings.
497
496
 
497
+ An app's scripts are derived from its source folder, and the entrypoint must be one of
498
+ those files. Set the source folder first, then pick an entrypoint inside it.
499
+
498
500
  ```bash
499
- # Set entrypoint and scripts
500
- farseer app configure My App --entrypoint index.ts --scripts "index.ts,helpers.ts"
501
+ # Set the source folder (path under Files/) the app's scripts come from
502
+ farseer app configure My App --source-folder "Scripts/MyApp"
503
+
504
+ # Set the entrypoint (must be a file in the source folder)
505
+ farseer app configure My App --entrypoint index.ts
501
506
 
502
507
  # Add argument
503
508
  farseer app configure My App --add-arg "Year=2025"
@@ -506,6 +511,16 @@ farseer app configure My App --add-arg "Year=2025"
506
511
  farseer app configure My App --description "Imports data"
507
512
  ```
508
513
 
514
+ Settings you don't pass are preserved — `configure` only changes what you specify.
515
+
516
+ If you move the source folder to one that doesn't contain the app's current
517
+ entrypoint, pass `--entrypoint` in the same command — `configure` errors rather
518
+ than silently clearing or relocating the entrypoint.
519
+
520
+ ```bash
521
+ farseer app configure My App --source-folder "Scripts/NewFolder" --entrypoint index.ts
522
+ ```
523
+
509
524
  ### `farseer app delete <name>`
510
525
 
511
526
  Delete app (requires `--force`).
@@ -750,7 +765,6 @@ apps/
750
765
  "name": "My Import App",
751
766
  "description": "Imports sales data",
752
767
  "entrypoint": "import-sales.ts",
753
- "scripts": ["import-sales.ts", "helpers.ts"],
754
768
  "arguments": [
755
769
  { "name": "Year", "defaultValue": "2025" },
756
770
  { "name": "Version", "defaultValue": "Plan" }
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(app_exports);
34
34
  var import_chalk = __toESM(require("chalk"));
35
35
  var import_logger = require("../utils/logger");
36
36
  var import_farseerFactory = require("../services/farseerFactory");
37
+ var import_farseerApi = require("../services/farseerApi");
37
38
  var import_helpers = require("../utils/helpers");
38
39
  function registerAppCommand(program) {
39
40
  const appCmd = program.command("app").description("Manage apps on a Farseer instance").addHelpText(
@@ -43,7 +44,7 @@ Commands:
43
44
  list [tenant] List all apps
44
45
  show [tenant] <name...> Show app details
45
46
  create [tenant] <name...> Create a new app
46
- configure [tenant] <name...> Configure app (entrypoint, scripts, arguments)
47
+ configure [tenant] <name...> Configure app (source folder, entrypoint, arguments)
47
48
  delete [tenant] <name...> Delete an app (requires --force)
48
49
 
49
50
  Note: App names with spaces don't need quotes if tenant is checked out.
@@ -217,7 +218,12 @@ Examples:
217
218
  }
218
219
  import_logger.logger.info(`Deleting app: ${app.name}...`);
219
220
  try {
220
- await api.deleteApp(app.reference);
221
+ await api.deleteApp(app.id);
222
+ const remaining = await api.listApps();
223
+ if (remaining.some((a) => a.id === app.id)) {
224
+ import_logger.logger.error(`Delete reported success but "${app.name}" is still present.`);
225
+ process.exit(1);
226
+ }
221
227
  import_logger.logger.success(`App deleted: ${app.name}`);
222
228
  } catch (error) {
223
229
  import_logger.logger.error("Failed to delete app.");
@@ -227,7 +233,13 @@ Examples:
227
233
  process.exit(1);
228
234
  }
229
235
  });
230
- appCmd.command("configure <args...>").description("Configure an app (set entrypoint, scripts, arguments)").option("--entrypoint <script>", 'Set the entrypoint script (e.g., "index.ts")').option("--scripts <scripts>", "Comma-separated list of scripts to include").option(
236
+ appCmd.command("configure <args...>").description("Configure an app (set source folder, entrypoint, arguments)").option(
237
+ "--entrypoint <script>",
238
+ `Set the entrypoint script \u2014 must be a file in the app's source folder (e.g., "index.ts")`
239
+ ).option(
240
+ "--source-folder <path>",
241
+ `Set the source folder the app's scripts come from (path under Files/, e.g. "Scripts/MyApp")`
242
+ ).option(
231
243
  "--add-arg <arg>",
232
244
  'Add argument in format "Name=DefaultValue" (can be used multiple times)',
233
245
  collectArgs,
@@ -251,64 +263,23 @@ Examples:
251
263
  import_logger.logger.error(`Failed to load app details: ${appName}`);
252
264
  process.exit(1);
253
265
  }
254
- const update = {};
266
+ const changes = {};
255
267
  if (options.name) {
256
- update.name = options.name;
268
+ changes.name = options.name;
257
269
  }
258
270
  if (options.description !== void 0) {
259
- update.description = options.description;
271
+ changes.description = options.description;
260
272
  }
261
- if (options.scripts || options.entrypoint) {
262
- const availableScripts = await api.getScriptFiles();
263
- let autoSetEntrypoint = false;
264
- let autoEntrypointName = "";
265
- if (options.scripts) {
266
- const scriptNames = options.scripts.split(",").map((s) => s.trim());
267
- const scriptIds = [];
268
- const resolvedScripts = [];
269
- for (const name of scriptNames) {
270
- const script = availableScripts.find(
271
- (s) => s.name.toLowerCase() === name.toLowerCase()
272
- );
273
- if (!script) {
274
- import_logger.logger.error(`Script not found: ${name}`);
275
- import_logger.logger.dim(
276
- "Available scripts: " + availableScripts.map((s) => s.name).join(", ")
277
- );
278
- process.exit(1);
279
- }
280
- scriptIds.push(script.id);
281
- resolvedScripts.push({ id: script.id, name: script.name });
282
- }
283
- update.scriptFileIds = scriptIds;
284
- if (!options.entrypoint && !app.mainScriptFileId && resolvedScripts.length > 0) {
285
- update.mainScriptFileId = resolvedScripts[0].id;
286
- autoSetEntrypoint = true;
287
- autoEntrypointName = resolvedScripts[0].name;
288
- }
289
- }
290
- if (options.entrypoint) {
291
- const entryScript = availableScripts.find(
292
- (s) => s.name.toLowerCase() === options.entrypoint.toLowerCase()
293
- );
294
- if (!entryScript) {
295
- import_logger.logger.error(`Entrypoint script not found: ${options.entrypoint}`);
296
- import_logger.logger.dim(
297
- "Available scripts: " + availableScripts.map((s) => s.name).join(", ")
298
- );
299
- process.exit(1);
300
- }
301
- update.mainScriptFileId = entryScript.id;
302
- if (!update.scriptFileIds) {
303
- update.scriptFileIds = [entryScript.id];
304
- } else if (!update.scriptFileIds.includes(entryScript.id)) {
305
- update.scriptFileIds.push(entryScript.id);
306
- }
307
- }
308
- if (autoSetEntrypoint) {
309
- import_logger.logger.info(`Auto-set "${autoEntrypointName}" as entrypoint (first script).`);
310
- import_logger.logger.dim(`Change with: farseer app configure "${appName}" --entrypoint <script>`);
311
- }
273
+ const sourceFolderError = await (0, import_farseerApi.applySourceFolderChange)(
274
+ api,
275
+ app,
276
+ changes,
277
+ { sourceFolder: options.sourceFolder, entrypoint: options.entrypoint },
278
+ "cli"
279
+ );
280
+ if (sourceFolderError) {
281
+ import_logger.logger.error(sourceFolderError);
282
+ process.exit(1);
312
283
  }
313
284
  if (options.addArg && options.addArg.length > 0) {
314
285
  const newArgs = [...app.expectedArguments];
@@ -330,38 +301,29 @@ Examples:
330
301
  newArgs.push({ name, dataType: "string", defaultValue });
331
302
  }
332
303
  }
333
- update.expectedArguments = newArgs;
304
+ changes.expectedArguments = newArgs;
334
305
  }
335
- if (Object.keys(update).length === 0) {
306
+ if (Object.keys(changes).length === 0) {
336
307
  import_logger.logger.warning("No changes specified.");
337
- import_logger.logger.dim("Use --entrypoint, --scripts, --add-arg, --description, or --name to configure the app.");
308
+ import_logger.logger.dim(
309
+ "Use --entrypoint, --source-folder, --add-arg, --description, or --name to configure the app."
310
+ );
338
311
  return;
339
312
  }
340
313
  import_logger.logger.info(`Updating app: ${app.name}...`);
341
314
  try {
342
- if (!update.name) {
343
- update.name = app.name;
344
- }
345
- if (update.description === void 0) {
346
- update.description = app.description || "";
347
- }
348
- const updated = await api.updateApp(appListItem.reference, update);
315
+ const updated = await api.updateApp(appListItem.reference, changes, app);
349
316
  import_logger.logger.success(`App updated: ${updated.name}`);
350
- if (update.name) console.log(` Name: ${updated.name}`);
351
- if (update.description !== void 0) console.log(` Description: ${updated.description || "(empty)"}`);
352
- if (update.mainScriptFileId) {
317
+ if (changes.name) console.log(` Name: ${updated.name}`);
318
+ if (changes.description !== void 0)
319
+ console.log(` Description: ${updated.description || "(empty)"}`);
320
+ if (changes.sourceFolderId !== void 0 || changes.mainScriptFileId !== void 0) {
353
321
  const updatedScripts = updated.scriptFiles ?? [];
354
- const mainScript = updatedScripts.find(
355
- (s) => s.id === updated.mainScriptFileId
356
- );
357
- console.log(` Entrypoint: ${mainScript?.name}`);
358
- }
359
- if (update.scriptFileIds) {
360
- console.log(
361
- ` Scripts: ${(updated.scriptFiles ?? []).map((s) => s.name).join(", ")}`
362
- );
322
+ const mainScript = updatedScripts.find((s) => s.id === updated.mainScriptFileId);
323
+ console.log(` Entrypoint: ${mainScript?.name ?? "(none)"}`);
324
+ console.log(` Scripts: ${updatedScripts.map((s) => s.name).join(", ") || "(none)"}`);
363
325
  }
364
- if (update.expectedArguments) {
326
+ if (changes.expectedArguments) {
365
327
  console.log(
366
328
  ` Arguments: ${updated.expectedArguments.map((a) => {
367
329
  const tags = [];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/app.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, IFarseerClient } from '../services/farseerFactory';\nimport { AppArgument } from '../services/farseerApi';\nimport { parseAppArgs, resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerAppCommand(program: Command): void {\n const appCmd = program\n .command('app')\n .description('Manage apps on a Farseer instance')\n .addHelpText(\n 'after',\n `\nCommands:\n list [tenant] List all apps\n show [tenant] <name...> Show app details\n create [tenant] <name...> Create a new app\n configure [tenant] <name...> Configure app (entrypoint, scripts, arguments)\n delete [tenant] <name...> Delete an app (requires --force)\n\nNote: App names with spaces don't need quotes if tenant is checked out.\n\nExamples:\n $ farseer app list mycompany # List all apps\n $ farseer app show mycompany \"My App\" # Explicit tenant\n $ farseer app show My App # Uses checked-out tenant\n $ farseer app configure \"My App\" --entrypoint index.ts\n`,\n );\n\n // List apps\n appCmd\n .command('list [tenant]')\n .description('List all apps on a Farseer instance')\n .option('--details', 'Show detailed information for each app')\n .action(async (tenantArg, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(tenantArg);\n\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api = result.client;\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);\n\n try {\n const apps = await api.listApps();\n\n if (apps.length === 0) {\n logger.warning('No apps found.');\n logger.dim('Create an app with: farseer app create <name>');\n return;\n }\n\n logger.header(`Apps on ${tenant}`);\n console.log();\n\n if (options.details) {\n // Fetch full details for each app\n for (const app of apps) {\n const details = await api.getApp(app.reference);\n if (details) {\n console.log(` \uD83D\uDCE6 ${chalk.bold(details.name)}`);\n if (details.description) {\n console.log(` ${chalk.dim(details.description)}`);\n }\n console.log(\n ` Status: ${details.status === 'AVAILABLE' ? chalk.green(details.status) : chalk.yellow(details.status)}`,\n );\n const detailScripts = details.scriptFiles ?? [];\n if (detailScripts.length > 0) {\n const mainScript = detailScripts.find((s) => s.id === details.mainScriptFileId);\n console.log(\n ` Entrypoint: ${mainScript ? chalk.cyan(mainScript.name) : chalk.red('Not set')}`,\n );\n console.log(` Scripts:`);\n for (const script of detailScripts) {\n const isMain = script.id === details.mainScriptFileId;\n console.log(\n ` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`,\n );\n }\n } else {\n console.log(` Scripts: ${chalk.dim('None')}`);\n }\n if (details.expectedArguments.length > 0) {\n console.log(` Arguments:`);\n for (const arg of details.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue ?? '')}`);\n }\n }\n console.log();\n }\n }\n } else {\n // Simple list\n for (const app of apps) {\n console.log(` \uD83D\uDCE6 ${app.name}`);\n }\n console.log();\n logger.dim(`Total: ${apps.length} app(s)`);\n logger.dim('Use --details to see more information.');\n }\n } catch (error) {\n logger.error('Failed to list apps.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Show app details\n appCmd\n .command('show <args...>')\n .description('Show details of an app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n const app = await api.getAppByName(appName);\n\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n logger.header(`App: ${app.name}`);\n console.log();\n console.log(` ID: ${app.id}`);\n console.log(` Status: ${app.status}`);\n if (app.description) {\n console.log(` Description: ${app.description}`);\n }\n console.log();\n\n const appScripts = app.scriptFiles ?? [];\n if (appScripts.length > 0) {\n console.log(' Scripts:');\n for (const script of appScripts) {\n const isMain = script.id === app.mainScriptFileId;\n console.log(\n ` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`,\n );\n }\n } else {\n console.log(' Scripts: None');\n }\n console.log();\n\n if (app.expectedArguments.length > 0) {\n console.log(' Arguments:');\n for (const arg of app.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue ?? '')}`);\n }\n } else {\n console.log(' Arguments: None');\n }\n console.log();\n });\n\n // Create app\n appCmd\n .command('create <args...>')\n .description('Create a new app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Check if app already exists\n const existing = await api.getAppByName(appName);\n if (existing) {\n logger.error(`App already exists: ${appName}`);\n process.exit(1);\n }\n\n logger.info(`Creating app: ${appName}...`);\n\n try {\n const app = await api.createApp(appName);\n logger.success(`App created: ${app.name} (ID: ${app.id})`);\n logger.dim('Configure it with: farseer app configure \"' + appName + '\"');\n } catch (error) {\n logger.error('Failed to create app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Delete app\n appCmd\n .command('delete <args...>')\n .description('Delete an app')\n .option('--force', 'Skip confirmation')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const app = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n if (!options.force) {\n logger.warning(`This will permanently delete app: ${app.name}`);\n logger.dim('Use --force to skip this confirmation.');\n process.exit(1);\n }\n\n logger.info(`Deleting app: ${app.name}...`);\n\n try {\n await api.deleteApp(app.reference);\n logger.success(`App deleted: ${app.name}`);\n } catch (error) {\n logger.error('Failed to delete app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Configure app\n appCmd\n .command('configure <args...>')\n .description('Configure an app (set entrypoint, scripts, arguments)')\n .option('--entrypoint <script>', 'Set the entrypoint script (e.g., \"index.ts\")')\n .option('--scripts <scripts>', 'Comma-separated list of scripts to include')\n .option(\n '--add-arg <arg>',\n 'Add argument in format \"Name=DefaultValue\" (can be used multiple times)',\n collectArgs,\n [],\n )\n .option('--description <desc>', 'Set app description')\n .option('--name <name>', 'Rename the app')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const appListItem = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!appListItem) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n const app = await api.getApp(appListItem.reference);\n if (!app) {\n logger.error(`Failed to load app details: ${appName}`);\n process.exit(1);\n }\n\n // Build update object\n const update: {\n name?: string;\n description?: string;\n expectedArguments?: AppArgument[];\n mainScriptFileId?: string | null;\n scriptFileIds?: string[];\n } = {};\n\n if (options.name) {\n update.name = options.name;\n }\n\n if (options.description !== undefined) {\n update.description = options.description;\n }\n\n // Handle scripts and entrypoint\n if (options.scripts || options.entrypoint) {\n const availableScripts = await api.getScriptFiles();\n let autoSetEntrypoint = false;\n let autoEntrypointName = '';\n\n if (options.scripts) {\n const scriptNames = options.scripts.split(',').map((s: string) => s.trim());\n const scriptIds: string[] = [];\n const resolvedScripts: { id: string; name: string }[] = [];\n\n for (const name of scriptNames) {\n const script = availableScripts.find(\n (s: { name: string }) => s.name.toLowerCase() === name.toLowerCase(),\n );\n if (!script) {\n logger.error(`Script not found: ${name}`);\n logger.dim(\n 'Available scripts: ' +\n availableScripts.map((s: { name: string }) => s.name).join(', '),\n );\n process.exit(1);\n }\n scriptIds.push(script.id);\n resolvedScripts.push({ id: script.id, name: script.name });\n }\n\n update.scriptFileIds = scriptIds;\n\n // Auto-set first script as entrypoint if no entrypoint specified and app has none\n if (!options.entrypoint && !app.mainScriptFileId && resolvedScripts.length > 0) {\n update.mainScriptFileId = resolvedScripts[0].id;\n autoSetEntrypoint = true;\n autoEntrypointName = resolvedScripts[0].name;\n }\n }\n\n if (options.entrypoint) {\n const entryScript = availableScripts.find(\n (s: { name: string }) => s.name.toLowerCase() === options.entrypoint.toLowerCase(),\n );\n if (!entryScript) {\n logger.error(`Entrypoint script not found: ${options.entrypoint}`);\n logger.dim(\n 'Available scripts: ' + availableScripts.map((s: { name: string }) => s.name).join(', '),\n );\n process.exit(1);\n }\n update.mainScriptFileId = entryScript.id;\n\n // If setting entrypoint but no scripts specified, include the entrypoint in scripts\n if (!update.scriptFileIds) {\n update.scriptFileIds = [entryScript.id];\n } else if (!update.scriptFileIds.includes(entryScript.id)) {\n update.scriptFileIds.push(entryScript.id);\n }\n }\n\n // Notify user about auto-set entrypoint\n if (autoSetEntrypoint) {\n logger.info(`Auto-set \"${autoEntrypointName}\" as entrypoint (first script).`);\n logger.dim(`Change with: farseer app configure \"${appName}\" --entrypoint <script>`);\n }\n }\n\n // Handle arguments\n if (options.addArg && options.addArg.length > 0) {\n const newArgs: AppArgument[] = [...app.expectedArguments];\n\n for (const arg of options.addArg) {\n const [name, defaultValue] = arg.split('=');\n if (!name || defaultValue === undefined) {\n logger.error(`Invalid argument format: ${arg}`);\n logger.dim('Use format: --add-arg \"Name=DefaultValue\"');\n process.exit(1);\n }\n\n // Check if arg already exists. Lookup is case-insensitive\n // (user-friendly: --add-arg JOBNAME=x updates an existing\n // jobName), but the written name uses the backend's stored\n // casing \u2014 validateExpectedArguments on the server is\n // case-sensitive, and writing the caller-supplied case\n // would silently rename the arg.\n //\n // --add-arg only sets the defaultValue on a string arg; any\n // existing axes (`dataType`, `fixed`, `options`, `secret`)\n // are preserved so updating a boolean/dropdown/locked arg\n // with --add-arg doesn't silently demote it.\n const existingIdx = newArgs.findIndex((a) => a.name.toLowerCase() === name.toLowerCase());\n if (existingIdx >= 0) {\n const existing = newArgs[existingIdx];\n newArgs[existingIdx] = {\n ...existing,\n defaultValue,\n };\n } else {\n newArgs.push({ name, dataType: 'string', defaultValue });\n }\n }\n\n update.expectedArguments = newArgs;\n }\n\n if (Object.keys(update).length === 0) {\n logger.warning('No changes specified.');\n logger.dim('Use --entrypoint, --scripts, --add-arg, --description, or --name to configure the app.');\n return;\n }\n\n logger.info(`Updating app: ${app.name}...`);\n\n try {\n // API requires name field to be present\n if (!update.name) {\n update.name = app.name;\n }\n if (update.description === undefined) {\n update.description = app.description || '';\n }\n const updated = await api.updateApp(appListItem.reference, update);\n logger.success(`App updated: ${updated.name}`);\n\n // Show summary of changes\n if (update.name) console.log(` Name: ${updated.name}`);\n if (update.description !== undefined) console.log(` Description: ${updated.description || '(empty)'}`);\n if (update.mainScriptFileId) {\n const updatedScripts = updated.scriptFiles ?? [];\n const mainScript = updatedScripts.find(\n (s: { id: string | number }) => s.id === updated.mainScriptFileId,\n );\n console.log(` Entrypoint: ${mainScript?.name}`);\n }\n if (update.scriptFileIds) {\n console.log(\n ` Scripts: ${(updated.scriptFiles ?? []).map((s: { name: string }) => s.name).join(', ')}`,\n );\n }\n if (update.expectedArguments) {\n console.log(\n ` Arguments: ${updated.expectedArguments\n .map((a) => {\n const tags: string[] = [];\n if (a.fixed) tags.push('locked');\n if (a.dataType === 'boolean') tags.push('boolean');\n else if (a.options && a.options.length > 0) tags.push('dropdown');\n if (a.secret) tags.push('secret');\n const suffix = tags.length > 0 ? ` (${tags.join(', ')})` : '';\n return `${a.name}=${a.defaultValue ?? ''}${suffix}`;\n })\n .join(', ')}`,\n );\n }\n } catch (error) {\n logger.error('Failed to update app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n\n// Helper to collect multiple --add-arg options\nfunction collectArgs(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8E;AAE9E,qBAA0D;AAEnD,SAAS,mBAAmB,SAAwB;AACvD,QAAM,SAAS,QACV,QAAQ,KAAK,EACb,YAAY,mCAAmC,EAC/C;AAAA,IACG;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBJ;AAGJ,SACK,QAAQ,eAAe,EACvB,YAAY,qCAAqC,EACjD,OAAO,aAAa,wCAAwC,EAC5D,OAAO,OAAO,WAAW,YAAY;AAClC,UAAM,EAAE,cAAc,OAAO,QAAI,4CAA4B,SAAS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Q,SAAS,EAAG,MAAK,KAAK,UAAU;AAChE,gBAAI,EAAE,OAAQ,MAAK,KAAK,QAAQ;AAChC,kBAAM,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,CAAC,MAAM;AAC3D,mBAAO,GAAG,EAAE,IAAI,IAAI,EAAE,gBAAgB,EAAE,GAAG,MAAM;AAAA,UACrD,CAAC,EACA,KAAK,IAAI,CAAC;AAAA,QACnB;AAAA,MACJ;AAAA,IACJ,SAAS,OAAO;AACZ,2BAAO,MAAM,uBAAuB;AACpC,UAAI,iBAAiB,OAAO;AACxB,6BAAO,IAAI,MAAM,OAAO;AAAA,MAC5B;AACA,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;AAGA,SAAS,YAAY,OAAe,UAA8B;AAC9D,SAAO,SAAS,OAAO,CAAC,KAAK,CAAC;AAClC;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { logger } from '../utils/logger';\nimport { getFarseerClientWithFallback, showLoginPrompt, IFarseerClient } from '../services/farseerFactory';\nimport { AppArgument, AppUpdateChanges, applySourceFolderChange } from '../services/farseerApi';\nimport { parseAppArgs, resolveTenantWithOrgMapping } from '../utils/helpers';\n\nexport function registerAppCommand(program: Command): void {\n const appCmd = program\n .command('app')\n .description('Manage apps on a Farseer instance')\n .addHelpText(\n 'after',\n `\nCommands:\n list [tenant] List all apps\n show [tenant] <name...> Show app details\n create [tenant] <name...> Create a new app\n configure [tenant] <name...> Configure app (source folder, entrypoint, arguments)\n delete [tenant] <name...> Delete an app (requires --force)\n\nNote: App names with spaces don't need quotes if tenant is checked out.\n\nExamples:\n $ farseer app list mycompany # List all apps\n $ farseer app show mycompany \"My App\" # Explicit tenant\n $ farseer app show My App # Uses checked-out tenant\n $ farseer app configure \"My App\" --entrypoint index.ts\n`,\n );\n\n // List apps\n appCmd\n .command('list [tenant]')\n .description('List all apps on a Farseer instance')\n .option('--details', 'Show detailed information for each app')\n .action(async (tenantArg, options) => {\n const { organisation, tenant } = resolveTenantWithOrgMapping(tenantArg);\n\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api = result.client;\n const authLabel = result.authType === 'apiKey' ? 'API key' : 'browser login';\n logger.info(`Fetching apps from ${tenant} (using ${authLabel})...`);\n\n try {\n const apps = await api.listApps();\n\n if (apps.length === 0) {\n logger.warning('No apps found.');\n logger.dim('Create an app with: farseer app create <name>');\n return;\n }\n\n logger.header(`Apps on ${tenant}`);\n console.log();\n\n if (options.details) {\n // Fetch full details for each app\n for (const app of apps) {\n const details = await api.getApp(app.reference);\n if (details) {\n console.log(` \uD83D\uDCE6 ${chalk.bold(details.name)}`);\n if (details.description) {\n console.log(` ${chalk.dim(details.description)}`);\n }\n console.log(\n ` Status: ${details.status === 'AVAILABLE' ? chalk.green(details.status) : chalk.yellow(details.status)}`,\n );\n const detailScripts = details.scriptFiles ?? [];\n if (detailScripts.length > 0) {\n const mainScript = detailScripts.find((s) => s.id === details.mainScriptFileId);\n console.log(\n ` Entrypoint: ${mainScript ? chalk.cyan(mainScript.name) : chalk.red('Not set')}`,\n );\n console.log(` Scripts:`);\n for (const script of detailScripts) {\n const isMain = script.id === details.mainScriptFileId;\n console.log(\n ` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`,\n );\n }\n } else {\n console.log(` Scripts: ${chalk.dim('None')}`);\n }\n if (details.expectedArguments.length > 0) {\n console.log(` Arguments:`);\n for (const arg of details.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue ?? '')}`);\n }\n }\n console.log();\n }\n }\n } else {\n // Simple list\n for (const app of apps) {\n console.log(` \uD83D\uDCE6 ${app.name}`);\n }\n console.log();\n logger.dim(`Total: ${apps.length} app(s)`);\n logger.dim('Use --details to see more information.');\n }\n } catch (error) {\n logger.error('Failed to list apps.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Show app details\n appCmd\n .command('show <args...>')\n .description('Show details of an app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n const app = await api.getAppByName(appName);\n\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n logger.header(`App: ${app.name}`);\n console.log();\n console.log(` ID: ${app.id}`);\n console.log(` Status: ${app.status}`);\n if (app.description) {\n console.log(` Description: ${app.description}`);\n }\n console.log();\n\n const appScripts = app.scriptFiles ?? [];\n if (appScripts.length > 0) {\n console.log(' Scripts:');\n for (const script of appScripts) {\n const isMain = script.id === app.mainScriptFileId;\n console.log(\n ` ${isMain ? chalk.green('\u25B6') : ' '} ${script.name}${isMain ? chalk.dim(' (entrypoint)') : ''}`,\n );\n }\n } else {\n console.log(' Scripts: None');\n }\n console.log();\n\n if (app.expectedArguments.length > 0) {\n console.log(' Arguments:');\n for (const arg of app.expectedArguments) {\n console.log(` - ${arg.name}: ${chalk.dim(arg.defaultValue ?? '')}`);\n }\n } else {\n console.log(' Arguments: None');\n }\n console.log();\n });\n\n // Create app\n appCmd\n .command('create <args...>')\n .description('Create a new app')\n .action(async (args: string[]) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Check if app already exists\n const existing = await api.getAppByName(appName);\n if (existing) {\n logger.error(`App already exists: ${appName}`);\n process.exit(1);\n }\n\n logger.info(`Creating app: ${appName}...`);\n\n try {\n const app = await api.createApp(appName);\n logger.success(`App created: ${app.name} (ID: ${app.id})`);\n logger.dim('Configure it with: farseer app configure \"' + appName + '\"');\n } catch (error) {\n logger.error('Failed to create app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Delete app\n appCmd\n .command('delete <args...>')\n .description('Delete an app')\n .option('--force', 'Skip confirmation')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const app = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!app) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n if (!options.force) {\n logger.warning(`This will permanently delete app: ${app.name}`);\n logger.dim('Use --force to skip this confirmation.');\n process.exit(1);\n }\n\n logger.info(`Deleting app: ${app.name}...`);\n\n try {\n await api.deleteApp(app.id);\n\n // The folder API 200s even when nothing was deleted; confirm.\n const remaining = await api.listApps();\n if (remaining.some((a) => a.id === app.id)) {\n logger.error(`Delete reported success but \"${app.name}\" is still present.`);\n process.exit(1);\n }\n\n logger.success(`App deleted: ${app.name}`);\n } catch (error) {\n logger.error('Failed to delete app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n\n // Configure app\n appCmd\n .command('configure <args...>')\n .description('Configure an app (set source folder, entrypoint, arguments)')\n .option(\n '--entrypoint <script>',\n 'Set the entrypoint script \u2014 must be a file in the app\\'s source folder (e.g., \"index.ts\")',\n )\n .option(\n '--source-folder <path>',\n 'Set the source folder the app\\'s scripts come from (path under Files/, e.g. \"Scripts/MyApp\")',\n )\n .option(\n '--add-arg <arg>',\n 'Add argument in format \"Name=DefaultValue\" (can be used multiple times)',\n collectArgs,\n [],\n )\n .option('--description <desc>', 'Set app description')\n .option('--name <name>', 'Rename the app')\n .action(async (args: string[], options) => {\n const { organisation, tenant, appName } = parseAppArgs(args);\n const result = await getFarseerClientWithFallback(organisation, tenant);\n if (!result) {\n showLoginPrompt(tenant);\n process.exit(1);\n }\n\n const api: IFarseerClient = result.client;\n\n // Find app\n const apps = await api.listApps();\n const appListItem = apps.find((a: { name: string }) => a.name.toLowerCase() === appName.toLowerCase());\n if (!appListItem) {\n logger.error(`App not found: ${appName}`);\n process.exit(1);\n }\n\n const app = await api.getApp(appListItem.reference);\n if (!app) {\n logger.error(`Failed to load app details: ${appName}`);\n process.exit(1);\n }\n\n // Build the set of changes. updateApp merges these onto the app's\n // current state, so anything left out here is preserved.\n const changes: AppUpdateChanges = {};\n\n if (options.name) {\n changes.name = options.name;\n }\n\n if (options.description !== undefined) {\n changes.description = options.description;\n }\n\n // Source folder + entrypoint. An app's scripts are derived from its\n // source folder, and the entrypoint must be one of those files. The\n // decision lives in applySourceFolderChange (shared with the MCP\n // configure_app tool); the 'cli' caller gets dimmed, flag-worded hints.\n const sourceFolderError = await applySourceFolderChange(\n api,\n app,\n changes,\n { sourceFolder: options.sourceFolder, entrypoint: options.entrypoint },\n 'cli',\n );\n if (sourceFolderError) {\n logger.error(sourceFolderError);\n process.exit(1);\n }\n\n // Handle arguments\n if (options.addArg && options.addArg.length > 0) {\n const newArgs: AppArgument[] = [...app.expectedArguments];\n\n for (const arg of options.addArg) {\n const [name, defaultValue] = arg.split('=');\n if (!name || defaultValue === undefined) {\n logger.error(`Invalid argument format: ${arg}`);\n logger.dim('Use format: --add-arg \"Name=DefaultValue\"');\n process.exit(1);\n }\n\n // Check if arg already exists. Lookup is case-insensitive\n // (user-friendly: --add-arg JOBNAME=x updates an existing\n // jobName), but the written name uses the backend's stored\n // casing \u2014 validateExpectedArguments on the server is\n // case-sensitive, and writing the caller-supplied case\n // would silently rename the arg.\n //\n // --add-arg only sets the defaultValue on a string arg; any\n // existing axes (`dataType`, `fixed`, `options`, `secret`)\n // are preserved so updating a boolean/dropdown/locked arg\n // with --add-arg doesn't silently demote it.\n const existingIdx = newArgs.findIndex((a) => a.name.toLowerCase() === name.toLowerCase());\n if (existingIdx >= 0) {\n const existing = newArgs[existingIdx];\n newArgs[existingIdx] = {\n ...existing,\n defaultValue,\n };\n } else {\n newArgs.push({ name, dataType: 'string', defaultValue });\n }\n }\n\n changes.expectedArguments = newArgs;\n }\n\n if (Object.keys(changes).length === 0) {\n logger.warning('No changes specified.');\n logger.dim(\n 'Use --entrypoint, --source-folder, --add-arg, --description, or --name to configure the app.',\n );\n return;\n }\n\n logger.info(`Updating app: ${app.name}...`);\n\n try {\n const updated = await api.updateApp(appListItem.reference, changes, app);\n logger.success(`App updated: ${updated.name}`);\n\n // Show summary of changes\n if (changes.name) console.log(` Name: ${updated.name}`);\n if (changes.description !== undefined)\n console.log(` Description: ${updated.description || '(empty)'}`);\n if (changes.sourceFolderId !== undefined || changes.mainScriptFileId !== undefined) {\n const updatedScripts = updated.scriptFiles ?? [];\n const mainScript = updatedScripts.find((s) => s.id === updated.mainScriptFileId);\n console.log(` Entrypoint: ${mainScript?.name ?? '(none)'}`);\n console.log(` Scripts: ${updatedScripts.map((s) => s.name).join(', ') || '(none)'}`);\n }\n if (changes.expectedArguments) {\n console.log(\n ` Arguments: ${updated.expectedArguments\n .map((a) => {\n const tags: string[] = [];\n if (a.fixed) tags.push('locked');\n if (a.dataType === 'boolean') tags.push('boolean');\n else if (a.options && a.options.length > 0) tags.push('dropdown');\n if (a.secret) tags.push('secret');\n const suffix = tags.length > 0 ? ` (${tags.join(', ')})` : '';\n return `${a.name}=${a.defaultValue ?? ''}${suffix}`;\n })\n .join(', ')}`,\n );\n }\n } catch (error) {\n logger.error('Failed to update app.');\n if (error instanceof Error) {\n logger.dim(error.message);\n }\n process.exit(1);\n }\n });\n}\n\n// Helper to collect multiple --add-arg options\nfunction collectArgs(value: string, previous: string[]): string[] {\n return previous.concat([value]);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAuB;AACvB,4BAA8E;AAC9E,wBAAuE;AACvE,qBAA0D;AAEnD,SAAS,mBAAm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Q,mBAAmB;AAC3B,gBAAQ;AAAA,UACJ,gBAAgB,QAAQ,kBACnB,IAAI,CAAC,MAAM;AACR,kBAAM,OAAiB,CAAC;AACxB,gBAAI,EAAE,MAAO,MAAK,KAAK,QAAQ;AAC/B,gBAAI,EAAE,aAAa,UAAW,MAAK,KAAK,SAAS;AAAA,qBACxC,EAAE,WAAW,EAAE,QAAQ,SAAS,EAAG,MAAK,KAAK,UAAU;AAChE,gBAAI,EAAE,OAAQ,MAAK,KAAK,QAAQ;AAChC,kBAAM,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,CAAC,MAAM;AAC3D,mBAAO,GAAG,EAAE,IAAI,IAAI,EAAE,gBAAgB,EAAE,GAAG,MAAM;AAAA,UACrD,CAAC,EACA,KAAK,IAAI,CAAC;AAAA,QACnB;AAAA,MACJ;AAAA,IACJ,SAAS,OAAO;AACZ,2BAAO,MAAM,uBAAuB;AACpC,UAAI,iBAAiB,OAAO;AACxB,6BAAO,IAAI,MAAM,OAAO;AAAA,MAC5B;AACA,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ,CAAC;AACT;AAGA,SAAS,YAAY,OAAe,UAA8B;AAC9D,SAAO,SAAS,OAAO,CAAC,KAAK,CAAC;AAClC;",
6
6
  "names": ["chalk"]
7
7
  }
@@ -116,8 +116,8 @@ Steps to follow:
116
116
  3. Create the app with farseer_create_app (name: "${appName}")
117
117
 
118
118
  4. Configure the app with farseer_configure_app:
119
+ - sourceFolder: "Scripts"
119
120
  - entrypoint: "${script}"
120
- - scripts: ["${script}"]
121
121
  - arguments: Add any arguments the script expects (they arrive via process.argv)
122
122
 
123
123
  5. Test with farseer_run_app
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/mcp/prompts/workflows.ts"],
4
- "sourcesContent": ["/**\n * Workflow Prompts\n *\n * Reusable prompt templates for common Farseer workflows.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\n\n// Define schemas outside of prompt registration to avoid deep type instantiation\nconst setupTenantSchema = {\n tenant: z.string().describe('Tenant name to setup'),\n};\n\nconst createAppSchema = {\n tenant: z.string().describe('Tenant name'),\n appName: z.string().describe('Name for the new app'),\n scriptName: z.string().optional().describe('Main script filename (default: index.ts)'),\n};\n\nconst understandModelSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nconst writeImportScriptSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Target variable to import into'),\n};\n\nconst copyAppSchema = {\n tenant: z.string().describe('Tenant name'),\n sourceApp: z.string().describe('Name of app to copy'),\n newAppName: z.string().describe('Name for the new app'),\n};\n\nconst exportDataSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Variable to export'),\n};\n\nconst debugSyncSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nexport function registerWorkflowPrompts(server: McpServer): void {\n // Cast to any to avoid very deep generic type instantiation from the MCP SDK\n const anyServer = server as any;\n // Setup new tenant\n anyServer.prompt(\n 'setup_new_tenant',\n 'Guide for setting up a new Farseer tenant: login, checkout, pull, install dependencies.',\n setupTenantSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `You are setting up a new Farseer tenant \"${tenant}\".\n\nSteps to follow:\n\n1. First, check authentication status with farseer_whoami\n2. If not logged in, inform the user to run \"farseer login\" in terminal (MCP cannot do browser login)\n3. Use farseer_checkout to set \"${tenant}\" as the default tenant (this also pulls files and apps)\n4. Tell user to run \"farseer install ${tenant}\" in terminal to install npm dependencies\n5. Use farseer_list_apps to show available apps\n6. Use farseer_export_model to understand the data structure\n\nAfter setup, the user can:\n- Run apps with farseer_run_app\n- Edit scripts in apps/${tenant}/files/Scripts/\n- Push changes with farseer_push\n- Check model with farseer_get_variable or farseer_get_table`,\n },\n },\n ],\n };\n },\n );\n\n // Create new app\n anyServer.prompt(\n 'create_new_app',\n 'Guide for creating a new Farseer app from scratch.',\n createAppSchema,\n async (params: { tenant: string; appName: string; scriptName?: string }) => {\n const { tenant, appName, scriptName } = params;\n const script = scriptName || 'index.ts';\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Creating a new Farseer app \"${appName}\" for tenant \"${tenant}\".\n\nIMPORTANT: A Farseer App = a TypeScript script + an app config that tells Farseer which script to run and with what arguments.\nThe script uses \\`farseer-client\\` to interact with the Farseer API.\nAuthentication is automatic - \\`new FarseerClient()\\` reads credentials from environment variables injected by the CLI.\nYou NEVER hardcode credentials in scripts.\n\nSteps to follow:\n\n1. Write the script file at farseer-apps/${tenant}/files/Scripts/${script}\n Use the template below as a starting point.\n\n2. Push the script to remote with farseer_push\n (Scripts must exist on remote before they can be assigned to an app)\n\n3. Create the app with farseer_create_app (name: \"${appName}\")\n\n4. Configure the app with farseer_configure_app:\n - entrypoint: \"${script}\"\n - scripts: [\"${script}\"]\n - arguments: Add any arguments the script expects (they arrive via process.argv)\n\n5. Test with farseer_run_app\n The CLI injects auth credentials as env vars and runs the script with npx tsx.\n\nScript template:\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\n// FarseerClient auto-configures from env vars injected by \"farseer run\"\n// NEVER hardcode credentials - just use the empty constructor\nconst client = new farseer.FarseerClient();\n\n// Arguments come via process.argv in the order defined by app config\nconst args = process.argv.slice(2);\n\nasync function main() {\n // Load dimension/variable metadata\n await client.initTagMap();\n\n // Your code here\n console.log('App running successfully');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\``,\n },\n },\n ],\n };\n },\n );\n\n // Understand model\n anyServer.prompt(\n 'understand_model',\n 'Explore and understand the data model of a Farseer tenant.',\n understandModelSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Analyzing the data model for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_export_model to get the full model structure\n\n2. Review dimension tables:\n - Use farseer_list_tables for overview\n - Key dimensions usually include: Products, Regions, Time (Months, Years), Versions\n - Check foreign key relationships between tables\n\n3. Review variables:\n - Use farseer_list_variables for overview\n - Use farseer_get_variable for specific variable details\n - Note which dimensions each variable has\n\n4. For import scripts, you need to know:\n - Target variable name\n - All dimensions the variable has\n - Valid members for each dimension\n\nKey concepts:\n- Dimensions structure the data (Product, Region, Month, Year, Version)\n- Variables store values at dimension intersections\n- Formulas calculate values automatically\n- Roll-up types determine aggregation (SUM, AVERAGE, etc.)\n\nCommon dimension tables:\n- Months, Years (time)\n- Versions (Plan, Actual, Forecast)\n- Products, Categories, Brands\n- Regions, Entities, Cost Centers`,\n },\n },\n ],\n };\n },\n );\n\n // Write import script\n anyServer.prompt(\n 'write_import_script',\n 'Guide for writing a data import script.',\n writeImportScriptSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Writing an import script for variable \"${variableName}\" in tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the target variable:\n - What dimensions does it have?\n - What is the roll-up type?\n\n2. Use farseer_get_table for each dimension to see valid members\n\n3. Create the import script with this pattern:\n\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\nconst client = new farseer.FarseerClient();\n\nasync function main() {\n await client.initTagMap();\n\n // Create import job with column definitions\n const importJob = await client.createImportJob({\n title: 'Import ${variableName}',\n columns: [\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Product' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },\n { type: 'VARIABLE', variableName: '${variableName}' },\n ],\n labels: ['auto', 'import-${variableName.toLowerCase().replace(/\\s+/g, '-')}']\n });\n\n // Add rows - each row matches column order\n const rows = [\n ['ProductA', 'Y2025', 'M1', 'Plan', 1000],\n ['ProductB', 'Y2025', 'M1', 'Plan', 2000],\n ];\n\n await importJob.addRows(rows);\n await importJob.flushRows();\n await importJob.undoPrevious(); // Remove previous import\n await importJob.commit();\n\n console.log('Import completed!');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\`\n\n4. Save script to apps/${tenant}/files/Scripts/\n5. Push with farseer_push\n6. Create app with farseer_create_app\n7. Configure with farseer_configure_app\n8. Test with farseer_run_app\n\nALTERNATIVE: For simple imports without a script, use the farseer_create_import_job tool directly.\nIt handles the full workflow (create metadata, add rows, undo previous, commit) in a single call.\nUse farseer_create_import_job when:\n- Data is already available (no need to fetch from external source)\n- The import is a one-time or simple operation\n- You want to quickly import without creating a full script\n\nUse a script when:\n- Data comes from external sources (APIs, databases, files)\n- Complex data transformation is needed\n- The import runs on a schedule as an App`,\n },\n },\n ],\n };\n },\n );\n\n // Copy existing app\n anyServer.prompt(\n 'copy_app',\n 'Guide for copying an existing app to create a new one.',\n copyAppSchema,\n async (params: { tenant: string; sourceApp: string; newAppName: string }) => {\n const { tenant, sourceApp, newAppName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Copying app \"${sourceApp}\" to create \"${newAppName}\" for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Pull latest with farseer_pull to get current app JSON\n\n2. Use farseer_get_app to see the source app configuration\n\n3. The app JSON files are in apps/${tenant}/apps/\n\n Copy the source JSON file and modify:\n - Change \"name\" to \"${newAppName}\"\n - **IMPORTANT: Remove \"_remote\" field** (this makes it a new app)\n - Modify arguments, description as needed\n\n4. JSON format for new app:\n\\`\\`\\`json\n{\n \"name\": \"${newAppName}\",\n \"description\": \"Copied from ${sourceApp}\",\n \"entrypoint\": \"script.ts\",\n \"scripts\": [\"script.ts\"],\n \"arguments\": [\n { \"name\": \"Year\", \"defaultValue\": \"2025\" }\n ]\n}\n\\`\\`\\`\n\nNote: Do NOT include \"_remote\" for new apps - CLI adds it after first push.\n\n5. Push with farseer_push to create the new app\n\n6. Test with farseer_run_app`,\n },\n },\n ],\n };\n },\n );\n\n // Export data\n anyServer.prompt(\n 'export_data',\n 'Guide for exporting variable data from Farseer.',\n exportDataSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Exporting data for variable \"${variableName}\" from tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the variable:\n - What dimensions does it span?\n - What is its data type?\n\n2. Choose export method:\n\n **Option A: Quick export (farseer_export_variable_data)**\n - Uses ExportApi.exportFormula() internally\n - Returns CSV/JSON data inline\n - Good for quick inspection or small datasets\n - Use 'limit' parameter for large datasets\n\n **Option B: Structured export (farseer_load_variable_data)**\n - Uses data.loadFarseerVariable() internally\n - Can specify which dimensions to include as columns\n - Returns structured CSV data\n - Good when you need specific dimension breakdowns\n\n **Option C: CLI export (farseer variable export)**\n - Saves CSV/JSON/XLSX to a local file\n - Best for saving data locally for analysis\n\n3. For analysis:\n - Parse the CSV data returned by the tools\n - Summarize, filter, or transform as needed`,\n },\n },\n ],\n };\n },\n );\n\n // Debug sync issues\n anyServer.prompt(\n 'debug_sync_issues',\n 'Troubleshoot synchronization problems between local and remote.',\n debugSyncSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Debugging sync issues for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Check authentication: farseer_whoami\n - Is JWT valid?\n - Is tenant checked out?\n\n2. Check sync status: farseer_status\n - Are there modified files?\n - Are there only-local or only-remote files?\n\n3. If files show as modified:\n - Use farseer_diff to see differences\n - Decide: pull (accept remote) or push (upload local)\n\n4. Common issues and solutions:\n\n **\"No credentials found\"**\n \u2192 User needs to run \"farseer login\" in terminal\n \u2192 Or configure API key: \"farseer config set ${tenant} --api-key KEY\"\n\n **\"Remote has changes\"**\n \u2192 Pull first with farseer_pull\n \u2192 Then push with farseer_push\n\n **\"Token expired\"**\n \u2192 User needs to run \"farseer login\" again\n\n **Apps not syncing**\n \u2192 Need JWT login (browser), not API key\n \u2192 API key only syncs files, not apps\n\n5. Force resolution:\n - To accept all remote changes: farseer_pull with force=true (overwrites local)\n - To accept all local changes: farseer_push with force=true (overwrites remote)\n - For selective resolution: farseer_pull without force will skip conflicts (resolve via CLI)\n\n6. Check specific file diff:\n - Use farseer_diff with file parameter to see exact changes`,\n },\n },\n ],\n };\n },\n );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAAkB;AAGlB,MAAM,oBAAoB;AAAA,EACtB,QAAQ,aAAE,OAAO,EAAE,SAAS,sBAAsB;AACtD;AAEA,MAAM,kBAAkB;AAAA,EACpB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,SAAS,aAAE,OAAO,EAAE,SAAS,sBAAsB;AAAA,EACnD,YAAY,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0CAA0C;AACzF;AAEA,MAAM,wBAAwB;AAAA,EAC1B,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAC7C;AAEA,MAAM,0BAA0B;AAAA,EAC5B,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,cAAc,aAAE,OAAO,EAAE,SAAS,gCAAgC;AACtE;AAEA,MAAM,gBAAgB;AAAA,EAClB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,WAAW,aAAE,OAAO,EAAE,SAAS,qBAAqB;AAAA,EACpD,YAAY,aAAE,OAAO,EAAE,SAAS,sBAAsB;AAC1D;AAEA,MAAM,mBAAmB;AAAA,EACrB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,cAAc,aAAE,OAAO,EAAE,SAAS,oBAAoB;AAC1D;AAEA,MAAM,kBAAkB;AAAA,EACpB,QAAQ,aAAE,OAAO,EAAE,SA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N,SAAS;AAAA,cACL,MAAM;AAAA,cACN,MAAM,qCAAqC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sDAoB5B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAoB/B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
4
+ "sourcesContent": ["/**\n * Workflow Prompts\n *\n * Reusable prompt templates for common Farseer workflows.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\n\n// Define schemas outside of prompt registration to avoid deep type instantiation\nconst setupTenantSchema = {\n tenant: z.string().describe('Tenant name to setup'),\n};\n\nconst createAppSchema = {\n tenant: z.string().describe('Tenant name'),\n appName: z.string().describe('Name for the new app'),\n scriptName: z.string().optional().describe('Main script filename (default: index.ts)'),\n};\n\nconst understandModelSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nconst writeImportScriptSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Target variable to import into'),\n};\n\nconst copyAppSchema = {\n tenant: z.string().describe('Tenant name'),\n sourceApp: z.string().describe('Name of app to copy'),\n newAppName: z.string().describe('Name for the new app'),\n};\n\nconst exportDataSchema = {\n tenant: z.string().describe('Tenant name'),\n variableName: z.string().describe('Variable to export'),\n};\n\nconst debugSyncSchema = {\n tenant: z.string().describe('Tenant name'),\n};\n\nexport function registerWorkflowPrompts(server: McpServer): void {\n // Cast to any to avoid very deep generic type instantiation from the MCP SDK\n const anyServer = server as any;\n // Setup new tenant\n anyServer.prompt(\n 'setup_new_tenant',\n 'Guide for setting up a new Farseer tenant: login, checkout, pull, install dependencies.',\n setupTenantSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `You are setting up a new Farseer tenant \"${tenant}\".\n\nSteps to follow:\n\n1. First, check authentication status with farseer_whoami\n2. If not logged in, inform the user to run \"farseer login\" in terminal (MCP cannot do browser login)\n3. Use farseer_checkout to set \"${tenant}\" as the default tenant (this also pulls files and apps)\n4. Tell user to run \"farseer install ${tenant}\" in terminal to install npm dependencies\n5. Use farseer_list_apps to show available apps\n6. Use farseer_export_model to understand the data structure\n\nAfter setup, the user can:\n- Run apps with farseer_run_app\n- Edit scripts in apps/${tenant}/files/Scripts/\n- Push changes with farseer_push\n- Check model with farseer_get_variable or farseer_get_table`,\n },\n },\n ],\n };\n },\n );\n\n // Create new app\n anyServer.prompt(\n 'create_new_app',\n 'Guide for creating a new Farseer app from scratch.',\n createAppSchema,\n async (params: { tenant: string; appName: string; scriptName?: string }) => {\n const { tenant, appName, scriptName } = params;\n const script = scriptName || 'index.ts';\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Creating a new Farseer app \"${appName}\" for tenant \"${tenant}\".\n\nIMPORTANT: A Farseer App = a TypeScript script + an app config that tells Farseer which script to run and with what arguments.\nThe script uses \\`farseer-client\\` to interact with the Farseer API.\nAuthentication is automatic - \\`new FarseerClient()\\` reads credentials from environment variables injected by the CLI.\nYou NEVER hardcode credentials in scripts.\n\nSteps to follow:\n\n1. Write the script file at farseer-apps/${tenant}/files/Scripts/${script}\n Use the template below as a starting point.\n\n2. Push the script to remote with farseer_push\n (Scripts must exist on remote before they can be assigned to an app)\n\n3. Create the app with farseer_create_app (name: \"${appName}\")\n\n4. Configure the app with farseer_configure_app:\n - sourceFolder: \"Scripts\"\n - entrypoint: \"${script}\"\n - arguments: Add any arguments the script expects (they arrive via process.argv)\n\n5. Test with farseer_run_app\n The CLI injects auth credentials as env vars and runs the script with npx tsx.\n\nScript template:\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\n// FarseerClient auto-configures from env vars injected by \"farseer run\"\n// NEVER hardcode credentials - just use the empty constructor\nconst client = new farseer.FarseerClient();\n\n// Arguments come via process.argv in the order defined by app config\nconst args = process.argv.slice(2);\n\nasync function main() {\n // Load dimension/variable metadata\n await client.initTagMap();\n\n // Your code here\n console.log('App running successfully');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\``,\n },\n },\n ],\n };\n },\n );\n\n // Understand model\n anyServer.prompt(\n 'understand_model',\n 'Explore and understand the data model of a Farseer tenant.',\n understandModelSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Analyzing the data model for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_export_model to get the full model structure\n\n2. Review dimension tables:\n - Use farseer_list_tables for overview\n - Key dimensions usually include: Products, Regions, Time (Months, Years), Versions\n - Check foreign key relationships between tables\n\n3. Review variables:\n - Use farseer_list_variables for overview\n - Use farseer_get_variable for specific variable details\n - Note which dimensions each variable has\n\n4. For import scripts, you need to know:\n - Target variable name\n - All dimensions the variable has\n - Valid members for each dimension\n\nKey concepts:\n- Dimensions structure the data (Product, Region, Month, Year, Version)\n- Variables store values at dimension intersections\n- Formulas calculate values automatically\n- Roll-up types determine aggregation (SUM, AVERAGE, etc.)\n\nCommon dimension tables:\n- Months, Years (time)\n- Versions (Plan, Actual, Forecast)\n- Products, Categories, Brands\n- Regions, Entities, Cost Centers`,\n },\n },\n ],\n };\n },\n );\n\n // Write import script\n anyServer.prompt(\n 'write_import_script',\n 'Guide for writing a data import script.',\n writeImportScriptSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Writing an import script for variable \"${variableName}\" in tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the target variable:\n - What dimensions does it have?\n - What is the roll-up type?\n\n2. Use farseer_get_table for each dimension to see valid members\n\n3. Create the import script with this pattern:\n\n\\`\\`\\`typescript\nimport * as farseer from 'farseer-client';\n\nconst client = new farseer.FarseerClient();\n\nasync function main() {\n await client.initTagMap();\n\n // Create import job with column definitions\n const importJob = await client.createImportJob({\n title: 'Import ${variableName}',\n columns: [\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Product' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Years' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Months' },\n { type: 'DIMENSION_TABLE', dimensionTableName: 'Versions' },\n { type: 'VARIABLE', variableName: '${variableName}' },\n ],\n labels: ['auto', 'import-${variableName.toLowerCase().replace(/\\s+/g, '-')}']\n });\n\n // Add rows - each row matches column order\n const rows = [\n ['ProductA', 'Y2025', 'M1', 'Plan', 1000],\n ['ProductB', 'Y2025', 'M1', 'Plan', 2000],\n ];\n\n await importJob.addRows(rows);\n await importJob.flushRows();\n await importJob.undoPrevious(); // Remove previous import\n await importJob.commit();\n\n console.log('Import completed!');\n}\n\nmain().catch(farseer.handleUnknownError);\n\\`\\`\\`\n\n4. Save script to apps/${tenant}/files/Scripts/\n5. Push with farseer_push\n6. Create app with farseer_create_app\n7. Configure with farseer_configure_app\n8. Test with farseer_run_app\n\nALTERNATIVE: For simple imports without a script, use the farseer_create_import_job tool directly.\nIt handles the full workflow (create metadata, add rows, undo previous, commit) in a single call.\nUse farseer_create_import_job when:\n- Data is already available (no need to fetch from external source)\n- The import is a one-time or simple operation\n- You want to quickly import without creating a full script\n\nUse a script when:\n- Data comes from external sources (APIs, databases, files)\n- Complex data transformation is needed\n- The import runs on a schedule as an App`,\n },\n },\n ],\n };\n },\n );\n\n // Copy existing app\n anyServer.prompt(\n 'copy_app',\n 'Guide for copying an existing app to create a new one.',\n copyAppSchema,\n async (params: { tenant: string; sourceApp: string; newAppName: string }) => {\n const { tenant, sourceApp, newAppName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Copying app \"${sourceApp}\" to create \"${newAppName}\" for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Pull latest with farseer_pull to get current app JSON\n\n2. Use farseer_get_app to see the source app configuration\n\n3. The app JSON files are in apps/${tenant}/apps/\n\n Copy the source JSON file and modify:\n - Change \"name\" to \"${newAppName}\"\n - **IMPORTANT: Remove \"_remote\" field** (this makes it a new app)\n - Modify arguments, description as needed\n\n4. JSON format for new app:\n\\`\\`\\`json\n{\n \"name\": \"${newAppName}\",\n \"description\": \"Copied from ${sourceApp}\",\n \"entrypoint\": \"script.ts\",\n \"scripts\": [\"script.ts\"],\n \"arguments\": [\n { \"name\": \"Year\", \"defaultValue\": \"2025\" }\n ]\n}\n\\`\\`\\`\n\nNote: Do NOT include \"_remote\" for new apps - CLI adds it after first push.\n\n5. Push with farseer_push to create the new app\n\n6. Test with farseer_run_app`,\n },\n },\n ],\n };\n },\n );\n\n // Export data\n anyServer.prompt(\n 'export_data',\n 'Guide for exporting variable data from Farseer.',\n exportDataSchema,\n async (params: { tenant: string; variableName: string }) => {\n const { tenant, variableName } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Exporting data for variable \"${variableName}\" from tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Use farseer_get_variable to understand the variable:\n - What dimensions does it span?\n - What is its data type?\n\n2. Choose export method:\n\n **Option A: Quick export (farseer_export_variable_data)**\n - Uses ExportApi.exportFormula() internally\n - Returns CSV/JSON data inline\n - Good for quick inspection or small datasets\n - Use 'limit' parameter for large datasets\n\n **Option B: Structured export (farseer_load_variable_data)**\n - Uses data.loadFarseerVariable() internally\n - Can specify which dimensions to include as columns\n - Returns structured CSV data\n - Good when you need specific dimension breakdowns\n\n **Option C: CLI export (farseer variable export)**\n - Saves CSV/JSON/XLSX to a local file\n - Best for saving data locally for analysis\n\n3. For analysis:\n - Parse the CSV data returned by the tools\n - Summarize, filter, or transform as needed`,\n },\n },\n ],\n };\n },\n );\n\n // Debug sync issues\n anyServer.prompt(\n 'debug_sync_issues',\n 'Troubleshoot synchronization problems between local and remote.',\n debugSyncSchema,\n async (params: { tenant: string }) => {\n const { tenant } = params;\n return {\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: `Debugging sync issues for tenant \"${tenant}\".\n\nSteps to follow:\n\n1. Check authentication: farseer_whoami\n - Is JWT valid?\n - Is tenant checked out?\n\n2. Check sync status: farseer_status\n - Are there modified files?\n - Are there only-local or only-remote files?\n\n3. If files show as modified:\n - Use farseer_diff to see differences\n - Decide: pull (accept remote) or push (upload local)\n\n4. Common issues and solutions:\n\n **\"No credentials found\"**\n \u2192 User needs to run \"farseer login\" in terminal\n \u2192 Or configure API key: \"farseer config set ${tenant} --api-key KEY\"\n\n **\"Remote has changes\"**\n \u2192 Pull first with farseer_pull\n \u2192 Then push with farseer_push\n\n **\"Token expired\"**\n \u2192 User needs to run \"farseer login\" again\n\n **Apps not syncing**\n \u2192 Need JWT login (browser), not API key\n \u2192 API key only syncs files, not apps\n\n5. Force resolution:\n - To accept all remote changes: farseer_pull with force=true (overwrites local)\n - To accept all local changes: farseer_push with force=true (overwrites remote)\n - For selective resolution: farseer_pull without force will skip conflicts (resolve via CLI)\n\n6. Check specific file diff:\n - Use farseer_diff with file parameter to see exact changes`,\n },\n },\n ],\n };\n },\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAAkB;AAGlB,MAAM,oBAAoB;AAAA,EACtB,QAAQ,aAAE,OAAO,EAAE,SAAS,sBAAsB;AACtD;AAEA,MAAM,kBAAkB;AAAA,EACpB,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AAAA,EACzC,SAAS,aAAE,OAAO,EAAE,SAAS,sBAAsB;AAAA,EACnD,YAAY,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0CAA0C;AACzF;AAEA,MAAM,wBAAwB;AAAA,EAC1B,QAAQ,aAAE,OAAO,EAAE,SAAS,aAAa;AA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