@hyperweb/telescope 1.15.2 → 1.17.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 +5 -5
- package/main/generators/create-combined-stargate-clients.js +99 -0
- package/main/generators/create-mcp-server.js +153 -279
- package/main/generators/create-root-readme.js +1 -1
- package/main/helpers/external-icjs.js +29 -19
- package/main/helpers/generated-type.js +24 -0
- package/main/helpers/internalForBigInt.js +248 -0
- package/main/helpers/types.js +24 -0
- package/main/helpers/vue-query.js +91 -0
- package/main/protod/proto-download.js +57 -0
- package/module/generators/create-combined-stargate-clients.js +95 -0
- package/module/generators/create-mcp-server.js +153 -279
- package/module/generators/create-root-readme.js +1 -1
- package/module/helpers/external-icjs.js +29 -19
- package/module/helpers/generated-type.js +21 -0
- package/module/helpers/internalForBigInt.js +245 -0
- package/module/helpers/types.js +21 -0
- package/module/helpers/vue-query.js +87 -0
- package/module/protod/proto-download.js +55 -0
- package/module/telescope.js +0 -0
- package/package.json +6 -6
- package/src/generators/create-mcp-server.ts +154 -282
- package/src/generators/create-root-readme.ts +1 -1
- package/src/helpers/external-icjs.ts +29 -19
- package/types/codegen/cosmos/orm/module/v1alpha1/module.d.ts +43 -0
- package/types/helpers/external-icjs.d.ts +1 -1
package/README.md
CHANGED
|
@@ -755,11 +755,10 @@ See [Helper Functions Configuration](#helper-functions-configuration) for more i
|
|
|
755
755
|
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
756
756
|
| `mcpServer.enabled` | generate MCP (Model Context Protocol) servers alongside TypeScript clients for AI agent integration | `false` |
|
|
757
757
|
|
|
758
|
-
When enabled, Telescope generates
|
|
759
|
-
-
|
|
760
|
-
-
|
|
761
|
-
-
|
|
762
|
-
- Ready-to-extend structure for implementing real blockchain functionality
|
|
758
|
+
When enabled, Telescope generates an MCP server package (`{packageName}-mcp`) that includes:
|
|
759
|
+
- **Function generator tool** for creating custom blockchain functions
|
|
760
|
+
- **Telescope examples** as reference patterns for implementation
|
|
761
|
+
- **AI prompts** for usage guidelines and best practices
|
|
763
762
|
|
|
764
763
|
See [MCP Integration](https://docs.hyperweb.io/telescope/developing/mcp-integration) for detailed documentation.
|
|
765
764
|
|
|
@@ -1588,3 +1587,4 @@ Thanks to these engineers, teams and projects for inspiring Telescope:
|
|
|
1588
1587
|
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
1589
1588
|
|
|
1590
1589
|
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
1590
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.plugin = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const ast_1 = require("@cosmology/ast");
|
|
6
|
+
const case_1 = require("case");
|
|
7
|
+
const utils_1 = require("@cosmology/utils");
|
|
8
|
+
const imports_1 = require("../imports");
|
|
9
|
+
const files_1 = require("../utils/files");
|
|
10
|
+
const plugin = (builder, allRegistries, allConverters) => {
|
|
11
|
+
builder.options.rpcClients.combinedClient.map((currentClient) => {
|
|
12
|
+
if (!allRegistries || !allRegistries.length) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const registryImports = [];
|
|
16
|
+
const converterImports = [];
|
|
17
|
+
const clientFile = currentClient.fileName;
|
|
18
|
+
const ctxRef = {
|
|
19
|
+
absolute: '/',
|
|
20
|
+
filename: '/',
|
|
21
|
+
proto: {
|
|
22
|
+
imports: [],
|
|
23
|
+
package: currentClient.name,
|
|
24
|
+
root: {},
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const ctx = new ast_1.GenericParseContext(ctxRef, null, builder.options);
|
|
28
|
+
const registryVariables = [];
|
|
29
|
+
const converterVariables = [];
|
|
30
|
+
const filteredRegistries = allRegistries.filter(item => (0, utils_1.isPackageIncluded)(item.package, currentClient.include.patterns));
|
|
31
|
+
filteredRegistries.forEach(registry => {
|
|
32
|
+
let rel = (0, path_1.relative)((0, path_1.dirname)(clientFile), registry.localname);
|
|
33
|
+
if (!rel.startsWith('.'))
|
|
34
|
+
rel = `./${rel}`;
|
|
35
|
+
rel = (0, utils_1.toPosixPath)(rel);
|
|
36
|
+
const variable = (0, utils_1.variableSlug)(registry.localname);
|
|
37
|
+
registryVariables.push(variable);
|
|
38
|
+
registryImports.push((0, ast_1.importNamespace)(variable, rel));
|
|
39
|
+
});
|
|
40
|
+
const filteredConverters = allConverters.filter(item => (0, utils_1.isPackageIncluded)(item.package, currentClient.include.patterns));
|
|
41
|
+
filteredConverters.forEach(converter => {
|
|
42
|
+
let rel = (0, path_1.relative)((0, path_1.dirname)(clientFile), converter.localname);
|
|
43
|
+
if (!rel.startsWith('.'))
|
|
44
|
+
rel = `./${rel}`;
|
|
45
|
+
rel = (0, utils_1.toPosixPath)(rel);
|
|
46
|
+
const variable = (0, utils_1.variableSlug)(converter.localname);
|
|
47
|
+
converterVariables.push(variable);
|
|
48
|
+
converterImports.push((0, ast_1.importNamespace)(variable, rel));
|
|
49
|
+
});
|
|
50
|
+
const name = 'get' + (0, case_1.pascal)(currentClient.name + 'SigningClient');
|
|
51
|
+
const txRpcName = 'get' + (0, case_1.pascal)(currentClient.name + 'SigningTxRpc');
|
|
52
|
+
const prefix = (0, case_1.camel)(currentClient.name);
|
|
53
|
+
const aminos = (0, ast_1.createStargateClientAminoRegistry)({
|
|
54
|
+
context: ctx,
|
|
55
|
+
aminos: converterVariables,
|
|
56
|
+
aminoConverters: prefix + 'AminoConverters'
|
|
57
|
+
});
|
|
58
|
+
const protos = (0, ast_1.createStargateClientProtoRegistry)({
|
|
59
|
+
context: ctx,
|
|
60
|
+
registries: registryVariables,
|
|
61
|
+
protoTypeRegistry: prefix + 'ProtoRegistry'
|
|
62
|
+
});
|
|
63
|
+
const clientOptions = (0, ast_1.createStargateClientOptions)({
|
|
64
|
+
context: ctx,
|
|
65
|
+
name: name + 'Options',
|
|
66
|
+
protoTypeRegistry: prefix + 'ProtoRegistry',
|
|
67
|
+
aminoConverters: prefix + 'AminoConverters'
|
|
68
|
+
});
|
|
69
|
+
const clientBody = (0, ast_1.createStargateClient)({
|
|
70
|
+
context: ctx,
|
|
71
|
+
name,
|
|
72
|
+
options: name + 'Options',
|
|
73
|
+
});
|
|
74
|
+
let getTxRpc;
|
|
75
|
+
if (ctx.pluginValue("stargateClients.addGetTxRpc")) {
|
|
76
|
+
getTxRpc = (0, ast_1.createGetTxRpc)(ctx, txRpcName, name);
|
|
77
|
+
}
|
|
78
|
+
const imports = (0, imports_1.buildAllImportsFromGenericContext)(ctx, clientFile);
|
|
79
|
+
let importDecls = [...imports, ...registryImports, ...converterImports];
|
|
80
|
+
importDecls = (0, utils_1.duplicateImportPathsWithExt)(importDecls, builder.options.restoreImportExtension);
|
|
81
|
+
let cProg = importDecls
|
|
82
|
+
.concat(aminos)
|
|
83
|
+
.concat(protos)
|
|
84
|
+
.concat(clientOptions)
|
|
85
|
+
.concat(clientBody);
|
|
86
|
+
// replace all backslash path for windows
|
|
87
|
+
for (let i = 0; i < cProg.length; i++) {
|
|
88
|
+
if (cProg[i].source?.value) {
|
|
89
|
+
cProg[i].source.value = (0, utils_1.toPosixPath)(cProg[i].source?.value);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (getTxRpc) {
|
|
93
|
+
cProg = cProg.concat(getTxRpc);
|
|
94
|
+
}
|
|
95
|
+
const clientOutFile = (0, path_1.join)(builder.outPath, clientFile);
|
|
96
|
+
(0, files_1.writeAstToFile)(builder.outPath, builder.options, cProg, clientOutFile);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
exports.plugin = plugin;
|