Skip to content

Commit 774000e

Browse files
authored
Merge pull request #12 from hyperweb-io/fix/starship-gen-tool
Fix generateStarshipConfig tool
2 parents f334873 + fe19394 commit 774000e

16 files changed

+1472
-2229
lines changed

docs/features.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Our MCP server, easily runnable with `npx -y @hyperweb/mcp-server@latest`, provi
3636

3737
- **Starship (`setupStarship`, `generateStarshipConfig`, `verifyStarshipConfig`)**
3838
- Provides guidance on setting up Starship, a unified development and testing environment for Cosmos chains.
39-
- Features a powerful configuration generator (`generateStarshipConfig`) that creates detailed `config.yaml` files based on user inputs for chains, relayers, explorers, and more.
39+
- Features a powerful configuration helper (`generateStarshipConfig`) that provides comprehensive documentation and type definitions to assist in creating detailed `config.yaml` files.
4040
- Includes a validation tool (`verifyStarshipConfig`) to parse and check Starship YAML configurations against the official schema, ensuring correctness before deployment.
4141

4242
---

docs/references.mdx

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -65,57 +65,16 @@ Tools for interacting with Starship, the unified development and testing environ
6565

6666
### `generateStarshipConfig`
6767

68-
- **Description**: Generates a Starship configuration file in YAML format based on detailed input options then creates the file (e.g., `starship/config.yaml`) in the workspace.
68+
- **Description**: This tool helps generate Starship configuration files by providing comprehensive documentation and type definitions.
6969
- **Source**: `src/starship/tools/starship-config-gen.ts`
70-
- **Parameters (StarshipConfigInput)**:
71-
- `configFilePath` (string, required): The absolute path to the Starship configuration file (e.g., `<current_working_directory>/starship/config.yaml`).
72-
- `configName` (string, optional, default: "starship"): Top-level configuration name.
73-
- `configVersion` (string, optional, default: "1.6.0"): Top-level configuration version.
74-
- `chains` (array of ChainConfig, required, min: 1): List of chain configurations. Each `ChainConfig` includes:
75-
- `id` (string, required): Unique identifier for the chain.
76-
- `name` (string, required): Type of chain (e.g., 'osmosis', 'custom').
77-
- `numValidators` (integer, required, positive): Number of validators.
78-
- `image` (string, optional): Override default Docker image.
79-
- `home` (string, optional): Home directory path (for `name: 'custom'`).
80-
- `binary` (string, optional): Binary name (for `name: 'custom'`).
81-
- `prefix` (string, optional): Address prefix (for `name: 'custom'`).
82-
- `denom` (string, optional): Primary denomination (for `name: 'custom'`).
83-
- `coins` (string, optional): Genesis coins.
84-
- `hdPath` (string, optional): HD path.
85-
- `coinType` (integer, optional): Coin type.
86-
- `repo` (string URL, optional): Git repository URL.
87-
- `ports` (object, optional): Port forwarding (`rest`, `rpc`, `grpc`, `faucet`, `exposer`).
88-
- `resources` (object, optional): CPU/memory allocation (`cpu`, `memory`).
89-
- `faucet` (object, optional): Faucet config (`enabled`, `type`, `image`, `concurrency`, `resources`).
90-
- `build` (object, optional): On-the-fly build config (`enabled`, `source`).
91-
- `upgrade` (object, optional): Upgrade prep config (`enabled`, `type`, `genesis`, `upgrades` array).
92-
- `genesis` (object, optional): `genesis.json` patches (`app_state`).
93-
- `scripts` (object, optional): Override setup scripts.
94-
- `cometmock` (object, optional): CometMock config (`enabled`, `image`).
95-
- `env` (array of EnvVar, optional): Custom environment variables (`name`, `value`).
96-
- `ics` (object, optional): ICS config for consumer chains (`enabled`, `provider`).
97-
- `balances` (array of BalanceEntry, optional): Initial balances (`address`, `amount`).
98-
- `readinessProbe` (object, optional): Custom readiness probe.
99-
- `config` (object, optional): Ethereum-specific config (if `name` is 'ethereum').
100-
- `relayers` (array of RelayerConfig, optional): List of relayer configurations. Each `RelayerConfig` includes:
101-
- `name` (string, required): Name for the relayer instance.
102-
- `type` (enum: `hermes` | `ts-relayer` | `go-relayer` | `neutron-query-relayer`, required): Type of relayer.
103-
- `image` (string, optional): Override default Docker image.
104-
- `replicas` (integer, optional, default: 1): Number of replicas (currently 1).
105-
- `chains` (array of string, required, min: 2): Chain IDs to connect.
106-
- `config` (object, optional): Hermes specific `config.toml` overrides.
107-
- `ports` (object, optional): Hermes specific port forwarding (`rest`, `exposer`).
108-
- `ics` (object, optional): Hermes specific ICS setup.
109-
- `explorer` (ExplorerConfig, optional): Explorer configuration (`enabled`, `type`, `ports`, `resources`, `image`).
110-
- `registry` (RegistryConfig, optional): Registry service configuration (`enabled`, `localhost`, `ports`, `resources`, `image`).
111-
- **Output**: Text confirmation with the generated YAML content and writes the file to the specified `configFilePath`.
70+
- **Parameters**: None.
71+
- **Output**: Provides text content containing a comprehensive guide for generating a Starship configuration file.
11272

11373
### `verifyStarshipConfig`
11474

11575
- **Description**: Parses and validates a Starship configuration YAML string against the known schema.
116-
- **Source**: `src/starship/tools/starship-config-gen.ts`
117-
- **Parameters (VerifyStarshipConfigInput)**:
118-
- `configFilePath` (string, required): The absolute path to the Starship configuration file.
76+
- **Source**: `src/starship/tools/starship-config-verify.ts`
77+
- **Parameters**:
11978
- `yamlContent` (string, required): The Starship configuration content in YAML format as a string.
12079
- **Output**: Text indicating if the configuration is valid or invalid, with error details if invalid.
12180

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"description": "Model Context Protocol Hyperweb products",
55
"main": "build/index.js",
66
"scripts": {
7-
"build": "tsc && npm run copy-prompts && chmod 755 build/index.js",
8-
"copy-prompts": "./scripts/copy-prompts.sh",
7+
"build": "rm -rf build && tsc && npm run copy-assets && chmod 755 build/index.js",
8+
"copy-assets": "./scripts/copy-assets.sh",
99
"categorize-snippets": "tsx src/interchainjs/scripts/categorize-snippets.ts",
10+
"fetch-config-docs": "tsx src/starship/scripts/fetch-config-docs.ts",
1011
"clean": "rimraf build",
1112
"test": "vitest",
1213
"test:watch": "vitest --watch",
@@ -26,6 +27,7 @@
2627
"@biomejs/biome": "1.9.4",
2728
"@types/js-yaml": "^4.0.9",
2829
"@types/node": "^22.13.10",
30+
"@types/node-fetch": "^2.6.12",
2931
"rimraf": "^6.0.1",
3032
"tsx": "^4.19.3",
3133
"typescript": "^5.8.2",
@@ -44,6 +46,7 @@
4446
"@modelcontextprotocol/sdk": "^1.7.0",
4547
"dotenv": "^16.4.7",
4648
"js-yaml": "^4.1.0",
49+
"node-fetch": "^3.3.2",
4750
"zod": "^3.24.2"
4851
}
4952
}

pnpm-lock.yaml

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)