@1claw/mcp 0.44.3 → 0.46.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/README.md +15 -5
- package/dist/client.d.ts +30 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +42 -0
- package/dist/client.js.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/create_channel.d.ts +16 -0
- package/dist/tools/create_channel.d.ts.map +1 -1
- package/dist/tools/create_channel.js +11 -2
- package/dist/tools/create_channel.js.map +1 -1
- package/dist/tools/delegation.d.ts +77 -0
- package/dist/tools/delegation.d.ts.map +1 -0
- package/dist/tools/delegation.js +181 -0
- package/dist/tools/delegation.js.map +1 -0
- package/dist/tools/oauth_revoke_consent.d.ts +21 -0
- package/dist/tools/oauth_revoke_consent.d.ts.map +1 -0
- package/dist/tools/oauth_revoke_consent.js +34 -0
- package/dist/tools/oauth_revoke_consent.js.map +1 -0
- package/dist/tools/oauth_revoke_token.d.ts +25 -0
- package/dist/tools/oauth_revoke_token.d.ts.map +1 -0
- package/dist/tools/oauth_revoke_token.js +39 -0
- package/dist/tools/oauth_revoke_token.js.map +1 -0
- package/dist/tools/org_directory.d.ts +2 -2
- package/dist/tools/platform_app_stats.d.ts +21 -0
- package/dist/tools/platform_app_stats.d.ts.map +1 -0
- package/dist/tools/platform_app_stats.js +47 -0
- package/dist/tools/platform_app_stats.js.map +1 -0
- package/dist/tools/platform_marketplace.d.ts +29 -0
- package/dist/tools/platform_marketplace.d.ts.map +1 -0
- package/dist/tools/platform_marketplace.js +49 -0
- package/dist/tools/platform_marketplace.js.map +1 -0
- package/dist/tools/platform_rotate_webhook_secret.d.ts +21 -0
- package/dist/tools/platform_rotate_webhook_secret.d.ts.map +1 -0
- package/dist/tools/platform_rotate_webhook_secret.js +44 -0
- package/dist/tools/platform_rotate_webhook_secret.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserError } from "fastmcp";
|
|
3
|
+
import { OneClawApiError } from "../client.js";
|
|
4
|
+
export function platformRotateWebhookSecretTool(client) {
|
|
5
|
+
return {
|
|
6
|
+
name: "platform_rotate_webhook_secret",
|
|
7
|
+
description: "Rotate the webhook secret for a platform app. The new secret is used to compute HMAC-SHA256 signatures on webhook deliveries.",
|
|
8
|
+
parameters: z.object({
|
|
9
|
+
app_id: z
|
|
10
|
+
.string()
|
|
11
|
+
.uuid()
|
|
12
|
+
.describe("The platform app ID whose webhook secret should be rotated"),
|
|
13
|
+
}),
|
|
14
|
+
execute: async (args, { log }) => {
|
|
15
|
+
try {
|
|
16
|
+
const result = (await client.platformRotateWebhookSecret(args.app_id));
|
|
17
|
+
log.info(`webhook secret rotated for platform app: ${args.app_id}`);
|
|
18
|
+
const lines = [
|
|
19
|
+
`Webhook secret rotated successfully for app ${args.app_id}.`,
|
|
20
|
+
];
|
|
21
|
+
if (result.webhook_secret_prefix) {
|
|
22
|
+
lines.push(` Secret prefix: ${result.webhook_secret_prefix}…`);
|
|
23
|
+
}
|
|
24
|
+
if (result.rotated_at) {
|
|
25
|
+
lines.push(` Rotated at: ${result.rotated_at}`);
|
|
26
|
+
}
|
|
27
|
+
lines.push(` (Full secret available in the dashboard — not shown in MCP output for security)`);
|
|
28
|
+
return lines.join("\n");
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err instanceof OneClawApiError) {
|
|
32
|
+
if (err.status === 400)
|
|
33
|
+
throw new UserError(err.detail);
|
|
34
|
+
if (err.status === 403)
|
|
35
|
+
throw new UserError(`Access denied: ${err.detail}`);
|
|
36
|
+
if (err.status === 404)
|
|
37
|
+
throw new UserError(`Platform app not found: ${err.detail}`);
|
|
38
|
+
}
|
|
39
|
+
throw err;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=platform_rotate_webhook_secret.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform_rotate_webhook_secret.js","sourceRoot":"","sources":["../../src/tools/platform_rotate_webhook_secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAiB,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,UAAU,+BAA+B,CAAC,MAAqB;IACnE,OAAO;QACL,IAAI,EAAE,gCAAyC;QAC/C,WAAW,EACT,+HAA+H;QACjI,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,IAAI,EAAE;iBACN,QAAQ,CAAC,4DAA4D,CAAC;SAC1E,CAAC;QACF,OAAO,EAAE,KAAK,EACZ,IAAwB,EACxB,EAAE,GAAG,EAA4C,EACjD,EAAE;YACF,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC,CAIpE,CAAC;gBAEF,GAAG,CAAC,IAAI,CAAC,4CAA4C,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;gBAEpE,MAAM,KAAK,GAAG;oBACZ,+CAA+C,IAAI,CAAC,MAAM,GAAG;iBAC9D,CAAC;gBACF,IAAI,MAAM,CAAC,qBAAqB,EAAE,CAAC;oBACjC,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,qBAAqB,GAAG,CAAC,CAAC;gBAClE,CAAC;gBACD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtB,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;gBACnD,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAC;gBAEhG,OAAO,KAAK,CAAC,IAAI,CAAC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