farseer-cli 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +23 -8
  2. package/dist/commands/pipeline.js +158 -0
  3. package/dist/commands/pipeline.js.map +7 -0
  4. package/dist/commands/variables.js +17 -8
  5. package/dist/commands/variables.js.map +2 -2
  6. package/dist/index.js +40 -46
  7. package/dist/index.js.map +2 -2
  8. package/dist/mcp/prompts/workflows.js +13 -68
  9. package/dist/mcp/prompts/workflows.js.map +2 -2
  10. package/dist/mcp/resources/documentation.js +14 -0
  11. package/dist/mcp/resources/documentation.js.map +2 -2
  12. package/dist/mcp/server.js +14 -2
  13. package/dist/mcp/server.js.map +2 -2
  14. package/dist/mcp/skills.js +59 -0
  15. package/dist/mcp/skills.js.map +7 -0
  16. package/dist/mcp/tools/appTools.js +4 -0
  17. package/dist/mcp/tools/appTools.js.map +2 -2
  18. package/dist/mcp/tools/dataTools.js +2 -0
  19. package/dist/mcp/tools/dataTools.js.map +2 -2
  20. package/dist/mcp/tools/modelTools.js +6 -41
  21. package/dist/mcp/tools/modelTools.js.map +2 -2
  22. package/dist/mcp/tools/pipelineContract.js +317 -0
  23. package/dist/mcp/tools/pipelineContract.js.map +7 -0
  24. package/dist/mcp/tools/pipelineTools.js +111 -0
  25. package/dist/mcp/tools/pipelineTools.js.map +7 -0
  26. package/dist/mcp/tools/runTools.js +2 -0
  27. package/dist/mcp/tools/runTools.js.map +2 -2
  28. package/dist/mcp/tools/syncTools.js +4 -0
  29. package/dist/mcp/tools/syncTools.js.map +2 -2
  30. package/dist/pipeline/compatibility.js +53 -0
  31. package/dist/pipeline/compatibility.js.map +7 -0
  32. package/dist/pipeline/connect.js +139 -0
  33. package/dist/pipeline/connect.js.map +7 -0
  34. package/dist/pipeline/create.js +158 -0
  35. package/dist/pipeline/create.js.map +7 -0
  36. package/dist/pipeline/errors.js +45 -0
  37. package/dist/pipeline/errors.js.map +7 -0
  38. package/dist/pipeline/generated-reference.json +115 -0
  39. package/dist/pipeline/guide.js +33 -0
  40. package/dist/pipeline/guide.js.map +7 -0
  41. package/dist/pipeline/init.js +204 -0
  42. package/dist/pipeline/init.js.map +7 -0
  43. package/dist/pipeline/operations.js +103 -0
  44. package/dist/pipeline/operations.js.map +7 -0
  45. package/dist/pipeline/query.js +103 -0
  46. package/dist/pipeline/query.js.map +7 -0
  47. package/dist/pipeline/queryWorker.js +119 -0
  48. package/dist/pipeline/queryWorker.js.map +7 -0
  49. package/dist/pipeline/readiness.js +55 -0
  50. package/dist/pipeline/readiness.js.map +7 -0
  51. package/dist/pipeline/reference.js +72 -0
  52. package/dist/pipeline/reference.js.map +7 -0
  53. package/dist/pipeline/requests.js +122 -0
  54. package/dist/pipeline/requests.js.map +7 -0
  55. package/dist/pipeline/runArguments.js +68 -0
  56. package/dist/pipeline/runArguments.js.map +7 -0
  57. package/dist/pipeline/runtime.js +105 -0
  58. package/dist/pipeline/runtime.js.map +7 -0
  59. package/dist/pipeline/service.js +967 -0
  60. package/dist/pipeline/service.js.map +7 -0
  61. package/dist/services/agentApprovalFetch.js +86 -0
  62. package/dist/services/agentApprovalFetch.js.map +7 -0
  63. package/dist/services/configService.js +29 -0
  64. package/dist/services/configService.js.map +2 -2
  65. package/dist/services/credentials.js +2 -0
  66. package/dist/services/credentials.js.map +2 -2
  67. package/dist/services/farseerService.js +10 -3
  68. package/dist/services/farseerService.js.map +2 -2
  69. package/dist/services/preflight.js +4 -0
  70. package/dist/services/preflight.js.map +2 -2
  71. package/dist/services/syncService.js +6 -0
  72. package/dist/services/syncService.js.map +2 -2
  73. package/dist/skills/pipeline.js +71 -0
  74. package/dist/skills/pipeline.js.map +7 -0
  75. package/dist/utils/helpers.js +2 -1
  76. package/dist/utils/helpers.js.map +2 -2
  77. package/dist/utils/variableValues.js +78 -0
  78. package/dist/utils/variableValues.js.map +7 -0
  79. package/docs/pipeline-client-guide.md +67 -0
  80. package/docs/pipeline-reference.md +2064 -0
  81. package/package.json +5 -1
  82. package/skills/pipeline-authoring/SKILL.md +95 -0
  83. package/skills/pipeline-authoring/practices.md +325 -0
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var pipelineContract_exports = {};
20
+ __export(pipelineContract_exports, {
21
+ OPERATION_EFFECTS: () => OPERATION_EFFECTS,
22
+ pipelineArguments: () => pipelineArguments,
23
+ pipelineFailure: () => pipelineFailure,
24
+ pipelineInputSchema: () => pipelineInputSchema,
25
+ pipelineOutputSchema: () => pipelineOutputSchema,
26
+ pipelineResult: () => pipelineResult,
27
+ pipelineToolResult: () => pipelineToolResult
28
+ });
29
+ module.exports = __toCommonJS(pipelineContract_exports);
30
+ var import_zod = require("zod");
31
+ var import_errors = require("../../pipeline/errors");
32
+ var import_operations = require("../../pipeline/operations");
33
+ var import_service = require("../../pipeline/service");
34
+ const operations = import_zod.z.enum(["guide", "init", ...import_operations.PIPELINE_OPERATIONS]);
35
+ const OPERATION_EFFECTS = {
36
+ guide: "reads",
37
+ init: "changes tenant",
38
+ check: "reads",
39
+ pull: "changes local sources",
40
+ push: "changes tenant",
41
+ run: "changes tenant",
42
+ runs: "reads",
43
+ inspect: "reads",
44
+ "inspect-import": "reads",
45
+ query: "reads",
46
+ versions: "reads",
47
+ restore: "changes tenant",
48
+ terminate: "changes tenant"
49
+ };
50
+ const effectSummary = ["reads", "changes local sources", "changes tenant"].map(
51
+ (effect) => `${operations.options.filter((operation) => OPERATION_EFFECTS[operation] === effect).join("/")} ${effect}`
52
+ ).join("; ");
53
+ const uuid = import_zod.z.string().uuid();
54
+ const alias = import_zod.z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/);
55
+ const fileBinding = import_zod.z.object({
56
+ name: alias,
57
+ file: import_zod.z.string().min(1).describe(
58
+ "Relative Data/*.parquet path in the prepared workspace; reads current contents, not a run snapshot"
59
+ )
60
+ }).strict();
61
+ const versionBinding = import_zod.z.object({ name: alias, datasetId: uuid, versionId: uuid }).strict();
62
+ const bindings = import_zod.z.union([import_zod.z.array(fileBinding).min(1).max(16), import_zod.z.array(versionBinding).min(1).max(16)]).refine(
63
+ (items) => new Set(items.map((item) => item.name.toLowerCase())).size === items.length,
64
+ "Binding names must be distinct, ignoring case"
65
+ );
66
+ const fields = {
67
+ pipeline: import_zod.z.string().min(1).describe(
68
+ "Pipeline folder name; selects tenant/.pipelines/<name>.json. Omit when the tenant has one pipeline. Not for guide or init"
69
+ ),
70
+ jobId: import_zod.z.number().int().positive().describe(
71
+ "init only: ID of a job prepared in the web app; derives the local profile from it and changes nothing on the tenant. Pass jobId or name, not both"
72
+ ),
73
+ name: import_zod.z.string().min(1).describe(
74
+ "init only: folder name for a new pipeline; creates the source folder, a job and the profile on the tenant. Pass jobId or name, not both"
75
+ ),
76
+ workspace: import_zod.z.string().min(1).describe("init with jobId only: tenant-relative source folder; defaults to the folder of the job main script"),
77
+ force: import_zod.z.boolean().describe(
78
+ "init with jobId only: overwrite an existing profile for that job, for example after the first run to record dataset ids"
79
+ ),
80
+ limit: import_zod.z.number().int().positive().describe("runs only: how many of the newest runs to list (default 20)"),
81
+ topic: import_zod.z.string().min(1).max(100).describe(
82
+ "guide only: method (default), practices (design judgment and import behaviours), grammar, or an exact model name listed by grammar"
83
+ ),
84
+ uuid: uuid.describe(
85
+ "inspect: the accepted runUuid; omit only to use this profile\u2019s saved receipt, never the latest run. Required for terminate: the queued run to end, from runs or a refusal"
86
+ ),
87
+ offset: import_zod.z.number().int().nonnegative().describe(
88
+ "inspect only: nextOffset from the previous page; defaults to 0. Until the run ends, nextOffset is where to resume; it is null only when the run has ended and no lines remain"
89
+ ),
90
+ importId: import_zod.z.number().int().positive().describe("Required for inspect-import: import identifier observed in this run\u2019s effects"),
91
+ args: import_zod.z.array(import_zod.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*=/, "Each run argument must be NAME=value")).describe(
92
+ 'run only: job arguments to change for this run, as NAME=value (e.g. ["MONTH=2026-08"]). Names the job does not declare, fixed arguments and bare values are refused; arguments you do not name keep the job default.'
93
+ ),
94
+ bindings: bindings.describe(
95
+ "Required for query: 1\u201316 named inputs, all immutable version bindings or all current-file bindings; do not mix stores"
96
+ ),
97
+ sql: import_zod.z.string().trim().min(1).max(1e5).describe(
98
+ "Required for query: one read-only SELECT/WITH using binding names. Use aggregates for complete counts; truncated rows are only a sample"
99
+ ),
100
+ datasetId: uuid.describe(
101
+ "Required for versions and restore: an observed dataset UUID; restore is limited to declared outputs"
102
+ ),
103
+ versionId: uuid.describe("Required for restore: retained historical publication UUID, not a current dataset name"),
104
+ expectedCurrentVersionId: uuid.describe(
105
+ "Required for restore: current version UUID just read from versions; a changed current is refused"
106
+ )
107
+ };
108
+ const pipelineInputSchema = import_zod.z.object({
109
+ operation: operations.describe(`${effectSummary}. Supply only arguments for the selected operation`),
110
+ pipeline: fields.pipeline.optional(),
111
+ jobId: fields.jobId.optional(),
112
+ name: fields.name.optional(),
113
+ workspace: fields.workspace.optional(),
114
+ force: fields.force.optional(),
115
+ limit: fields.limit.optional(),
116
+ topic: fields.topic.optional(),
117
+ uuid: fields.uuid.optional(),
118
+ offset: fields.offset.optional(),
119
+ importId: fields.importId.optional(),
120
+ args: fields.args.optional(),
121
+ bindings: fields.bindings.optional(),
122
+ sql: fields.sql.optional(),
123
+ datasetId: fields.datasetId.optional(),
124
+ versionId: fields.versionId.optional(),
125
+ expectedCurrentVersionId: fields.expectedCurrentVersionId.optional()
126
+ }).strict();
127
+ const selected = import_zod.z.object({ pipeline: fields.pipeline.optional() });
128
+ const pipelineArguments = import_zod.z.discriminatedUnion("operation", [
129
+ import_zod.z.object({ operation: import_zod.z.literal("guide"), topic: fields.topic.optional() }).strict(),
130
+ import_zod.z.object({
131
+ operation: import_zod.z.literal("init"),
132
+ jobId: fields.jobId.optional(),
133
+ name: fields.name.optional(),
134
+ workspace: fields.workspace.optional(),
135
+ force: fields.force.optional()
136
+ }).strict(),
137
+ selected.extend({ operation: import_zod.z.literal("check") }).strict(),
138
+ selected.extend({ operation: import_zod.z.literal("pull") }).strict(),
139
+ selected.extend({ operation: import_zod.z.literal("push") }).strict(),
140
+ selected.extend({ operation: import_zod.z.literal("run"), args: fields.args.optional() }).strict(),
141
+ selected.extend({ operation: import_zod.z.literal("runs"), limit: fields.limit.optional() }).strict(),
142
+ selected.extend({ operation: import_zod.z.literal("inspect"), uuid: fields.uuid.optional(), offset: fields.offset.optional() }).strict(),
143
+ selected.extend({ operation: import_zod.z.literal("inspect-import"), importId: fields.importId }).strict(),
144
+ selected.extend({ operation: import_zod.z.literal("query"), bindings: fields.bindings, sql: fields.sql }).strict(),
145
+ selected.extend({ operation: import_zod.z.literal("versions"), datasetId: fields.datasetId }).strict(),
146
+ selected.extend({
147
+ operation: import_zod.z.literal("restore"),
148
+ datasetId: fields.datasetId,
149
+ versionId: fields.versionId,
150
+ expectedCurrentVersionId: fields.expectedCurrentVersionId
151
+ }).strict(),
152
+ selected.extend({ operation: import_zod.z.literal("terminate"), uuid: fields.uuid }).strict()
153
+ ]).superRefine((p, ctx) => {
154
+ if (p.operation !== "init") return;
155
+ if (p.jobId === void 0 === (p.name === void 0))
156
+ ctx.addIssue({
157
+ code: import_zod.z.ZodIssueCode.custom,
158
+ message: "init takes either a prepared jobId or a new name, not both and not neither"
159
+ });
160
+ if (p.name !== void 0 && (p.workspace !== void 0 || p.force !== void 0))
161
+ ctx.addIssue({
162
+ code: import_zod.z.ZodIssueCode.custom,
163
+ message: "workspace and force only apply when attaching to a prepared jobId"
164
+ });
165
+ });
166
+ const pipelineOutputSchema = import_zod.z.object({
167
+ operation: operations,
168
+ outcome: import_zod.z.enum(["success", "refused", "failed", "unknown"]).describe(
169
+ "Tool outcome, not run status. success means the requested operation returned; inspect may successfully report a failed run. failed may leave earlier effects. unknown requires inspection before another mutation"
170
+ ),
171
+ result: import_zod.z.union([
172
+ import_zod.z.object({ topic: import_zod.z.string(), text: import_zod.z.string() }),
173
+ // init with jobId: the derived profile and what it found.
174
+ import_zod.z.object({
175
+ file: import_zod.z.string(),
176
+ profile: import_zod.z.record(import_zod.z.unknown()),
177
+ datasets: import_zod.z.array(import_zod.z.record(import_zod.z.unknown())),
178
+ pendingDatasets: import_zod.z.array(import_zod.z.record(import_zod.z.unknown())),
179
+ warnings: import_zod.z.array(import_zod.z.string()),
180
+ nextSteps: import_zod.z.array(import_zod.z.string())
181
+ }).passthrough(),
182
+ // init with name: what was created on the tenant.
183
+ import_zod.z.object({
184
+ jobId: import_zod.z.number().int().positive(),
185
+ name: import_zod.z.string(),
186
+ workspace: import_zod.z.string(),
187
+ profile: import_zod.z.string(),
188
+ created: import_zod.z.record(import_zod.z.unknown())
189
+ }).passthrough(),
190
+ import_zod.z.object({
191
+ readyForAcceptance: import_zod.z.boolean(),
192
+ checks: import_zod.z.array(
193
+ import_zod.z.object({ name: import_zod.z.string(), status: import_zod.z.enum(["pass", "fail", "pending"]), detail: import_zod.z.string() })
194
+ )
195
+ }).passthrough(),
196
+ import_zod.z.object({ runUuid: uuid, phase: import_zod.z.literal("accepted"), observation: import_zod.z.literal("pending") }).passthrough(),
197
+ import_zod.z.object({ runUuid: uuid, status: import_zod.z.string(), terminated: import_zod.z.boolean(), note: import_zod.z.string().optional() }).passthrough(),
198
+ import_zod.z.object({
199
+ jobId: import_zod.z.number().int().positive(),
200
+ runs: import_zod.z.array(
201
+ import_zod.z.object({
202
+ uuid: import_zod.z.string(),
203
+ status: import_zod.z.string(),
204
+ startedAt: import_zod.z.string(),
205
+ receipt: import_zod.z.boolean()
206
+ }).passthrough()
207
+ )
208
+ }).passthrough(),
209
+ import_zod.z.object({ importId: import_zod.z.number().int().positive(), status: import_zod.z.string(), commitConfirmed: import_zod.z.boolean() }).passthrough(),
210
+ import_zod.z.object({
211
+ status: import_zod.z.string(),
212
+ runUuid: uuid.optional(),
213
+ logs: import_zod.z.array(import_zod.z.string()).optional(),
214
+ observations: import_zod.z.array(import_zod.z.unknown()).optional(),
215
+ nextOffset: import_zod.z.number().int().nonnegative().nullable().optional()
216
+ }).passthrough(),
217
+ import_zod.z.object({
218
+ columns: import_zod.z.array(import_zod.z.string()),
219
+ rows: import_zod.z.array(import_zod.z.array(import_zod.z.unknown())),
220
+ complete: import_zod.z.boolean(),
221
+ truncated: import_zod.z.boolean(),
222
+ semantics: import_zod.z.string(),
223
+ inputs: import_zod.z.array(import_zod.z.record(import_zod.z.unknown()))
224
+ }).passthrough(),
225
+ import_zod.z.object({
226
+ conflicts: import_zod.z.array(import_zod.z.unknown()),
227
+ failed: import_zod.z.array(import_zod.z.unknown()).optional(),
228
+ rejected: import_zod.z.array(import_zod.z.unknown()).optional()
229
+ }).passthrough(),
230
+ import_zod.z.object({ dataset: import_zod.z.record(import_zod.z.unknown()), versions: import_zod.z.array(import_zod.z.record(import_zod.z.unknown())) }).passthrough(),
231
+ import_zod.z.object({ dataset: import_zod.z.record(import_zod.z.unknown()), note: import_zod.z.string() }).passthrough()
232
+ ]).optional(),
233
+ error: import_zod.z.object({
234
+ code: import_zod.z.string(),
235
+ message: import_zod.z.string(),
236
+ nextAction: import_zod.z.string(),
237
+ retryable: import_zod.z.literal(false).describe("No automatic mutation retries, including on refusal or uncertainty"),
238
+ runUuid: uuid.optional()
239
+ }).optional()
240
+ });
241
+ function pipelineFailure(operation, error) {
242
+ const known = error instanceof import_errors.PipelineError;
243
+ const validation = error instanceof import_zod.z.ZodError;
244
+ const denied = [401, 403, 409, 429].includes((0, import_errors.httpStatus)(error) ?? 0);
245
+ return {
246
+ operation,
247
+ outcome: known ? error.outcome : validation || denied ? "refused" : "failed",
248
+ error: {
249
+ code: known ? error.code : validation ? "INVALID_ARGUMENTS" : denied ? "REQUEST_REFUSED" : "OPERATION_FAILED",
250
+ message: (0, import_service.redact)(error instanceof Error ? error.message : String(error)).slice(0, 4e3),
251
+ nextAction: known ? error.nextAction : validation ? "Correct the arguments for this operation before calling it again." : "Inspect the cause and any earlier effects before taking further action. Do not blindly retry.",
252
+ retryable: false,
253
+ ...known && error.runUuid ? { runUuid: error.runUuid } : {}
254
+ }
255
+ };
256
+ }
257
+ function pipelineResult(operation, result) {
258
+ if (operation === "inspect" && result.status === "unconfirmed")
259
+ return {
260
+ ...pipelineFailure(
261
+ operation,
262
+ new import_errors.PipelineError(
263
+ "unknown",
264
+ "RUN_UNCONFIRMED",
265
+ "The run outcome is not confirmed by history.",
266
+ "Inspect the saved receipt and job history. Do not submit again."
267
+ )
268
+ ),
269
+ result
270
+ };
271
+ if (operation === "pull" || operation === "push") {
272
+ const incomplete = ["conflicts", "rejected", "failed"].some(
273
+ (key) => Array.isArray(result[key]) && result[key].length
274
+ );
275
+ if (incomplete)
276
+ return {
277
+ ...pipelineFailure(
278
+ operation,
279
+ new import_errors.PipelineError(
280
+ Array.isArray(result.failed) && result.failed.length ? "unknown" : "failed",
281
+ "SYNC_INCOMPLETE",
282
+ "Some source files were not synchronized; earlier file changes may remain.",
283
+ "Read conflicts/rejected/failed, pull and reconcile before running."
284
+ )
285
+ ),
286
+ result
287
+ };
288
+ }
289
+ return { operation, outcome: "success", result };
290
+ }
291
+ function pipelineToolResult(reply, guideText) {
292
+ const parsed = pipelineOutputSchema.safeParse(JSON.parse(JSON.stringify(reply)));
293
+ if (!parsed.success)
294
+ throw new import_errors.PipelineError(
295
+ ["init", "run", "restore", "push", "pull"].includes(reply.operation) ? "unknown" : "failed",
296
+ "INVALID_RESULT",
297
+ "The operation returned a result that does not match the supported contract.",
298
+ "Inspect any effects before another mutation; report this CLI/backend compatibility problem."
299
+ );
300
+ const structuredContent = parsed.data;
301
+ return {
302
+ isError: reply.outcome !== "success",
303
+ structuredContent,
304
+ content: [{ type: "text", text: guideText ?? JSON.stringify(structuredContent) }]
305
+ };
306
+ }
307
+ // Annotate the CommonJS export names for ESM import in node:
308
+ 0 && (module.exports = {
309
+ OPERATION_EFFECTS,
310
+ pipelineArguments,
311
+ pipelineFailure,
312
+ pipelineInputSchema,
313
+ pipelineOutputSchema,
314
+ pipelineResult,
315
+ pipelineToolResult
316
+ });
317
+ //# sourceMappingURL=pipelineContract.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/mcp/tools/pipelineContract.ts"],
4
+ "sourcesContent": ["import { z } from 'zod';\nimport { PipelineError, httpStatus } from '../../pipeline/errors';\nimport { PIPELINE_OPERATIONS } from '../../pipeline/operations';\nimport { redact } from '../../pipeline/service';\n\nconst operations = z.enum(['guide', 'init', ...PIPELINE_OPERATIONS]);\nexport type PipelineToolOperation = z.infer<typeof operations>;\n\n/**\n * What each operation touches, for the operation description. The tool itself advertises the\n * most conservative hints because one MCP annotation covers every operation it dispatches.\n */\nexport const OPERATION_EFFECTS: Record<PipelineToolOperation, 'reads' | 'changes local sources' | 'changes tenant'> = {\n guide: 'reads',\n init: 'changes tenant',\n check: 'reads',\n pull: 'changes local sources',\n push: 'changes tenant',\n run: 'changes tenant',\n runs: 'reads',\n inspect: 'reads',\n 'inspect-import': 'reads',\n query: 'reads',\n versions: 'reads',\n restore: 'changes tenant',\n terminate: 'changes tenant',\n};\nconst effectSummary = (['reads', 'changes local sources', 'changes tenant'] as const)\n .map(\n (effect) =>\n `${operations.options.filter((operation) => OPERATION_EFFECTS[operation] === effect).join('/')} ${effect}`,\n )\n .join('; ');\n\nconst uuid = z.string().uuid();\nconst alias = z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/);\nconst fileBinding = z\n .object({\n name: alias,\n file: z\n .string()\n .min(1)\n .describe(\n 'Relative Data/*.parquet path in the prepared workspace; reads current contents, not a run snapshot',\n ),\n })\n .strict();\nconst versionBinding = z.object({ name: alias, datasetId: uuid, versionId: uuid }).strict();\nconst bindings = z\n .union([z.array(fileBinding).min(1).max(16), z.array(versionBinding).min(1).max(16)])\n .refine(\n (items) => new Set(items.map((item) => item.name.toLowerCase())).size === items.length,\n 'Binding names must be distinct, ignoring case',\n );\nconst fields = {\n pipeline: z\n .string()\n .min(1)\n .describe(\n 'Pipeline folder name; selects tenant/.pipelines/<name>.json. Omit when the tenant has one pipeline. Not for guide or init',\n ),\n jobId: z\n .number()\n .int()\n .positive()\n .describe(\n 'init only: ID of a job prepared in the web app; derives the local profile from it and changes nothing on the tenant. Pass jobId or name, not both',\n ),\n name: z\n .string()\n .min(1)\n .describe(\n 'init only: folder name for a new pipeline; creates the source folder, a job and the profile on the tenant. Pass jobId or name, not both',\n ),\n workspace: z\n .string()\n .min(1)\n .describe('init with jobId only: tenant-relative source folder; defaults to the folder of the job main script'),\n force: z\n .boolean()\n .describe(\n 'init with jobId only: overwrite an existing profile for that job, for example after the first run to record dataset ids',\n ),\n limit: z.number().int().positive().describe('runs only: how many of the newest runs to list (default 20)'),\n topic: z\n .string()\n .min(1)\n .max(100)\n .describe(\n 'guide only: method (default), practices (design judgment and import behaviours), grammar, or an exact model name listed by grammar',\n ),\n uuid: uuid.describe(\n 'inspect: the accepted runUuid; omit only to use this profile\u2019s saved receipt, never the latest run. Required for terminate: the queued run to end, from runs or a refusal',\n ),\n offset: z\n .number()\n .int()\n .nonnegative()\n .describe(\n 'inspect only: nextOffset from the previous page; defaults to 0. Until the run ends, nextOffset is where to resume; it is null only when the run has ended and no lines remain',\n ),\n importId: z\n .number()\n .int()\n .positive()\n .describe('Required for inspect-import: import identifier observed in this run\u2019s effects'),\n args: z\n .array(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*=/, 'Each run argument must be NAME=value'))\n .describe(\n 'run only: job arguments to change for this run, as NAME=value (e.g. [\"MONTH=2026-08\"]). Names the job does not declare, fixed arguments and bare values are refused; arguments you do not name keep the job default.',\n ),\n bindings: bindings.describe(\n 'Required for query: 1\u201316 named inputs, all immutable version bindings or all current-file bindings; do not mix stores',\n ),\n sql: z\n .string()\n .trim()\n .min(1)\n .max(100_000)\n .describe(\n 'Required for query: one read-only SELECT/WITH using binding names. Use aggregates for complete counts; truncated rows are only a sample',\n ),\n datasetId: uuid.describe(\n 'Required for versions and restore: an observed dataset UUID; restore is limited to declared outputs',\n ),\n versionId: uuid.describe('Required for restore: retained historical publication UUID, not a current dataset name'),\n expectedCurrentVersionId: uuid.describe(\n 'Required for restore: current version UUID just read from versions; a changed current is refused',\n ),\n};\n\n// Preserve flat calls. The SDK needs an object at the schema root, so conditional\n// requirements are described here and validated before connecting to a tenant.\nexport const pipelineInputSchema = z\n .object({\n operation: operations.describe(`${effectSummary}. Supply only arguments for the selected operation`),\n pipeline: fields.pipeline.optional(),\n jobId: fields.jobId.optional(),\n name: fields.name.optional(),\n workspace: fields.workspace.optional(),\n force: fields.force.optional(),\n limit: fields.limit.optional(),\n topic: fields.topic.optional(),\n uuid: fields.uuid.optional(),\n offset: fields.offset.optional(),\n importId: fields.importId.optional(),\n args: fields.args.optional(),\n bindings: fields.bindings.optional(),\n sql: fields.sql.optional(),\n datasetId: fields.datasetId.optional(),\n versionId: fields.versionId.optional(),\n expectedCurrentVersionId: fields.expectedCurrentVersionId.optional(),\n })\n .strict();\nconst selected = z.object({ pipeline: fields.pipeline.optional() });\nexport const pipelineArguments = z\n .discriminatedUnion('operation', [\n z.object({ operation: z.literal('guide'), topic: fields.topic.optional() }).strict(),\n z\n .object({\n operation: z.literal('init'),\n jobId: fields.jobId.optional(),\n name: fields.name.optional(),\n workspace: fields.workspace.optional(),\n force: fields.force.optional(),\n })\n .strict(),\n selected.extend({ operation: z.literal('check') }).strict(),\n selected.extend({ operation: z.literal('pull') }).strict(),\n selected.extend({ operation: z.literal('push') }).strict(),\n selected.extend({ operation: z.literal('run'), args: fields.args.optional() }).strict(),\n selected.extend({ operation: z.literal('runs'), limit: fields.limit.optional() }).strict(),\n selected\n .extend({ operation: z.literal('inspect'), uuid: fields.uuid.optional(), offset: fields.offset.optional() })\n .strict(),\n selected.extend({ operation: z.literal('inspect-import'), importId: fields.importId }).strict(),\n selected.extend({ operation: z.literal('query'), bindings: fields.bindings, sql: fields.sql }).strict(),\n selected.extend({ operation: z.literal('versions'), datasetId: fields.datasetId }).strict(),\n selected\n .extend({\n operation: z.literal('restore'),\n datasetId: fields.datasetId,\n versionId: fields.versionId,\n expectedCurrentVersionId: fields.expectedCurrentVersionId,\n })\n .strict(),\n selected.extend({ operation: z.literal('terminate'), uuid: fields.uuid }).strict(),\n ])\n .superRefine((p, ctx) => {\n if (p.operation !== 'init') return;\n if ((p.jobId === undefined) === (p.name === undefined))\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'init takes either a prepared jobId or a new name, not both and not neither',\n });\n if (p.name !== undefined && (p.workspace !== undefined || p.force !== undefined))\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'workspace and force only apply when attaching to a prepared jobId',\n });\n });\nexport type PipelineArguments = z.infer<typeof pipelineArguments>;\n\nexport const pipelineOutputSchema = z.object({\n operation: operations,\n outcome: z\n .enum(['success', 'refused', 'failed', 'unknown'])\n .describe(\n 'Tool outcome, not run status. success means the requested operation returned; inspect may successfully report a failed run. failed may leave earlier effects. unknown requires inspection before another mutation',\n ),\n result: z\n .union([\n z.object({ topic: z.string(), text: z.string() }),\n // init with jobId: the derived profile and what it found.\n z\n .object({\n file: z.string(),\n profile: z.record(z.unknown()),\n datasets: z.array(z.record(z.unknown())),\n pendingDatasets: z.array(z.record(z.unknown())),\n warnings: z.array(z.string()),\n nextSteps: z.array(z.string()),\n })\n .passthrough(),\n // init with name: what was created on the tenant.\n z\n .object({\n jobId: z.number().int().positive(),\n name: z.string(),\n workspace: z.string(),\n profile: z.string(),\n created: z.record(z.unknown()),\n })\n .passthrough(),\n z\n .object({\n readyForAcceptance: z.boolean(),\n checks: z.array(\n z.object({ name: z.string(), status: z.enum(['pass', 'fail', 'pending']), detail: z.string() }),\n ),\n })\n .passthrough(),\n z.object({ runUuid: uuid, phase: z.literal('accepted'), observation: z.literal('pending') }).passthrough(),\n z\n .object({ runUuid: uuid, status: z.string(), terminated: z.boolean(), note: z.string().optional() })\n .passthrough(),\n z\n .object({\n jobId: z.number().int().positive(),\n runs: z.array(\n z\n .object({\n uuid: z.string(),\n status: z.string(),\n startedAt: z.string(),\n receipt: z.boolean(),\n })\n .passthrough(),\n ),\n })\n .passthrough(),\n z\n .object({ importId: z.number().int().positive(), status: z.string(), commitConfirmed: z.boolean() })\n .passthrough(),\n z\n .object({\n status: z.string(),\n runUuid: uuid.optional(),\n logs: z.array(z.string()).optional(),\n observations: z.array(z.unknown()).optional(),\n nextOffset: z.number().int().nonnegative().nullable().optional(),\n })\n .passthrough(),\n z\n .object({\n columns: z.array(z.string()),\n rows: z.array(z.array(z.unknown())),\n complete: z.boolean(),\n truncated: z.boolean(),\n semantics: z.string(),\n inputs: z.array(z.record(z.unknown())),\n })\n .passthrough(),\n z\n .object({\n conflicts: z.array(z.unknown()),\n failed: z.array(z.unknown()).optional(),\n rejected: z.array(z.unknown()).optional(),\n })\n .passthrough(),\n z.object({ dataset: z.record(z.unknown()), versions: z.array(z.record(z.unknown())) }).passthrough(),\n z.object({ dataset: z.record(z.unknown()), note: z.string() }).passthrough(),\n ])\n .optional(),\n error: z\n .object({\n code: z.string(),\n message: z.string(),\n nextAction: z.string(),\n retryable: z.literal(false).describe('No automatic mutation retries, including on refusal or uncertainty'),\n runUuid: uuid.optional(),\n })\n .optional(),\n});\nexport type PipelineReply = z.infer<typeof pipelineOutputSchema>;\n\nexport function pipelineFailure(operation: PipelineReply['operation'], error: unknown): PipelineReply {\n const known = error instanceof PipelineError;\n const validation = error instanceof z.ZodError;\n const denied = [401, 403, 409, 429].includes(httpStatus(error) ?? 0);\n return {\n operation,\n outcome: known ? error.outcome : validation || denied ? 'refused' : 'failed',\n error: {\n code: known\n ? error.code\n : validation\n ? 'INVALID_ARGUMENTS'\n : denied\n ? 'REQUEST_REFUSED'\n : 'OPERATION_FAILED',\n message: redact(error instanceof Error ? error.message : String(error)).slice(0, 4000),\n nextAction: known\n ? error.nextAction\n : validation\n ? 'Correct the arguments for this operation before calling it again.'\n : 'Inspect the cause and any earlier effects before taking further action. Do not blindly retry.',\n retryable: false,\n ...(known && error.runUuid ? { runUuid: error.runUuid } : {}),\n },\n };\n}\n\nexport function pipelineResult(operation: PipelineReply['operation'], result: Record<string, unknown>): PipelineReply {\n if (operation === 'inspect' && result.status === 'unconfirmed')\n return {\n ...pipelineFailure(\n operation,\n new PipelineError(\n 'unknown',\n 'RUN_UNCONFIRMED',\n 'The run outcome is not confirmed by history.',\n 'Inspect the saved receipt and job history. Do not submit again.',\n ),\n ),\n result: result as PipelineReply['result'],\n };\n if (operation === 'pull' || operation === 'push') {\n const incomplete = ['conflicts', 'rejected', 'failed'].some(\n (key) => Array.isArray(result[key]) && result[key].length,\n );\n if (incomplete)\n return {\n ...pipelineFailure(\n operation,\n new PipelineError(\n Array.isArray(result.failed) && result.failed.length ? 'unknown' : 'failed',\n 'SYNC_INCOMPLETE',\n 'Some source files were not synchronized; earlier file changes may remain.',\n 'Read conflicts/rejected/failed, pull and reconcile before running.',\n ),\n ),\n result: result as PipelineReply['result'],\n };\n }\n return { operation, outcome: 'success', result: result as PipelineReply['result'] };\n}\n\nexport function pipelineToolResult(reply: PipelineReply, guideText?: string) {\n // Omit undefined fields identically in text and structured results.\n const parsed = pipelineOutputSchema.safeParse(JSON.parse(JSON.stringify(reply)));\n if (!parsed.success)\n throw new PipelineError(\n ['init', 'run', 'restore', 'push', 'pull'].includes(reply.operation) ? 'unknown' : 'failed',\n 'INVALID_RESULT',\n 'The operation returned a result that does not match the supported contract.',\n 'Inspect any effects before another mutation; report this CLI/backend compatibility problem.',\n );\n const structuredContent = parsed.data;\n return {\n isError: reply.outcome !== 'success',\n structuredContent,\n content: [{ type: 'text' as const, text: guideText ?? JSON.stringify(structuredContent) }],\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,oBAA0C;AAC1C,wBAAoC;AACpC,qBAAuB;AAEvB,MAAM,aAAa,aAAE,KAAK,CAAC,SAAS,QAAQ,GAAG,qCAAmB,CAAC;AAO5D,MAAM,oBAAyG;AAAA,EAClH,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AACf;AACA,MAAM,gBAAiB,CAAC,SAAS,yBAAyB,gBAAgB,EACrE;AAAA,EACG,CAAC,WACG,GAAG,WAAW,QAAQ,OAAO,CAAC,cAAc,kBAAkB,SAAS,MAAM,MAAM,EAAE,KAAK,GAAG,CAAC,IAAI,MAAM;AAChH,EACC,KAAK,IAAI;AAEd,MAAM,OAAO,aAAE,OAAO,EAAE,KAAK;AAC7B,MAAM,QAAQ,aAAE,OAAO,EAAE,MAAM,+BAA+B;AAC9D,MAAM,cAAc,aACf,OAAO;AAAA,EACJ,MAAM;AAAA,EACN,MAAM,aACD,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACG;AAAA,EACJ;AACR,CAAC,EACA,OAAO;AACZ,MAAM,iBAAiB,aAAE,OAAO,EAAE,MAAM,OAAO,WAAW,MAAM,WAAW,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A,MACJ;AAAA,EACR;AACA,SAAO,EAAE,WAAW,SAAS,WAAW,OAA0C;AACtF;AAEO,SAAS,mBAAmB,OAAsB,WAAoB;AAEzE,QAAM,SAAS,qBAAqB,UAAU,KAAK,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC;AAC/E,MAAI,CAAC,OAAO;AACR,UAAM,IAAI;AAAA,MACN,CAAC,QAAQ,OAAO,WAAW,QAAQ,MAAM,EAAE,SAAS,MAAM,SAAS,IAAI,YAAY;AAAA,MACnF;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AACJ,QAAM,oBAAoB,OAAO;AACjC,SAAO;AAAA,IACH,SAAS,MAAM,YAAY;AAAA,IAC3B;AAAA,IACA,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,aAAa,KAAK,UAAU,iBAAiB,EAAE,CAAC;AAAA,EAC7F;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var pipelineTools_exports = {};
20
+ __export(pipelineTools_exports, {
21
+ registerPipelineTools: () => registerPipelineTools
22
+ });
23
+ module.exports = __toCommonJS(pipelineTools_exports);
24
+ var import_connect = require("../../pipeline/connect");
25
+ var import_errors = require("../../pipeline/errors");
26
+ var import_operations = require("../../pipeline/operations");
27
+ var import_reference = require("../../pipeline/reference");
28
+ var import_requests = require("../../pipeline/requests");
29
+ var import_session = require("../utils/session");
30
+ var import_pipelineContract = require("./pipelineContract");
31
+ function registerPipelineTools(server) {
32
+ const lifetime = new AbortController();
33
+ const onclose = server.server.onclose;
34
+ server.server.onclose = () => {
35
+ lifetime.abort();
36
+ onclose?.();
37
+ };
38
+ const handler = async (input, extra) => {
39
+ try {
40
+ const p = import_pipelineContract.pipelineArguments.parse(
41
+ Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0))
42
+ );
43
+ const signal = AbortSignal.any([extra.signal, lifetime.signal]);
44
+ return await (0, import_requests.withPipelineRequests)(async () => {
45
+ if (p.operation === "guide") {
46
+ const text = (0, import_reference.pipelineGuide)(p.topic);
47
+ return (0, import_pipelineContract.pipelineToolResult)(
48
+ { operation: "guide", outcome: "success", result: { topic: p.topic ?? "method", text } },
49
+ text
50
+ );
51
+ }
52
+ const access = await (0, import_requests.boundedPipelineCall)(() => (0, import_session.requireSession)());
53
+ if (!access.ok)
54
+ throw new import_errors.PipelineError(
55
+ "refused",
56
+ "TENANT_CONNECTION_REFUSED",
57
+ access.response.content.filter((item) => item.type === "text").map((item) => item.text).join("\n"),
58
+ "Check the selected tenant and sign in before retrying."
59
+ );
60
+ const { organisation, tenant } = access.session;
61
+ if (p.operation === "init") {
62
+ const { jobId, name, workspace, force } = p;
63
+ const openClient = () => (0, import_connect.openPipelineConnection)(organisation, tenant, access.session);
64
+ const result2 = await (0, import_operations.runPipelineInit)(
65
+ { organisation, tenant, jobId, name, workspace, force },
66
+ openClient,
67
+ (0, import_connect.pipelinePaths)(tenant)
68
+ );
69
+ return (0, import_pipelineContract.pipelineToolResult)((0, import_pipelineContract.pipelineResult)("init", result2));
70
+ }
71
+ const service = await (0, import_connect.connectPipeline)(organisation, tenant, { pipeline: p.pipeline }, access.session);
72
+ const result = await (0, import_operations.runPipelineOperation)(
73
+ service,
74
+ p.operation,
75
+ {
76
+ uuid: "uuid" in p ? p.uuid : void 0,
77
+ offset: "offset" in p ? p.offset : void 0,
78
+ importId: "importId" in p ? p.importId : void 0,
79
+ args: "args" in p ? p.args : void 0,
80
+ bindings: "bindings" in p ? p.bindings : void 0,
81
+ sql: "sql" in p ? p.sql : void 0,
82
+ datasetId: "datasetId" in p ? p.datasetId : void 0,
83
+ versionId: "versionId" in p ? p.versionId : void 0,
84
+ expectedCurrent: "expectedCurrentVersionId" in p ? p.expectedCurrentVersionId : void 0,
85
+ limit: "limit" in p ? p.limit : void 0
86
+ },
87
+ signal
88
+ );
89
+ return (0, import_pipelineContract.pipelineToolResult)((0, import_pipelineContract.pipelineResult)(p.operation, result));
90
+ }, signal);
91
+ } catch (error) {
92
+ return (0, import_pipelineContract.pipelineToolResult)((0, import_pipelineContract.pipelineFailure)(input.operation, error));
93
+ }
94
+ };
95
+ const register = server.registerTool.bind(server);
96
+ register(
97
+ "farseer_pipeline",
98
+ {
99
+ description: "Required workflow for all new repeatable data pipelines: use Simple Pipelines, even when TypeScript is requested. Inspect existing apps and source first. Preserve existing TypeScript apps through the app tools for inspection, execution and targeted maintenance; they are not missing pipeline setup. Migration requires an explicit migration request: do not replace an app or create a duplicate pipeline to fix it. Requested one-off direct imports remain supported. Before authoring, read guide topic=method, then topic=practices (how a Farseer data engineer designs a pipeline and the import behaviours that cause wrong numbers), then topic=grammar and relevant Pydantic model topics. Start a new pipeline with init name=<folder> (creates the folder, a job and the local profile on the tenant), or derive the profile from a job prepared in the web app with init jobId=<id>; init force=true rewrites that profile, for example after the first run to record dataset ids. check verifies prepared setup; explain missing setup. When the tenant has several pipelines, select one with pipeline=<folder name>. Use pull/push for source sync and run once after sync. runs lists the job run history; inspect takes the returned runUuid and nextOffset; versions requires datasetId; inspect-import requires importId; query requires sql and bindings; restore requires datasetId, versionId and expectedCurrentVersionId. A run that stays queued and never started may be stuck or waiting behind other jobs: end it with terminate uuid=<uuid> only when runs shows receipt: true, then tell the user which run you ended; ask the user before terminating any other run; terminate refuses a running run, which only a person may stop. Runs/restores have normal tenant effects. Shared edits require coordination; no tenant editing locks. Results carry outcome=success/refused/failed/unknown: success means the tool returned, not that a run succeeded or a query is complete. Follow error.nextAction; stop on refusals and never automatically retry uncertain writes or switch clients to get around a refusal. Inspect all log pages and use complete aggregates rather than truncated rows for totals.",
100
+ inputSchema: import_pipelineContract.pipelineInputSchema,
101
+ outputSchema: import_pipelineContract.pipelineOutputSchema,
102
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true }
103
+ },
104
+ handler
105
+ );
106
+ }
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ registerPipelineTools
110
+ });
111
+ //# sourceMappingURL=pipelineTools.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/mcp/tools/pipelineTools.ts"],
4
+ "sourcesContent": ["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\nimport { connectPipeline, openPipelineConnection, pipelinePaths } from '../../pipeline/connect';\nimport { PipelineError } from '../../pipeline/errors';\nimport { runPipelineInit, runPipelineOperation } from '../../pipeline/operations';\nimport { pipelineGuide } from '../../pipeline/reference';\nimport { boundedPipelineCall, withPipelineRequests } from '../../pipeline/requests';\nimport { requireSession } from '../utils/session';\nimport {\n pipelineArguments,\n pipelineInputSchema,\n pipelineOutputSchema,\n pipelineFailure,\n pipelineResult,\n pipelineToolResult,\n type PipelineArguments,\n} from './pipelineContract';\n\nexport function registerPipelineTools(server: McpServer) {\n const lifetime = new AbortController();\n const onclose = server.server.onclose;\n server.server.onclose = () => {\n lifetime.abort();\n onclose?.();\n };\n const handler = async (input: z.infer<typeof pipelineInputSchema>, extra: { signal: AbortSignal }) => {\n try {\n const p: PipelineArguments = pipelineArguments.parse(\n Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined)),\n );\n const signal = AbortSignal.any([extra.signal, lifetime.signal]);\n return await withPipelineRequests(async () => {\n if (p.operation === 'guide') {\n const text = pipelineGuide(p.topic);\n return pipelineToolResult(\n { operation: 'guide', outcome: 'success', result: { topic: p.topic ?? 'method', text } },\n text,\n );\n }\n const access = await boundedPipelineCall(() => requireSession());\n if (!access.ok)\n throw new PipelineError(\n 'refused',\n 'TENANT_CONNECTION_REFUSED',\n access.response.content\n .filter((item) => item.type === 'text')\n .map((item) => item.text)\n .join('\\n'),\n 'Check the selected tenant and sign in before retrying.',\n );\n const { organisation, tenant } = access.session;\n if (p.operation === 'init') {\n const { jobId, name, workspace, force } = p;\n const openClient = () => openPipelineConnection(organisation, tenant, access.session);\n const result = await runPipelineInit(\n { organisation, tenant, jobId, name, workspace, force },\n openClient,\n pipelinePaths(tenant),\n );\n return pipelineToolResult(pipelineResult('init', result as unknown as Record<string, unknown>));\n }\n const service = await connectPipeline(organisation, tenant, { pipeline: p.pipeline }, access.session);\n const result = await runPipelineOperation(\n service,\n p.operation,\n {\n uuid: 'uuid' in p ? p.uuid : undefined,\n offset: 'offset' in p ? p.offset : undefined,\n importId: 'importId' in p ? p.importId : undefined,\n args: 'args' in p ? p.args : undefined,\n bindings: 'bindings' in p ? p.bindings : undefined,\n sql: 'sql' in p ? p.sql : undefined,\n datasetId: 'datasetId' in p ? p.datasetId : undefined,\n versionId: 'versionId' in p ? p.versionId : undefined,\n expectedCurrent: 'expectedCurrentVersionId' in p ? p.expectedCurrentVersionId : undefined,\n limit: 'limit' in p ? p.limit : undefined,\n },\n signal,\n );\n return pipelineToolResult(pipelineResult(p.operation, result as Record<string, unknown>));\n }, signal);\n } catch (error) {\n return pipelineToolResult(pipelineFailure(input.operation, error));\n }\n };\n // Match the existing tools' workaround for the SDK's recursive Zod overloads.\n const register = server.registerTool.bind(server) as (...args: any[]) => unknown;\n register(\n 'farseer_pipeline',\n {\n description:\n 'Required workflow for all new repeatable data pipelines: use Simple Pipelines, even when TypeScript is requested. Inspect existing apps and source first. Preserve existing TypeScript apps through the app tools for inspection, execution and targeted maintenance; they are not missing pipeline setup. Migration requires an explicit migration request: do not replace an app or create a duplicate pipeline to fix it. Requested one-off direct imports remain supported. Before authoring, read guide topic=method, then topic=practices (how a Farseer data engineer designs a pipeline and the import behaviours that cause wrong numbers), then topic=grammar and relevant Pydantic model topics. Start a new pipeline with init name=<folder> (creates the folder, a job and the local profile on the tenant), or derive the profile from a job prepared in the web app with init jobId=<id>; init force=true rewrites that profile, for example after the first run to record dataset ids. check verifies prepared setup; explain missing setup. When the tenant has several pipelines, select one with pipeline=<folder name>. Use pull/push for source sync and run once after sync. runs lists the job run history; inspect takes the returned runUuid and nextOffset; versions requires datasetId; inspect-import requires importId; query requires sql and bindings; restore requires datasetId, versionId and expectedCurrentVersionId. A run that stays queued and never started may be stuck or waiting behind other jobs: end it with terminate uuid=<uuid> only when runs shows receipt: true, then tell the user which run you ended; ask the user before terminating any other run; terminate refuses a running run, which only a person may stop. Runs/restores have normal tenant effects. Shared edits require coordination; no tenant editing locks. Results carry outcome=success/refused/failed/unknown: success means the tool returned, not that a run succeeded or a query is complete. Follow error.nextAction; stop on refusals and never automatically retry uncertain writes or switch clients to get around a refusal. Inspect all log pages and use complete aggregates rather than truncated rows for totals.',\n inputSchema: pipelineInputSchema,\n outputSchema: pipelineOutputSchema,\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },\n },\n handler,\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAuE;AACvE,oBAA8B;AAC9B,wBAAsD;AACtD,uBAA8B;AAC9B,sBAA0D;AAC1D,qBAA+B;AAC/B,8BAQO;AAEA,SAAS,sBAAsB,QAAmB;AACrD,QAAM,WAAW,IAAI,gBAAgB;AACrC,QAAM,UAAU,OAAO,OAAO;AAC9B,SAAO,OAAO,UAAU,MAAM;AAC1B,aAAS,MAAM;AACf,cAAU;AAAA,EACd;AACA,QAAM,UAAU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,UACjB;AAAA,UACA,EAAE;AAAA,UACF;AAAA,YACI,MAAM,UAAU,IAAI,EAAE,OAAO;AAAA,YAC7B,QAAQ,YAAY,IAAI,EAAE,SAAS;AAAA,YACnC,UAAU,cAAc,IAAI,EAAE,WAAW;AAAA,YACzC,MAAM,UAAU,IAAI,EAAE,OAAO;AAAA,YAC7B,UAAU,cAAc,IAAI,EAAE,WAAW;AAAA,YACzC,KAAK,SAAS,IAAI,EAAE,MAAM;AAAA,YAC1B,WAAW,eAAe,IAAI,EAAE,YAAY;AAAA,YAC5C,WAAW,eAAe,IAAI,EAAE,YAAY;AAAA,YAC5C,iBAAiB,8BAA8B,IAAI,EAAE,2BAA2B;AAAA,YAChF,OAAO,WAAW,IAAI,EAAE,QAAQ;AAAA,UACpC;AAAA,UACA;AAAA,QACJ;AACA,mBAAO,gDAAmB,wCAAe,EAAE,WAAW,MAAiC,CAAC;AAAA,MAC5F,GAAG,MAAM;AAAA,IACb,SAAS,OAAO;AACZ,iBAAO,gDAAmB,yCAAgB,MAAM,WAAW,KAAK,CAAC;AAAA,IACrE;AAAA,EACJ;AAEA,QAAM,WAAW,OAAO,aAAa,KAAK,MAAM;AAChD;AAAA,IACI;AAAA,IACA;AAAA,MACI,aACI;AAAA,MACJ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,aAAa,EAAE,cAAc,OAAO,iBAAiB,MAAM,gBAAgB,OAAO,eAAe,KAAK;AAAA,IAC1G;AAAA,IACA;AAAA,EACJ;AACJ;",
6
+ "names": ["result"]
7
+ }
@@ -88,6 +88,8 @@ function registerRunTools(server) {
88
88
  "farseer_run_app",
89
89
  `Run a Farseer app locally.
90
90
 
91
+ Use this tool to run an existing TypeScript app, including an existing pipeline, without requiring the user to explicitly say TypeScript. Preserve its implementation and configuration; migration requires an explicit migration request. All new repeatable pipelines must use Simple Pipelines through farseer_pipeline and its remote run operation. An existing TypeScript app is not missing Simple Pipelines setup.
92
+
91
93
  This executes the app's entrypoint script using npx tsx with credentials automatically injected.
92
94
  The script's FarseerClient() constructor picks up the injected env vars - no hardcoded credentials needed.
93
95