farseer-cli 1.18.0 → 1.20.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.
Files changed (262) hide show
  1. package/README.md +33 -10
  2. package/dist/commands/app.js +42 -3
  3. package/dist/commands/app.js.map +1 -2
  4. package/dist/commands/apps.js.map +0 -1
  5. package/dist/commands/cells.js +120 -85
  6. package/dist/commands/cells.js.map +1 -2
  7. package/dist/commands/code.js.map +0 -1
  8. package/dist/commands/config.js.map +0 -1
  9. package/dist/commands/dashboards.js +246 -12
  10. package/dist/commands/dashboards.js.map +1 -2
  11. package/dist/commands/diff.js.map +0 -1
  12. package/dist/commands/dimensions.js +52 -27
  13. package/dist/commands/dimensions.js.map +1 -2
  14. package/dist/commands/docs.js +82 -0
  15. package/dist/commands/docs.js.map +6 -0
  16. package/dist/commands/files.js +49 -0
  17. package/dist/commands/files.js.map +2 -3
  18. package/dist/commands/folders.js +76 -0
  19. package/dist/commands/folders.js.map +6 -0
  20. package/dist/commands/formula.js +38 -30
  21. package/dist/commands/formula.js.map +1 -2
  22. package/dist/commands/install.js +32 -30
  23. package/dist/commands/install.js.map +2 -3
  24. package/dist/commands/list.js.map +0 -1
  25. package/dist/commands/login.js +3 -3
  26. package/dist/commands/login.js.map +1 -2
  27. package/dist/commands/logout.js.map +0 -1
  28. package/dist/commands/mcp-server.js.map +0 -1
  29. package/dist/commands/model.js +30 -5
  30. package/dist/commands/model.js.map +2 -3
  31. package/dist/commands/pipeline.js.map +0 -1
  32. package/dist/commands/pull.js +1 -1
  33. package/dist/commands/pull.js.map +1 -2
  34. package/dist/commands/push.js +6 -4
  35. package/dist/commands/push.js.map +1 -2
  36. package/dist/commands/refresh.js.map +0 -1
  37. package/dist/commands/run.js.map +0 -1
  38. package/dist/commands/sheets.js +289 -52
  39. package/dist/commands/sheets.js.map +1 -2
  40. package/dist/commands/skills.js +157 -0
  41. package/dist/commands/skills.js.map +6 -0
  42. package/dist/commands/status.js.map +0 -1
  43. package/dist/commands/tool.js.map +0 -1
  44. package/dist/commands/variables.js +246 -82
  45. package/dist/commands/variables.js.map +1 -2
  46. package/dist/commands/whoami.js.map +0 -1
  47. package/dist/index.js +117 -23
  48. package/dist/index.js.map +1 -2
  49. package/dist/mcp/index.js.map +0 -1
  50. package/dist/mcp/prompts/workflows.js.map +0 -1
  51. package/dist/mcp/resources/documentation.js +19 -12
  52. package/dist/mcp/resources/documentation.js.map +1 -2
  53. package/dist/mcp/server.js.map +0 -1
  54. package/dist/mcp/skills.js.map +0 -1
  55. package/dist/mcp/tools/appTools.js +1 -7
  56. package/dist/mcp/tools/appTools.js.map +1 -2
  57. package/dist/mcp/tools/authTools.js +1 -1
  58. package/dist/mcp/tools/authTools.js.map +1 -2
  59. package/dist/mcp/tools/cellTools.js +6 -19
  60. package/dist/mcp/tools/cellTools.js.map +1 -2
  61. package/dist/mcp/tools/dashboardTools.js +30 -412
  62. package/dist/mcp/tools/dashboardTools.js.map +2 -3
  63. package/dist/mcp/tools/dataTools.js +15 -146
  64. package/dist/mcp/tools/dataTools.js.map +1 -2
  65. package/dist/mcp/tools/folderTools.js +12 -78
  66. package/dist/mcp/tools/folderTools.js.map +1 -2
  67. package/dist/mcp/tools/modelTools.js +23 -372
  68. package/dist/mcp/tools/modelTools.js.map +1 -2
  69. package/dist/mcp/tools/pipelineContract.js +5 -1
  70. package/dist/mcp/tools/pipelineContract.js.map +1 -2
  71. package/dist/mcp/tools/pipelineTools.js.map +0 -1
  72. package/dist/mcp/tools/runTools.js +8 -69
  73. package/dist/mcp/tools/runTools.js.map +1 -2
  74. package/dist/mcp/tools/sheetTools.js +14 -264
  75. package/dist/mcp/tools/sheetTools.js.map +1 -2
  76. package/dist/mcp/tools/syncTools.js +7 -3
  77. package/dist/mcp/tools/syncTools.js.map +1 -2
  78. package/dist/mcp/utils/helpers.js.map +0 -1
  79. package/dist/mcp/utils/launchPin.js.map +0 -1
  80. package/dist/mcp/utils/operationResponse.js +41 -0
  81. package/dist/mcp/utils/operationResponse.js.map +6 -0
  82. package/dist/mcp/utils/registerTool.js.map +0 -1
  83. package/dist/mcp/utils/session.js.map +0 -1
  84. package/dist/mcp/utils/tenantPin.js.map +0 -1
  85. package/dist/operations/cells.js +444 -0
  86. package/dist/operations/cells.js.map +6 -0
  87. package/dist/operations/dashboards.js +357 -0
  88. package/dist/operations/dashboards.js.map +6 -0
  89. package/dist/operations/data.js +206 -0
  90. package/dist/operations/data.js.map +6 -0
  91. package/dist/operations/errors.js +64 -0
  92. package/dist/operations/errors.js.map +6 -0
  93. package/dist/operations/exportModel.js +59 -0
  94. package/dist/operations/exportModel.js.map +6 -0
  95. package/dist/operations/folderPath.js +128 -0
  96. package/dist/operations/folderPath.js.map +6 -0
  97. package/dist/operations/folders.js +80 -0
  98. package/dist/operations/folders.js.map +6 -0
  99. package/dist/operations/install.js +109 -0
  100. package/dist/operations/install.js.map +6 -0
  101. package/dist/operations/model.js +271 -0
  102. package/dist/operations/model.js.map +6 -0
  103. package/dist/operations/sheets.js +428 -0
  104. package/dist/operations/sheets.js.map +6 -0
  105. package/dist/pipeline/compatibility.js.map +0 -1
  106. package/dist/pipeline/connect.js.map +0 -1
  107. package/dist/pipeline/create.js.map +0 -1
  108. package/dist/pipeline/errors.js.map +0 -1
  109. package/dist/pipeline/failStep.js +43 -0
  110. package/dist/pipeline/failStep.js.map +6 -0
  111. package/dist/pipeline/generated-reference.json +25 -13
  112. package/dist/pipeline/guide.js.map +0 -1
  113. package/dist/pipeline/init.js.map +0 -1
  114. package/dist/pipeline/operations.js.map +0 -1
  115. package/dist/pipeline/query.js.map +0 -1
  116. package/dist/pipeline/queryDownloads.js.map +0 -1
  117. package/dist/pipeline/queryWorker.js +3 -1
  118. package/dist/pipeline/queryWorker.js.map +1 -2
  119. package/dist/pipeline/readiness.js.map +0 -1
  120. package/dist/pipeline/reference.js.map +0 -1
  121. package/dist/pipeline/requests.js +3 -32
  122. package/dist/pipeline/requests.js.map +1 -2
  123. package/dist/pipeline/runArguments.js.map +0 -1
  124. package/dist/pipeline/runtime.js.map +0 -1
  125. package/dist/pipeline/service.js +46 -2
  126. package/dist/pipeline/service.js.map +1 -2
  127. package/dist/services/appSyncService.js +59 -9
  128. package/dist/services/appSyncService.js.map +1 -2
  129. package/dist/services/apps.js +10 -0
  130. package/dist/services/apps.js.map +1 -2
  131. package/dist/services/authErrors.js.map +0 -1
  132. package/dist/services/codefirst/api.js +38 -5
  133. package/dist/services/codefirst/api.js.map +1 -2
  134. package/dist/services/codefirst/binaryDisk.js.map +0 -1
  135. package/dist/services/codefirst/byteHashes.js +5 -0
  136. package/dist/services/codefirst/byteHashes.js.map +1 -2
  137. package/dist/services/codefirst/documents.js +41 -15
  138. package/dist/services/codefirst/documents.js.map +1 -2
  139. package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
  140. package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
  141. package/dist/services/codefirst/layoutCompose.js +44 -38
  142. package/dist/services/codefirst/layoutCompose.js.map +1 -2
  143. package/dist/services/codefirst/layoutCore.js +14 -1
  144. package/dist/services/codefirst/layoutCore.js.map +1 -2
  145. package/dist/services/codefirst/layoutPaths.js +80 -4
  146. package/dist/services/codefirst/layoutPaths.js.map +1 -2
  147. package/dist/services/codefirst/layoutProjection.js +73 -39
  148. package/dist/services/codefirst/layoutProjection.js.map +1 -2
  149. package/dist/services/codefirst/layoutReadback.js +357 -130
  150. package/dist/services/codefirst/layoutReadback.js.map +2 -3
  151. package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
  152. package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
  153. package/dist/services/codefirst/layoutReceipt.js +283 -243
  154. package/dist/services/codefirst/layoutReceipt.js.map +2 -3
  155. package/dist/services/codefirst/layoutScan.js +208 -110
  156. package/dist/services/codefirst/layoutScan.js.map +1 -2
  157. package/dist/services/codefirst/output.js +76 -10
  158. package/dist/services/codefirst/output.js.map +1 -2
  159. package/dist/services/codefirst/types.js.map +0 -1
  160. package/dist/services/codefirst/workflow.js +65 -29
  161. package/dist/services/codefirst/workflow.js.map +2 -3
  162. package/dist/services/codefirst/workspace.js.map +0 -1
  163. package/dist/services/codefirst/workspaceLock.js.map +0 -1
  164. package/dist/services/codefirst/workspaceRoot.js +2 -1
  165. package/dist/services/codefirst/workspaceRoot.js.map +1 -2
  166. package/dist/services/configService.js.map +0 -1
  167. package/dist/services/credentials.js.map +0 -1
  168. package/dist/services/farseerService.js +31 -7
  169. package/dist/services/farseerService.js.map +1 -2
  170. package/dist/services/httpError.js.map +0 -1
  171. package/dist/services/modelExport.js.map +0 -1
  172. package/dist/services/organisation.js.map +0 -1
  173. package/dist/services/preflight.js.map +0 -1
  174. package/dist/services/realms.js.map +0 -1
  175. package/dist/services/syncService.js +3 -3
  176. package/dist/services/syncService.js.map +1 -2
  177. package/dist/skills/bundled.js +106 -0
  178. package/dist/skills/bundled.js.map +6 -0
  179. package/dist/skills/install.js +257 -0
  180. package/dist/skills/install.js.map +6 -0
  181. package/dist/skills/pipeline.js +10 -18
  182. package/dist/skills/pipeline.js.map +1 -2
  183. package/dist/utils/agentSandbox.js +1 -1
  184. package/dist/utils/agentSandbox.js.map +0 -1
  185. package/dist/utils/cliOptions.js.map +0 -1
  186. package/dist/utils/constants.js.map +0 -1
  187. package/dist/utils/entityResolver.js +72 -25
  188. package/dist/utils/entityResolver.js.map +1 -2
  189. package/dist/utils/errorFormatter.js +72 -11
  190. package/dist/utils/errorFormatter.js.map +1 -2
  191. package/dist/utils/fileLogger.js.map +0 -1
  192. package/dist/utils/fileValidation.js.map +0 -1
  193. package/dist/utils/folderMatch.js.map +0 -1
  194. package/dist/utils/formulaFilters.js +11 -2
  195. package/dist/utils/formulaFilters.js.map +1 -2
  196. package/dist/utils/helpers.js.map +0 -1
  197. package/dist/utils/logger.js.map +0 -1
  198. package/dist/utils/nameResolver.js.map +0 -1
  199. package/dist/utils/operationCli.js +102 -0
  200. package/dist/utils/operationCli.js.map +6 -0
  201. package/dist/utils/packageManager.js.map +0 -1
  202. package/dist/utils/syncReporting.js.map +0 -1
  203. package/dist/utils/syncScope.js.map +0 -1
  204. package/dist/utils/updateCheck.js.map +0 -1
  205. package/dist/utils/variableValues.js.map +0 -1
  206. package/dist/utils/workspace.js.map +0 -1
  207. package/docs/cli-guide.md +182 -2
  208. package/docs/import-workflows.md +14 -14
  209. package/docs/new-app-template.md +1 -1
  210. package/docs/pipeline-client-guide.md +1 -1
  211. package/docs/pipeline-reference.md +304 -9
  212. package/docs/troubleshooting.md +18 -0
  213. package/package.json +2 -2
  214. package/skills/farseer-analysis/SKILL.md +132 -0
  215. package/skills/farseer-app-dev/SKILL.md +131 -0
  216. package/skills/farseer-app-dev/assignments.md +185 -0
  217. package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
  218. package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
  219. package/skills/farseer-app-dev/working-patterns.md +876 -0
  220. package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
  221. package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
  222. package/skills/farseer-author-import-job/SKILL.md +114 -0
  223. package/skills/farseer-author-import-job/cell-writes.md +530 -0
  224. package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
  225. package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
  226. package/skills/farseer-build-model/SKILL.md +122 -0
  227. package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
  228. package/skills/farseer-build-model/naming-conventions.md +435 -0
  229. package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
  230. package/skills/farseer-build-pipeline/SKILL.md +190 -0
  231. package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
  232. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
  233. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
  234. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
  235. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
  236. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
  237. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
  238. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
  239. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
  240. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
  241. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
  242. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
  243. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
  244. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
  245. package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
  246. package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
  247. package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
  248. package/skills/farseer-dashboards/SKILL.md +40 -0
  249. package/skills/farseer-formulas/SKILL.md +165 -0
  250. package/skills/farseer-help-center/SKILL.md +66 -0
  251. package/skills/farseer-model/SKILL.md +119 -0
  252. package/skills/farseer-modify-model/SKILL.md +158 -0
  253. package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
  254. package/skills/farseer-optimize-model/SKILL.md +314 -0
  255. package/skills/farseer-optimize-model/stats-dump.ts +139 -0
  256. package/skills/farseer-pnl/SKILL.md +220 -0
  257. package/skills/farseer-review-model/SKILL.md +172 -0
  258. package/skills/farseer-run-apps/SKILL.md +102 -0
  259. package/skills/pipeline-authoring/SKILL.md +7 -5
  260. package/skills/pipeline-authoring/practices.md +21 -8
  261. package/dist/services/agentApprovalFetch.js +0 -86
  262. package/dist/services/agentApprovalFetch.js.map +0 -7
@@ -1,4 +1,4 @@
1
- # Pipeline YAML reference: engine 3.0.0
1
+ # Pipeline YAML reference: engine 3.3.0
2
2
 
3
3
  Generated file. Regenerate with `tools/pipeline/generate_docs.py`.
4
4
 
@@ -14,7 +14,9 @@ Read a topic through `farseer pipeline guide --topic NAME` or MCP `farseer_pipel
14
14
  - [Connection](#connection)
15
15
  - [CsvParseOptions](#csvparseoptions)
16
16
  - [CsvWriteOptions](#csvwriteoptions)
17
+ - [CustomExtractConfig](#customextractconfig)
17
18
  - [CustomField](#customfield)
19
+ - [DataFormat](#dataformat)
18
20
  - [DataSchema](#dataschema)
19
21
  - [DateColumn](#datecolumn)
20
22
  - [DimensionTableEntryOptions](#dimensiontableentryoptions)
@@ -46,6 +48,16 @@ Read a topic through `farseer pipeline guide --topic NAME` or MCP `farseer_pipel
46
48
  - [FixedDimension](#fixeddimension)
47
49
  - [GoogleDriveExtractConfig](#googledriveextractconfig)
48
50
  - [GoogleDrivePublicExtractConfig](#googledrivepublicextractconfig)
51
+ - [HttpBasicAuth](#httpbasicauth)
52
+ - [HttpBearerAuth](#httpbearerauth)
53
+ - [HttpCursorPagination](#httpcursorpagination)
54
+ - [HttpExtractConfig](#httpextractconfig)
55
+ - [HttpHeaderAuth](#httpheaderauth)
56
+ - [HttpNextUrlPagination](#httpnexturlpagination)
57
+ - [HttpOAuth2ClientCredentialsAuth](#httpoauth2clientcredentialsauth)
58
+ - [HttpOffsetPagination](#httpoffsetpagination)
59
+ - [HttpPagePagination](#httppagepagination)
60
+ - [HttpQueryAuth](#httpqueryauth)
49
61
  - [HubspotAssociationsExtractConfig](#hubspotassociationsextractconfig)
50
62
  - [HubspotExtractConfig](#hubspotextractconfig)
51
63
  - [HubspotObjectsExtractConfig](#hubspotobjectsextractconfig)
@@ -119,7 +131,7 @@ Unknown fields are rejected.
119
131
  | `name` | string | yes | none | |
120
132
  | `type` | [StepType](#steptype) | yes | none | |
121
133
  | `deps` | array of string | no | none | |
122
- | `description` | string | no | `""` | |
134
+ | `description` | string | no | `""` | For the client, who reads it in the step's panel on the Pipeline tab: what the step does, and any rule needed to judge its result. Plain words, at most about 300 characters, no build details. |
123
135
  | `extract` | [ExtractConfig](#extractconfig) or null | no | `null` | |
124
136
  | `parse` | [ParseConfig](#parseconfig) or null | no | `null` | |
125
137
  | `transform` | [TransformConfig](#transformconfig) or null | no | `null` | |
@@ -129,6 +141,8 @@ Unknown fields are rejected.
129
141
  | `quality_rules` | array of [QualityRuleEntry](#qualityruleentry) | no | none | |
130
142
  | `write_mode` | [WriteMode](#writemode) | no | `"overwrite"` | |
131
143
  | `merge_keys` | array of string | no | none | |
144
+ | `sort_by` | array of string | no | none | |
145
+ | `max_file_size` | string or integer or null | no | `null` | |
132
146
 
133
147
  Runtime-derived; do not set in YAML: `qualified_name`, `namespace`, `source_path`, `render_context`.
134
148
 
@@ -275,6 +289,50 @@ Unknown fields are rejected.
275
289
  | `include_header` | boolean | no | `true` | |
276
290
  | `lineterminator` | string | no | `"\n"` | minLength=`1` |
277
291
 
292
+ ## CustomExtractConfig
293
+
294
+ `extract.type: custom` -- an extract an author writes, as an `@extractor` function in `Code/`.
295
+
296
+ For a source no built-in type reaches: an odd authentication, a SOAP
297
+ service, a flow of several calls. `script` is a file under `Code/`, in the
298
+ folder mirroring the step's own under `Models/`, and `function` names the
299
+ function in it, the dataset's own name when omitted -- the binding
300
+ `transform` and `parse` scripts follow.
301
+
302
+ extract:
303
+ type: custom
304
+ custom:
305
+ script: invoices.py
306
+ args: {base_url: "https://api.example.com/v1"}
307
+ secrets: {token: "{{ pipeline_args.SHOP_TOKEN }}"}
308
+
309
+ The function takes keyword-only `args` (a dict), `secrets` (a mapping
310
+ that prints itself masked), `http` (a client with retries and the
311
+ network guard of the `http` extract, sending `headers` with every
312
+ request) and `logger`, each optional. Every value under `secrets` is
313
+ masked in the run's output, what the function prints included; a
314
+ credential put under `args` or `headers` is not.
315
+
316
+ What the function returns is what lands: a file it wrote into the
317
+ directory it was handed (the file's extension is the payload's format),
318
+ records (a list or generator of dicts, landed as one JSON object per line),
319
+ or a table (a DataFrame or Arrow table, landed as parquet). The parse step
320
+ reading this extract interprets it, as for any other source, and
321
+ `optional: true` skips only when the function raises
322
+ `ExtractionSourceMissing`.
323
+
324
+ Unknown fields are rejected.
325
+
326
+ | YAML field | Type | Required | Default | Constraints / description |
327
+ | --- | --- | --- | --- | --- |
328
+ | `script` | string | yes | none | |
329
+ | `function` | string or null | no | `null` | |
330
+ | `args` | object | no | none | |
331
+ | `secrets` | map of string | no | none | |
332
+ | `headers` | map of string | no | none | Headers the `http` client sends with every request, to any host, such as a `User-Agent` a source's firewall expects. Not credentials: those go under `secrets:`. |
333
+ | `timeout` | number | no | `120.0` | maximum=`3600`; exclusiveMinimum=`0`; Seconds per request the `http` client handed to the function makes. |
334
+ | `private_network` | boolean | no | `false` | |
335
+
278
336
  ## CustomField
279
337
 
280
338
  Maps a DataFrame column to a CUSTOM column meta.
@@ -289,9 +347,39 @@ Unknown fields are rejected.
289
347
  | --- | --- | --- | --- | --- |
290
348
  | `source_column` | string | yes | none | |
291
349
 
350
+ ## DataFormat
351
+
352
+ The extension a stored file may carry, which is all a store needs.
353
+
354
+ Not "a format the framework can interpret" -- every step writes parquet, and
355
+ `parse:` decides how a payload is read. This is the narrower question of
356
+ what a file at rest may be *called*, which the Farseer Files store answers
357
+ by writing `<leaf>.<value>` and probing these in order to find it again.
358
+
359
+ The set mirrors the backend's upload allow-list exactly, so any file that
360
+ store accepts can be landed. A subset would be a second, narrower policy
361
+ for someone to keep in sync, and it would fail the first time a source
362
+ hands back a type nobody trimmed for.
363
+
364
+ A folder there can hold more than one file under a dataset's name -- the
365
+ workbook an extract reads sits beside the parquet it writes, and a
366
+ `sales.csv` written before parquet became the only output stays until
367
+ someone removes it -- because the store writes its own file and touches no
368
+ other. A name the store wrote in this run is read under the extension it
369
+ was written with; the probe, which takes the first extension present, is
370
+ for files from earlier runs, so `PARQUET` is first: a step's own output is
371
+ the one found.
372
+
373
+ Values: `"parquet"`, `"csv"`, `"json"`, `"xlsx"`, `"xls"`, `"xml"`, `"zip"`, `"txt"`, `"html"`, `"pdf"`, `"docx"`, `"md"`, `"yaml"`, `"yml"`, `"css"`, `"scss"`, `"js"`, `"jsx"`, `"ts"`, `"tsx"`, `"py"`, `"jpg"`, `"jpeg"`, `"png"`, `"svg"`, `"gif"`, `"webp"`
374
+
292
375
  ## DataSchema
293
376
 
294
- Top-level `schema:` block in a dataset YAML.
377
+ Top-level `schema:` block in a dataset YAML: the columns the dataset keeps.
378
+
379
+ A parse step or transform with a `schema:` writes exactly these columns, in
380
+ this order. A column its output has and this does not declare is dropped and
381
+ named in a warning, so declare every column a reader needs; a declared column
382
+ the output lacks fails validation. Without a `schema:` every column is kept.
295
383
 
296
384
  Unknown fields are rejected.
297
385
 
@@ -399,11 +487,13 @@ Unknown fields are rejected.
399
487
  | `hubspot` | [HubspotExtractConfig](#hubspotextractconfig) or null | no | `null` | |
400
488
  | `sap_odata` | [SapOdataExtractConfig](#sapodataextractconfig) or null | no | `null` | |
401
489
  | `s3` | [S3ExtractConfig](#s3extractconfig) or null | no | `null` | |
490
+ | `http` | [HttpExtractConfig](#httpextractconfig) or null | no | `null` | |
491
+ | `custom` | [CustomExtractConfig](#customextractconfig) or null | no | `null` | |
402
492
  | `optional` | boolean | no | `false` | When true, a source that does not exist (404, no such table, no such file) skips this extract instead of failing the run. The skip propagates to the parse step reading it and every step that depends on that, loads and exports included, and the run still finishes successfully. Network errors, authentication failures, timeouts and 5xx responses still fail the run. |
403
493
 
404
494
  ## ExtractType
405
495
 
406
- Values: `"google_drive_public"`, `"google_drive"`, `"sharepoint"`, `"sql_database"`, `"farseer"`, `"business_central"`, `"tldv"`, `"intercom"`, `"notion"`, `"hubspot"`, `"sap_odata"`, `"s3"`
496
+ Values: `"google_drive_public"`, `"google_drive"`, `"sharepoint"`, `"sql_database"`, `"farseer"`, `"business_central"`, `"tldv"`, `"intercom"`, `"notion"`, `"hubspot"`, `"sap_odata"`, `"s3"`, `"http"`, `"custom"`
407
497
 
408
498
  ## FarseerDatasetsExtractConfig
409
499
 
@@ -807,6 +897,207 @@ Unknown fields are rejected.
807
897
  | --- | --- | --- | --- | --- |
808
898
  | `file_id` | string | yes | none | |
809
899
 
900
+ ## HttpBasicAuth
901
+
902
+ HTTP Basic authentication with a username and a password.
903
+
904
+ Unknown fields are rejected.
905
+
906
+ | YAML field | Type | Required | Default | Constraints / description |
907
+ | --- | --- | --- | --- | --- |
908
+ | `type` | `"basic"` | yes | none | |
909
+ | `username` | string | yes | none | |
910
+ | `password` | string | yes | none | From a secret run argument: `{{ pipeline_args.NAME }}`. |
911
+
912
+ ## HttpBearerAuth
913
+
914
+ `Authorization: Bearer <token>` on every request to the configured origin.
915
+
916
+ Unknown fields are rejected.
917
+
918
+ | YAML field | Type | Required | Default | Constraints / description |
919
+ | --- | --- | --- | --- | --- |
920
+ | `type` | `"bearer"` | yes | none | |
921
+ | `token` | string | yes | none | The token, from a secret run argument: `{{ pipeline_args.NAME }}`. |
922
+
923
+ ## HttpCursorPagination
924
+
925
+ Send the cursor from each page as a query parameter, until a page returns none.
926
+
927
+ A page that hands back the cursor it was asked with fails the step rather
928
+ than looping.
929
+
930
+ Unknown fields are rejected.
931
+
932
+ | YAML field | Type | Required | Default | Constraints / description |
933
+ | --- | --- | --- | --- | --- |
934
+ | `type` | `"cursor"` | yes | none | |
935
+ | `cursor` | string | yes | none | JSON Pointer to the next cursor in the body, e.g. `/meta/next_cursor`. |
936
+ | `param` | string | yes | none | The query parameter the cursor is sent in. |
937
+ | `max_pages` | integer | no | `1000` | exclusiveMinimum=`0`; A ceiling on pages, so a crawl that never ends fails instead of running until the job's time limit. A source with more pages fails the step; it never truncates. The empty page that ends a page or offset crawl does not count. |
938
+
939
+ ## HttpExtractConfig
940
+
941
+ `extract.type: http` -- one HTTP(S) source, configured rather than coded.
942
+
943
+ A single request lands the response body as it came, under `format` (or
944
+ the extension its `Content-Type` names), for the parse step reading this
945
+ extract to interpret: an ECB `csvdata` response is read by
946
+ `parse: {format: csv}` with no code at all.
947
+
948
+ With `records`, or with `pagination`, the body is JSON and what lands is
949
+ the records: the array `records` points at, from every page, one JSON
950
+ object per line, as the source sent each one. A `format: json` parse step
951
+ reads them when the fields it declares are flat; nested ones need an
952
+ `@parse` function.
953
+
954
+ extract:
955
+ type: http
956
+ http:
957
+ url: https://api.example.com/v1/orders
958
+ params: {status: open}
959
+ auth: {type: bearer, token: "{{ pipeline_args.SHOP_TOKEN }}"}
960
+ records: /data
961
+ pagination: {type: cursor, cursor: /meta/next_cursor, param: cursor}
962
+
963
+ Credentials go in `auth:` and nowhere else, templated from secret run
964
+ arguments. They are sent only to the origin of `url`, masked in every
965
+ message, and dropped on a redirect to another origin.
966
+
967
+ `not_found` and `empty` say whether a 404, or a response with no body (no
968
+ records, in record mode), means the data is not there -- the signal
969
+ `optional: true` skips on -- or that something is wrong. Both default to
970
+ failing: the ECB answers 404 for a misspelled series key, which must not
971
+ read as an absent month.
972
+
973
+ Destinations other than public `https://` hosts are refused -- loopback,
974
+ link-local, private ranges and plain `http://` -- unless
975
+ `private_network: true`, which is how a source behind the tenant's VPN is
976
+ reached. That catches a wrong URL; it is not a sandbox.
977
+
978
+ Unknown fields are rejected.
979
+
980
+ | YAML field | Type | Required | Default | Constraints / description |
981
+ | --- | --- | --- | --- | --- |
982
+ | `url` | string | yes | none | |
983
+ | `method` | `"GET"`, `"POST"` | no | `"GET"` | |
984
+ | `params` | map of string or integer or number or boolean | no | none | Query parameters, added to `url`'s own. |
985
+ | `headers` | map of string | no | none | Headers that are not credentials; credentials go in `auth:`. |
986
+ | `json` | any | no | `null` | A JSON request body, for `POST` only. |
987
+ | `auth` | [HttpBearerAuth](#httpbearerauth) or [HttpBasicAuth](#httpbasicauth) or [HttpHeaderAuth](#httpheaderauth) or [HttpQueryAuth](#httpqueryauth) or [HttpOAuth2ClientCredentialsAuth](#httpoauth2clientcredentialsauth) or null | no | `null` | |
988
+ | `format` | [DataFormat](#dataformat) or null | no | `null` | What the body is, which is the extension the payload is stored under. Omit it to take the one the `Content-Type` names. Record mode always lands `json`. |
989
+ | `records` | string or null | no | `null` | JSON Pointer to the array of records in the body, e.g. `/data` or `/value`. Omit it for a body that is the array itself. |
990
+ | `pagination` | [HttpNextUrlPagination](#httpnexturlpagination) or [HttpCursorPagination](#httpcursorpagination) or [HttpPagePagination](#httppagepagination) or [HttpOffsetPagination](#httpoffsetpagination) or null | no | `null` | |
991
+ | `not_found` | `"fail"`, `"missing"` | no | `"fail"` | |
992
+ | `empty` | `"fail"`, `"missing"` | no | `"fail"` | |
993
+ | `timeout` | number | no | `120.0` | maximum=`3600`; exclusiveMinimum=`0`; Seconds per request. |
994
+ | `private_network` | boolean | no | `false` | |
995
+
996
+ ## HttpHeaderAuth
997
+
998
+ One or more headers carrying a key, such as `X-Api-Key`.
999
+
1000
+ Every value here is treated as a secret: masked in messages and logs, and
1001
+ never sent to another origin.
1002
+
1003
+ Unknown fields are rejected.
1004
+
1005
+ | YAML field | Type | Required | Default | Constraints / description |
1006
+ | --- | --- | --- | --- | --- |
1007
+ | `type` | `"header"` | yes | none | |
1008
+ | `headers` | map of string | yes | none | |
1009
+
1010
+ ## HttpNextUrlPagination
1011
+
1012
+ Follow each page's link to the next one, until a page has none.
1013
+
1014
+ `next_url` points at the link in the body (`/@odata.nextLink`,
1015
+ `/links/next`). Without it the `Link` response header is read for
1016
+ `rel="next"`. A relative link is resolved against the page it came from;
1017
+ a link to another origin is refused, because the request carries the
1018
+ step's credentials.
1019
+
1020
+ Unknown fields are rejected.
1021
+
1022
+ | YAML field | Type | Required | Default | Constraints / description |
1023
+ | --- | --- | --- | --- | --- |
1024
+ | `type` | `"next_url"` | yes | none | |
1025
+ | `next_url` | string or null | no | `null` | JSON Pointer to the next page's URL in the body. Omit it to read the `Link` header. |
1026
+ | `max_pages` | integer | no | `1000` | exclusiveMinimum=`0`; A ceiling on pages, so a crawl that never ends fails instead of running until the job's time limit. A source with more pages fails the step; it never truncates. The empty page that ends a page or offset crawl does not count. |
1027
+
1028
+ ## HttpOAuth2ClientCredentialsAuth
1029
+
1030
+ OAuth 2.0 client credentials: a token from `token_url`, then `Bearer` on every request.
1031
+
1032
+ The token is requested once per run and is not refreshed, so a crawl that
1033
+ outlives it fails with a 401 rather than continuing on a stale grant.
1034
+ `params` adds form fields some servers require, such as `audience` or
1035
+ `resource`.
1036
+
1037
+ Unknown fields are rejected.
1038
+
1039
+ | YAML field | Type | Required | Default | Constraints / description |
1040
+ | --- | --- | --- | --- | --- |
1041
+ | `type` | `"oauth2_client_credentials"` | yes | none | |
1042
+ | `token_url` | string | yes | none | |
1043
+ | `client_id` | string | yes | none | |
1044
+ | `client_secret` | string | yes | none | From a secret run argument: `{{ pipeline_args.NAME }}`. |
1045
+ | `scope` | string or null | no | `null` | |
1046
+ | `params` | map of string | no | none | |
1047
+
1048
+ ## HttpOffsetPagination
1049
+
1050
+ Move an offset by the records each page returned, until a page returns none.
1051
+
1052
+ It asks for `limit` records a page but moves by what arrived, so a server
1053
+ that caps its pages below `limit` is still read whole. It stops on an
1054
+ empty page for the reason page numbering does.
1055
+
1056
+ Unknown fields are rejected.
1057
+
1058
+ | YAML field | Type | Required | Default | Constraints / description |
1059
+ | --- | --- | --- | --- | --- |
1060
+ | `type` | `"offset"` | yes | none | |
1061
+ | `param` | string | no | `"offset"` | |
1062
+ | `limit_param` | string | no | `"limit"` | |
1063
+ | `limit` | integer | yes | none | exclusiveMinimum=`0` |
1064
+ | `start` | integer | no | `0` | minimum=`0` |
1065
+ | `max_pages` | integer | no | `1000` | exclusiveMinimum=`0`; A ceiling on pages, so a crawl that never ends fails instead of running until the job's time limit. A source with more pages fails the step; it never truncates. The empty page that ends a page or offset crawl does not count. |
1066
+
1067
+ ## HttpPagePagination
1068
+
1069
+ Number the pages in a query parameter, until a page returns no records.
1070
+
1071
+ It stops on the first empty page rather than the first short one: an API
1072
+ that caps its page size below the one asked for returns short pages long
1073
+ before the end, and stopping there would drop the rest without a word.
1074
+
1075
+ Unknown fields are rejected.
1076
+
1077
+ | YAML field | Type | Required | Default | Constraints / description |
1078
+ | --- | --- | --- | --- | --- |
1079
+ | `type` | `"page"` | yes | none | |
1080
+ | `param` | string | no | `"page"` | |
1081
+ | `start` | integer | no | `1` | |
1082
+ | `size_param` | string or null | no | `null` | |
1083
+ | `size` | integer or null | no | `null` | integer: exclusiveMinimum=`0` |
1084
+ | `max_pages` | integer | no | `1000` | exclusiveMinimum=`0`; A ceiling on pages, so a crawl that never ends fails instead of running until the job's time limit. A source with more pages fails the step; it never truncates. The empty page that ends a page or offset crawl does not count. |
1085
+
1086
+ ## HttpQueryAuth
1087
+
1088
+ A key sent as a query parameter, such as `?api_key=...`.
1089
+
1090
+ Every value here is treated as a secret and masked wherever the URL is
1091
+ shown. Prefer a header where the API accepts one: a query string is more
1092
+ likely to be logged on the server side.
1093
+
1094
+ Unknown fields are rejected.
1095
+
1096
+ | YAML field | Type | Required | Default | Constraints / description |
1097
+ | --- | --- | --- | --- | --- |
1098
+ | `type` | `"query"` | yes | none | |
1099
+ | `params` | map of string | yes | none | |
1100
+
810
1101
  ## HubspotAssociationsExtractConfig
811
1102
 
812
1103
  One row per (record of `object_type`, associated record) pair.
@@ -1676,9 +1967,10 @@ after-image delta process may, can keep the older one. It is wrong for
1676
1967
  sources that send differences. `key` has to equal the `merge_keys` of the
1677
1968
  parse step reading the extract.
1678
1969
 
1679
- `deletes` is the rule for SAP's delete records. `ignore` is the only rule
1680
- for now: they are dropped and counted, so an archived document stays in
1681
- the dataset, as it does with the cursor.
1970
+ `deletes` is the rule for SAP's delete records. `apply` is the default: a
1971
+ delete removes the keyed row, so the dataset mirrors the source's current
1972
+ state. `ignore` drops the delete and counts it and keeps the row, for
1973
+ retaining history the source purges, as the cursor does.
1682
1974
 
1683
1975
  `reset_subscription_until` and `release_until` are lifecycle steps, each
1684
1976
  in effect until the instant it names and refused after it, so a copied
@@ -1696,7 +1988,7 @@ Unknown fields are rejected.
1696
1988
  | YAML field | Type | Required | Default | Constraints / description |
1697
1989
  | --- | --- | --- | --- | --- |
1698
1990
  | `key` | array of string | yes | none | minItems=`1` |
1699
- | `deletes` | `"ignore"` | yes | none | |
1991
+ | `deletes` | `"ignore"`, `"apply"` | no | `"apply"` | |
1700
1992
  | `reset_subscription_until` | string or null | no | `null` | string: format=`"date-time"` |
1701
1993
  | `release_until` | string or null | no | `null` | string: format=`"date-time"` |
1702
1994
 
@@ -1962,7 +2254,10 @@ For `engine: duckdb`:
1962
2254
  the SQL as views named by their leaf name. Output is always parquet.
1963
2255
  `sql_file` (a `.sql` file in `Code/`) exists for engine-run pipelines but
1964
2256
  is refused for authored pipelines, which are validated before any source
1965
- is read; use `query`.
2257
+ is read; use `query`. A query that should stop because the data isn't
2258
+ what the step needs calls `fail_step('…')` with what is wrong and what the
2259
+ client does next, not `error()`: the client reads `fail_step`'s message as
2260
+ the step's failure, and `error()` only as the app's own code failing.
1966
2261
 
1967
2262
  For `engine: ibis`:
1968
2263
 
@@ -108,6 +108,24 @@ const transformed = table.derive({
108
108
 
109
109
  ---
110
110
 
111
+ ## Sync and authentication
112
+
113
+ When `farseer pull`, `push` or `status` does not do what you expect:
114
+
115
+ 1. `farseer whoami`: is the login still valid, and which tenant does this shell target (the argument, else `FARSEER_TENANT`)?
116
+ 2. `farseer status <tenant>`: which files are modified, local-only or remote-only.
117
+ 3. `farseer diff <tenant> [file]`: what differs, before you decide between pulling (keep remote) and pushing (keep local).
118
+
119
+ | Message | What to do |
120
+ |---|---|
121
+ | `Authentication required.` | `farseer login`, or `farseer config set <tenant> --api-key KEY` |
122
+ | `Remote has changes for N file(s) since last pull` | `farseer pull`, then `farseer push` |
123
+ | Apps not syncing over MCP (`farseer_pull`, `farseer_push`) | Those tools sync apps only with a browser login: `farseer login`. The CLI's `pull` and `push` sync apps with an API key as well. |
124
+
125
+ Without `--force`, pull asks how to resolve each conflict and push refuses while the remote has changes (`farseer docs cli-guide` describes the choices). `farseer pull --force` makes local match remote and `farseer push --force` makes remote match local; both also delete what the other side does not have, and both ask first. If the sync baseline drifts out of step, `farseer refresh <tenant>` rebuilds it.
126
+
127
+ ---
128
+
111
129
  ## Debugging Tips
112
130
 
113
131
  ### Check existing dimension members
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "farseer-cli",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "CLI tool for syncing Farseer App scripts between local folder and Farseer instances",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "chalk": "^4.1.2",
56
56
  "commander": "^11.1.0",
57
57
  "diff": "^5.1.0",
58
- "farseer-client": "npm:@farseerdev/farseer-client@1.22.0",
58
+ "farseer-client": "npm:@farseerdev/farseer-client@1.26.0",
59
59
  "inquirer": "^8.2.6",
60
60
  "js-yaml": "4.1.1",
61
61
  "zod": "^3.25.0"
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: farseer-analysis
3
+ description: How to answer a business question from Farseer numbers by establishing a comparison, explaining what changed and why with measurable drivers, checking mix and concentration, and interpreting the result. Use when the user asks for an analysis, a comparison, a trend, drivers, a variance or performance, rather than a single value.
4
+ metadata:
5
+ version: "1"
6
+ ---
7
+
8
+ # Analyst Reasoning Heuristics
9
+
10
+ Use the following principles when answering analytical questions.
11
+
12
+ ## 1. Focus on the business metric
13
+ Identify the KPI or business outcome the question refers to. Prefer final reporting metrics over intermediate calculations.
14
+
15
+ ## 2. Always establish a comparison
16
+ Numbers are meaningful only relative to a baseline. Compare against:
17
+ - peers
18
+ - averages
19
+ - prior periods
20
+ - plan or targets
21
+ - segment benchmarks
22
+
23
+ Clearly state whether performance is above, below, or in line with the benchmark.
24
+
25
+ ## 3. Separate scale from quality
26
+ Distinguish between:
27
+ - **scale** (size, volume, revenue, contribution)
28
+ - **quality** (efficiency, margin, productivity)
29
+
30
+ Large entities are not always the best performers.
31
+
32
+ ## 4. Explain differences using measurable drivers
33
+ When values differ:
34
+ - quantify the difference
35
+ - identify measurable drivers that explain it
36
+ - use the smallest meaningful set of drivers supported by the data
37
+
38
+ Describe **what changed** before explaining **why**.
39
+
40
+ ## 5. Check mix and concentration
41
+ Evaluate whether results are influenced by:
42
+ - mix across segments (products, customers, regions, etc.)
43
+ - concentration in a small number of entities.
44
+
45
+ Highlight dominant contributors and dependencies.
46
+
47
+ ## 6. Look for trends in time analysis
48
+ For time-based questions:
49
+ - identify overall direction
50
+ - highlight turning points
51
+ - distinguish temporary fluctuation from sustained change.
52
+
53
+ ## 7. Conclude with insight
54
+ Do not stop at reporting numbers. Explain what the result means and why it matters.
55
+
56
+ ---
57
+
58
+ # Variance Explanation Method
59
+
60
+ When explaining differences (e.g. Actual vs Budget, entity vs average, or period vs period):
61
+
62
+ 1. **Observation**
63
+ - State the measurable difference.
64
+ - Quantify the change.
65
+
66
+ 2. **Driver**
67
+ - Identify the most likely measurable drivers.
68
+ - Use only drivers that exist in the model.
69
+
70
+ 3. **Validation**
71
+ - Verify the explanation using supporting metrics.
72
+
73
+ Never propose explanations that cannot be supported by available data.
74
+
75
+ **Never explain a result before quantifying the difference.**
76
+
77
+ ---
78
+
79
+ ## Multi-Dimensional Analysis
80
+
81
+ When a question involves more than one dimension (e.g. clients and products, brands and regions, channels and categories):
82
+
83
+ 1. Treat one dimension as the **segment** and the other as the **entity being evaluated**.
84
+ 2. Analyze performance **within each segment**, not only globally.
85
+ 3. Identify which entities **overperform or underperform within each segment**.
86
+
87
+ Avoid returning only overall rankings when the question asks for cross-dimension insights.
88
+
89
+ ---
90
+
91
+ # Output Format Rules
92
+
93
+ ## General style
94
+ - Be concise and direct. Brevity comes from cutting restatement and padding, never from omitting data the question asks about.
95
+ - Do not describe internal reasoning steps.
96
+ - Do not explain methodology unless explicitly asked.
97
+
98
+ ## Answer structure: scale it to the question
99
+
100
+ **Simple lookups and general questions** ("what was X", "which year", "do we have Y"): give the direct answer in a sentence or two and stop: no table, no conclusion, at most 3 lines. A user can always ask for more.
101
+
102
+ **Analytical questions** (drivers, comparisons, variances, trends, "why") get the full structure. Interpretation is the core analyst job, and depth is expected here:
103
+
104
+ 1. **Direct answer**: always first.
105
+ 2. **Supporting table or ranking**: whenever the question involves a ranking, comparison, or breakdown; the table often IS the answer.
106
+ 3. **Explanation**: interpret the data: drivers, context, what moved and why. Take the space the analysis needs.
107
+ 4. **Conclusion or implication**: what it means going forward, not a restatement of item 1.
108
+
109
+ For analytical answers, length follows the analysis. There is no line budget: write what the interpretation needs.
110
+
111
+ ## Tables
112
+ Use tables for:
113
+ - rankings
114
+ - comparisons
115
+ - variance breakdowns
116
+ - concentration analysis
117
+
118
+ ## Rankings
119
+ For rankings return only:
120
+
121
+ Rank | Name | Metric
122
+
123
+ Optionally include rate metrics (e.g., margin %) when relevant.
124
+
125
+ ## Labels
126
+ Use business names rather than internal IDs unless the ID is required for identification.
127
+
128
+ ## Clarity
129
+ Answers should clearly communicate:
130
+ - what happened
131
+ - why it happened
132
+ - why it matters