@walkeros/mcp 4.3.1 → 4.3.2
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/dist/index.d.ts +104 -1
- package/dist/index.js +654 -269
- package/dist/index.js.map +1 -1
- package/dist/stdio.js +367 -15
- package/dist/stdio.js.map +1 -1
- package/package.json +4 -4
package/dist/stdio.js
CHANGED
|
@@ -722,7 +722,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
|
|
|
722
722
|
var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
|
|
723
723
|
var WALKEROS_JSON_PATH = "dist/walkerOS.json";
|
|
724
724
|
var CACHE_TTL = 5 * 60 * 1e3;
|
|
725
|
-
var CLIENT_HEADER = "walkeros-mcp/4.3.
|
|
725
|
+
var CLIENT_HEADER = "walkeros-mcp/4.3.2";
|
|
726
726
|
function getPackageBaseUrl() {
|
|
727
727
|
return process.env.WALKEROS_APP_URL || void 0;
|
|
728
728
|
}
|
|
@@ -1466,7 +1466,7 @@ async function feedbackHandlerBody(client, input) {
|
|
|
1466
1466
|
const isAnonymous = explicitAnonymous ?? anonymous ?? true;
|
|
1467
1467
|
await client.submitFeedback(text, {
|
|
1468
1468
|
anonymous: isAnonymous,
|
|
1469
|
-
version: "4.3.
|
|
1469
|
+
version: "4.3.2"
|
|
1470
1470
|
});
|
|
1471
1471
|
return mcpResult8({ ok: true });
|
|
1472
1472
|
} catch (error) {
|
|
@@ -1502,7 +1502,7 @@ var spec_default = {
|
|
|
1502
1502
|
openapi: "3.1.0",
|
|
1503
1503
|
info: {
|
|
1504
1504
|
title: "walkerOS Tag Manager API",
|
|
1505
|
-
version: "4.
|
|
1505
|
+
version: "4.1.0",
|
|
1506
1506
|
description: "API for managing walkerOS flows, projects, and real-time event observation.",
|
|
1507
1507
|
contact: {
|
|
1508
1508
|
name: "elbwalker",
|
|
@@ -3821,6 +3821,9 @@ var spec_default = {
|
|
|
3821
3821
|
},
|
|
3822
3822
|
sessionGrant: {
|
|
3823
3823
|
type: "string"
|
|
3824
|
+
},
|
|
3825
|
+
sessionId: {
|
|
3826
|
+
type: "string"
|
|
3824
3827
|
}
|
|
3825
3828
|
},
|
|
3826
3829
|
required: ["grant", "activationUrl", "sessionExpiresAt"]
|
|
@@ -3916,6 +3919,13 @@ var spec_default = {
|
|
|
3916
3919
|
bundleUrl: {
|
|
3917
3920
|
type: "string",
|
|
3918
3921
|
format: "uri"
|
|
3922
|
+
},
|
|
3923
|
+
url: {
|
|
3924
|
+
type: "string",
|
|
3925
|
+
format: "uri"
|
|
3926
|
+
},
|
|
3927
|
+
binding: {
|
|
3928
|
+
type: "string"
|
|
3919
3929
|
}
|
|
3920
3930
|
},
|
|
3921
3931
|
required: [
|
|
@@ -16452,6 +16462,7 @@ var PREVIEW_SUMMARY_FIELDS = [
|
|
|
16452
16462
|
"grant",
|
|
16453
16463
|
"sessionGrant",
|
|
16454
16464
|
"sessionExpiresAt",
|
|
16465
|
+
"sessionId",
|
|
16455
16466
|
"status",
|
|
16456
16467
|
"observeFeed",
|
|
16457
16468
|
"createdBy",
|
|
@@ -16475,6 +16486,18 @@ function redactPreviewList(data) {
|
|
|
16475
16486
|
...data.total !== void 0 ? { total: data.total } : {}
|
|
16476
16487
|
};
|
|
16477
16488
|
}
|
|
16489
|
+
async function resolveLiveSessionId(client, flowId, projectId) {
|
|
16490
|
+
try {
|
|
16491
|
+
const result = await client.listJourneys({
|
|
16492
|
+
flowId,
|
|
16493
|
+
...projectId !== void 0 && { projectId },
|
|
16494
|
+
limit: 1
|
|
16495
|
+
});
|
|
16496
|
+
return result.sessionId;
|
|
16497
|
+
} catch {
|
|
16498
|
+
return null;
|
|
16499
|
+
}
|
|
16500
|
+
}
|
|
16478
16501
|
function createFlowManageToolSpec(client) {
|
|
16479
16502
|
return {
|
|
16480
16503
|
name: "flow_manage",
|
|
@@ -16726,16 +16749,17 @@ async function flowManageHandlerBody(client, input) {
|
|
|
16726
16749
|
new Error("preview_regrant is not supported by this client")
|
|
16727
16750
|
);
|
|
16728
16751
|
}
|
|
16752
|
+
const pairedSessionId = sessionId ?? await resolveLiveSessionId(client, flowId, resolvedProjectId);
|
|
16729
16753
|
const data = await client.regrantPreview({
|
|
16730
16754
|
projectId: resolvedProjectId,
|
|
16731
16755
|
flowId,
|
|
16732
16756
|
previewId,
|
|
16733
16757
|
origins: origins ?? [],
|
|
16734
|
-
...
|
|
16758
|
+
...pairedSessionId ? { sessionId: pairedSessionId } : {}
|
|
16735
16759
|
});
|
|
16736
16760
|
return mcpResult12(redactPreview(data), {
|
|
16737
16761
|
next: [
|
|
16738
|
-
|
|
16762
|
+
pairedSessionId ? "Open activationUrl on the target origin: it activates the web preview AND forwards its events to the observe session. Use sessionGrant as the X-Walkeros-Preview header for direct server-hop test events." : "Open activationUrl on the target origin to activate preview mode."
|
|
16739
16763
|
]
|
|
16740
16764
|
});
|
|
16741
16765
|
}
|
|
@@ -17214,6 +17238,312 @@ function registerObserveJourneysTool(server, client) {
|
|
|
17214
17238
|
);
|
|
17215
17239
|
}
|
|
17216
17240
|
|
|
17241
|
+
// src/tools/observe-session.ts
|
|
17242
|
+
import { z as z14 } from "zod";
|
|
17243
|
+
import { mcpResult as mcpResult16, mcpError as mcpError15 } from "@walkeros/core";
|
|
17244
|
+
var TITLE15 = "Observe Session";
|
|
17245
|
+
var DESCRIPTION15 = "Open, inspect, or end an Observe session: a time-boxed window on one flow that runtimes attach to as arms. A preview arm streams from a browser, a container arm runs server-side, and both feed ONE shared journeys feed. start opens the window (arms picks which runtimes attach), status reports per-arm state plus recordsReceived and expiresAt, stop ends the whole session including every arm. A flow has at most one session, so status/stop resolve it from flowId when sessionId is omitted. Read the events with observe_journeys; this tool never returns event data and never judges whether events are correct.";
|
|
17246
|
+
var HINT_SIMULATE_FIRST = "Simulate before preview: flow_simulate checks mapping with no browser.";
|
|
17247
|
+
var HINT_PREVIEW_STREAMS = "Preview streams into this session: mint a link with flow_manage preview_regrant, then open it on your site.";
|
|
17248
|
+
var HINT_READ = "Read with observe_journeys (flowId); it is the only read.";
|
|
17249
|
+
var HINT_STOP = "End both arms with observe_session stop.";
|
|
17250
|
+
var HINT_EMPTY_FEED = "recordsReceived is 0: nothing has reached the feed yet. Drive traffic on an attached arm.";
|
|
17251
|
+
var HINT_ENDED = "Session ended and both arms detached. Start a new one with observe_session start.";
|
|
17252
|
+
var HINT_NO_WINDOW = "No Observe session on this flow. Open one with observe_session start.";
|
|
17253
|
+
var inputSchema15 = {
|
|
17254
|
+
action: z14.enum(["start", "status", "stop"]).describe(
|
|
17255
|
+
"start opens a session, status reports arm state, stop ends the whole session."
|
|
17256
|
+
),
|
|
17257
|
+
flowId: z14.string().describe("Flow the Observe session runs on."),
|
|
17258
|
+
projectId: z14.string().optional().describe("Project ID. Optional; falls back to the default project."),
|
|
17259
|
+
sessionId: z14.string().optional().describe(
|
|
17260
|
+
"Session to act on for status/stop. Optional; the flow has at most one session and it is resolved for you."
|
|
17261
|
+
),
|
|
17262
|
+
arms: z14.object({
|
|
17263
|
+
container: z14.literal(true).optional().describe(
|
|
17264
|
+
"Pass true to attach the server container arm, which selects the flow's server settings when no preview arm is named. Only true is accepted: a web settings that references a server flow always brings its container arm along, so a container cannot be suppressed here."
|
|
17265
|
+
),
|
|
17266
|
+
preview: z14.string().optional().describe(
|
|
17267
|
+
"Name the flow settings this session observes. A web settings attaches the browser preview arm (plus the container arm of any server flow it references); a server settings attaches the container arm alone. Omit to use the flow's single web settings."
|
|
17268
|
+
)
|
|
17269
|
+
}).optional().describe(
|
|
17270
|
+
"Which runtimes attach. Omit to attach the default preview arm; a web settings that references a server flow brings its container arm with it."
|
|
17271
|
+
),
|
|
17272
|
+
origins: z14.array(z14.string()).optional().describe(
|
|
17273
|
+
"Bare https origins (https://host[:port]) the session may ingest web events from."
|
|
17274
|
+
),
|
|
17275
|
+
level: z14.enum(["off", "standard", "trace"]).optional().describe("Container observation verbosity. Defaults to the app's own."),
|
|
17276
|
+
replace: z14.boolean().optional().describe(
|
|
17277
|
+
"Replace the flow's existing window instead of attaching to it. Re-provisions from the new config."
|
|
17278
|
+
)
|
|
17279
|
+
};
|
|
17280
|
+
var annotations15 = {
|
|
17281
|
+
readOnlyHint: false,
|
|
17282
|
+
destructiveHint: true,
|
|
17283
|
+
idempotentHint: false,
|
|
17284
|
+
openWorldHint: true
|
|
17285
|
+
};
|
|
17286
|
+
function readSettings(flow) {
|
|
17287
|
+
if (!flow || typeof flow !== "object") return [];
|
|
17288
|
+
const settings = flow.settings;
|
|
17289
|
+
if (!Array.isArray(settings)) return [];
|
|
17290
|
+
const entries = [];
|
|
17291
|
+
for (const entry of settings) {
|
|
17292
|
+
if (!entry || typeof entry !== "object") continue;
|
|
17293
|
+
const { name, platform } = entry;
|
|
17294
|
+
if (typeof name !== "string") continue;
|
|
17295
|
+
if (platform !== "web" && platform !== "server") continue;
|
|
17296
|
+
entries.push({ name, platform });
|
|
17297
|
+
}
|
|
17298
|
+
return entries;
|
|
17299
|
+
}
|
|
17300
|
+
function resolveSettingsName(settings, arms) {
|
|
17301
|
+
if (arms?.preview !== void 0) {
|
|
17302
|
+
const named = settings.find((entry) => entry.name === arms.preview);
|
|
17303
|
+
if (!named) {
|
|
17304
|
+
throw new Error(
|
|
17305
|
+
`This flow has no settings named "${arms.preview}". Available: ${describeSettings(settings)}`
|
|
17306
|
+
);
|
|
17307
|
+
}
|
|
17308
|
+
return named.name;
|
|
17309
|
+
}
|
|
17310
|
+
if (arms?.container === true) {
|
|
17311
|
+
const servers = settings.filter((entry) => entry.platform === "server");
|
|
17312
|
+
const only = servers[0];
|
|
17313
|
+
if (!only) {
|
|
17314
|
+
throw new Error(
|
|
17315
|
+
`The container arm needs a server settings, and this flow has no server settings. Available: ${describeSettings(settings)}`
|
|
17316
|
+
);
|
|
17317
|
+
}
|
|
17318
|
+
if (servers.length > 1) {
|
|
17319
|
+
throw new Error(
|
|
17320
|
+
`This flow has several server settings. Name one with arms.preview. Available: ${describeSettings(settings)}`
|
|
17321
|
+
);
|
|
17322
|
+
}
|
|
17323
|
+
return only.name;
|
|
17324
|
+
}
|
|
17325
|
+
const webs = settings.filter((entry) => entry.platform === "web");
|
|
17326
|
+
const onlyWeb = webs[0];
|
|
17327
|
+
if (onlyWeb && webs.length === 1) return onlyWeb.name;
|
|
17328
|
+
if (webs.length > 1) {
|
|
17329
|
+
throw new Error(
|
|
17330
|
+
`This flow has several web settings. Name one with arms.preview. Available: ${describeSettings(settings)}`
|
|
17331
|
+
);
|
|
17332
|
+
}
|
|
17333
|
+
const onlySettings = settings[0];
|
|
17334
|
+
if (onlySettings && settings.length === 1) return onlySettings.name;
|
|
17335
|
+
throw new Error(
|
|
17336
|
+
`Could not pick a settings to observe. Name one with arms.preview. Available: ${describeSettings(settings)}`
|
|
17337
|
+
);
|
|
17338
|
+
}
|
|
17339
|
+
function describeSettings(settings) {
|
|
17340
|
+
if (settings.length === 0) return "none";
|
|
17341
|
+
return settings.map((entry) => `${entry.name} (${entry.platform})`).join(", ");
|
|
17342
|
+
}
|
|
17343
|
+
function toArms(session) {
|
|
17344
|
+
return {
|
|
17345
|
+
preview: {
|
|
17346
|
+
attached: session.web !== null,
|
|
17347
|
+
settingsName: session.observedFlowName,
|
|
17348
|
+
activationUrl: session.web?.activationUrl ?? null,
|
|
17349
|
+
previewEnabled: session.web?.previewEnabled ?? false
|
|
17350
|
+
},
|
|
17351
|
+
container: {
|
|
17352
|
+
attached: session.server !== null,
|
|
17353
|
+
settingsName: session.serverFlowName,
|
|
17354
|
+
endpoint: session.server?.endpoint ?? null
|
|
17355
|
+
}
|
|
17356
|
+
};
|
|
17357
|
+
}
|
|
17358
|
+
function toSummary(session) {
|
|
17359
|
+
return {
|
|
17360
|
+
sessionId: session.id,
|
|
17361
|
+
flowId: session.flowId,
|
|
17362
|
+
status: session.status,
|
|
17363
|
+
errorMessage: session.errorMessage,
|
|
17364
|
+
expiresAt: session.expiresAt,
|
|
17365
|
+
recordsReceived: session.recordsReceived,
|
|
17366
|
+
arms: toArms(session)
|
|
17367
|
+
};
|
|
17368
|
+
}
|
|
17369
|
+
var SESSION_RESOLUTION_FAILED = "Could not resolve this flow's Observe session because the journeys read that identifies it is unavailable. Pass sessionId explicitly to act on the session without that lookup.";
|
|
17370
|
+
var SessionResolutionError = class extends Error {
|
|
17371
|
+
code;
|
|
17372
|
+
details;
|
|
17373
|
+
constructor(message, cause) {
|
|
17374
|
+
super(message, { cause });
|
|
17375
|
+
this.name = "SessionResolutionError";
|
|
17376
|
+
this.code = readStringField(cause, "code");
|
|
17377
|
+
this.details = readArrayField(cause, "details");
|
|
17378
|
+
}
|
|
17379
|
+
};
|
|
17380
|
+
function readStringField(source, key) {
|
|
17381
|
+
if (source === null || typeof source !== "object" || !(key in source))
|
|
17382
|
+
return void 0;
|
|
17383
|
+
const value = Reflect.get(source, key);
|
|
17384
|
+
return typeof value === "string" ? value : void 0;
|
|
17385
|
+
}
|
|
17386
|
+
function readArrayField(source, key) {
|
|
17387
|
+
if (source === null || typeof source !== "object" || !(key in source))
|
|
17388
|
+
return void 0;
|
|
17389
|
+
const value = Reflect.get(source, key);
|
|
17390
|
+
return Array.isArray(value) ? value : void 0;
|
|
17391
|
+
}
|
|
17392
|
+
async function resolveSessionId(client, options) {
|
|
17393
|
+
try {
|
|
17394
|
+
const result = await client.listJourneys({
|
|
17395
|
+
flowId: options.flowId,
|
|
17396
|
+
...options.projectId !== void 0 && { projectId: options.projectId },
|
|
17397
|
+
limit: 1
|
|
17398
|
+
});
|
|
17399
|
+
return result.sessionId;
|
|
17400
|
+
} catch (error) {
|
|
17401
|
+
if (isAuthError(error)) throw error;
|
|
17402
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
17403
|
+
throw new SessionResolutionError(
|
|
17404
|
+
`${SESSION_RESOLUTION_FAILED} (${detail})`,
|
|
17405
|
+
error
|
|
17406
|
+
);
|
|
17407
|
+
}
|
|
17408
|
+
}
|
|
17409
|
+
function resolveProjectId(client, projectId) {
|
|
17410
|
+
return projectId ?? client.getDefaultProject();
|
|
17411
|
+
}
|
|
17412
|
+
var NO_DEFAULT_PROJECT_ERROR2 = "No project ID given and no default project set. Pass projectId or set one with project_manage set_default.";
|
|
17413
|
+
function createObserveSessionToolSpec(client) {
|
|
17414
|
+
return {
|
|
17415
|
+
name: "observe_session",
|
|
17416
|
+
title: TITLE15,
|
|
17417
|
+
description: DESCRIPTION15,
|
|
17418
|
+
inputSchema: inputSchema15,
|
|
17419
|
+
annotations: annotations15,
|
|
17420
|
+
handler: (input) => observeSessionHandlerBody(client, input)
|
|
17421
|
+
};
|
|
17422
|
+
}
|
|
17423
|
+
async function observeSessionHandlerBody(client, input) {
|
|
17424
|
+
const {
|
|
17425
|
+
action,
|
|
17426
|
+
flowId,
|
|
17427
|
+
projectId,
|
|
17428
|
+
sessionId,
|
|
17429
|
+
arms,
|
|
17430
|
+
origins,
|
|
17431
|
+
level,
|
|
17432
|
+
replace
|
|
17433
|
+
} = input ?? {};
|
|
17434
|
+
if (!flowId) {
|
|
17435
|
+
return mcpError15(new Error("flowId is required for observe_session."));
|
|
17436
|
+
}
|
|
17437
|
+
const resolvedProjectId = resolveProjectId(client, projectId);
|
|
17438
|
+
if (!resolvedProjectId) {
|
|
17439
|
+
return mcpError15(new Error(NO_DEFAULT_PROJECT_ERROR2));
|
|
17440
|
+
}
|
|
17441
|
+
try {
|
|
17442
|
+
switch (action) {
|
|
17443
|
+
case "start": {
|
|
17444
|
+
if (!client.startObserveSession) {
|
|
17445
|
+
return mcpError15(
|
|
17446
|
+
new Error("observe_session start is not supported by this client.")
|
|
17447
|
+
);
|
|
17448
|
+
}
|
|
17449
|
+
const settings = readSettings(
|
|
17450
|
+
await client.getFlow({
|
|
17451
|
+
flowId,
|
|
17452
|
+
projectId: resolvedProjectId,
|
|
17453
|
+
fields: ["settings"]
|
|
17454
|
+
})
|
|
17455
|
+
);
|
|
17456
|
+
const settingsName = resolveSettingsName(settings, arms);
|
|
17457
|
+
const session = await client.startObserveSession({
|
|
17458
|
+
projectId: resolvedProjectId,
|
|
17459
|
+
flowId,
|
|
17460
|
+
settingsName,
|
|
17461
|
+
...origins !== void 0 && { origins },
|
|
17462
|
+
...level !== void 0 && { level },
|
|
17463
|
+
...replace !== void 0 && { replace }
|
|
17464
|
+
});
|
|
17465
|
+
return mcpResult16(toSummary(session), {
|
|
17466
|
+
next: [HINT_SIMULATE_FIRST, HINT_PREVIEW_STREAMS, HINT_READ]
|
|
17467
|
+
});
|
|
17468
|
+
}
|
|
17469
|
+
case "status": {
|
|
17470
|
+
if (!client.getObserveSession) {
|
|
17471
|
+
return mcpError15(
|
|
17472
|
+
new Error(
|
|
17473
|
+
"observe_session status is not supported by this client."
|
|
17474
|
+
)
|
|
17475
|
+
);
|
|
17476
|
+
}
|
|
17477
|
+
const resolvedSessionId = sessionId ?? await resolveSessionId(client, {
|
|
17478
|
+
flowId,
|
|
17479
|
+
projectId: resolvedProjectId
|
|
17480
|
+
});
|
|
17481
|
+
if (!resolvedSessionId) {
|
|
17482
|
+
return mcpResult16(
|
|
17483
|
+
{ sessionId: null, flowId },
|
|
17484
|
+
{ next: [HINT_NO_WINDOW, HINT_SIMULATE_FIRST] }
|
|
17485
|
+
);
|
|
17486
|
+
}
|
|
17487
|
+
const session = await client.getObserveSession({
|
|
17488
|
+
projectId: resolvedProjectId,
|
|
17489
|
+
flowId,
|
|
17490
|
+
sessionId: resolvedSessionId
|
|
17491
|
+
});
|
|
17492
|
+
return mcpResult16(toSummary(session), {
|
|
17493
|
+
next: session.recordsReceived === 0 ? [HINT_EMPTY_FEED, HINT_READ, HINT_STOP] : [HINT_READ, HINT_STOP]
|
|
17494
|
+
});
|
|
17495
|
+
}
|
|
17496
|
+
case "stop": {
|
|
17497
|
+
if (!client.endObserveSession) {
|
|
17498
|
+
return mcpError15(
|
|
17499
|
+
new Error("observe_session stop is not supported by this client.")
|
|
17500
|
+
);
|
|
17501
|
+
}
|
|
17502
|
+
const resolvedSessionId = sessionId ?? await resolveSessionId(client, {
|
|
17503
|
+
flowId,
|
|
17504
|
+
projectId: resolvedProjectId
|
|
17505
|
+
});
|
|
17506
|
+
if (!resolvedSessionId) {
|
|
17507
|
+
return mcpResult16(
|
|
17508
|
+
{ sessionId: null, flowId, ended: false },
|
|
17509
|
+
{ next: [HINT_NO_WINDOW] }
|
|
17510
|
+
);
|
|
17511
|
+
}
|
|
17512
|
+
await client.endObserveSession({
|
|
17513
|
+
projectId: resolvedProjectId,
|
|
17514
|
+
flowId,
|
|
17515
|
+
sessionId: resolvedSessionId
|
|
17516
|
+
});
|
|
17517
|
+
return mcpResult16(
|
|
17518
|
+
{ sessionId: resolvedSessionId, flowId, ended: true },
|
|
17519
|
+
{ next: [HINT_ENDED] }
|
|
17520
|
+
);
|
|
17521
|
+
}
|
|
17522
|
+
default:
|
|
17523
|
+
throw new Error(
|
|
17524
|
+
`Unknown action: ${String(action)}. Use one of: start, status, stop`
|
|
17525
|
+
);
|
|
17526
|
+
}
|
|
17527
|
+
} catch (error) {
|
|
17528
|
+
return mcpError15(error, isAuthError(error) ? AUTH_HINT : void 0);
|
|
17529
|
+
}
|
|
17530
|
+
}
|
|
17531
|
+
function registerObserveSessionTool(server, client) {
|
|
17532
|
+
const spec = createObserveSessionToolSpec(client);
|
|
17533
|
+
server.registerTool(
|
|
17534
|
+
spec.name,
|
|
17535
|
+
{
|
|
17536
|
+
title: spec.title,
|
|
17537
|
+
description: spec.description,
|
|
17538
|
+
inputSchema: spec.inputSchema,
|
|
17539
|
+
annotations: spec.annotations
|
|
17540
|
+
},
|
|
17541
|
+
// SDK infers handler type from inputSchema shape; ToolSpec.handler is the
|
|
17542
|
+
// type-erased (input: unknown) => Promise<unknown> form by design.
|
|
17543
|
+
spec.handler
|
|
17544
|
+
);
|
|
17545
|
+
}
|
|
17546
|
+
|
|
17217
17547
|
// src/resources/package-schemas.ts
|
|
17218
17548
|
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
17219
17549
|
import { fetchPackageSchema } from "@walkeros/core";
|
|
@@ -17484,17 +17814,17 @@ function registerReferenceResources(server) {
|
|
|
17484
17814
|
}
|
|
17485
17815
|
|
|
17486
17816
|
// src/prompts/add-step.ts
|
|
17487
|
-
import { z as
|
|
17817
|
+
import { z as z15 } from "zod";
|
|
17488
17818
|
function registerAddStepPrompt(server) {
|
|
17489
17819
|
server.registerPrompt(
|
|
17490
17820
|
"add-step",
|
|
17491
17821
|
{
|
|
17492
17822
|
description: "Add a source, destination, transformer, or store step to a flow configuration. Guides through package selection, config scaffolding, and wiring.",
|
|
17493
17823
|
argsSchema: {
|
|
17494
|
-
stepType:
|
|
17824
|
+
stepType: z15.string().optional().describe(
|
|
17495
17825
|
"Type of step to add: source, destination, transformer, or store"
|
|
17496
17826
|
),
|
|
17497
|
-
flowPath:
|
|
17827
|
+
flowPath: z15.string().optional().describe("Path to the flow.json file to modify")
|
|
17498
17828
|
}
|
|
17499
17829
|
},
|
|
17500
17830
|
async ({ stepType, flowPath }) => ({
|
|
@@ -17539,14 +17869,14 @@ function registerAddStepPrompt(server) {
|
|
|
17539
17869
|
}
|
|
17540
17870
|
|
|
17541
17871
|
// src/prompts/setup-mapping.ts
|
|
17542
|
-
import { z as
|
|
17872
|
+
import { z as z16 } from "zod";
|
|
17543
17873
|
function registerSetupMappingPrompt(server) {
|
|
17544
17874
|
server.registerPrompt(
|
|
17545
17875
|
"setup-mapping",
|
|
17546
17876
|
{
|
|
17547
17877
|
description: "Set up event mapping for any step in a flow. Teaches mapping syntax and uses package examples as templates.",
|
|
17548
17878
|
argsSchema: {
|
|
17549
|
-
stepName:
|
|
17879
|
+
stepName: z16.string().optional().describe('Step name in the flow (e.g., "gtag", "meta", "express")')
|
|
17550
17880
|
}
|
|
17551
17881
|
},
|
|
17552
17882
|
async ({ stepName }) => ({
|
|
@@ -17584,14 +17914,14 @@ function registerSetupMappingPrompt(server) {
|
|
|
17584
17914
|
}
|
|
17585
17915
|
|
|
17586
17916
|
// src/prompts/manage-contract.ts
|
|
17587
|
-
import { z as
|
|
17917
|
+
import { z as z17 } from "zod";
|
|
17588
17918
|
function registerManageContractPrompt(server) {
|
|
17589
17919
|
server.registerPrompt(
|
|
17590
17920
|
"manage-contract",
|
|
17591
17921
|
{
|
|
17592
17922
|
description: "Create or update event contracts for a flow. Can generate contracts from existing mappings or scaffold mappings from contracts.",
|
|
17593
17923
|
argsSchema: {
|
|
17594
|
-
direction:
|
|
17924
|
+
direction: z17.string().optional().describe(
|
|
17595
17925
|
'Direction: "from-mappings" (extract contract from existing mappings), "from-scratch" (create new contract), or "to-mappings" (scaffold mappings from contract)'
|
|
17596
17926
|
)
|
|
17597
17927
|
}
|
|
@@ -17653,6 +17983,9 @@ var SERVER_INSTRUCTIONS = `walkerOS is an open-source, privacy-first event data
|
|
|
17653
17983
|
10. \`flow_simulate({ configPath: "flow.json", event: "..." })\` \u2014 test
|
|
17654
17984
|
11. \`flow_manage({ action: "update", flowId: "...", content: {...} })\` \u2014 save to cloud
|
|
17655
17985
|
12. \`deploy_manage({ action: "deploy", flowId: "..." })\` \u2014 deploy
|
|
17986
|
+
13. \`observe_session({ action: "start", flowId: "..." })\` - open an Observe session: a time-boxed window on one flow that runtimes attach to as arms
|
|
17987
|
+
14. \`flow_manage({ action: "preview_regrant", flowId: "...", previewId: "...", origins: [...] })\` - mint an activation link; minted while the flow is observed, it pairs with that Observe session automatically, so the previewed page streams into the same feed
|
|
17988
|
+
15. \`observe_journeys({ flowId: "..." })\` - read what arrived; it is the only read, and it never judges whether events are correct
|
|
17656
17989
|
|
|
17657
17990
|
## Architecture: Source \u2192 Collector \u2192 Destination(s)
|
|
17658
17991
|
|
|
@@ -17783,6 +18116,7 @@ function createWalkerOSMcpServer(opts) {
|
|
|
17783
18116
|
registerFlowManageTool(server, opts.client);
|
|
17784
18117
|
registerDeployTool(server, opts.client);
|
|
17785
18118
|
registerSecretManageTool(server, opts.client);
|
|
18119
|
+
registerObserveSessionTool(server, opts.client);
|
|
17786
18120
|
registerObserveJourneysTool(server, opts.client);
|
|
17787
18121
|
registerFeedbackTool(server, opts.client);
|
|
17788
18122
|
registerDiagnosticsTool(server, opts.client, packageVersion);
|
|
@@ -17849,6 +18183,9 @@ import {
|
|
|
17849
18183
|
getDeploymentBySlug,
|
|
17850
18184
|
deleteDeployment,
|
|
17851
18185
|
listJourneys,
|
|
18186
|
+
startObserveSession,
|
|
18187
|
+
getObserveSession,
|
|
18188
|
+
endObserveSession,
|
|
17852
18189
|
requestDeviceCode,
|
|
17853
18190
|
pollForToken,
|
|
17854
18191
|
whoami,
|
|
@@ -17944,6 +18281,21 @@ var HttpToolClient = class {
|
|
|
17944
18281
|
async listJourneys(options) {
|
|
17945
18282
|
return listJourneys(options);
|
|
17946
18283
|
}
|
|
18284
|
+
/**
|
|
18285
|
+
* Observe session lifecycle over the CLI's authenticated boundary. The trio
|
|
18286
|
+
* routes through the same `apiFetch` as every other method here, so token
|
|
18287
|
+
* resolution, base URL, and `ApiError` shaping (which `isAuthError` reads)
|
|
18288
|
+
* stay identical to the rest of the client.
|
|
18289
|
+
*/
|
|
18290
|
+
async startObserveSession(options) {
|
|
18291
|
+
return startObserveSession(options);
|
|
18292
|
+
}
|
|
18293
|
+
async getObserveSession(options) {
|
|
18294
|
+
return getObserveSession(options);
|
|
18295
|
+
}
|
|
18296
|
+
async endObserveSession(options) {
|
|
18297
|
+
return endObserveSession(options);
|
|
18298
|
+
}
|
|
17947
18299
|
async requestDeviceCode() {
|
|
17948
18300
|
return requestDeviceCode();
|
|
17949
18301
|
}
|
|
@@ -17994,7 +18346,7 @@ var HttpToolClient = class {
|
|
|
17994
18346
|
};
|
|
17995
18347
|
|
|
17996
18348
|
// src/stdio.ts
|
|
17997
|
-
setClientContext({ type: "mcp", version: "4.3.
|
|
18349
|
+
setClientContext({ type: "mcp", version: "4.3.2" });
|
|
17998
18350
|
process.on("uncaughtException", (err) => {
|
|
17999
18351
|
const emitter = getMcpEmitterSingleton();
|
|
18000
18352
|
if (emitter) {
|
|
@@ -18014,7 +18366,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
18014
18366
|
async function main() {
|
|
18015
18367
|
const server = createWalkerOSMcpServer({
|
|
18016
18368
|
client: new HttpToolClient(),
|
|
18017
|
-
version: "4.3.
|
|
18369
|
+
version: "4.3.2"
|
|
18018
18370
|
});
|
|
18019
18371
|
const transport = new StdioServerTransport();
|
|
18020
18372
|
await server.connect(transport);
|
|
@@ -18024,7 +18376,7 @@ main().catch(async (error) => {
|
|
|
18024
18376
|
try {
|
|
18025
18377
|
const emitter = await createMcpEmitter({
|
|
18026
18378
|
clientInfo: void 0,
|
|
18027
|
-
packageVersion: "4.3.
|
|
18379
|
+
packageVersion: "4.3.2"
|
|
18028
18380
|
});
|
|
18029
18381
|
await emitter.emitError("startup");
|
|
18030
18382
|
} catch {
|