@walkeros/mcp 4.3.0-next-1784055686454 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -5
- package/dist/index.js +158 -18
- package/dist/index.js.map +1 -1
- package/dist/stdio.js +161 -21
- package/dist/stdio.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ interface RegrantPreviewOptions {
|
|
|
16
16
|
flowId: string;
|
|
17
17
|
previewId: string;
|
|
18
18
|
origins: string[];
|
|
19
|
+
/** Observe session id — binds the minted grant to that session so
|
|
20
|
+
* forwarded events reach its container. Opaque identifier. */
|
|
21
|
+
sessionId?: string;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* The assembled cross-runtime journeys for a flow's active Observe session,
|
|
@@ -100,10 +103,10 @@ interface ToolClient {
|
|
|
100
103
|
deletePreview(options: DeletePreviewOptions): Promise<unknown>;
|
|
101
104
|
/**
|
|
102
105
|
* Mint a fresh, origin-bound activation grant for an existing preview.
|
|
103
|
-
* OPTIONAL:
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* the ingest token or project id).
|
|
106
|
+
* OPTIONAL: clients that cannot mint grants may omit it, and the
|
|
107
|
+
* flow_manage handler guards on its presence before calling. Clients may
|
|
108
|
+
* return their raw API response; the flow_manage handler whitelists the
|
|
109
|
+
* fields it surfaces (never the ingest token or project id).
|
|
107
110
|
*/
|
|
108
111
|
regrantPreview?(options: RegrantPreviewOptions): Promise<unknown>;
|
|
109
112
|
listSecrets(options: ListSecretsOptions): Promise<unknown>;
|
|
@@ -262,8 +265,11 @@ declare class HttpToolClient implements ToolClient {
|
|
|
262
265
|
}): Promise<unknown>;
|
|
263
266
|
listPreviews(options: ListPreviewsOptions): Promise<unknown>;
|
|
264
267
|
getPreview(options: GetPreviewOptions): Promise<unknown>;
|
|
265
|
-
createPreview(options: CreatePreviewOptions
|
|
268
|
+
createPreview(options: CreatePreviewOptions & {
|
|
269
|
+
siteUrl?: string;
|
|
270
|
+
}): Promise<unknown>;
|
|
266
271
|
deletePreview(options: DeletePreviewOptions): Promise<unknown>;
|
|
272
|
+
regrantPreview(options: RegrantPreviewOptions): Promise<unknown>;
|
|
267
273
|
listSecrets(options: ListSecretsOptions): Promise<unknown>;
|
|
268
274
|
createSecret(options: CreateSecretOptions): Promise<unknown>;
|
|
269
275
|
updateSecret(options: UpdateSecretOptions): Promise<unknown>;
|
package/dist/index.js
CHANGED
|
@@ -550,6 +550,9 @@ var inputSchema3 = {
|
|
|
550
550
|
),
|
|
551
551
|
origins: z3.array(z3.string()).optional().describe(
|
|
552
552
|
"Site origins (bare https://host[:port]) to mint a preview activation grant for. Used by preview_regrant; the returned activationUrl targets the first origin."
|
|
553
|
+
),
|
|
554
|
+
sessionId: z3.string().optional().describe(
|
|
555
|
+
"Observe session id \u2014 when set, preview_regrant mints an activation/forwarding grant PAIR: the returned activationUrl both activates the web preview and lets the page forward events to the session container (elbPreviewSession param). Pass it to observe server-side hops; omit for a plain web preview."
|
|
553
556
|
)
|
|
554
557
|
};
|
|
555
558
|
var annotations3 = {
|
|
@@ -558,6 +561,39 @@ var annotations3 = {
|
|
|
558
561
|
idempotentHint: false,
|
|
559
562
|
openWorldHint: true
|
|
560
563
|
};
|
|
564
|
+
var PREVIEW_SUMMARY_FIELDS = [
|
|
565
|
+
"id",
|
|
566
|
+
"previewId",
|
|
567
|
+
"flowId",
|
|
568
|
+
"flowSettingsId",
|
|
569
|
+
"bundleUrl",
|
|
570
|
+
"activationUrl",
|
|
571
|
+
"grant",
|
|
572
|
+
"sessionGrant",
|
|
573
|
+
"sessionExpiresAt",
|
|
574
|
+
"status",
|
|
575
|
+
"observeFeed",
|
|
576
|
+
"createdBy",
|
|
577
|
+
"createdAt"
|
|
578
|
+
];
|
|
579
|
+
function isRecord(value) {
|
|
580
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
581
|
+
}
|
|
582
|
+
function redactPreview(data) {
|
|
583
|
+
if (!isRecord(data)) return {};
|
|
584
|
+
const out = {};
|
|
585
|
+
for (const field of PREVIEW_SUMMARY_FIELDS) {
|
|
586
|
+
if (data[field] !== void 0) out[field] = data[field];
|
|
587
|
+
}
|
|
588
|
+
return out;
|
|
589
|
+
}
|
|
590
|
+
function redactPreviewList(data) {
|
|
591
|
+
if (!isRecord(data)) return { previews: [] };
|
|
592
|
+
return {
|
|
593
|
+
previews: Array.isArray(data.previews) ? data.previews.map(redactPreview) : [],
|
|
594
|
+
...data.total !== void 0 ? { total: data.total } : {}
|
|
595
|
+
};
|
|
596
|
+
}
|
|
561
597
|
function createFlowManageToolSpec(client) {
|
|
562
598
|
return {
|
|
563
599
|
name: "flow_manage",
|
|
@@ -587,7 +623,8 @@ async function flowManageHandlerBody(client, input) {
|
|
|
587
623
|
flowSettingsId,
|
|
588
624
|
source,
|
|
589
625
|
siteUrl,
|
|
590
|
-
origins
|
|
626
|
+
origins,
|
|
627
|
+
sessionId
|
|
591
628
|
} = input ?? {};
|
|
592
629
|
const validationError = validateActionInput(
|
|
593
630
|
"flow_manage",
|
|
@@ -751,7 +788,7 @@ async function flowManageHandlerBody(client, input) {
|
|
|
751
788
|
projectId: resolvedProjectId,
|
|
752
789
|
flowId
|
|
753
790
|
});
|
|
754
|
-
return mcpResult3(data);
|
|
791
|
+
return mcpResult3(redactPreviewList(data));
|
|
755
792
|
}
|
|
756
793
|
case "preview_get": {
|
|
757
794
|
assertParam(flowId, "flowId", "preview_get");
|
|
@@ -761,7 +798,7 @@ async function flowManageHandlerBody(client, input) {
|
|
|
761
798
|
flowId,
|
|
762
799
|
previewId
|
|
763
800
|
});
|
|
764
|
-
return mcpResult3(data);
|
|
801
|
+
return mcpResult3(redactPreview(data));
|
|
765
802
|
}
|
|
766
803
|
case "preview_create": {
|
|
767
804
|
assertParam(flowId, "flowId", "preview_create");
|
|
@@ -777,7 +814,7 @@ async function flowManageHandlerBody(client, input) {
|
|
|
777
814
|
...source ? { source } : {},
|
|
778
815
|
...siteUrl ? { siteUrl } : {}
|
|
779
816
|
});
|
|
780
|
-
return mcpResult3(preview, {
|
|
817
|
+
return mcpResult3(redactPreview(preview), {
|
|
781
818
|
next: [
|
|
782
819
|
'Open activationUrl on your site to activate preview mode. When activationUrl is null, no grant has been minted for a site yet \u2014 use action "preview_regrant" with your site origins to mint one.',
|
|
783
820
|
"Poll observeFeed (observe_journeys with this flowId) to watch preview events arrive."
|
|
@@ -812,11 +849,12 @@ async function flowManageHandlerBody(client, input) {
|
|
|
812
849
|
projectId: resolvedProjectId,
|
|
813
850
|
flowId,
|
|
814
851
|
previewId,
|
|
815
|
-
origins: origins ?? []
|
|
852
|
+
origins: origins ?? [],
|
|
853
|
+
...sessionId ? { sessionId } : {}
|
|
816
854
|
});
|
|
817
|
-
return mcpResult3(data, {
|
|
855
|
+
return mcpResult3(redactPreview(data), {
|
|
818
856
|
next: [
|
|
819
|
-
"Open activationUrl on the target origin to activate preview mode."
|
|
857
|
+
sessionId ? "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."
|
|
820
858
|
]
|
|
821
859
|
});
|
|
822
860
|
}
|
|
@@ -1344,7 +1382,7 @@ async function feedbackHandlerBody(client, input) {
|
|
|
1344
1382
|
const isAnonymous = explicitAnonymous ?? anonymous ?? true;
|
|
1345
1383
|
await client.submitFeedback(text, {
|
|
1346
1384
|
anonymous: isAnonymous,
|
|
1347
|
-
version: "4.3.0
|
|
1385
|
+
version: "4.3.0"
|
|
1348
1386
|
});
|
|
1349
1387
|
return mcpResult7({ ok: true });
|
|
1350
1388
|
} catch (error) {
|
|
@@ -2082,7 +2120,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
|
|
|
2082
2120
|
var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
|
|
2083
2121
|
var WALKEROS_JSON_PATH = "dist/walkerOS.json";
|
|
2084
2122
|
var CACHE_TTL = 5 * 60 * 1e3;
|
|
2085
|
-
var CLIENT_HEADER = "walkeros-mcp/4.3.0
|
|
2123
|
+
var CLIENT_HEADER = "walkeros-mcp/4.3.0";
|
|
2086
2124
|
function getPackageBaseUrl() {
|
|
2087
2125
|
return process.env.WALKEROS_APP_URL || void 0;
|
|
2088
2126
|
}
|
|
@@ -2707,7 +2745,7 @@ var spec_default = {
|
|
|
2707
2745
|
openapi: "3.1.0",
|
|
2708
2746
|
info: {
|
|
2709
2747
|
title: "walkerOS Tag Manager API",
|
|
2710
|
-
version: "
|
|
2748
|
+
version: "3.1.0",
|
|
2711
2749
|
description: "API for managing walkerOS flows, projects, and real-time event observation.",
|
|
2712
2750
|
contact: {
|
|
2713
2751
|
name: "elbwalker",
|
|
@@ -5031,6 +5069,9 @@ var spec_default = {
|
|
|
5031
5069
|
sessionExpiresAt: {
|
|
5032
5070
|
type: "string",
|
|
5033
5071
|
format: "date-time"
|
|
5072
|
+
},
|
|
5073
|
+
sessionGrant: {
|
|
5074
|
+
type: "string"
|
|
5034
5075
|
}
|
|
5035
5076
|
},
|
|
5036
5077
|
required: ["grant", "activationUrl", "sessionExpiresAt"]
|
|
@@ -5105,15 +5146,15 @@ var spec_default = {
|
|
|
5105
5146
|
token: {
|
|
5106
5147
|
type: "string"
|
|
5107
5148
|
},
|
|
5108
|
-
|
|
5109
|
-
type:
|
|
5149
|
+
previewEnabled: {
|
|
5150
|
+
type: "boolean"
|
|
5110
5151
|
},
|
|
5111
5152
|
bundleUrl: {
|
|
5112
5153
|
type: "string",
|
|
5113
5154
|
format: "uri"
|
|
5114
5155
|
}
|
|
5115
5156
|
},
|
|
5116
|
-
required: ["previewId", "token", "
|
|
5157
|
+
required: ["previewId", "token", "previewEnabled", "bundleUrl"]
|
|
5117
5158
|
},
|
|
5118
5159
|
ObserveSessionJourneysResponse: {
|
|
5119
5160
|
type: "object",
|
|
@@ -7194,6 +7235,65 @@ var spec_default = {
|
|
|
7194
7235
|
},
|
|
7195
7236
|
required: ["email"]
|
|
7196
7237
|
},
|
|
7238
|
+
VerifyResponse: {
|
|
7239
|
+
oneOf: [
|
|
7240
|
+
{
|
|
7241
|
+
type: "object",
|
|
7242
|
+
properties: {
|
|
7243
|
+
status: {
|
|
7244
|
+
type: "string",
|
|
7245
|
+
enum: ["ok"]
|
|
7246
|
+
},
|
|
7247
|
+
redirectTo: {
|
|
7248
|
+
type: "string",
|
|
7249
|
+
example: "/"
|
|
7250
|
+
}
|
|
7251
|
+
},
|
|
7252
|
+
required: ["status", "redirectTo"]
|
|
7253
|
+
},
|
|
7254
|
+
{
|
|
7255
|
+
type: "object",
|
|
7256
|
+
properties: {
|
|
7257
|
+
status: {
|
|
7258
|
+
type: "string",
|
|
7259
|
+
enum: ["confirm_required"]
|
|
7260
|
+
},
|
|
7261
|
+
email: {
|
|
7262
|
+
type: "string",
|
|
7263
|
+
example: "user@example.com"
|
|
7264
|
+
}
|
|
7265
|
+
},
|
|
7266
|
+
required: ["status", "email"]
|
|
7267
|
+
},
|
|
7268
|
+
{
|
|
7269
|
+
type: "object",
|
|
7270
|
+
properties: {
|
|
7271
|
+
status: {
|
|
7272
|
+
type: "string",
|
|
7273
|
+
enum: ["expired", "used", "invalid", "malformed"]
|
|
7274
|
+
}
|
|
7275
|
+
},
|
|
7276
|
+
required: ["status"]
|
|
7277
|
+
}
|
|
7278
|
+
]
|
|
7279
|
+
},
|
|
7280
|
+
VerifyRequest: {
|
|
7281
|
+
type: "object",
|
|
7282
|
+
properties: {
|
|
7283
|
+
token: {
|
|
7284
|
+
type: "string",
|
|
7285
|
+
minLength: 1
|
|
7286
|
+
},
|
|
7287
|
+
redirect_to: {
|
|
7288
|
+
type: "string",
|
|
7289
|
+
example: "/dashboard"
|
|
7290
|
+
},
|
|
7291
|
+
confirm: {
|
|
7292
|
+
type: "boolean"
|
|
7293
|
+
}
|
|
7294
|
+
},
|
|
7295
|
+
required: ["token"]
|
|
7296
|
+
},
|
|
7197
7297
|
WhoamiResponse: {
|
|
7198
7298
|
type: "object",
|
|
7199
7299
|
properties: {
|
|
@@ -8172,10 +8272,46 @@ var spec_default = {
|
|
|
8172
8272
|
}
|
|
8173
8273
|
},
|
|
8174
8274
|
"/api/auth/verify": {
|
|
8275
|
+
post: {
|
|
8276
|
+
tags: ["Auth"],
|
|
8277
|
+
summary: "Redeem magic link token",
|
|
8278
|
+
description: "Redeem a magic link token and create an authenticated session. Redeems immediately when the browser-nonce cookie from the magic-link request matches; otherwise answers confirm_required and expects a follow-up call with confirm: true.",
|
|
8279
|
+
requestBody: {
|
|
8280
|
+
content: {
|
|
8281
|
+
"application/json": {
|
|
8282
|
+
schema: {
|
|
8283
|
+
$ref: "#/components/schemas/VerifyRequest"
|
|
8284
|
+
}
|
|
8285
|
+
}
|
|
8286
|
+
}
|
|
8287
|
+
},
|
|
8288
|
+
responses: {
|
|
8289
|
+
"200": {
|
|
8290
|
+
description: "Redemption result. status=ok sets the session cookie and carries the redirect target.",
|
|
8291
|
+
content: {
|
|
8292
|
+
"application/json": {
|
|
8293
|
+
schema: {
|
|
8294
|
+
$ref: "#/components/schemas/VerifyResponse"
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
}
|
|
8298
|
+
},
|
|
8299
|
+
"400": {
|
|
8300
|
+
description: "Validation error",
|
|
8301
|
+
content: {
|
|
8302
|
+
"application/json": {
|
|
8303
|
+
schema: {
|
|
8304
|
+
$ref: "#/components/schemas/ErrorResponse"
|
|
8305
|
+
}
|
|
8306
|
+
}
|
|
8307
|
+
}
|
|
8308
|
+
}
|
|
8309
|
+
}
|
|
8310
|
+
},
|
|
8175
8311
|
get: {
|
|
8176
8312
|
tags: ["Auth"],
|
|
8177
|
-
summary: "
|
|
8178
|
-
description: "
|
|
8313
|
+
summary: "Legacy magic link entry point",
|
|
8314
|
+
description: "Side-effect-free redirector to the /auth/verify page for links minted before the page-URL change. Never consumes the token; redemption happens via POST.",
|
|
8179
8315
|
parameters: [
|
|
8180
8316
|
{
|
|
8181
8317
|
schema: {
|
|
@@ -8202,8 +8338,8 @@ var spec_default = {
|
|
|
8202
8338
|
}
|
|
8203
8339
|
],
|
|
8204
8340
|
responses: {
|
|
8205
|
-
"
|
|
8206
|
-
description: "Redirect to
|
|
8341
|
+
"307": {
|
|
8342
|
+
description: "Redirect to the /auth/verify page with the token forwarded"
|
|
8207
8343
|
}
|
|
8208
8344
|
}
|
|
8209
8345
|
}
|
|
@@ -17631,6 +17767,7 @@ import {
|
|
|
17631
17767
|
getPreview,
|
|
17632
17768
|
createPreview,
|
|
17633
17769
|
deletePreview,
|
|
17770
|
+
regrantPreview,
|
|
17634
17771
|
listSecrets,
|
|
17635
17772
|
createSecret,
|
|
17636
17773
|
updateSecret,
|
|
@@ -17700,11 +17837,14 @@ var HttpToolClient = class {
|
|
|
17700
17837
|
return getPreview(options);
|
|
17701
17838
|
}
|
|
17702
17839
|
async createPreview(options) {
|
|
17703
|
-
return createPreview(options);
|
|
17840
|
+
return createPreview({ ...options, url: options.url ?? options.siteUrl });
|
|
17704
17841
|
}
|
|
17705
17842
|
async deletePreview(options) {
|
|
17706
17843
|
return deletePreview(options);
|
|
17707
17844
|
}
|
|
17845
|
+
async regrantPreview(options) {
|
|
17846
|
+
return regrantPreview(options);
|
|
17847
|
+
}
|
|
17708
17848
|
async listSecrets(options) {
|
|
17709
17849
|
return listSecrets(options);
|
|
17710
17850
|
}
|