mcpmake 0.1.0 → 0.2.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/commands/bundle.d.ts +1 -0
- package/dist/commands/bundle.d.ts.map +1 -0
- package/dist/commands/bundle.js +5 -4
- package/dist/commands/bundle.js.map +1 -0
- package/dist/commands/ci.d.ts +1 -0
- package/dist/commands/ci.d.ts.map +1 -0
- package/dist/commands/ci.js +3 -2
- package/dist/commands/ci.js.map +1 -0
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +4 -3
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/diff.d.ts +1 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +5 -4
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/from/describe.d.ts +1 -0
- package/dist/commands/from/describe.d.ts.map +1 -0
- package/dist/commands/from/describe.js +11 -10
- package/dist/commands/from/describe.js.map +1 -0
- package/dist/commands/from/har.d.ts +1 -0
- package/dist/commands/from/har.d.ts.map +1 -0
- package/dist/commands/from/har.js +14 -13
- package/dist/commands/from/har.js.map +1 -0
- package/dist/commands/from/openapi.d.ts +1 -0
- package/dist/commands/from/openapi.d.ts.map +1 -0
- package/dist/commands/from/openapi.js +17 -16
- package/dist/commands/from/openapi.js.map +1 -0
- package/dist/commands/from/postman.d.ts +1 -0
- package/dist/commands/from/postman.d.ts.map +1 -0
- package/dist/commands/from/postman.js +13 -12
- package/dist/commands/from/postman.js.map +1 -0
- package/dist/commands/from/stainless.d.ts +110 -0
- package/dist/commands/from/stainless.d.ts.map +1 -0
- package/dist/commands/from/stainless.js +272 -0
- package/dist/commands/from/stainless.js.map +1 -0
- package/dist/commands/from/target-support.d.ts +1 -0
- package/dist/commands/from/target-support.d.ts.map +1 -0
- package/dist/commands/from/target-support.js +2 -1
- package/dist/commands/from/target-support.js.map +1 -0
- package/dist/commands/from/url.d.ts +1 -0
- package/dist/commands/from/url.d.ts.map +1 -0
- package/dist/commands/from/url.js +14 -13
- package/dist/commands/from/url.js.map +1 -0
- package/dist/commands/from/website.d.ts +1 -0
- package/dist/commands/from/website.d.ts.map +1 -0
- package/dist/commands/from/website.js +17 -16
- package/dist/commands/from/website.js.map +1 -0
- package/dist/commands/lint.d.ts +1 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +6 -5
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/merge.d.ts +1 -0
- package/dist/commands/merge.d.ts.map +1 -0
- package/dist/commands/merge.js +3 -2
- package/dist/commands/merge.js.map +1 -0
- package/dist/commands/publish.d.ts +1 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +4 -3
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/rescan.d.ts +1 -0
- package/dist/commands/rescan.d.ts.map +1 -0
- package/dist/commands/rescan.js +12 -11
- package/dist/commands/rescan.js.map +1 -0
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +10 -9
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.d.ts +1 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +7 -6
- package/dist/commands/verify.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -0
- package/dist/registry/official-registry.d.ts +1 -0
- package/dist/registry/official-registry.d.ts.map +1 -0
- package/dist/registry/official-registry.js +1 -0
- package/dist/registry/official-registry.js.map +1 -0
- package/package.json +24 -42
- package/README.md +0 -691
- package/dist/analyzer/auth-detector.d.ts +0 -12
- package/dist/analyzer/auth-detector.js +0 -142
- package/dist/analyzer/dom-parser.d.ts +0 -10
- package/dist/analyzer/dom-parser.js +0 -259
- package/dist/analyzer/goal-crawler.d.ts +0 -25
- package/dist/analyzer/goal-crawler.js +0 -177
- package/dist/analyzer/hybrid-detector.d.ts +0 -28
- package/dist/analyzer/hybrid-detector.js +0 -96
- package/dist/analyzer/index.d.ts +0 -12
- package/dist/analyzer/index.js +0 -8
- package/dist/analyzer/screenshot-capture.d.ts +0 -29
- package/dist/analyzer/screenshot-capture.js +0 -42
- package/dist/analyzer/selector-builder.d.ts +0 -19
- package/dist/analyzer/selector-builder.js +0 -199
- package/dist/analyzer/semantic-analyzer.d.ts +0 -13
- package/dist/analyzer/semantic-analyzer.js +0 -145
- package/dist/analyzer/site-crawler.d.ts +0 -38
- package/dist/analyzer/site-crawler.js +0 -235
- package/dist/cloud/billing/billing-engine.d.ts +0 -44
- package/dist/cloud/billing/billing-engine.js +0 -81
- package/dist/cloud/billing/credit-store.d.ts +0 -64
- package/dist/cloud/billing/credit-store.js +0 -168
- package/dist/cloud/billing/index.d.ts +0 -4
- package/dist/cloud/billing/index.js +0 -2
- package/dist/cloud/billing/usage-store.d.ts +0 -42
- package/dist/cloud/billing/usage-store.js +0 -85
- package/dist/cloud/billing/usage-tracker.d.ts +0 -38
- package/dist/cloud/billing/usage-tracker.js +0 -95
- package/dist/cloud/build-pipeline.d.ts +0 -39
- package/dist/cloud/build-pipeline.js +0 -310
- package/dist/cloud/build-queue.d.ts +0 -30
- package/dist/cloud/build-queue.js +0 -70
- package/dist/cloud/caddy-manager.d.ts +0 -18
- package/dist/cloud/caddy-manager.js +0 -97
- package/dist/cloud/container-backend.d.ts +0 -62
- package/dist/cloud/container-backend.js +0 -59
- package/dist/cloud/container-manager.d.ts +0 -64
- package/dist/cloud/container-manager.js +0 -301
- package/dist/cloud/crypto.d.ts +0 -27
- package/dist/cloud/crypto.js +0 -63
- package/dist/cloud/db/index.d.ts +0 -27
- package/dist/cloud/db/index.js +0 -53
- package/dist/cloud/db/migrations.d.ts +0 -12
- package/dist/cloud/db/migrations.js +0 -329
- package/dist/cloud/db/pg-store.d.ts +0 -45
- package/dist/cloud/db/pg-store.js +0 -336
- package/dist/cloud/failure-tracker.d.ts +0 -51
- package/dist/cloud/failure-tracker.js +0 -102
- package/dist/cloud/idle-monitor.d.ts +0 -30
- package/dist/cloud/idle-monitor.js +0 -70
- package/dist/cloud/mailer.d.ts +0 -21
- package/dist/cloud/mailer.js +0 -193
- package/dist/cloud/mcp-proxy.d.ts +0 -58
- package/dist/cloud/mcp-proxy.js +0 -203
- package/dist/cloud/metric-samples.d.ts +0 -43
- package/dist/cloud/metric-samples.js +0 -85
- package/dist/cloud/metrics.d.ts +0 -26
- package/dist/cloud/metrics.js +0 -59
- package/dist/cloud/multipart.d.ts +0 -26
- package/dist/cloud/multipart.js +0 -132
- package/dist/cloud/observability.d.ts +0 -27
- package/dist/cloud/observability.js +0 -98
- package/dist/cloud/rate-limiter.d.ts +0 -31
- package/dist/cloud/rate-limiter.js +0 -58
- package/dist/cloud/request-security.d.ts +0 -5
- package/dist/cloud/request-security.js +0 -74
- package/dist/cloud/resource-monitor.d.ts +0 -69
- package/dist/cloud/resource-monitor.js +0 -130
- package/dist/cloud/secret-store.d.ts +0 -38
- package/dist/cloud/secret-store.js +0 -103
- package/dist/cloud/security.d.ts +0 -26
- package/dist/cloud/security.js +0 -142
- package/dist/cloud/server.d.ts +0 -21
- package/dist/cloud/server.js +0 -1079
- package/dist/cloud/shared-state.d.ts +0 -72
- package/dist/cloud/shared-state.js +0 -159
- package/dist/cloud/ssrf.d.ts +0 -43
- package/dist/cloud/ssrf.js +0 -150
- package/dist/cloud/store.d.ts +0 -41
- package/dist/cloud/store.js +0 -75
- package/dist/cloud/stripe.d.ts +0 -78
- package/dist/cloud/stripe.js +0 -317
- package/dist/cloud/telemetry-store.d.ts +0 -53
- package/dist/cloud/telemetry-store.js +0 -108
- package/dist/cloud/web/auth.d.ts +0 -225
- package/dist/cloud/web/auth.js +0 -555
- package/dist/cloud/web/charts.d.ts +0 -70
- package/dist/cloud/web/charts.js +0 -178
- package/dist/cloud/web/csrf.d.ts +0 -14
- package/dist/cloud/web/csrf.js +0 -22
- package/dist/cloud/web/docs.d.ts +0 -40
- package/dist/cloud/web/docs.js +0 -174
- package/dist/cloud/web/router.d.ts +0 -25
- package/dist/cloud/web/router.js +0 -1921
- package/dist/cloud/web/static/alpine.min.js +0 -5
- package/dist/cloud/web/static/favicon.svg +0 -4
- package/dist/cloud/web/static/htmx-sse.js +0 -290
- package/dist/cloud/web/static/htmx.min.js +0 -1
- package/dist/cloud/web/static/style.css +0 -2683
- package/dist/cloud/web/static-server.d.ts +0 -13
- package/dist/cloud/web/static-server.js +0 -73
- package/dist/cloud/web/template-engine.d.ts +0 -27
- package/dist/cloud/web/template-engine.js +0 -146
- package/dist/cloud/web/templates/layouts/admin.hbs +0 -57
- package/dist/cloud/web/templates/layouts/auth.hbs +0 -138
- package/dist/cloud/web/templates/layouts/base.hbs +0 -16
- package/dist/cloud/web/templates/layouts/dashboard.hbs +0 -39
- package/dist/cloud/web/templates/layouts/landing.hbs +0 -82
- package/dist/cloud/web/templates/pages/admin/overview.hbs +0 -123
- package/dist/cloud/web/templates/pages/admin/servers.hbs +0 -129
- package/dist/cloud/web/templates/pages/admin/telemetry.hbs +0 -39
- package/dist/cloud/web/templates/pages/admin/user-edit.hbs +0 -91
- package/dist/cloud/web/templates/pages/admin/users.hbs +0 -179
- package/dist/cloud/web/templates/pages/auth/forgot-password.hbs +0 -25
- package/dist/cloud/web/templates/pages/auth/login.hbs +0 -33
- package/dist/cloud/web/templates/pages/auth/register.hbs +0 -32
- package/dist/cloud/web/templates/pages/auth/reset-password.hbs +0 -34
- package/dist/cloud/web/templates/pages/dashboard/billing.hbs +0 -140
- package/dist/cloud/web/templates/pages/dashboard/create.hbs +0 -173
- package/dist/cloud/web/templates/pages/dashboard/index.hbs +0 -8
- package/dist/cloud/web/templates/pages/dashboard/server-detail.hbs +0 -280
- package/dist/cloud/web/templates/pages/dashboard/server-logs.hbs +0 -35
- package/dist/cloud/web/templates/pages/dashboard/server-metrics.hbs +0 -63
- package/dist/cloud/web/templates/pages/dashboard/servers-partial.hbs +0 -21
- package/dist/cloud/web/templates/pages/dashboard/servers.hbs +0 -44
- package/dist/cloud/web/templates/pages/docs/show.hbs +0 -16
- package/dist/cloud/web/templates/pages/errors/404.hbs +0 -9
- package/dist/cloud/web/templates/pages/errors/500.hbs +0 -8
- package/dist/cloud/web/templates/pages/landing/index.hbs +0 -223
- package/dist/cloud/web/templates/pages/legal/privacy.hbs +0 -71
- package/dist/cloud/web/templates/pages/legal/terms.hbs +0 -73
- package/dist/cloud/web/templates/partials/admin-stats.hbs +0 -52
- package/dist/cloud/web/templates/partials/flash-message.hbs +0 -6
- package/dist/cloud/web/templates/partials/pricing-table.hbs +0 -103
- package/dist/cloud/web/templates/partials/server-card.hbs +0 -19
- package/dist/cloud/web/templates/partials/status-badge.hbs +0 -1
- package/dist/config/configurable-command.d.ts +0 -13
- package/dist/config/configurable-command.js +0 -70
- package/dist/config/mcpmake-config.d.ts +0 -68
- package/dist/config/mcpmake-config.js +0 -207
- package/dist/docs/cli.md +0 -400
- package/dist/docs/mcp-2026-07-28-migration.md +0 -78
- package/dist/docs/migrate-from-stainless.md +0 -94
- package/dist/docs/quickstart.md +0 -166
- package/dist/docs/show-hn.md +0 -26
- package/dist/docs/website-servers.md +0 -169
- package/dist/emitter/code-writer.d.ts +0 -8
- package/dist/emitter/code-writer.js +0 -25
- package/dist/emitter/index.d.ts +0 -32
- package/dist/emitter/index.js +0 -280
- package/dist/emitter/mcpb-bundler.d.ts +0 -31
- package/dist/emitter/mcpb-bundler.js +0 -172
- package/dist/emitter/project-scaffolder.d.ts +0 -4
- package/dist/emitter/project-scaffolder.js +0 -89
- package/dist/emitter/python-template-loader.d.ts +0 -4
- package/dist/emitter/python-template-loader.js +0 -30
- package/dist/emitter/python-templates/dockerfile.hbs +0 -14
- package/dist/emitter/python-templates/env.example.hbs +0 -6
- package/dist/emitter/python-templates/requirements.txt.hbs +0 -4
- package/dist/emitter/python-templates/server.py.hbs +0 -77
- package/dist/emitter/site-scaffolder.d.ts +0 -13
- package/dist/emitter/site-scaffolder.js +0 -70
- package/dist/emitter/site-template-loader.d.ts +0 -5
- package/dist/emitter/site-template-loader.js +0 -47
- package/dist/emitter/site-templates/browser-manager.ts.hbs +0 -233
- package/dist/emitter/site-templates/config.ts.hbs +0 -28
- package/dist/emitter/site-templates/dockerfile.hbs +0 -31
- package/dist/emitter/site-templates/env.example.hbs +0 -19
- package/dist/emitter/site-templates/package.json.hbs +0 -26
- package/dist/emitter/site-templates/server-main-http.ts.hbs +0 -108
- package/dist/emitter/site-templates/server-main.ts.hbs +0 -23
- package/dist/emitter/site-templates/tool-handler-action.ts.hbs +0 -86
- package/dist/emitter/site-templates/tool-handler-form.ts.hbs +0 -116
- package/dist/emitter/site-templates/tool-handler-lifecycle.ts.hbs +0 -146
- package/dist/emitter/site-templates/tool-index.ts.hbs +0 -11
- package/dist/emitter/template-loader.d.ts +0 -1
- package/dist/emitter/template-loader.js +0 -27
- package/dist/emitter/templates/auth-provider.ts.hbs +0 -57
- package/dist/emitter/templates/config.ts.hbs +0 -63
- package/dist/emitter/templates/discovery.ts.hbs +0 -301
- package/dist/emitter/templates/dockerfile.hbs +0 -34
- package/dist/emitter/templates/env.example.hbs +0 -28
- package/dist/emitter/templates/gitignore.hbs +0 -5
- package/dist/emitter/templates/http-executor.ts.hbs +0 -117
- package/dist/emitter/templates/oauth.ts.hbs +0 -188
- package/dist/emitter/templates/package.json.hbs +0 -25
- package/dist/emitter/templates/prompts.ts.hbs +0 -22
- package/dist/emitter/templates/readme.md.hbs +0 -123
- package/dist/emitter/templates/resources.ts.hbs +0 -63
- package/dist/emitter/templates/server-main-http.ts.hbs +0 -407
- package/dist/emitter/templates/server-main.ts.hbs +0 -40
- package/dist/emitter/templates/task-handlers.ts.hbs +0 -189
- package/dist/emitter/templates/task-manager.ts.hbs +0 -139
- package/dist/emitter/templates/task-sse.ts.hbs +0 -105
- package/dist/emitter/templates/tool-handler.ts.hbs +0 -124
- package/dist/emitter/templates/tool-index.ts.hbs +0 -11
- package/dist/emitter/templates/tool-test.ts.hbs +0 -57
- package/dist/emitter/templates/trace.ts.hbs +0 -79
- package/dist/emitter/templates/tsconfig.json.hbs +0 -16
- package/dist/emitter/templates/types.ts.hbs +0 -5
- package/dist/emitter/worker-template-loader.d.ts +0 -5
- package/dist/emitter/worker-template-loader.js +0 -33
- package/dist/emitter/worker-templates/config.ts.hbs +0 -54
- package/dist/emitter/worker-templates/dev-vars.example.hbs +0 -10
- package/dist/emitter/worker-templates/gitignore.hbs +0 -6
- package/dist/emitter/worker-templates/package.json.hbs +0 -24
- package/dist/emitter/worker-templates/readme.md.hbs +0 -53
- package/dist/emitter/worker-templates/server.test.ts.hbs +0 -20
- package/dist/emitter/worker-templates/tool-handler.ts.hbs +0 -85
- package/dist/emitter/worker-templates/tool-index.ts.hbs +0 -28
- package/dist/emitter/worker-templates/tsconfig.json.hbs +0 -17
- package/dist/emitter/worker-templates/worker.ts.hbs +0 -242
- package/dist/emitter/worker-templates/wrangler.toml.hbs +0 -19
- package/dist/generator/spec-generator.d.ts +0 -6
- package/dist/generator/spec-generator.js +0 -50
- package/dist/parser/har-filter.d.ts +0 -8
- package/dist/parser/har-filter.js +0 -71
- package/dist/parser/har-loader.d.ts +0 -2
- package/dist/parser/har-loader.js +0 -14
- package/dist/parser/har-normalizer.d.ts +0 -20
- package/dist/parser/har-normalizer.js +0 -78
- package/dist/parser/index.d.ts +0 -10
- package/dist/parser/index.js +0 -6
- package/dist/parser/openapi-loader.d.ts +0 -6
- package/dist/parser/openapi-loader.js +0 -308
- package/dist/parser/operation-extractor.d.ts +0 -13
- package/dist/parser/operation-extractor.js +0 -155
- package/dist/parser/overlay-loader.d.ts +0 -10
- package/dist/parser/overlay-loader.js +0 -184
- package/dist/parser/postman-loader.d.ts +0 -9
- package/dist/parser/postman-loader.js +0 -106
- package/dist/parser/schema-converter.d.ts +0 -12
- package/dist/parser/schema-converter.js +0 -117
- package/dist/plugins/adapter.d.ts +0 -40
- package/dist/plugins/adapter.js +0 -15
- package/dist/plugins/loader.d.ts +0 -25
- package/dist/plugins/loader.js +0 -58
- package/dist/pricing.d.ts +0 -55
- package/dist/pricing.js +0 -133
- package/dist/providers/index.d.ts +0 -15
- package/dist/providers/index.js +0 -56
- package/dist/recorder/browser-recorder.d.ts +0 -22
- package/dist/recorder/browser-recorder.js +0 -205
- package/dist/rescan/diff-engine.d.ts +0 -5
- package/dist/rescan/diff-engine.js +0 -312
- package/dist/rescan/index.d.ts +0 -3
- package/dist/rescan/index.js +0 -2
- package/dist/rescan/rescan-runner.d.ts +0 -42
- package/dist/rescan/rescan-runner.js +0 -69
- package/dist/rescan/rescan-scheduler.d.ts +0 -41
- package/dist/rescan/rescan-scheduler.js +0 -179
- package/dist/site-transformer/browser-tools.d.ts +0 -10
- package/dist/site-transformer/browser-tools.js +0 -59
- package/dist/site-transformer/index.d.ts +0 -2
- package/dist/site-transformer/index.js +0 -2
- package/dist/site-transformer/selector-healer.d.ts +0 -8
- package/dist/site-transformer/selector-healer.js +0 -106
- package/dist/site-transformer/tool-generator.d.ts +0 -13
- package/dist/site-transformer/tool-generator.js +0 -245
- package/dist/transformer/auth-detector.d.ts +0 -13
- package/dist/transformer/auth-detector.js +0 -90
- package/dist/transformer/catalog-builder.d.ts +0 -18
- package/dist/transformer/catalog-builder.js +0 -56
- package/dist/transformer/client-compat.d.ts +0 -6
- package/dist/transformer/client-compat.js +0 -44
- package/dist/transformer/har-clusterer.d.ts +0 -9
- package/dist/transformer/har-clusterer.js +0 -27
- package/dist/transformer/har-dedup.d.ts +0 -10
- package/dist/transformer/har-dedup.js +0 -81
- package/dist/transformer/har-schema-inferrer.d.ts +0 -15
- package/dist/transformer/har-schema-inferrer.js +0 -90
- package/dist/transformer/har-to-operations.d.ts +0 -13
- package/dist/transformer/har-to-operations.js +0 -192
- package/dist/transformer/index.d.ts +0 -8
- package/dist/transformer/index.js +0 -6
- package/dist/transformer/llm-namer.d.ts +0 -6
- package/dist/transformer/llm-namer.js +0 -59
- package/dist/transformer/naming.d.ts +0 -4
- package/dist/transformer/naming.js +0 -30
- package/dist/transformer/operation-filter.d.ts +0 -13
- package/dist/transformer/operation-filter.js +0 -52
- package/dist/transformer/resource-builder.d.ts +0 -12
- package/dist/transformer/resource-builder.js +0 -80
- package/dist/transformer/schema-merger.d.ts +0 -14
- package/dist/transformer/schema-merger.js +0 -65
- package/dist/transformer/tool-builder.d.ts +0 -3
- package/dist/transformer/tool-builder.js +0 -114
- package/dist/types/index.d.ts +0 -131
- package/dist/types/index.js +0 -1
- package/dist/types/site.d.ts +0 -284
- package/dist/types/site.js +0 -8
- package/dist/utils/fail.d.ts +0 -48
- package/dist/utils/fail.js +0 -204
- package/dist/utils/fs.d.ts +0 -5
- package/dist/utils/fs.js +0 -28
- package/dist/utils/interactive.d.ts +0 -6
- package/dist/utils/interactive.js +0 -30
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -2
- package/dist/utils/sanitize.d.ts +0 -28
- package/dist/utils/sanitize.js +0 -44
- package/dist/utils/watcher.d.ts +0 -11
- package/dist/utils/watcher.js +0 -36
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<div class="pricing-grid">
|
|
2
|
-
<!-- Free -->
|
|
3
|
-
<article class="pricing-card">
|
|
4
|
-
<div class="pricing-card-header">
|
|
5
|
-
<h3 class="pricing-tier-name">Free</h3>
|
|
6
|
-
<div class="pricing-amount"><span class="pricing-currency">$</span><span class="pricing-value">0</span><span class="pricing-period">/mo</span></div>
|
|
7
|
-
<p class="pricing-tagline">Get started instantly</p>
|
|
8
|
-
</div>
|
|
9
|
-
<ul class="pricing-features">
|
|
10
|
-
<li>1 MCP server</li>
|
|
11
|
-
<li>500 requests / month</li>
|
|
12
|
-
<li>8-hour idle shutdown</li>
|
|
13
|
-
<li>Community support</li>
|
|
14
|
-
</ul>
|
|
15
|
-
<div class="pricing-card-footer">
|
|
16
|
-
<a href="/register" class="btn btn-secondary btn-block">Get started</a>
|
|
17
|
-
<p class="pricing-note">No credit card required</p>
|
|
18
|
-
</div>
|
|
19
|
-
</article>
|
|
20
|
-
|
|
21
|
-
<!-- Hobbyist -->
|
|
22
|
-
<article class="pricing-card">
|
|
23
|
-
<div class="pricing-card-header">
|
|
24
|
-
<h3 class="pricing-tier-name">Hobbyist</h3>
|
|
25
|
-
<div class="pricing-amount"><span class="pricing-currency">$</span><span class="pricing-value">9</span><span class="pricing-period">/mo</span></div>
|
|
26
|
-
<p class="pricing-tagline">For side projects</p>
|
|
27
|
-
</div>
|
|
28
|
-
<ul class="pricing-features">
|
|
29
|
-
<li>5 MCP servers</li>
|
|
30
|
-
<li>10,000 requests / month</li>
|
|
31
|
-
<li>24-hour keep-alive</li>
|
|
32
|
-
<li>Email support</li>
|
|
33
|
-
</ul>
|
|
34
|
-
<div class="pricing-card-footer">
|
|
35
|
-
{{#if csrfToken}}
|
|
36
|
-
<form method="POST" action="/dashboard/billing/checkout">
|
|
37
|
-
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
|
38
|
-
<input type="hidden" name="plan" value="hobbyist">
|
|
39
|
-
<button type="submit" class="btn btn-secondary btn-block">Subscribe</button>
|
|
40
|
-
</form>
|
|
41
|
-
{{else}}
|
|
42
|
-
<a href="/register?plan=hobbyist" class="btn btn-secondary btn-block">Subscribe</a>
|
|
43
|
-
{{/if}}
|
|
44
|
-
</div>
|
|
45
|
-
</article>
|
|
46
|
-
|
|
47
|
-
<!-- Pro (featured) -->
|
|
48
|
-
<article class="pricing-card pricing-card--featured">
|
|
49
|
-
<div class="pricing-badge">Popular</div>
|
|
50
|
-
<div class="pricing-card-header">
|
|
51
|
-
<h3 class="pricing-tier-name">Pro</h3>
|
|
52
|
-
<div class="pricing-amount"><span class="pricing-currency">$</span><span class="pricing-value">29</span><span class="pricing-period">/mo</span></div>
|
|
53
|
-
<p class="pricing-tagline">For production APIs</p>
|
|
54
|
-
</div>
|
|
55
|
-
<ul class="pricing-features">
|
|
56
|
-
<li>20 MCP servers</li>
|
|
57
|
-
<li>100,000 requests / month</li>
|
|
58
|
-
<li>Always-on servers</li>
|
|
59
|
-
<li>Custom domain</li>
|
|
60
|
-
<li>90-day log retention</li>
|
|
61
|
-
<li>Priority support</li>
|
|
62
|
-
</ul>
|
|
63
|
-
<div class="pricing-card-footer">
|
|
64
|
-
{{#if csrfToken}}
|
|
65
|
-
<form method="POST" action="/dashboard/billing/checkout">
|
|
66
|
-
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
|
67
|
-
<input type="hidden" name="plan" value="pro">
|
|
68
|
-
<button type="submit" class="btn btn-primary btn-block">Subscribe</button>
|
|
69
|
-
</form>
|
|
70
|
-
{{else}}
|
|
71
|
-
<a href="/register?plan=pro" class="btn btn-primary btn-block">Subscribe</a>
|
|
72
|
-
{{/if}}
|
|
73
|
-
</div>
|
|
74
|
-
</article>
|
|
75
|
-
|
|
76
|
-
<!-- Team -->
|
|
77
|
-
<article class="pricing-card">
|
|
78
|
-
<div class="pricing-card-header">
|
|
79
|
-
<h3 class="pricing-tier-name">Team</h3>
|
|
80
|
-
<div class="pricing-amount"><span class="pricing-currency">$</span><span class="pricing-value">99</span><span class="pricing-period">/mo</span></div>
|
|
81
|
-
<p class="pricing-tagline">For organizations</p>
|
|
82
|
-
</div>
|
|
83
|
-
<ul class="pricing-features">
|
|
84
|
-
<li>Unlimited MCP servers</li>
|
|
85
|
-
<li>1,000,000 requests / month</li>
|
|
86
|
-
<li>Always-on servers</li>
|
|
87
|
-
<li>RBAC & workspaces</li>
|
|
88
|
-
<li>Audit logs</li>
|
|
89
|
-
<li>Dedicated support</li>
|
|
90
|
-
</ul>
|
|
91
|
-
<div class="pricing-card-footer">
|
|
92
|
-
{{#if csrfToken}}
|
|
93
|
-
<form method="POST" action="/dashboard/billing/checkout">
|
|
94
|
-
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
|
95
|
-
<input type="hidden" name="plan" value="team">
|
|
96
|
-
<button type="submit" class="btn btn-primary btn-block">Subscribe</button>
|
|
97
|
-
</form>
|
|
98
|
-
{{else}}
|
|
99
|
-
<a href="/register?plan=team" class="btn btn-secondary btn-block">Subscribe</a>
|
|
100
|
-
{{/if}}
|
|
101
|
-
</div>
|
|
102
|
-
</article>
|
|
103
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<div class="server-card">
|
|
2
|
-
<div class="server-card-header">
|
|
3
|
-
<a href="/dashboard/servers/{{slug}}" class="server-card-name">{{slug}}</a>
|
|
4
|
-
{{> status-badge status=status}}
|
|
5
|
-
</div>
|
|
6
|
-
<div class="server-card-meta">
|
|
7
|
-
<span>{{toolCount}} tools</span>
|
|
8
|
-
<span>Last active: {{formatDate lastActiveAt}}</span>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="server-card-actions">
|
|
11
|
-
<a href="/dashboard/servers/{{slug}}" class="btn btn-sm btn-secondary">View</a>
|
|
12
|
-
<a href="/dashboard/servers/{{slug}}/logs" class="btn btn-sm btn-secondary">Logs</a>
|
|
13
|
-
<form method="POST" action="/dashboard/servers/{{slug}}/delete"
|
|
14
|
-
x-data x-on:submit.prevent="if(confirm('Delete server {{slug}}?')) $el.submit()">
|
|
15
|
-
<input type="hidden" name="_csrf" value="{{csrfToken}}">
|
|
16
|
-
<button type="submit" class="btn btn-sm btn-danger">Delete</button>
|
|
17
|
-
</form>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<span class="status-badge status-{{status}}">{{status}}</span>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wraps a citty command so it honours `.mcpmake.yaml`: a `--config` flag is
|
|
3
|
-
* added and config-file values are overlaid onto the parsed args (without
|
|
4
|
-
* overriding explicit CLI flags) right before the command runs.
|
|
5
|
-
*/
|
|
6
|
-
import { type ArgsDef, type CommandDef } from 'citty';
|
|
7
|
-
/**
|
|
8
|
-
* Drop-in replacement for `defineCommand` that layers `.mcpmake.yaml` config in.
|
|
9
|
-
*
|
|
10
|
-
* @param commandName Name used to look up a per-command override section.
|
|
11
|
-
* @param def The command definition (same shape as `defineCommand`).
|
|
12
|
-
*/
|
|
13
|
-
export declare function defineConfigurableCommand<T extends ArgsDef>(commandName: string, def: CommandDef<T>): CommandDef<T>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wraps a citty command so it honours `.mcpmake.yaml`: a `--config` flag is
|
|
3
|
-
* added and config-file values are overlaid onto the parsed args (without
|
|
4
|
-
* overriding explicit CLI flags) right before the command runs.
|
|
5
|
-
*/
|
|
6
|
-
import { defineCommand } from 'citty';
|
|
7
|
-
import { applyConfigToArgs, displayPath } from './mcpmake-config.js';
|
|
8
|
-
import { logger } from '../utils/logger.js';
|
|
9
|
-
import { fail } from '../utils/fail.js';
|
|
10
|
-
const CONFIG_ARG = {
|
|
11
|
-
type: 'string',
|
|
12
|
-
description: 'Path to a .mcpmake.yaml config file (default: auto-discovered in the working directory)',
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Drop-in replacement for `defineCommand` that layers `.mcpmake.yaml` config in.
|
|
16
|
-
*
|
|
17
|
-
* @param commandName Name used to look up a per-command override section.
|
|
18
|
-
* @param def The command definition (same shape as `defineCommand`).
|
|
19
|
-
*/
|
|
20
|
-
export function defineConfigurableCommand(commandName, def) {
|
|
21
|
-
const originalRun = def.run;
|
|
22
|
-
const baseArgs = (def.args && typeof def.args === 'object' ? def.args : {});
|
|
23
|
-
// citty enforces `required` during parsing — before our config overlay runs —
|
|
24
|
-
// so a required *flag* the user supplied via .mcpmake.yaml would be rejected.
|
|
25
|
-
// Relax those flags for citty and re-validate after merging config below.
|
|
26
|
-
// (Required positionals stay enforced: they always belong on the command line.)
|
|
27
|
-
const requiredFlags = [];
|
|
28
|
-
const relaxedArgs = {};
|
|
29
|
-
for (const [name, d] of Object.entries(baseArgs)) {
|
|
30
|
-
const ad = d;
|
|
31
|
-
if (ad.required === true && ad.type !== 'positional' && ad.default === undefined) {
|
|
32
|
-
requiredFlags.push(name);
|
|
33
|
-
relaxedArgs[name] = { ...d, required: false };
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
relaxedArgs[name] = d;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const argsWithConfig = { ...relaxedArgs, config: CONFIG_ARG };
|
|
40
|
-
return defineCommand({
|
|
41
|
-
...def,
|
|
42
|
-
args: argsWithConfig,
|
|
43
|
-
async run(ctx) {
|
|
44
|
-
const args = ctx.args;
|
|
45
|
-
try {
|
|
46
|
-
const result = applyConfigToArgs(args, ctx.rawArgs, commandName, argsWithConfig, {
|
|
47
|
-
configPath: typeof args.config === 'string' ? args.config : undefined,
|
|
48
|
-
});
|
|
49
|
-
if (result.path && result.applied.length > 0) {
|
|
50
|
-
logger.info(`Loaded ${result.applied.length} setting(s) from ${displayPath(result.path)}: ` +
|
|
51
|
-
result.applied.join(', '));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
await fail(`Config error: ${err instanceof Error ? err.message : String(err)}`, err);
|
|
56
|
-
}
|
|
57
|
-
// Re-enforce required flags now that config has been applied.
|
|
58
|
-
const missing = requiredFlags.filter((k) => {
|
|
59
|
-
const v = args[k];
|
|
60
|
-
return v === undefined || v === null || v === '';
|
|
61
|
-
});
|
|
62
|
-
if (missing.length > 0) {
|
|
63
|
-
await fail(missing
|
|
64
|
-
.map((k) => `Missing required argument: --${k} (set it on the command line or in .mcpmake.yaml)`)
|
|
65
|
-
.join('\n'));
|
|
66
|
-
}
|
|
67
|
-
return originalRun?.(ctx);
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `.mcpmake.yaml` project config — kills CLI-flag repetition and enables
|
|
3
|
-
* team-shared, version-controlled generation settings.
|
|
4
|
-
*
|
|
5
|
-
* Schema: top-level keys are global defaults applied to every command; an
|
|
6
|
-
* optional section keyed by a command name overrides them for that command.
|
|
7
|
-
*
|
|
8
|
-
* # .mcpmake.yaml
|
|
9
|
-
* output: ./generated # global default for all commands
|
|
10
|
-
* transport: http
|
|
11
|
-
* format: typescript
|
|
12
|
-
* openapi: # per-command overrides
|
|
13
|
-
* base-url: https://api.example.com
|
|
14
|
-
* include: [users, repos] # arrays map to the comma-separated flag form
|
|
15
|
-
* deploy:
|
|
16
|
-
* url: https://mcpmake.dev
|
|
17
|
-
*
|
|
18
|
-
* Precedence (highest wins): explicit CLI flag > per-command section >
|
|
19
|
-
* global key > the command's built-in default. Positional args (e.g. the spec
|
|
20
|
-
* path) are never taken from config — they stay on the command line.
|
|
21
|
-
*/
|
|
22
|
-
import type { ArgsDef } from 'citty';
|
|
23
|
-
/** Command names that may appear as config sections (vs. global keys). */
|
|
24
|
-
export declare const KNOWN_COMMANDS: Set<string>;
|
|
25
|
-
export interface LoadedConfig {
|
|
26
|
-
path: string;
|
|
27
|
-
data: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
export interface ConfigEnv {
|
|
30
|
-
/** Explicit path from a `--config` flag (highest priority). */
|
|
31
|
-
configPath?: string;
|
|
32
|
-
env?: NodeJS.ProcessEnv;
|
|
33
|
-
cwd?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Resolve which config file to use, or null if none.
|
|
37
|
-
*
|
|
38
|
-
* Order: explicit `--config` path → `MCPMAKE_CONFIG` env → auto-discovered
|
|
39
|
-
* `.mcpmake.yaml`/`.yml` in the working directory. An explicit path that does
|
|
40
|
-
* not exist is an error; auto-discovery silently yields null.
|
|
41
|
-
*/
|
|
42
|
-
export declare function findConfigPath(deps?: ConfigEnv): string | null;
|
|
43
|
-
/** Read + parse the config file, or null when there is none. Throws on malformed YAML. */
|
|
44
|
-
export declare function loadConfig(deps?: ConfigEnv): LoadedConfig | null;
|
|
45
|
-
/** Global keys = every top-level key that is not a command section. */
|
|
46
|
-
export declare function globalConfig(data: Record<string, unknown>): Record<string, unknown>;
|
|
47
|
-
/** The per-command override section, or an empty object. */
|
|
48
|
-
export declare function sectionConfig(data: Record<string, unknown>, commandName: string): Record<string, unknown>;
|
|
49
|
-
/**
|
|
50
|
-
* Set of arg names explicitly present on the command line (so they win over
|
|
51
|
-
* config). Scans the raw argv: `--name`, `--name=v`, and `--no-name` all mark
|
|
52
|
-
* `name`; short aliases (`-o`) resolve through the arg spec. Stops at `--`.
|
|
53
|
-
*/
|
|
54
|
-
export declare function explicitFlags(rawArgs: string[], argSpec: ArgsDef): Set<string>;
|
|
55
|
-
export interface ApplyResult {
|
|
56
|
-
/** Path of the config file used, or null when none applied. */
|
|
57
|
-
path: string | null;
|
|
58
|
-
/** Arg names that were filled from config (not overridden by a CLI flag). */
|
|
59
|
-
applied: string[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Overlay config-file values onto already-parsed citty `args`, mutating it in
|
|
63
|
-
* place. CLI flags (detected via rawArgs) and positionals are never touched.
|
|
64
|
-
* Returns which keys were applied so the caller can surface it.
|
|
65
|
-
*/
|
|
66
|
-
export declare function applyConfigToArgs(args: Record<string, unknown>, rawArgs: string[], commandName: string, argSpec: ArgsDef, deps?: ConfigEnv): ApplyResult;
|
|
67
|
-
/** Render a config path relative to cwd for friendly logging. */
|
|
68
|
-
export declare function displayPath(path: string, cwd?: string): string;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `.mcpmake.yaml` project config — kills CLI-flag repetition and enables
|
|
3
|
-
* team-shared, version-controlled generation settings.
|
|
4
|
-
*
|
|
5
|
-
* Schema: top-level keys are global defaults applied to every command; an
|
|
6
|
-
* optional section keyed by a command name overrides them for that command.
|
|
7
|
-
*
|
|
8
|
-
* # .mcpmake.yaml
|
|
9
|
-
* output: ./generated # global default for all commands
|
|
10
|
-
* transport: http
|
|
11
|
-
* format: typescript
|
|
12
|
-
* openapi: # per-command overrides
|
|
13
|
-
* base-url: https://api.example.com
|
|
14
|
-
* include: [users, repos] # arrays map to the comma-separated flag form
|
|
15
|
-
* deploy:
|
|
16
|
-
* url: https://mcpmake.dev
|
|
17
|
-
*
|
|
18
|
-
* Precedence (highest wins): explicit CLI flag > per-command section >
|
|
19
|
-
* global key > the command's built-in default. Positional args (e.g. the spec
|
|
20
|
-
* path) are never taken from config — they stay on the command line.
|
|
21
|
-
*/
|
|
22
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
23
|
-
import { isAbsolute, relative, resolve } from 'node:path';
|
|
24
|
-
import { parse as parseYaml } from 'yaml';
|
|
25
|
-
import { logger } from '../utils/logger.js';
|
|
26
|
-
/** Command names that may appear as config sections (vs. global keys). */
|
|
27
|
-
export const KNOWN_COMMANDS = new Set([
|
|
28
|
-
'openapi',
|
|
29
|
-
'har',
|
|
30
|
-
'url',
|
|
31
|
-
'describe',
|
|
32
|
-
'postman',
|
|
33
|
-
'website',
|
|
34
|
-
'deploy',
|
|
35
|
-
'verify',
|
|
36
|
-
'update',
|
|
37
|
-
'publish',
|
|
38
|
-
'merge',
|
|
39
|
-
'lint',
|
|
40
|
-
'diff',
|
|
41
|
-
'bundle',
|
|
42
|
-
'ci',
|
|
43
|
-
]);
|
|
44
|
-
const CONFIG_FILENAMES = ['.mcpmake.yaml', '.mcpmake.yml'];
|
|
45
|
-
function isPlainObject(v) {
|
|
46
|
-
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Resolve which config file to use, or null if none.
|
|
50
|
-
*
|
|
51
|
-
* Order: explicit `--config` path → `MCPMAKE_CONFIG` env → auto-discovered
|
|
52
|
-
* `.mcpmake.yaml`/`.yml` in the working directory. An explicit path that does
|
|
53
|
-
* not exist is an error; auto-discovery silently yields null.
|
|
54
|
-
*/
|
|
55
|
-
export function findConfigPath(deps = {}) {
|
|
56
|
-
const cwd = deps.cwd ?? process.cwd();
|
|
57
|
-
const env = deps.env ?? process.env;
|
|
58
|
-
const explicit = deps.configPath || env.MCPMAKE_CONFIG;
|
|
59
|
-
if (explicit) {
|
|
60
|
-
const p = isAbsolute(explicit) ? explicit : resolve(cwd, explicit);
|
|
61
|
-
if (!existsSync(p)) {
|
|
62
|
-
throw new Error(`Config file not found: ${explicit}`);
|
|
63
|
-
}
|
|
64
|
-
return p;
|
|
65
|
-
}
|
|
66
|
-
for (const name of CONFIG_FILENAMES) {
|
|
67
|
-
const p = resolve(cwd, name);
|
|
68
|
-
if (existsSync(p))
|
|
69
|
-
return p;
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
/** Read + parse the config file, or null when there is none. Throws on malformed YAML. */
|
|
74
|
-
export function loadConfig(deps = {}) {
|
|
75
|
-
const path = findConfigPath(deps);
|
|
76
|
-
if (!path)
|
|
77
|
-
return null;
|
|
78
|
-
const raw = readFileSync(path, 'utf8');
|
|
79
|
-
let parsed;
|
|
80
|
-
try {
|
|
81
|
-
parsed = parseYaml(raw);
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
throw new Error(`Failed to parse ${path}: ${err instanceof Error ? err.message : String(err)}`);
|
|
85
|
-
}
|
|
86
|
-
if (parsed == null)
|
|
87
|
-
return { path, data: {} };
|
|
88
|
-
if (!isPlainObject(parsed)) {
|
|
89
|
-
throw new Error(`Config file ${path} must be a YAML mapping (key: value pairs)`);
|
|
90
|
-
}
|
|
91
|
-
return { path, data: parsed };
|
|
92
|
-
}
|
|
93
|
-
/** Global keys = every top-level key that is not a command section. */
|
|
94
|
-
export function globalConfig(data) {
|
|
95
|
-
const out = {};
|
|
96
|
-
for (const [k, v] of Object.entries(data)) {
|
|
97
|
-
if (KNOWN_COMMANDS.has(k) && isPlainObject(v))
|
|
98
|
-
continue;
|
|
99
|
-
out[k] = v;
|
|
100
|
-
}
|
|
101
|
-
return out;
|
|
102
|
-
}
|
|
103
|
-
/** The per-command override section, or an empty object. */
|
|
104
|
-
export function sectionConfig(data, commandName) {
|
|
105
|
-
const section = data[commandName];
|
|
106
|
-
return isPlainObject(section) ? section : {};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Set of arg names explicitly present on the command line (so they win over
|
|
110
|
-
* config). Scans the raw argv: `--name`, `--name=v`, and `--no-name` all mark
|
|
111
|
-
* `name`; short aliases (`-o`) resolve through the arg spec. Stops at `--`.
|
|
112
|
-
*/
|
|
113
|
-
export function explicitFlags(rawArgs, argSpec) {
|
|
114
|
-
const aliasToName = {};
|
|
115
|
-
for (const [name, def] of Object.entries(argSpec)) {
|
|
116
|
-
const alias = def.alias;
|
|
117
|
-
if (!alias)
|
|
118
|
-
continue;
|
|
119
|
-
for (const a of Array.isArray(alias) ? alias : [alias]) {
|
|
120
|
-
aliasToName[a] = name;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const set = new Set();
|
|
124
|
-
for (const tok of rawArgs) {
|
|
125
|
-
if (tok === '--')
|
|
126
|
-
break;
|
|
127
|
-
if (tok.startsWith('--')) {
|
|
128
|
-
const raw = tok.slice(2).split('=')[0];
|
|
129
|
-
if (!raw)
|
|
130
|
-
continue;
|
|
131
|
-
// `--no-force` negates a boolean `force`, but an arg may also be *named*
|
|
132
|
-
// `no-resources` (a positive flag). Prefer a literal arg-name match; only
|
|
133
|
-
// strip `no-` when the bare name is the real arg.
|
|
134
|
-
if (!(raw in argSpec) && raw.startsWith('no-') && raw.slice(3) in argSpec) {
|
|
135
|
-
set.add(raw.slice(3));
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
set.add(raw);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else if (tok.length > 1 && tok[0] === '-' && !/^-\d/.test(tok)) {
|
|
142
|
-
// Short flag(s): support bundled forms like -fw.
|
|
143
|
-
for (const ch of tok.slice(1)) {
|
|
144
|
-
const name = aliasToName[ch];
|
|
145
|
-
if (name)
|
|
146
|
-
set.add(name);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return set;
|
|
151
|
-
}
|
|
152
|
-
/** Coerce a YAML value to the type the citty arg expects. */
|
|
153
|
-
function coerceValue(value, type) {
|
|
154
|
-
if (type === 'boolean') {
|
|
155
|
-
if (typeof value === 'boolean')
|
|
156
|
-
return value;
|
|
157
|
-
if (typeof value === 'string') {
|
|
158
|
-
return value === 'true' || value === '1' || value === 'yes';
|
|
159
|
-
}
|
|
160
|
-
return Boolean(value);
|
|
161
|
-
}
|
|
162
|
-
if (type === 'string') {
|
|
163
|
-
if (Array.isArray(value))
|
|
164
|
-
return value.join(',');
|
|
165
|
-
return value == null ? value : String(value);
|
|
166
|
-
}
|
|
167
|
-
return value;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Overlay config-file values onto already-parsed citty `args`, mutating it in
|
|
171
|
-
* place. CLI flags (detected via rawArgs) and positionals are never touched.
|
|
172
|
-
* Returns which keys were applied so the caller can surface it.
|
|
173
|
-
*/
|
|
174
|
-
export function applyConfigToArgs(args, rawArgs, commandName, argSpec, deps = {}) {
|
|
175
|
-
const loaded = loadConfig(deps);
|
|
176
|
-
if (!loaded)
|
|
177
|
-
return { path: null, applied: [] };
|
|
178
|
-
const global = globalConfig(loaded.data);
|
|
179
|
-
const section = sectionConfig(loaded.data, commandName);
|
|
180
|
-
// Warn on typos in a command-specific section (global keys may legitimately
|
|
181
|
-
// target other commands, so those are not warned).
|
|
182
|
-
for (const key of Object.keys(section)) {
|
|
183
|
-
if (!(key in argSpec)) {
|
|
184
|
-
logger.warn(`Unknown setting "${commandName}.${key}" in ${loaded.path} — ignored`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const merged = { ...global, ...section };
|
|
188
|
-
const explicit = explicitFlags(rawArgs, argSpec);
|
|
189
|
-
const applied = [];
|
|
190
|
-
for (const [key, value] of Object.entries(merged)) {
|
|
191
|
-
const def = argSpec[key];
|
|
192
|
-
if (!def)
|
|
193
|
-
continue; // unknown global key — silently skip (may target another command)
|
|
194
|
-
if (def.type === 'positional')
|
|
195
|
-
continue; // positionals stay on the CLI
|
|
196
|
-
if (explicit.has(key))
|
|
197
|
-
continue; // explicit CLI flag wins
|
|
198
|
-
args[key] = coerceValue(value, def.type);
|
|
199
|
-
applied.push(key);
|
|
200
|
-
}
|
|
201
|
-
return { path: loaded.path, applied };
|
|
202
|
-
}
|
|
203
|
-
/** Render a config path relative to cwd for friendly logging. */
|
|
204
|
-
export function displayPath(path, cwd = process.cwd()) {
|
|
205
|
-
const rel = relative(cwd, path);
|
|
206
|
-
return rel && !rel.startsWith('..') ? rel : path;
|
|
207
|
-
}
|