farseer-cli 1.0.5 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api-reference.md +372 -0
- package/docs/arquero-patterns.md +158 -0
- package/docs/cli-guide.md +160 -0
- package/docs/how-farseer-works.md +113 -0
- package/docs/import-workflows.md +306 -0
- package/docs/model-export.md +95 -0
- package/docs/new-app-template.md +240 -0
- package/docs/query-formulas.md +97 -0
- package/docs/troubleshooting.md +140 -0
- package/package.json +3 -3
- package/dist/commands/app.js +0 -349
- package/dist/commands/app.js.map +0 -7
- package/dist/commands/apps.js +0 -111
- package/dist/commands/apps.js.map +0 -7
- package/dist/commands/checkout.js +0 -166
- package/dist/commands/checkout.js.map +0 -7
- package/dist/commands/config.js +0 -139
- package/dist/commands/config.js.map +0 -7
- package/dist/commands/diff.js +0 -183
- package/dist/commands/diff.js.map +0 -7
- package/dist/commands/dimensions.js +0 -145
- package/dist/commands/dimensions.js.map +0 -7
- package/dist/commands/files.js +0 -99
- package/dist/commands/files.js.map +0 -7
- package/dist/commands/install.js +0 -79
- package/dist/commands/install.js.map +0 -7
- package/dist/commands/list.js +0 -92
- package/dist/commands/list.js.map +0 -7
- package/dist/commands/login.js +0 -134
- package/dist/commands/login.js.map +0 -7
- package/dist/commands/logout.js +0 -59
- package/dist/commands/logout.js.map +0 -7
- package/dist/commands/mcp-server.js +0 -41
- package/dist/commands/mcp-server.js.map +0 -7
- package/dist/commands/model.js +0 -189
- package/dist/commands/model.js.map +0 -7
- package/dist/commands/pull.js +0 -287
- package/dist/commands/pull.js.map +0 -7
- package/dist/commands/push.js +0 -251
- package/dist/commands/push.js.map +0 -7
- package/dist/commands/run.js +0 -288
- package/dist/commands/run.js.map +0 -7
- package/dist/commands/status.js +0 -145
- package/dist/commands/status.js.map +0 -7
- package/dist/commands/variables.js +0 -176
- package/dist/commands/variables.js.map +0 -7
- package/dist/commands/whoami.js +0 -63
- package/dist/commands/whoami.js.map +0 -7
- package/dist/index.js +0 -153
- package/dist/index.js.map +0 -7
- package/dist/mcp/index.js +0 -35
- package/dist/mcp/index.js.map +0 -7
- package/dist/mcp/prompts/workflows.js +0 -437
- package/dist/mcp/prompts/workflows.js.map +0 -7
- package/dist/mcp/resources/documentation.js +0 -167
- package/dist/mcp/resources/documentation.js.map +0 -7
- package/dist/mcp/server.js +0 -52
- package/dist/mcp/server.js.map +0 -7
- package/dist/mcp/tools/appTools.js +0 -377
- package/dist/mcp/tools/appTools.js.map +0 -7
- package/dist/mcp/tools/authTools.js +0 -158
- package/dist/mcp/tools/authTools.js.map +0 -7
- package/dist/mcp/tools/dataTools.js +0 -366
- package/dist/mcp/tools/dataTools.js.map +0 -7
- package/dist/mcp/tools/modelTools.js +0 -331
- package/dist/mcp/tools/modelTools.js.map +0 -7
- package/dist/mcp/tools/runTools.js +0 -231
- package/dist/mcp/tools/runTools.js.map +0 -7
- package/dist/mcp/tools/syncTools.js +0 -382
- package/dist/mcp/tools/syncTools.js.map +0 -7
- package/dist/mcp/utils/helpers.js +0 -113
- package/dist/mcp/utils/helpers.js.map +0 -7
- package/dist/services/appSyncService.js +0 -399
- package/dist/services/appSyncService.js.map +0 -7
- package/dist/services/configService.js +0 -196
- package/dist/services/configService.js.map +0 -7
- package/dist/services/farseerApi.js +0 -426
- package/dist/services/farseerApi.js.map +0 -7
- package/dist/services/farseerFactory.js +0 -231
- package/dist/services/farseerFactory.js.map +0 -7
- package/dist/services/farseerService.js +0 -614
- package/dist/services/farseerService.js.map +0 -7
- package/dist/services/gitService.js +0 -134
- package/dist/services/gitService.js.map +0 -7
- package/dist/services/syncService.js +0 -415
- package/dist/services/syncService.js.map +0 -7
- package/dist/utils/constants.js +0 -49
- package/dist/utils/constants.js.map +0 -7
- package/dist/utils/helpers.js +0 -433
- package/dist/utils/helpers.js.map +0 -7
- package/dist/utils/logger.js +0 -76
- package/dist/utils/logger.js.map +0 -7
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var appTools_exports = {};
|
|
19
|
-
__export(appTools_exports, {
|
|
20
|
-
registerAppTools: () => registerAppTools
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(appTools_exports);
|
|
23
|
-
var import_zod = require("zod");
|
|
24
|
-
var import_farseerFactory = require("../../services/farseerFactory");
|
|
25
|
-
var import_configService = require("../../services/configService");
|
|
26
|
-
var import_helpers = require("../utils/helpers");
|
|
27
|
-
const listAppsSchema = {
|
|
28
|
-
tenant: import_zod.z.string().optional().describe("Tenant name"),
|
|
29
|
-
details: import_zod.z.boolean().optional().describe("Include full details for each app")
|
|
30
|
-
};
|
|
31
|
-
const getAppSchema = {
|
|
32
|
-
tenant: import_zod.z.string().optional().describe("Tenant name"),
|
|
33
|
-
appName: import_zod.z.string().describe("Name of the app (can include spaces)")
|
|
34
|
-
};
|
|
35
|
-
const createAppSchema = {
|
|
36
|
-
tenant: import_zod.z.string().optional().describe("Tenant name"),
|
|
37
|
-
appName: import_zod.z.string().describe("Name for the new app")
|
|
38
|
-
};
|
|
39
|
-
const argumentSchema = import_zod.z.object({
|
|
40
|
-
name: import_zod.z.string(),
|
|
41
|
-
defaultValue: import_zod.z.string()
|
|
42
|
-
});
|
|
43
|
-
const configureAppSchema = {
|
|
44
|
-
tenant: import_zod.z.string().optional().describe("Tenant name"),
|
|
45
|
-
appName: import_zod.z.string().describe("Name of the app to configure"),
|
|
46
|
-
entrypoint: import_zod.z.string().optional().describe('Main script filename (e.g., "index.ts")'),
|
|
47
|
-
scripts: import_zod.z.array(import_zod.z.string()).optional().describe("List of script filenames to include"),
|
|
48
|
-
description: import_zod.z.string().optional().describe("App description"),
|
|
49
|
-
arguments: import_zod.z.array(argumentSchema).optional().describe("App arguments with default values"),
|
|
50
|
-
newName: import_zod.z.string().optional().describe("Rename the app")
|
|
51
|
-
};
|
|
52
|
-
const deleteAppSchema = {
|
|
53
|
-
tenant: import_zod.z.string().optional().describe("Tenant name"),
|
|
54
|
-
appName: import_zod.z.string().describe("Name of the app to delete")
|
|
55
|
-
};
|
|
56
|
-
function registerAppTools(server) {
|
|
57
|
-
server.tool(
|
|
58
|
-
"farseer_list_apps",
|
|
59
|
-
`List all apps (Remote Jobs) configured on a Farseer tenant.
|
|
60
|
-
|
|
61
|
-
Apps are executable script configurations that include:
|
|
62
|
-
- Entry point script
|
|
63
|
-
- List of included scripts
|
|
64
|
-
- Expected arguments with default values
|
|
65
|
-
|
|
66
|
-
Use details=true to include full information for each app.
|
|
67
|
-
|
|
68
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
69
|
-
listAppsSchema,
|
|
70
|
-
async (params) => {
|
|
71
|
-
const { tenant: tenantArg, details } = params;
|
|
72
|
-
const checkout = (0, import_configService.getCurrentCheckout)();
|
|
73
|
-
const tenant = tenantArg || checkout?.tenant;
|
|
74
|
-
const organisation = tenantArg || checkout?.organisation;
|
|
75
|
-
if (!tenant || !organisation) {
|
|
76
|
-
return (0, import_helpers.tenantRequiredResponse)();
|
|
77
|
-
}
|
|
78
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
79
|
-
if (!clientResult) {
|
|
80
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
const appList = await clientResult.client.listApps();
|
|
84
|
-
if (!details) {
|
|
85
|
-
return (0, import_helpers.successResponse)({
|
|
86
|
-
tenant,
|
|
87
|
-
totalApps: appList.length,
|
|
88
|
-
apps: appList.map((a) => ({
|
|
89
|
-
name: a.name,
|
|
90
|
-
id: a.id,
|
|
91
|
-
reference: a.reference
|
|
92
|
-
}))
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const appsWithDetails = [];
|
|
96
|
-
for (const item of appList) {
|
|
97
|
-
const app = await clientResult.client.getApp(item.reference);
|
|
98
|
-
if (app) {
|
|
99
|
-
const mainScript = app.scriptFiles.find((s) => s.id === app.mainScriptFileId);
|
|
100
|
-
appsWithDetails.push({
|
|
101
|
-
name: app.name,
|
|
102
|
-
id: app.id,
|
|
103
|
-
description: app.description || "",
|
|
104
|
-
entrypoint: mainScript?.name || null,
|
|
105
|
-
scripts: app.scriptFiles.map((s) => s.name),
|
|
106
|
-
arguments: app.expectedArguments.map((a) => ({
|
|
107
|
-
name: a.name,
|
|
108
|
-
defaultValue: a.defaultValue
|
|
109
|
-
}))
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return (0, import_helpers.successResponse)({
|
|
114
|
-
tenant,
|
|
115
|
-
totalApps: appsWithDetails.length,
|
|
116
|
-
apps: appsWithDetails
|
|
117
|
-
});
|
|
118
|
-
} catch (error) {
|
|
119
|
-
return (0, import_helpers.errorResponse)(
|
|
120
|
-
`List apps failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
121
|
-
"NETWORK_ERROR"
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
server.tool(
|
|
127
|
-
"farseer_get_app",
|
|
128
|
-
`Get detailed information about a specific Farseer app.
|
|
129
|
-
|
|
130
|
-
Returns:
|
|
131
|
-
- App name and description
|
|
132
|
-
- Entry point script (main script that runs)
|
|
133
|
-
- List of all included scripts
|
|
134
|
-
- Expected arguments with their default values
|
|
135
|
-
|
|
136
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
137
|
-
getAppSchema,
|
|
138
|
-
async (params) => {
|
|
139
|
-
const { tenant: tenantArg, appName } = params;
|
|
140
|
-
const checkout = (0, import_configService.getCurrentCheckout)();
|
|
141
|
-
const tenant = tenantArg || checkout?.tenant;
|
|
142
|
-
const organisation = tenantArg || checkout?.organisation;
|
|
143
|
-
if (!tenant || !organisation) {
|
|
144
|
-
return (0, import_helpers.tenantRequiredResponse)();
|
|
145
|
-
}
|
|
146
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
147
|
-
if (!clientResult) {
|
|
148
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
149
|
-
}
|
|
150
|
-
try {
|
|
151
|
-
const app = await clientResult.client.getAppByName(appName);
|
|
152
|
-
if (!app) {
|
|
153
|
-
return (0, import_helpers.errorResponse)(`App "${appName}" not found`, "NOT_FOUND");
|
|
154
|
-
}
|
|
155
|
-
const mainScript = app.scriptFiles.find((s) => s.id === app.mainScriptFileId);
|
|
156
|
-
return (0, import_helpers.successResponse)({
|
|
157
|
-
tenant,
|
|
158
|
-
app: {
|
|
159
|
-
id: app.id,
|
|
160
|
-
name: app.name,
|
|
161
|
-
description: app.description || "",
|
|
162
|
-
entrypoint: mainScript?.name || null,
|
|
163
|
-
scripts: app.scriptFiles.map((s) => ({
|
|
164
|
-
id: s.id,
|
|
165
|
-
name: s.name,
|
|
166
|
-
isEntrypoint: s.id === app.mainScriptFileId
|
|
167
|
-
})),
|
|
168
|
-
arguments: app.expectedArguments.map((a) => ({
|
|
169
|
-
name: a.name,
|
|
170
|
-
type: a.type,
|
|
171
|
-
defaultValue: a.defaultValue
|
|
172
|
-
})),
|
|
173
|
-
status: app.status,
|
|
174
|
-
lastHeartbeat: app.lastHeartbeat
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
} catch (error) {
|
|
178
|
-
return (0, import_helpers.errorResponse)(
|
|
179
|
-
`Get app failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
180
|
-
"NETWORK_ERROR"
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
server.tool(
|
|
186
|
-
"farseer_create_app",
|
|
187
|
-
`Create a new app (Remote Job) on a Farseer tenant.
|
|
188
|
-
|
|
189
|
-
This creates an empty app shell. After creation, use farseer_configure_app to:
|
|
190
|
-
- Set the entry point script
|
|
191
|
-
- Add scripts to the app
|
|
192
|
-
- Configure arguments
|
|
193
|
-
|
|
194
|
-
Scripts must exist on the remote (push them first if they're new).
|
|
195
|
-
|
|
196
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
197
|
-
createAppSchema,
|
|
198
|
-
async (params) => {
|
|
199
|
-
const { tenant: tenantArg, appName } = params;
|
|
200
|
-
const checkout = (0, import_configService.getCurrentCheckout)();
|
|
201
|
-
const tenant = tenantArg || checkout?.tenant;
|
|
202
|
-
const organisation = tenantArg || checkout?.organisation;
|
|
203
|
-
if (!tenant || !organisation) {
|
|
204
|
-
return (0, import_helpers.tenantRequiredResponse)();
|
|
205
|
-
}
|
|
206
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
207
|
-
if (!clientResult) {
|
|
208
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
209
|
-
}
|
|
210
|
-
try {
|
|
211
|
-
const existing = await clientResult.client.getAppByName(appName);
|
|
212
|
-
if (existing) {
|
|
213
|
-
return (0, import_helpers.errorResponse)(`App "${appName}" already exists`, "VALIDATION_ERROR");
|
|
214
|
-
}
|
|
215
|
-
const app = await clientResult.client.createApp(appName);
|
|
216
|
-
return (0, import_helpers.successResponse)({
|
|
217
|
-
tenant,
|
|
218
|
-
app: {
|
|
219
|
-
id: app.id,
|
|
220
|
-
name: app.name
|
|
221
|
-
},
|
|
222
|
-
message: `App "${appName}" created. Use farseer_configure_app to set entrypoint, scripts, and arguments.`
|
|
223
|
-
});
|
|
224
|
-
} catch (error) {
|
|
225
|
-
return (0, import_helpers.errorResponse)(
|
|
226
|
-
`Create app failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
227
|
-
"NETWORK_ERROR"
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
server.tool(
|
|
233
|
-
"farseer_configure_app",
|
|
234
|
-
`Configure an existing Farseer app.
|
|
235
|
-
|
|
236
|
-
You can set:
|
|
237
|
-
- entrypoint: Main script to execute (e.g., "index.ts")
|
|
238
|
-
- scripts: List of scripts to include in the app
|
|
239
|
-
- description: App description
|
|
240
|
-
- arguments: List of expected arguments with default values
|
|
241
|
-
- newName: Rename the app
|
|
242
|
-
|
|
243
|
-
Important:
|
|
244
|
-
- Scripts must exist on the remote (push them first)
|
|
245
|
-
- If you set scripts but not entrypoint, the first script becomes entrypoint
|
|
246
|
-
- Arguments are passed to the script via command line
|
|
247
|
-
|
|
248
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
249
|
-
configureAppSchema,
|
|
250
|
-
async (params) => {
|
|
251
|
-
const { tenant: tenantArg, appName, entrypoint, scripts, description, arguments: args, newName } = params;
|
|
252
|
-
const checkout = (0, import_configService.getCurrentCheckout)();
|
|
253
|
-
const tenant = tenantArg || checkout?.tenant;
|
|
254
|
-
const organisation = tenantArg || checkout?.organisation;
|
|
255
|
-
if (!tenant || !organisation) {
|
|
256
|
-
return (0, import_helpers.tenantRequiredResponse)();
|
|
257
|
-
}
|
|
258
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
259
|
-
if (!clientResult) {
|
|
260
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
261
|
-
}
|
|
262
|
-
try {
|
|
263
|
-
const app = await clientResult.client.getAppByName(appName);
|
|
264
|
-
if (!app) {
|
|
265
|
-
return (0, import_helpers.errorResponse)(`App "${appName}" not found`, "NOT_FOUND");
|
|
266
|
-
}
|
|
267
|
-
const availableScripts = await clientResult.client.getScriptFiles();
|
|
268
|
-
const scriptIdMap = new Map(availableScripts.map((s) => [s.name.toLowerCase(), s.id]));
|
|
269
|
-
const update = {};
|
|
270
|
-
if (newName) {
|
|
271
|
-
update.name = newName;
|
|
272
|
-
}
|
|
273
|
-
if (description !== void 0) {
|
|
274
|
-
update.description = description;
|
|
275
|
-
}
|
|
276
|
-
if (args) {
|
|
277
|
-
update.expectedArguments = args.map((a) => ({
|
|
278
|
-
name: a.name,
|
|
279
|
-
type: "variable",
|
|
280
|
-
defaultValue: a.defaultValue
|
|
281
|
-
}));
|
|
282
|
-
}
|
|
283
|
-
if (scripts && scripts.length > 0) {
|
|
284
|
-
const scriptIds = [];
|
|
285
|
-
const notFound = [];
|
|
286
|
-
for (const scriptName of scripts) {
|
|
287
|
-
const id = scriptIdMap.get(scriptName.toLowerCase());
|
|
288
|
-
if (id) {
|
|
289
|
-
scriptIds.push(id);
|
|
290
|
-
} else {
|
|
291
|
-
notFound.push(scriptName);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
if (notFound.length > 0) {
|
|
295
|
-
return (0, import_helpers.errorResponse)(
|
|
296
|
-
`Scripts not found on remote: ${notFound.join(", ")}. Push them first.`,
|
|
297
|
-
"VALIDATION_ERROR"
|
|
298
|
-
);
|
|
299
|
-
}
|
|
300
|
-
update.scriptFileIds = scriptIds;
|
|
301
|
-
if (!entrypoint && scriptIds.length > 0) {
|
|
302
|
-
update.mainScriptFileId = scriptIds[0];
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (entrypoint) {
|
|
306
|
-
const entrypointId = scriptIdMap.get(entrypoint.toLowerCase());
|
|
307
|
-
if (!entrypointId) {
|
|
308
|
-
return (0, import_helpers.errorResponse)(
|
|
309
|
-
`Entrypoint script "${entrypoint}" not found on remote. Push it first.`,
|
|
310
|
-
"VALIDATION_ERROR"
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
update.mainScriptFileId = entrypointId;
|
|
314
|
-
}
|
|
315
|
-
const reference = app.id.toString();
|
|
316
|
-
await clientResult.client.updateApp(reference, update);
|
|
317
|
-
return (0, import_helpers.successResponse)({
|
|
318
|
-
tenant,
|
|
319
|
-
appName: newName || appName,
|
|
320
|
-
updated: Object.keys(update),
|
|
321
|
-
message: `App "${appName}" configured successfully`
|
|
322
|
-
});
|
|
323
|
-
} catch (error) {
|
|
324
|
-
return (0, import_helpers.errorResponse)(
|
|
325
|
-
`Configure app failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
326
|
-
"NETWORK_ERROR"
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
);
|
|
331
|
-
server.tool(
|
|
332
|
-
"farseer_delete_app",
|
|
333
|
-
`Delete an app from a Farseer tenant.
|
|
334
|
-
|
|
335
|
-
WARNING: This is irreversible - the app will be permanently removed from the remote instance.
|
|
336
|
-
|
|
337
|
-
This does NOT delete the script files, only the app configuration.
|
|
338
|
-
|
|
339
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
340
|
-
deleteAppSchema,
|
|
341
|
-
async (params) => {
|
|
342
|
-
const { tenant: tenantArg, appName } = params;
|
|
343
|
-
const checkout = (0, import_configService.getCurrentCheckout)();
|
|
344
|
-
const tenant = tenantArg || checkout?.tenant;
|
|
345
|
-
const organisation = tenantArg || checkout?.organisation;
|
|
346
|
-
if (!tenant || !organisation) {
|
|
347
|
-
return (0, import_helpers.tenantRequiredResponse)();
|
|
348
|
-
}
|
|
349
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(organisation, tenant);
|
|
350
|
-
if (!clientResult) {
|
|
351
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
352
|
-
}
|
|
353
|
-
try {
|
|
354
|
-
const app = await clientResult.client.getAppByName(appName);
|
|
355
|
-
if (!app) {
|
|
356
|
-
return (0, import_helpers.errorResponse)(`App "${appName}" not found`, "NOT_FOUND");
|
|
357
|
-
}
|
|
358
|
-
await clientResult.client.deleteApp(app.id.toString());
|
|
359
|
-
return (0, import_helpers.successResponse)({
|
|
360
|
-
tenant,
|
|
361
|
-
deletedApp: appName,
|
|
362
|
-
message: `App "${appName}" has been deleted`
|
|
363
|
-
});
|
|
364
|
-
} catch (error) {
|
|
365
|
-
return (0, import_helpers.errorResponse)(
|
|
366
|
-
`Delete app failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
367
|
-
"NETWORK_ERROR"
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
374
|
-
0 && (module.exports = {
|
|
375
|
-
registerAppTools
|
|
376
|
-
});
|
|
377
|
-
//# sourceMappingURL=appTools.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/mcp/tools/appTools.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * App Management Tools\n *\n * Tools for managing Farseer apps (Remote Jobs).\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\nimport { getFarseerClientWithFallback } from '../../services/farseerFactory';\nimport { getCurrentCheckout } from '../../services/configService';\nimport {\n successResponse,\n errorResponse,\n authRequiredResponse,\n tenantRequiredResponse,\n} from '../utils/helpers';\n\n// Define schemas outside of tool registration to avoid deep type instantiation\nconst listAppsSchema = {\n tenant: z.string().optional().describe('Tenant name'),\n details: z.boolean().optional().describe('Include full details for each app'),\n};\n\nconst getAppSchema = {\n tenant: z.string().optional().describe('Tenant name'),\n appName: z.string().describe('Name of the app (can include spaces)'),\n};\n\nconst createAppSchema = {\n tenant: z.string().optional().describe('Tenant name'),\n appName: z.string().describe('Name for the new app'),\n};\n\nconst argumentSchema = z.object({\n name: z.string(),\n defaultValue: z.string(),\n});\n\nconst configureAppSchema = {\n tenant: z.string().optional().describe('Tenant name'),\n appName: z.string().describe('Name of the app to configure'),\n entrypoint: z.string().optional().describe('Main script filename (e.g., \"index.ts\")'),\n scripts: z.array(z.string()).optional().describe('List of script filenames to include'),\n description: z.string().optional().describe('App description'),\n arguments: z.array(argumentSchema).optional().describe('App arguments with default values'),\n newName: z.string().optional().describe('Rename the app'),\n};\n\nconst deleteAppSchema = {\n tenant: z.string().optional().describe('Tenant name'),\n appName: z.string().describe('Name of the app to delete'),\n};\n\nexport function registerAppTools(server: McpServer): void {\n // farseer_list_apps - List all apps\n server.tool(\n 'farseer_list_apps',\n `List all apps (Remote Jobs) configured on a Farseer tenant.\n\nApps are executable script configurations that include:\n- Entry point script\n- List of included scripts\n- Expected arguments with default values\n\nUse details=true to include full information for each app.\n\nIf no tenant is specified, uses the currently checked-out tenant.`,\n listAppsSchema,\n async (params: { tenant?: string; details?: boolean }) => {\n const { tenant: tenantArg, details } = params;\n const checkout = getCurrentCheckout();\n const tenant = tenantArg || checkout?.tenant;\n const organisation = tenantArg || checkout?.organisation;\n\n if (!tenant || !organisation) {\n return tenantRequiredResponse();\n }\n\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n try {\n const appList = await clientResult.client.listApps();\n\n if (!details) {\n return successResponse({\n tenant,\n totalApps: appList.length,\n apps: appList.map((a) => ({\n name: a.name,\n id: a.id,\n reference: a.reference,\n })),\n });\n }\n\n // Get full details for each app\n const appsWithDetails = [];\n for (const item of appList) {\n const app = await clientResult.client.getApp(item.reference);\n if (app) {\n const mainScript = app.scriptFiles.find((s) => s.id === app.mainScriptFileId);\n appsWithDetails.push({\n name: app.name,\n id: app.id,\n description: app.description || '',\n entrypoint: mainScript?.name || null,\n scripts: app.scriptFiles.map((s) => s.name),\n arguments: app.expectedArguments.map((a) => ({\n name: a.name,\n defaultValue: a.defaultValue,\n })),\n });\n }\n }\n\n return successResponse({\n tenant,\n totalApps: appsWithDetails.length,\n apps: appsWithDetails,\n });\n } catch (error) {\n return errorResponse(\n `List apps failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n 'NETWORK_ERROR'\n );\n }\n }\n );\n\n // farseer_get_app - Get app details\n server.tool(\n 'farseer_get_app',\n `Get detailed information about a specific Farseer app.\n\nReturns:\n- App name and description\n- Entry point script (main script that runs)\n- List of all included scripts\n- Expected arguments with their default values\n\nIf no tenant is specified, uses the currently checked-out tenant.`,\n getAppSchema,\n async (params: { tenant?: string; appName: string }) => {\n const { tenant: tenantArg, appName } = params;\n const checkout = getCurrentCheckout();\n const tenant = tenantArg || checkout?.tenant;\n const organisation = tenantArg || checkout?.organisation;\n\n if (!tenant || !organisation) {\n return tenantRequiredResponse();\n }\n\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n try {\n const app = await clientResult.client.getAppByName(appName);\n\n if (!app) {\n return errorResponse(`App \"${appName}\" not found`, 'NOT_FOUND');\n }\n\n const mainScript = app.scriptFiles.find((s) => s.id === app.mainScriptFileId);\n\n return successResponse({\n tenant,\n app: {\n id: app.id,\n name: app.name,\n description: app.description || '',\n entrypoint: mainScript?.name || null,\n scripts: app.scriptFiles.map((s) => ({\n id: s.id,\n name: s.name,\n isEntrypoint: s.id === app.mainScriptFileId,\n })),\n arguments: app.expectedArguments.map((a) => ({\n name: a.name,\n type: a.type,\n defaultValue: a.defaultValue,\n })),\n status: app.status,\n lastHeartbeat: app.lastHeartbeat,\n },\n });\n } catch (error) {\n return errorResponse(\n `Get app failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n 'NETWORK_ERROR'\n );\n }\n }\n );\n\n // farseer_create_app - Create new app\n server.tool(\n 'farseer_create_app',\n `Create a new app (Remote Job) on a Farseer tenant.\n\nThis creates an empty app shell. After creation, use farseer_configure_app to:\n- Set the entry point script\n- Add scripts to the app\n- Configure arguments\n\nScripts must exist on the remote (push them first if they're new).\n\nIf no tenant is specified, uses the currently checked-out tenant.`,\n createAppSchema,\n async (params: { tenant?: string; appName: string }) => {\n const { tenant: tenantArg, appName } = params;\n const checkout = getCurrentCheckout();\n const tenant = tenantArg || checkout?.tenant;\n const organisation = tenantArg || checkout?.organisation;\n\n if (!tenant || !organisation) {\n return tenantRequiredResponse();\n }\n\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n try {\n // Check if app already exists\n const existing = await clientResult.client.getAppByName(appName);\n if (existing) {\n return errorResponse(`App \"${appName}\" already exists`, 'VALIDATION_ERROR');\n }\n\n const app = await clientResult.client.createApp(appName);\n\n return successResponse({\n tenant,\n app: {\n id: app.id,\n name: app.name,\n },\n message: `App \"${appName}\" created. Use farseer_configure_app to set entrypoint, scripts, and arguments.`,\n });\n } catch (error) {\n return errorResponse(\n `Create app failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n 'NETWORK_ERROR'\n );\n }\n }\n );\n\n // farseer_configure_app - Configure app settings\n server.tool(\n 'farseer_configure_app',\n `Configure an existing Farseer app.\n\nYou can set:\n- entrypoint: Main script to execute (e.g., \"index.ts\")\n- scripts: List of scripts to include in the app\n- description: App description\n- arguments: List of expected arguments with default values\n- newName: Rename the app\n\nImportant:\n- Scripts must exist on the remote (push them first)\n- If you set scripts but not entrypoint, the first script becomes entrypoint\n- Arguments are passed to the script via command line\n\nIf no tenant is specified, uses the currently checked-out tenant.`,\n configureAppSchema,\n async (params: {\n tenant?: string;\n appName: string;\n entrypoint?: string;\n scripts?: string[];\n description?: string;\n arguments?: Array<{ name: string; defaultValue: string }>;\n newName?: string;\n }) => {\n const { tenant: tenantArg, appName, entrypoint, scripts, description, arguments: args, newName } = params;\n const checkout = getCurrentCheckout();\n const tenant = tenantArg || checkout?.tenant;\n const organisation = tenantArg || checkout?.organisation;\n\n if (!tenant || !organisation) {\n return tenantRequiredResponse();\n }\n\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n try {\n const app = await clientResult.client.getAppByName(appName);\n if (!app) {\n return errorResponse(`App \"${appName}\" not found`, 'NOT_FOUND');\n }\n\n // Get available scripts for ID lookup\n const availableScripts = await clientResult.client.getScriptFiles();\n const scriptIdMap = new Map(availableScripts.map((s) => [s.name.toLowerCase(), s.id]));\n\n // Build update payload\n const update: {\n name?: string;\n description?: string;\n expectedArguments?: Array<{ name: string; type: 'variable'; defaultValue: string }>;\n mainScriptFileId?: string | null;\n scriptFileIds?: string[];\n } = {};\n\n if (newName) {\n update.name = newName;\n }\n\n if (description !== undefined) {\n update.description = description;\n }\n\n if (args) {\n update.expectedArguments = args.map((a) => ({\n name: a.name,\n type: 'variable' as const,\n defaultValue: a.defaultValue,\n }));\n }\n\n if (scripts && scripts.length > 0) {\n const scriptIds: string[] = [];\n const notFound: string[] = [];\n\n for (const scriptName of scripts) {\n const id = scriptIdMap.get(scriptName.toLowerCase());\n if (id) {\n scriptIds.push(id);\n } else {\n notFound.push(scriptName);\n }\n }\n\n if (notFound.length > 0) {\n return errorResponse(\n `Scripts not found on remote: ${notFound.join(', ')}. Push them first.`,\n 'VALIDATION_ERROR'\n );\n }\n\n update.scriptFileIds = scriptIds;\n\n // Set entrypoint to first script if not explicitly specified\n if (!entrypoint && scriptIds.length > 0) {\n update.mainScriptFileId = scriptIds[0];\n }\n }\n\n if (entrypoint) {\n const entrypointId = scriptIdMap.get(entrypoint.toLowerCase());\n if (!entrypointId) {\n return errorResponse(\n `Entrypoint script \"${entrypoint}\" not found on remote. Push it first.`,\n 'VALIDATION_ERROR'\n );\n }\n update.mainScriptFileId = entrypointId;\n }\n\n // Apply update\n const reference = app.id.toString();\n await clientResult.client.updateApp(reference, update);\n\n return successResponse({\n tenant,\n appName: newName || appName,\n updated: Object.keys(update),\n message: `App \"${appName}\" configured successfully`,\n });\n } catch (error) {\n return errorResponse(\n `Configure app failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n 'NETWORK_ERROR'\n );\n }\n }\n );\n\n // farseer_delete_app - Delete app\n server.tool(\n 'farseer_delete_app',\n `Delete an app from a Farseer tenant.\n\nWARNING: This is irreversible - the app will be permanently removed from the remote instance.\n\nThis does NOT delete the script files, only the app configuration.\n\nIf no tenant is specified, uses the currently checked-out tenant.`,\n deleteAppSchema,\n async (params: { tenant?: string; appName: string }) => {\n const { tenant: tenantArg, appName } = params;\n const checkout = getCurrentCheckout();\n const tenant = tenantArg || checkout?.tenant;\n const organisation = tenantArg || checkout?.organisation;\n\n if (!tenant || !organisation) {\n return tenantRequiredResponse();\n }\n\n const clientResult = await getFarseerClientWithFallback(organisation, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n try {\n const app = await clientResult.client.getAppByName(appName);\n if (!app) {\n return errorResponse(`App \"${appName}\" not found`, 'NOT_FOUND');\n }\n\n await clientResult.client.deleteApp(app.id.toString());\n\n return successResponse({\n tenant,\n deletedApp: appName,\n message: `App \"${appName}\" has been deleted`,\n });\n } catch (error) {\n return errorResponse(\n `Delete app failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n 'NETWORK_ERROR'\n );\n }\n }\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAAkB;AAClB,4BAA6C;AAC7C,2BAAmC;AACnC,qBAKO;AAGP,MAAM,iBAAiB;AAAA,EACnB,QAAQ,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,aAAa;AAAA,EACpD,SAAS,aAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,mCAAmC;AAChF;AAEA,MAAM,eAAe;AAAA,EACjB,QAAQ,aAAE,OAAO,EAAE,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aAAa,OAAO;AAC1D,YAAI,CAAC,KAAK;AACN,qBAAO,8BAAc,QAAQ,OAAO,eAAe,WAAW;AAAA,QAClE;AAEA,cAAM,aAAa,OAAO,UAAU,IAAI,GAAG,SAAS,CAAC;AAErD,mBAAO,gCAAgB;AAAA,UACnB;AAAA,UACA,YAAY;AAAA,UACZ,SAAS,QAAQ,OAAO;AAAA,QAC5B,CAAC;AAAA,MACL,SAAS,OAAO;AACZ,mBAAO;AAAA,UACH,sBAAsB,iBAAiB,QAAQ,MAAM,UAAU,eAAe;AAAA,UAC9E;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var authTools_exports = {};
|
|
19
|
-
__export(authTools_exports, {
|
|
20
|
-
registerAuthTools: () => registerAuthTools
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(authTools_exports);
|
|
23
|
-
var import_zod = require("zod");
|
|
24
|
-
var import_configService = require("../../services/configService");
|
|
25
|
-
var import_farseerFactory = require("../../services/farseerFactory");
|
|
26
|
-
var import_syncService = require("../../services/syncService");
|
|
27
|
-
var import_appSyncService = require("../../services/appSyncService");
|
|
28
|
-
var import_helpers = require("../utils/helpers");
|
|
29
|
-
const checkoutSchema = {
|
|
30
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted with tenant, assumes org=tenant."),
|
|
31
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. If omitted, returns current checkout status."),
|
|
32
|
-
skipPull: import_zod.z.boolean().optional().describe("Skip automatic pull after checkout (default: false)")
|
|
33
|
-
};
|
|
34
|
-
function registerAuthTools(server) {
|
|
35
|
-
server.tool(
|
|
36
|
-
"farseer_whoami",
|
|
37
|
-
`Check Farseer authentication status.
|
|
38
|
-
|
|
39
|
-
Returns information about:
|
|
40
|
-
- Whether a JWT token is valid (from browser login)
|
|
41
|
-
- JWT token expiration time
|
|
42
|
-
- Currently checked-out tenant and organisation
|
|
43
|
-
- List of tenants with API keys configured
|
|
44
|
-
|
|
45
|
-
Use this before any operation to verify you have valid credentials.
|
|
46
|
-
If not authenticated, run "farseer login" in terminal.`,
|
|
47
|
-
{},
|
|
48
|
-
async () => {
|
|
49
|
-
const status = (0, import_helpers.getAuthStatus)();
|
|
50
|
-
return (0, import_helpers.successResponse)({
|
|
51
|
-
jwtValid: status.jwtValid,
|
|
52
|
-
jwtExpiresAt: status.jwtExpiresAt,
|
|
53
|
-
currentCheckout: status.currentCheckout,
|
|
54
|
-
configuredTenants: status.configuredTenants,
|
|
55
|
-
message: status.jwtValid ? "Authenticated via browser login (JWT)" : status.configuredTenants.length > 0 ? "Not authenticated via browser, but API keys are configured" : 'Not authenticated. Run "farseer login" to authenticate.'
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
server.tool(
|
|
60
|
-
"farseer_checkout",
|
|
61
|
-
`Set a default tenant for all subsequent Farseer operations, or get the current checkout status.
|
|
62
|
-
|
|
63
|
-
When setting a tenant:
|
|
64
|
-
- Verifies authentication works for that tenant
|
|
65
|
-
- Optionally pulls files and apps from remote
|
|
66
|
-
- Sets the tenant as default for all future commands
|
|
67
|
-
|
|
68
|
-
Organisation and tenant terminology:
|
|
69
|
-
- Organisation: subdomain of Farseer instance (e.g., "fs-personal" for fs-personal.farseer.io)
|
|
70
|
-
- Tenant: workspace ID sent as X-TENANT-ID header
|
|
71
|
-
|
|
72
|
-
Often org and tenant are the same (e.g., "tthotels"), but they can differ
|
|
73
|
-
(e.g., org="fs-personal", tenant="john-doe").
|
|
74
|
-
|
|
75
|
-
If you only provide tenant without organisation, it assumes org=tenant.`,
|
|
76
|
-
checkoutSchema,
|
|
77
|
-
async (params) => {
|
|
78
|
-
const { organisation, tenant, skipPull } = params;
|
|
79
|
-
if (!tenant) {
|
|
80
|
-
const current = (0, import_configService.getCurrentCheckout)();
|
|
81
|
-
if (current) {
|
|
82
|
-
return (0, import_helpers.successResponse)({
|
|
83
|
-
currentCheckout: current,
|
|
84
|
-
message: `Currently checked out: ${current.tenant} (org: ${current.organisation})`
|
|
85
|
-
});
|
|
86
|
-
} else {
|
|
87
|
-
return (0, import_helpers.successResponse)({
|
|
88
|
-
currentCheckout: null,
|
|
89
|
-
message: "No tenant currently checked out. Use tenant parameter to checkout."
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const org = organisation || tenant;
|
|
94
|
-
const clientResult = await (0, import_farseerFactory.getFarseerClientWithFallback)(org, tenant);
|
|
95
|
-
if (!clientResult) {
|
|
96
|
-
return (0, import_helpers.authRequiredResponse)(tenant);
|
|
97
|
-
}
|
|
98
|
-
if (org === tenant) {
|
|
99
|
-
(0, import_configService.setCurrentTenant)(tenant);
|
|
100
|
-
} else {
|
|
101
|
-
(0, import_configService.setCurrentCheckout)(org, tenant);
|
|
102
|
-
}
|
|
103
|
-
let pullResult = null;
|
|
104
|
-
let appPullResult = null;
|
|
105
|
-
if (!skipPull) {
|
|
106
|
-
try {
|
|
107
|
-
const syncService = new import_syncService.SyncService(org, clientResult.client);
|
|
108
|
-
pullResult = await syncService.pull();
|
|
109
|
-
if (clientResult.authType === "jwt") {
|
|
110
|
-
const appSyncService = new import_appSyncService.AppSyncService(org, clientResult.client);
|
|
111
|
-
appPullResult = await appSyncService.pull();
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
return (0, import_helpers.successResponse)({
|
|
115
|
-
currentCheckout: { organisation: org, tenant },
|
|
116
|
-
message: `Checked out ${tenant}, but pull failed: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
117
|
-
pullError: true
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return (0, import_helpers.successResponse)({
|
|
122
|
-
currentCheckout: { organisation: org, tenant },
|
|
123
|
-
message: `Successfully checked out ${tenant}${skipPull ? "" : " and pulled latest files"}`,
|
|
124
|
-
files: pullResult ? {
|
|
125
|
-
downloaded: pullResult.downloaded,
|
|
126
|
-
deleted: pullResult.deleted,
|
|
127
|
-
unchanged: pullResult.unchanged.length
|
|
128
|
-
} : void 0,
|
|
129
|
-
apps: appPullResult ? {
|
|
130
|
-
created: appPullResult.created,
|
|
131
|
-
updated: appPullResult.updated,
|
|
132
|
-
deleted: appPullResult.deleted,
|
|
133
|
-
unchanged: appPullResult.unchanged.length
|
|
134
|
-
} : void 0
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
server.tool(
|
|
139
|
-
"farseer_checkout_clear",
|
|
140
|
-
`Clear the current tenant checkout.
|
|
141
|
-
|
|
142
|
-
After clearing, you'll need to specify tenant explicitly for all commands.`,
|
|
143
|
-
{},
|
|
144
|
-
async () => {
|
|
145
|
-
const current = (0, import_configService.getCurrentCheckout)();
|
|
146
|
-
(0, import_configService.clearCurrentTenant)();
|
|
147
|
-
return (0, import_helpers.successResponse)({
|
|
148
|
-
previousCheckout: current,
|
|
149
|
-
message: current ? `Cleared checkout for ${current.tenant}` : "No tenant was checked out"
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
-
0 && (module.exports = {
|
|
156
|
-
registerAuthTools
|
|
157
|
-
});
|
|
158
|
-
//# sourceMappingURL=authTools.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/mcp/tools/authTools.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Authentication and Configuration Tools\n *\n * Tools for checking auth status and managing tenant checkout.\n */\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\nimport {\n getCurrentCheckout,\n setCurrentCheckout,\n setCurrentTenant,\n clearCurrentTenant,\n} from '../../services/configService';\nimport { getFarseerClientWithFallback } from '../../services/farseerFactory';\nimport { SyncService } from '../../services/syncService';\nimport { AppSyncService } from '../../services/appSyncService';\nimport {\n getAuthStatus,\n successResponse,\n errorResponse,\n authRequiredResponse,\n} from '../utils/helpers';\n\n// Define schemas outside of tool registration to avoid deep type instantiation\nconst checkoutSchema = {\n organisation: z\n .string()\n .optional()\n .describe('Farseer organisation (subdomain). If omitted with tenant, assumes org=tenant.'),\n tenant: z.string().optional().describe('Tenant ID. If omitted, returns current checkout status.'),\n skipPull: z.boolean().optional().describe('Skip automatic pull after checkout (default: false)'),\n};\n\nexport function registerAuthTools(server: McpServer): void {\n // farseer_whoami - Check authentication status\n server.tool(\n 'farseer_whoami',\n `Check Farseer authentication status.\n\nReturns information about:\n- Whether a JWT token is valid (from browser login)\n- JWT token expiration time\n- Currently checked-out tenant and organisation\n- List of tenants with API keys configured\n\nUse this before any operation to verify you have valid credentials.\nIf not authenticated, run \"farseer login\" in terminal.`,\n {},\n async () => {\n const status = getAuthStatus();\n return successResponse({\n jwtValid: status.jwtValid,\n jwtExpiresAt: status.jwtExpiresAt,\n currentCheckout: status.currentCheckout,\n configuredTenants: status.configuredTenants,\n message: status.jwtValid\n ? 'Authenticated via browser login (JWT)'\n : status.configuredTenants.length > 0\n ? 'Not authenticated via browser, but API keys are configured'\n : 'Not authenticated. Run \"farseer login\" to authenticate.',\n });\n }\n );\n\n // farseer_checkout - Set or get default tenant\n server.tool(\n 'farseer_checkout',\n `Set a default tenant for all subsequent Farseer operations, or get the current checkout status.\n\nWhen setting a tenant:\n- Verifies authentication works for that tenant\n- Optionally pulls files and apps from remote\n- Sets the tenant as default for all future commands\n\nOrganisation and tenant terminology:\n- Organisation: subdomain of Farseer instance (e.g., \"fs-personal\" for fs-personal.farseer.io)\n- Tenant: workspace ID sent as X-TENANT-ID header\n\nOften org and tenant are the same (e.g., \"tthotels\"), but they can differ\n(e.g., org=\"fs-personal\", tenant=\"john-doe\").\n\nIf you only provide tenant without organisation, it assumes org=tenant.`,\n checkoutSchema,\n async (params: { organisation?: string; tenant?: string; skipPull?: boolean }) => {\n const { organisation, tenant, skipPull } = params;\n\n // If no tenant provided, return current checkout status\n if (!tenant) {\n const current = getCurrentCheckout();\n if (current) {\n return successResponse({\n currentCheckout: current,\n message: `Currently checked out: ${current.tenant} (org: ${current.organisation})`,\n });\n } else {\n return successResponse({\n currentCheckout: null,\n message: 'No tenant currently checked out. Use tenant parameter to checkout.',\n });\n }\n }\n\n // Resolve organisation (default to tenant if not specified)\n const org = organisation || tenant;\n\n // Test connection before setting checkout\n const clientResult = await getFarseerClientWithFallback(org, tenant);\n if (!clientResult) {\n return authRequiredResponse(tenant);\n }\n\n // Set checkout\n if (org === tenant) {\n setCurrentTenant(tenant);\n } else {\n setCurrentCheckout(org, tenant);\n }\n\n let pullResult = null;\n let appPullResult = null;\n\n // Pull files and apps unless skipped\n if (!skipPull) {\n try {\n const syncService = new SyncService(org, clientResult.client);\n pullResult = await syncService.pull();\n\n // Pull apps if using JWT auth (API key doesn't support apps)\n if (clientResult.authType === 'jwt') {\n const appSyncService = new AppSyncService(org, clientResult.client);\n appPullResult = await appSyncService.pull();\n }\n } catch (error) {\n // Pull failed but checkout succeeded\n return successResponse({\n currentCheckout: { organisation: org, tenant },\n message: `Checked out ${tenant}, but pull failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n pullError: true,\n });\n }\n }\n\n return successResponse({\n currentCheckout: { organisation: org, tenant },\n message: `Successfully checked out ${tenant}${skipPull ? '' : ' and pulled latest files'}`,\n files: pullResult\n ? {\n downloaded: pullResult.downloaded,\n deleted: pullResult.deleted,\n unchanged: pullResult.unchanged.length,\n }\n : undefined,\n apps: appPullResult\n ? {\n created: appPullResult.created,\n updated: appPullResult.updated,\n deleted: appPullResult.deleted,\n unchanged: appPullResult.unchanged.length,\n }\n : undefined,\n });\n }\n );\n\n // farseer_checkout_clear - Clear current checkout\n server.tool(\n 'farseer_checkout_clear',\n `Clear the current tenant checkout.\n\nAfter clearing, you'll need to specify tenant explicitly for all commands.`,\n {},\n async () => {\n const current = getCurrentCheckout();\n clearCurrentTenant();\n\n return successResponse({\n previousCheckout: current,\n message: current\n ? `Cleared checkout for ${current.tenant}`\n : 'No tenant was checked out',\n });\n }\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAAkB;AAClB,2BAKO;AACP,4BAA6C;AAC7C,yBAA4B;AAC5B,4BAA+B;AAC/B,qBAKO;AAGP,MAAM,iBAAiB;AAAA,EACnB,cAAc,aACT,OAAO,EACP,SAAS,EACT,SAAS,+EAA+E;AAAA,EAC7F,QAAQ,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,yDAAyD;AAAA,EAChG,UAAU,aAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,qDAAqD;AACnG;AAEO,SAAS,kBAAkB,QAAyB;AAEvD,SAAO;AAAA,IACH;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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