@kindgi/cli 0.0.0-bootstrap.0 → 0.1.1
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/LICENSE +201 -0
- package/README.md +738 -1
- package/dist/build/apt.d.ts +16 -0
- package/dist/build/apt.d.ts.map +1 -0
- package/dist/build/apt.js +50 -0
- package/dist/build/apt.js.map +1 -0
- package/dist/build/bundle.d.ts +48 -0
- package/dist/build/bundle.d.ts.map +1 -0
- package/dist/build/bundle.js +125 -0
- package/dist/build/bundle.js.map +1 -0
- package/dist/build/containerfile.d.ts +27 -0
- package/dist/build/containerfile.d.ts.map +1 -0
- package/dist/build/containerfile.js +197 -0
- package/dist/build/containerfile.js.map +1 -0
- package/dist/build/context-files.d.ts +24 -0
- package/dist/build/context-files.d.ts.map +1 -0
- package/dist/build/context-files.js +99 -0
- package/dist/build/context-files.js.map +1 -0
- package/dist/build/defaults.d.ts +66 -0
- package/dist/build/defaults.d.ts.map +1 -0
- package/dist/build/defaults.js +597 -0
- package/dist/build/defaults.js.map +1 -0
- package/dist/build/envelope.d.ts +72 -0
- package/dist/build/envelope.d.ts.map +1 -0
- package/dist/build/envelope.js +76 -0
- package/dist/build/envelope.js.map +1 -0
- package/dist/build/host-install.d.ts +100 -0
- package/dist/build/host-install.d.ts.map +1 -0
- package/dist/build/host-install.js +443 -0
- package/dist/build/host-install.js.map +1 -0
- package/dist/build/image-config.d.ts +32 -0
- package/dist/build/image-config.d.ts.map +1 -0
- package/dist/build/image-config.js +129 -0
- package/dist/build/image-config.js.map +1 -0
- package/dist/build/integrity.d.ts +51 -0
- package/dist/build/integrity.d.ts.map +1 -0
- package/dist/build/integrity.js +75 -0
- package/dist/build/integrity.js.map +1 -0
- package/dist/build/node-image.d.ts +18 -0
- package/dist/build/node-image.d.ts.map +1 -0
- package/dist/build/node-image.js +46 -0
- package/dist/build/node-image.js.map +1 -0
- package/dist/build/pack-root.d.ts +69 -0
- package/dist/build/pack-root.d.ts.map +1 -0
- package/dist/build/pack-root.js +102 -0
- package/dist/build/pack-root.js.map +1 -0
- package/dist/build/poetry-requirements.d.ts +5 -0
- package/dist/build/poetry-requirements.d.ts.map +1 -0
- package/dist/build/poetry-requirements.js +8 -0
- package/dist/build/poetry-requirements.js.map +1 -0
- package/dist/build/python-image.d.ts +40 -0
- package/dist/build/python-image.d.ts.map +1 -0
- package/dist/build/python-image.js +197 -0
- package/dist/build/python-image.js.map +1 -0
- package/dist/build/runners.d.ts +259 -0
- package/dist/build/runners.d.ts.map +1 -0
- package/dist/build/runners.js +4 -0
- package/dist/build/runners.js.map +1 -0
- package/dist/build/version-specifier.d.ts +2 -0
- package/dist/build/version-specifier.d.ts.map +1 -0
- package/dist/build/version-specifier.js +70 -0
- package/dist/build/version-specifier.js.map +1 -0
- package/dist/cli-package.d.ts +15 -0
- package/dist/cli-package.d.ts.map +1 -0
- package/dist/cli-package.js +37 -0
- package/dist/cli-package.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/adapters.d.ts +3 -0
- package/dist/commands/adapters.d.ts.map +1 -0
- package/dist/commands/adapters.js +148 -0
- package/dist/commands/adapters.js.map +1 -0
- package/dist/commands/agents.d.ts +3 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +82 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/approvals.d.ts +3 -0
- package/dist/commands/approvals.d.ts.map +1 -0
- package/dist/commands/approvals.js +92 -0
- package/dist/commands/approvals.js.map +1 -0
- package/dist/commands/artifacts.d.ts +3 -0
- package/dist/commands/artifacts.d.ts.map +1 -0
- package/dist/commands/artifacts.js +87 -0
- package/dist/commands/artifacts.js.map +1 -0
- package/dist/commands/auth.d.ts +25 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +283 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/build.d.ts +46 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +902 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/capabilities.d.ts +3 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +38 -0
- package/dist/commands/capabilities.js.map +1 -0
- package/dist/commands/conversations.d.ts +3 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +75 -0
- package/dist/commands/conversations.js.map +1 -0
- package/dist/commands/deploy.d.ts +7 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +697 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +43 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +1110 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/env.d.ts +27 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +816 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/feedback.d.ts +33 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +374 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/flows.d.ts +3 -0
- package/dist/commands/flows.d.ts.map +1 -0
- package/dist/commands/flows.js +60 -0
- package/dist/commands/flows.js.map +1 -0
- package/dist/commands/guardrails.d.ts +3 -0
- package/dist/commands/guardrails.d.ts.map +1 -0
- package/dist/commands/guardrails.js +89 -0
- package/dist/commands/guardrails.js.map +1 -0
- package/dist/commands/health.d.ts +8 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +40 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/helpers.d.ts +48 -0
- package/dist/commands/helpers.d.ts.map +1 -0
- package/dist/commands/helpers.js +110 -0
- package/dist/commands/helpers.js.map +1 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +90 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +46 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +454 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/key.d.ts +3 -0
- package/dist/commands/key.d.ts.map +1 -0
- package/dist/commands/key.js +322 -0
- package/dist/commands/key.js.map +1 -0
- package/dist/commands/mcp.d.ts +43 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +433 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/memory.d.ts +3 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +82 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/observations.d.ts +3 -0
- package/dist/commands/observations.d.ts.map +1 -0
- package/dist/commands/observations.js +27 -0
- package/dist/commands/observations.js.map +1 -0
- package/dist/commands/proposals.d.ts +3 -0
- package/dist/commands/proposals.d.ts.map +1 -0
- package/dist/commands/proposals.js +116 -0
- package/dist/commands/proposals.js.map +1 -0
- package/dist/commands/provenance.d.ts +3 -0
- package/dist/commands/provenance.d.ts.map +1 -0
- package/dist/commands/provenance.js +53 -0
- package/dist/commands/provenance.js.map +1 -0
- package/dist/commands/providers.d.ts +3 -0
- package/dist/commands/providers.d.ts.map +1 -0
- package/dist/commands/providers.js +212 -0
- package/dist/commands/providers.js.map +1 -0
- package/dist/commands/reviewers.d.ts +3 -0
- package/dist/commands/reviewers.d.ts.map +1 -0
- package/dist/commands/reviewers.js +78 -0
- package/dist/commands/reviewers.js.map +1 -0
- package/dist/commands/runs.d.ts +3 -0
- package/dist/commands/runs.d.ts.map +1 -0
- package/dist/commands/runs.js +223 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/secrets.d.ts +18 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +702 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/skills.d.ts +64 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +430 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/test.d.ts +5 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +181 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/tokens.d.ts +3 -0
- package/dist/commands/tokens.d.ts.map +1 -0
- package/dist/commands/tokens.js +33 -0
- package/dist/commands/tokens.js.map +1 -0
- package/dist/commands/tools.d.ts +3 -0
- package/dist/commands/tools.d.ts.map +1 -0
- package/dist/commands/tools.js +162 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/types.d.ts +54 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +4 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/unwired.d.ts +22 -0
- package/dist/commands/unwired.d.ts.map +1 -0
- package/dist/commands/unwired.js +52 -0
- package/dist/commands/unwired.js.map +1 -0
- package/dist/commands/version.d.ts +8 -0
- package/dist/commands/version.d.ts.map +1 -0
- package/dist/commands/version.js +41 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +83 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +162 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +45 -0
- package/dist/context.js.map +1 -0
- package/dist/deploy/defaults.d.ts +14 -0
- package/dist/deploy/defaults.d.ts.map +1 -0
- package/dist/deploy/defaults.js +37 -0
- package/dist/deploy/defaults.js.map +1 -0
- package/dist/deploy/envelope-loader.d.ts +24 -0
- package/dist/deploy/envelope-loader.d.ts.map +1 -0
- package/dist/deploy/envelope-loader.js +141 -0
- package/dist/deploy/envelope-loader.js.map +1 -0
- package/dist/deploy/post.d.ts +48 -0
- package/dist/deploy/post.d.ts.map +1 -0
- package/dist/deploy/post.js +210 -0
- package/dist/deploy/post.js.map +1 -0
- package/dist/deploy/response.d.ts +42 -0
- package/dist/deploy/response.d.ts.map +1 -0
- package/dist/deploy/response.js +128 -0
- package/dist/deploy/response.js.map +1 -0
- package/dist/deploy/runners.d.ts +218 -0
- package/dist/deploy/runners.d.ts.map +1 -0
- package/dist/deploy/runners.js +4 -0
- package/dist/deploy/runners.js.map +1 -0
- package/dist/dev/bundler.d.ts +10 -0
- package/dist/dev/bundler.d.ts.map +1 -0
- package/dist/dev/bundler.js +235 -0
- package/dist/dev/bundler.js.map +1 -0
- package/dist/dev/defaults.d.ts +140 -0
- package/dist/dev/defaults.d.ts.map +1 -0
- package/dist/dev/defaults.js +709 -0
- package/dist/dev/defaults.js.map +1 -0
- package/dist/dev/dev-only-imports.d.ts +15 -0
- package/dist/dev/dev-only-imports.d.ts.map +1 -0
- package/dist/dev/dev-only-imports.js +57 -0
- package/dist/dev/dev-only-imports.js.map +1 -0
- package/dist/dev/docker-compose.dev.yml +68 -0
- package/dist/dev/index-child.d.ts +2 -0
- package/dist/dev/index-child.d.ts.map +1 -0
- package/dist/dev/index-child.js +53 -0
- package/dist/dev/index-child.js.map +1 -0
- package/dist/dev/pack-code.d.ts +36 -0
- package/dist/dev/pack-code.d.ts.map +1 -0
- package/dist/dev/pack-code.js +129 -0
- package/dist/dev/pack-code.js.map +1 -0
- package/dist/dev/pack-env.d.ts +13 -0
- package/dist/dev/pack-env.d.ts.map +1 -0
- package/dist/dev/pack-env.js +36 -0
- package/dist/dev/pack-env.js.map +1 -0
- package/dist/dev/pack-service.d.ts +40 -0
- package/dist/dev/pack-service.d.ts.map +1 -0
- package/dist/dev/pack-service.js +189 -0
- package/dist/dev/pack-service.js.map +1 -0
- package/dist/dev/paths.d.ts +22 -0
- package/dist/dev/paths.d.ts.map +1 -0
- package/dist/dev/paths.js +35 -0
- package/dist/dev/paths.js.map +1 -0
- package/dist/dev/postgres-container.d.ts +77 -0
- package/dist/dev/postgres-container.d.ts.map +1 -0
- package/dist/dev/postgres-container.js +346 -0
- package/dist/dev/postgres-container.js.map +1 -0
- package/dist/dev/python-builder.d.ts +16 -0
- package/dist/dev/python-builder.d.ts.map +1 -0
- package/dist/dev/python-builder.js +122 -0
- package/dist/dev/python-builder.js.map +1 -0
- package/dist/dev/register.d.ts +71 -0
- package/dist/dev/register.d.ts.map +1 -0
- package/dist/dev/register.js +54 -0
- package/dist/dev/register.js.map +1 -0
- package/dist/dev/runners.d.ts +312 -0
- package/dist/dev/runners.d.ts.map +1 -0
- package/dist/dev/runners.js +4 -0
- package/dist/dev/runners.js.map +1 -0
- package/dist/dev/runtime-container.d.ts +71 -0
- package/dist/dev/runtime-container.d.ts.map +1 -0
- package/dist/dev/runtime-container.js +173 -0
- package/dist/dev/runtime-container.js.map +1 -0
- package/dist/dev/runtime-env.d.ts +62 -0
- package/dist/dev/runtime-env.d.ts.map +1 -0
- package/dist/dev/runtime-env.js +100 -0
- package/dist/dev/runtime-env.js.map +1 -0
- package/dist/dev/runtime-image.d.ts +26 -0
- package/dist/dev/runtime-image.d.ts.map +1 -0
- package/dist/dev/runtime-image.js +44 -0
- package/dist/dev/runtime-image.js.map +1 -0
- package/dist/dev/runtime-registry.d.ts +73 -0
- package/dist/dev/runtime-registry.d.ts.map +1 -0
- package/dist/dev/runtime-registry.js +111 -0
- package/dist/dev/runtime-registry.js.map +1 -0
- package/dist/env/defaults.d.ts +3 -0
- package/dist/env/defaults.d.ts.map +1 -0
- package/dist/env/defaults.js +22 -0
- package/dist/env/defaults.js.map +1 -0
- package/dist/env/pack-env-plan.d.ts +70 -0
- package/dist/env/pack-env-plan.d.ts.map +1 -0
- package/dist/env/pack-env-plan.js +236 -0
- package/dist/env/pack-env-plan.js.map +1 -0
- package/dist/env/parser.d.ts +9 -0
- package/dist/env/parser.d.ts.map +1 -0
- package/dist/env/parser.js +11 -0
- package/dist/env/parser.js.map +1 -0
- package/dist/env/project-env.d.ts +34 -0
- package/dist/env/project-env.d.ts.map +1 -0
- package/dist/env/project-env.js +45 -0
- package/dist/env/project-env.js.map +1 -0
- package/dist/env/runners.d.ts +22 -0
- package/dist/env/runners.d.ts.map +1 -0
- package/dist/env/runners.js +4 -0
- package/dist/env/runners.js.map +1 -0
- package/dist/env/writer.d.ts +7 -0
- package/dist/env/writer.d.ts.map +1 -0
- package/dist/env/writer.js +9 -0
- package/dist/env/writer.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +111 -0
- package/dist/errors.js.map +1 -0
- package/dist/help.d.ts +5 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +61 -0
- package/dist/help.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/init/augment-scaffolder.d.ts +86 -0
- package/dist/init/augment-scaffolder.d.ts.map +1 -0
- package/dist/init/augment-scaffolder.js +538 -0
- package/dist/init/augment-scaffolder.js.map +1 -0
- package/dist/init/dependency-specs.d.ts +58 -0
- package/dist/init/dependency-specs.d.ts.map +1 -0
- package/dist/init/dependency-specs.js +153 -0
- package/dist/init/dependency-specs.js.map +1 -0
- package/dist/init/gitignore-patcher.d.ts +23 -0
- package/dist/init/gitignore-patcher.d.ts.map +1 -0
- package/dist/init/gitignore-patcher.js +103 -0
- package/dist/init/gitignore-patcher.js.map +1 -0
- package/dist/init/mode-detect.d.ts +34 -0
- package/dist/init/mode-detect.d.ts.map +1 -0
- package/dist/init/mode-detect.js +115 -0
- package/dist/init/mode-detect.js.map +1 -0
- package/dist/init/package-json-patcher.d.ts +36 -0
- package/dist/init/package-json-patcher.d.ts.map +1 -0
- package/dist/init/package-json-patcher.js +128 -0
- package/dist/init/package-json-patcher.js.map +1 -0
- package/dist/init/pnpm-workspace-patcher.d.ts +55 -0
- package/dist/init/pnpm-workspace-patcher.d.ts.map +1 -0
- package/dist/init/pnpm-workspace-patcher.js +248 -0
- package/dist/init/pnpm-workspace-patcher.js.map +1 -0
- package/dist/init/pyproject-patcher.d.ts +56 -0
- package/dist/init/pyproject-patcher.d.ts.map +1 -0
- package/dist/init/pyproject-patcher.js +324 -0
- package/dist/init/pyproject-patcher.js.map +1 -0
- package/dist/init/python-augment.d.ts +22 -0
- package/dist/init/python-augment.d.ts.map +1 -0
- package/dist/init/python-augment.js +300 -0
- package/dist/init/python-augment.js.map +1 -0
- package/dist/init/template-files.d.ts +18 -0
- package/dist/init/template-files.d.ts.map +1 -0
- package/dist/init/template-files.js +53 -0
- package/dist/init/template-files.js.map +1 -0
- package/dist/key/defaults.d.ts +3 -0
- package/dist/key/defaults.d.ts.map +1 -0
- package/dist/key/defaults.js +60 -0
- package/dist/key/defaults.js.map +1 -0
- package/dist/key/fingerprint.d.ts +6 -0
- package/dist/key/fingerprint.d.ts.map +1 -0
- package/dist/key/fingerprint.js +25 -0
- package/dist/key/fingerprint.js.map +1 -0
- package/dist/key/paths.d.ts +30 -0
- package/dist/key/paths.d.ts.map +1 -0
- package/dist/key/paths.js +51 -0
- package/dist/key/paths.js.map +1 -0
- package/dist/key/runners.d.ts +60 -0
- package/dist/key/runners.d.ts.map +1 -0
- package/dist/key/runners.js +4 -0
- package/dist/key/runners.js.map +1 -0
- package/dist/main.d.ts +113 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +199 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp/launcher.d.ts +143 -0
- package/dist/mcp/launcher.d.ts.map +1 -0
- package/dist/mcp/launcher.js +393 -0
- package/dist/mcp/launcher.js.map +1 -0
- package/dist/mcp/preset-loader.d.ts +29 -0
- package/dist/mcp/preset-loader.d.ts.map +1 -0
- package/dist/mcp/preset-loader.js +217 -0
- package/dist/mcp/preset-loader.js.map +1 -0
- package/dist/mcp/preset-types.d.ts +71 -0
- package/dist/mcp/preset-types.d.ts.map +1 -0
- package/dist/mcp/preset-types.js +4 -0
- package/dist/mcp/preset-types.js.map +1 -0
- package/dist/mcp/presets/README.md +68 -0
- package/dist/mcp/presets/postgres.json +15 -0
- package/dist/output.d.ts +26 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +46 -0
- package/dist/output.js.map +1 -0
- package/dist/pack-config.d.ts +37 -0
- package/dist/pack-config.d.ts.map +1 -0
- package/dist/pack-config.js +65 -0
- package/dist/pack-config.js.map +1 -0
- package/dist/package-manager.d.ts +33 -0
- package/dist/package-manager.d.ts.map +1 -0
- package/dist/package-manager.js +129 -0
- package/dist/package-manager.js.map +1 -0
- package/dist/parse.d.ts +88 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +100 -0
- package/dist/parse.js.map +1 -0
- package/dist/providers/preset-loader.d.ts +47 -0
- package/dist/providers/preset-loader.d.ts.map +1 -0
- package/dist/providers/preset-loader.js +107 -0
- package/dist/providers/preset-loader.js.map +1 -0
- package/dist/providers/presets/anthropic.json +47 -0
- package/dist/providers/presets/gemini.json +40 -0
- package/dist/reference.d.ts +28 -0
- package/dist/reference.d.ts.map +1 -0
- package/dist/reference.js +52 -0
- package/dist/reference.js.map +1 -0
- package/dist/sdk-package.d.ts +9 -0
- package/dist/sdk-package.d.ts.map +1 -0
- package/dist/sdk-package.js +20 -0
- package/dist/sdk-package.js.map +1 -0
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +252 -0
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +302 -0
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +297 -0
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +289 -0
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +705 -0
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +298 -0
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +211 -0
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +189 -0
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +205 -0
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +325 -0
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +176 -0
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +305 -0
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +242 -0
- package/dist/stop-signal.d.ts +15 -0
- package/dist/stop-signal.d.ts.map +1 -0
- package/dist/stop-signal.js +16 -0
- package/dist/stop-signal.js.map +1 -0
- package/dist/templates/minimal/.nvmrc +1 -0
- package/dist/templates/minimal/AGENTS.md +23 -0
- package/dist/templates/minimal/README.md.tmpl +69 -0
- package/dist/templates/minimal/agents/.gitkeep +0 -0
- package/dist/templates/minimal/flows/.gitkeep +0 -0
- package/dist/templates/minimal/gitignore +8 -0
- package/dist/templates/minimal/guardrails/.gitkeep +0 -0
- package/dist/templates/minimal/kindgi.config.ts.tmpl +44 -0
- package/dist/templates/minimal/package.json.tmpl +25 -0
- package/dist/templates/minimal/pnpm-workspace.yaml +8 -0
- package/dist/templates/minimal/tools/.gitkeep +0 -0
- package/dist/templates/minimal/tsconfig.json.tmpl +27 -0
- package/dist/templates/minimal/vitest.config.ts.tmpl +14 -0
- package/dist/templates/python/AGENTS.md +30 -0
- package/dist/templates/python/README.md.tmpl +56 -0
- package/dist/templates/python/agents/echo_agent.py.tmpl +23 -0
- package/dist/templates/python/flows/echo_flow.py.tmpl +17 -0
- package/dist/templates/python/gitignore +9 -0
- package/dist/templates/python/guardrails/response_not_empty.py.tmpl +27 -0
- package/dist/templates/python/pyproject.toml.tmpl +42 -0
- package/dist/templates/python/tests/test_tools.py.tmpl +22 -0
- package/dist/templates/python/tools/echo.py.tmpl +27 -0
- package/dist/templates/python/tools/greet.py.tmpl +20 -0
- package/dist/templates/sample/.nvmrc +1 -0
- package/dist/templates/sample/AGENTS.md +23 -0
- package/dist/templates/sample/README.md.tmpl +85 -0
- package/dist/templates/sample/agents/echo-agent/index.ts.tmpl +34 -0
- package/dist/templates/sample/flows/echo-flow/index.ts.tmpl +59 -0
- package/dist/templates/sample/gitignore +8 -0
- package/dist/templates/sample/guardrails/response-not-empty/index.ts.tmpl +58 -0
- package/dist/templates/sample/kindgi.config.ts.tmpl +41 -0
- package/dist/templates/sample/package.json.tmpl +25 -0
- package/dist/templates/sample/pnpm-workspace.yaml +8 -0
- package/dist/templates/sample/tools/echo/index.test.ts.tmpl +31 -0
- package/dist/templates/sample/tools/echo/index.ts.tmpl +37 -0
- package/dist/templates/sample/tools/fetch-httpbin/index.ts.tmpl +60 -0
- package/dist/templates/sample/tools/greet/index.ts.tmpl +35 -0
- package/dist/templates/sample/tsconfig.json.tmpl +27 -0
- package/dist/templates/sample/vitest.config.ts.tmpl +14 -0
- package/dist/terminal-input.d.ts +17 -0
- package/dist/terminal-input.d.ts.map +1 -0
- package/dist/terminal-input.js +88 -0
- package/dist/terminal-input.js.map +1 -0
- package/dist/test/defaults.d.ts +3 -0
- package/dist/test/defaults.d.ts.map +1 -0
- package/dist/test/defaults.js +104 -0
- package/dist/test/defaults.js.map +1 -0
- package/dist/test/runners.d.ts +60 -0
- package/dist/test/runners.d.ts.map +1 -0
- package/dist/test/runners.js +4 -0
- package/dist/test/runners.js.map +1 -0
- package/dist/version-info.d.ts +9 -0
- package/dist/version-info.d.ts.map +1 -0
- package/dist/version-info.js +27 -0
- package/dist/version-info.js.map +1 -0
- package/dist/write-fully.d.ts +13 -0
- package/dist/write-fully.d.ts.map +1 -0
- package/dist/write-fully.js +17 -0
- package/dist/write-fully.js.map +1 -0
- package/package.json +63 -4
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kindgi-authoring-guardrails
|
|
3
|
+
description: >
|
|
4
|
+
Covers writing guardrails (safety checks) for a Kindgi pack: the check
|
|
5
|
+
implementation via defineCheck from @kindgi/sdk/define, the guardrail
|
|
6
|
+
declaration a pack file default-exports (the indexer's shape), the
|
|
7
|
+
three kinds (zero-llm / llm-judge / external), action semantics
|
|
8
|
+
(halt / retry / escalate / log-only / compensate), severity levels,
|
|
9
|
+
scope selectors, config schemas via Zod or JSON Schema, validating a
|
|
10
|
+
declaration with defineGuardrail from @kindgi/guardrails, and how
|
|
11
|
+
guardrails reach agents. Load this whenever you are authoring or
|
|
12
|
+
editing code inside a pack's guardrails/ directory, defining a check,
|
|
13
|
+
or wiring a guardrail onto an agent. Authoring tools is covered by
|
|
14
|
+
kindgi-authoring-tools; authoring agents is covered by
|
|
15
|
+
kindgi-authoring-agents.
|
|
16
|
+
type: core
|
|
17
|
+
library: "@kindgi/sdk"
|
|
18
|
+
version: "0.3.6"
|
|
19
|
+
sdk_version: "0.1.1"
|
|
20
|
+
pack_languages: [node]
|
|
21
|
+
sources:
|
|
22
|
+
- packages/guardrails/src/types.ts
|
|
23
|
+
- packages/guardrails/src/define-check.ts
|
|
24
|
+
- packages/guardrails/src/define.ts
|
|
25
|
+
- packages/guardrails/src/judge.ts
|
|
26
|
+
- packages/guardrails/src/checks.ts
|
|
27
|
+
- packages/handler-runtime/src/kindgi-index.ts
|
|
28
|
+
- packages/handler-runtime/src/handler-runner.ts
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Authoring Kindgi guardrails
|
|
32
|
+
|
|
33
|
+
> **Running `kindgi`:** the CLI is a devDependency of the project (`@kindgi/cli`),
|
|
34
|
+
> not a global command. Run it through the project's package manager —
|
|
35
|
+
> `pnpm exec kindgi …`, `npx --no kindgi …` (npm), `yarn kindgi …` or
|
|
36
|
+
> `bun run kindgi …`. Commands below are written `kindgi …` for brevity.
|
|
37
|
+
|
|
38
|
+
A **guardrail** is a safety rule an agent turn must satisfy. It combines
|
|
39
|
+
a **check** (the function that inspects the turn's trace) with an
|
|
40
|
+
**action** (what happens when the check fails). In a pack, a guardrail
|
|
41
|
+
lives at `guardrails/<name>/index.ts`. For an agent turn, the runtime
|
|
42
|
+
evaluates every guardrail the agent lists once, on the final response,
|
|
43
|
+
before the response is stored.
|
|
44
|
+
|
|
45
|
+
## Mental model: guardrail vs check
|
|
46
|
+
|
|
47
|
+
- **Check** — the implementation. `defineCheck({ id, kind, configSchema?,
|
|
48
|
+
evaluate })` from `@kindgi/sdk/define` returns a registered check whose
|
|
49
|
+
`evaluate(config, trace, bindings)` resolves to `{ passed, reason? }`.
|
|
50
|
+
Zero-llm checks are pure over the trace.
|
|
51
|
+
- **Guardrail** — the declaration: `id`, `kind`, the `check` it uses,
|
|
52
|
+
the check's `config`, and `action` / `severity` / `scope`. Its type is
|
|
53
|
+
`Guardrail` from `@kindgi/guardrails`. One check can back many
|
|
54
|
+
guardrails with different configs.
|
|
55
|
+
- **Built-in checks** (`BUILT_IN_CHECK_IDS` in `@kindgi/guardrails`):
|
|
56
|
+
`must-cite`, `never-call-tool`, `max-tool-calls`, `output-matches`,
|
|
57
|
+
`tool-order`, `required-substring`, `forbidden-substring`. A guardrail
|
|
58
|
+
can name one of these instead of shipping its own check.
|
|
59
|
+
|
|
60
|
+
`@kindgi/sdk` exports `defineCheck` but no helper for the guardrail
|
|
61
|
+
itself: a pack file default-exports the declaration as a plain object.
|
|
62
|
+
|
|
63
|
+
## A pack guardrail file (zero-llm)
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// guardrails/no-fabricated-quotes/index.ts
|
|
67
|
+
import { defineCheck } from '@kindgi/sdk/define';
|
|
68
|
+
import { z } from 'zod';
|
|
69
|
+
|
|
70
|
+
// The check implementation. The pack service calls `check.evaluate`.
|
|
71
|
+
export const check = defineCheck({
|
|
72
|
+
id: 'acme.checks.no-fabricated-quotes',
|
|
73
|
+
kind: 'zero-llm',
|
|
74
|
+
configSchema: z.object({ minPrecedentCalls: z.number().int().min(0).optional() }),
|
|
75
|
+
evaluate: async (config, trace) => {
|
|
76
|
+
const needed = config.minPrecedentCalls ?? 1;
|
|
77
|
+
const precedentCalls = trace.toolCalls.filter((c) => c.toolName === 'acme.fetch-precedent');
|
|
78
|
+
if (precedentCalls.length < needed) {
|
|
79
|
+
return {
|
|
80
|
+
passed: false,
|
|
81
|
+
reason: `Only ${precedentCalls.length} precedent lookups (need ${needed}+).`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return { passed: true };
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// The guardrail declaration the indexer reads.
|
|
89
|
+
export default {
|
|
90
|
+
id: 'acme.no-fabricated-quotes',
|
|
91
|
+
name: 'No fabricated quotations',
|
|
92
|
+
kind: 'zero-llm',
|
|
93
|
+
check,
|
|
94
|
+
action: { 'on-violation': 'halt' },
|
|
95
|
+
severity: 'critical',
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
How the pack tooling reads this file:
|
|
100
|
+
|
|
101
|
+
- The **indexer** (`packages/handler-runtime/src/kindgi-index.ts`)
|
|
102
|
+
recognises a guardrail by a default export with a `kind` and an
|
|
103
|
+
`action` object carrying `on-violation`. It records `id`, `name`,
|
|
104
|
+
`kind`, `action`, `severity`, `scope`, `sandbox` / `limits` /
|
|
105
|
+
`network`, and the check: its id (`check` may be the check id as a
|
|
106
|
+
string, or the check object) and its config schema (from the check's
|
|
107
|
+
`configZod`, `configSchema` or `configJsonSchema`, or a top-level
|
|
108
|
+
`configZod` / `configSchema`), and the declaration's `config` — what
|
|
109
|
+
the check runs with. It does not record `description`, `budget` or
|
|
110
|
+
`judgeCapabilities`.
|
|
111
|
+
- The **pack service** loads the same module to run the check. It uses
|
|
112
|
+
the module's `evaluate` export, or the `default` / `check` export when
|
|
113
|
+
that is a function or has an `evaluate` method — here, the named
|
|
114
|
+
`check` export.
|
|
115
|
+
|
|
116
|
+
## Validating a declaration in-process
|
|
117
|
+
|
|
118
|
+
`defineGuardrail(spec, checks)` from `@kindgi/guardrails` validates a
|
|
119
|
+
`Guardrail` against the wire schema and a check registry: the check id
|
|
120
|
+
must be registered, the check's `kind` must match, and `config` must
|
|
121
|
+
pass the check's config schema. It returns a `Result`; use it in tests
|
|
122
|
+
or wherever guardrails are registered in-process.
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { createCheckRegistry, defineGuardrail } from '@kindgi/guardrails';
|
|
126
|
+
import type { GuardrailId } from '@kindgi/sdk/types';
|
|
127
|
+
|
|
128
|
+
import { check } from './index.js';
|
|
129
|
+
|
|
130
|
+
const checks = createCheckRegistry([check]); // built-in checks are included
|
|
131
|
+
const defined = defineGuardrail(
|
|
132
|
+
{
|
|
133
|
+
id: 'acme.no-fabricated-quotes' as GuardrailId,
|
|
134
|
+
kind: 'zero-llm',
|
|
135
|
+
check: check.id,
|
|
136
|
+
config: { minPrecedentCalls: 2 },
|
|
137
|
+
action: { 'on-violation': 'halt' },
|
|
138
|
+
severity: 'critical',
|
|
139
|
+
},
|
|
140
|
+
checks,
|
|
141
|
+
);
|
|
142
|
+
if (defined.kind === 'err') {
|
|
143
|
+
throw new Error(`acme.no-fabricated-quotes: ${defined.error.message}`);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Registering a guardrail through the API (`POST /v1/guardrails`, or
|
|
148
|
+
`client.guardrails.author(spec, { projectId })` in `@kindgi/sdk/client`)
|
|
149
|
+
stores the declaration only; the check it names must already be
|
|
150
|
+
available to the runtime that evaluates it.
|
|
151
|
+
|
|
152
|
+
## Field-by-field
|
|
153
|
+
|
|
154
|
+
- **`id`** — `<pack-id>.<guardrail-name>` (kebab-case, dot-namespaced).
|
|
155
|
+
Name the ASSERTION as a positive rule (e.g. `no-fabricated-quotes`,
|
|
156
|
+
`response-not-empty`, `must-cite-source`).
|
|
157
|
+
- **`kind`**:
|
|
158
|
+
- `'zero-llm'` — pure function over the trace. Fast, deterministic,
|
|
159
|
+
free. **The default choice for most safety rules.**
|
|
160
|
+
- `'llm-judge'` — a model scores the turn against a rubric. Costs
|
|
161
|
+
money; requires `judgeCapabilities`. See below.
|
|
162
|
+
- `'external'` — evaluated outside the engine. The built-in
|
|
163
|
+
`external` strategy returns an `invalid-guardrail` error; a caller
|
|
164
|
+
that wants external evaluation registers its own strategy.
|
|
165
|
+
- **`check`** — the id of a registered check (built-in, or one built
|
|
166
|
+
with `defineCheck`). In a pack file it may also be the check object.
|
|
167
|
+
- **`config`** — the check's parameters, validated against the check's
|
|
168
|
+
`configSchema` by `defineGuardrail`. In a pack, the declaration's
|
|
169
|
+
`config` goes into the index and the check runs with it; without one
|
|
170
|
+
it runs with `{}`. A declaration a pack file default-exports isn't run
|
|
171
|
+
through `defineGuardrail`, so nothing validates its `config`: keep it
|
|
172
|
+
valid against the schema yourself. `evaluate` receives the config as
|
|
173
|
+
declared —
|
|
174
|
+
schema defaults are not filled in — so handle absent optional fields.
|
|
175
|
+
- **`action.on-violation`** — `'halt'`, `'retry'` (with
|
|
176
|
+
`retry.maxAttempts`, 1–10), `'escalate'` (with `escalateTo`),
|
|
177
|
+
`'log-only'`, `'compensate'` (with `compensateWith`, a tool id). In an
|
|
178
|
+
agent turn, a failed `halt` guardrail fails the turn with
|
|
179
|
+
`guardrail-violation` and the response is not stored; failures with
|
|
180
|
+
any other action are reported in `AgentTurnResult.violations` and the
|
|
181
|
+
turn completes. The action handlers in `@kindgi/guardrails`
|
|
182
|
+
(`retryHandler`, `escalateHandler`, `compensateHandler`, …) record the
|
|
183
|
+
intent for callers that act on it. In 0.1 the runtime acts only on
|
|
184
|
+
`halt`: `retry`, `escalate` and `compensate` are recorded on the
|
|
185
|
+
violation, with no second attempt, escalation or compensating call.
|
|
186
|
+
- **`severity`** — `'info'` / `'warn'` / `'error'` (the default) /
|
|
187
|
+
`'critical'`. Orthogonal to `action`: logs and dashboards group by
|
|
188
|
+
severity; execution follows the action. A `log-only` guardrail can
|
|
189
|
+
still be `'critical'`.
|
|
190
|
+
- **`scope`** — when the guardrail applies. `{ when: 'always' }` fires
|
|
191
|
+
everywhere; `{ when: 'ci-only' }` blocks CI but not runtime;
|
|
192
|
+
`{ when: 'runtime-only' }` enforces at runtime but not CI. `agents`,
|
|
193
|
+
`flows` and `tenants` lists narrow it further.
|
|
194
|
+
- **`budget`** — `{ maxCostUsd?, maxLatencyMs? }`, relevant to
|
|
195
|
+
`llm-judge`. Declarative: the runtime does not enforce it.
|
|
196
|
+
- **`judgeCapabilities`** — for `llm-judge`: the capability
|
|
197
|
+
declaration used to route the judge model.
|
|
198
|
+
|
|
199
|
+
## LLM-judge guardrail (costs money)
|
|
200
|
+
|
|
201
|
+
An `llm-judge` guardrail does not run custom check code: the engine's
|
|
202
|
+
`llm-judge` strategy sends the turn's trace and the rubric in `config`
|
|
203
|
+
(`{ rubric, responseFormat?, threshold?, temperature? }`) to a model
|
|
204
|
+
routed through `judgeCapabilities`, and parses a PASS/FAIL or a score.
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
import type { Guardrail } from '@kindgi/guardrails';
|
|
208
|
+
import type { GuardrailId } from '@kindgi/sdk/types';
|
|
209
|
+
|
|
210
|
+
export const toneProfessional: Guardrail = {
|
|
211
|
+
id: 'acme.tone-professional' as GuardrailId,
|
|
212
|
+
kind: 'llm-judge',
|
|
213
|
+
// Required by the `Guardrail` type; the llm-judge strategy judges
|
|
214
|
+
// with `config` and does not call this check.
|
|
215
|
+
check: 'acme.checks.tone-professional',
|
|
216
|
+
config: {
|
|
217
|
+
rubric: 'The response is professional in tone and contains no slang.',
|
|
218
|
+
responseFormat: 'pass-fail',
|
|
219
|
+
},
|
|
220
|
+
judgeCapabilities: { needs: [{ feature: 'structured-output' }] },
|
|
221
|
+
action: { 'on-violation': 'log-only' },
|
|
222
|
+
severity: 'warn',
|
|
223
|
+
budget: { maxCostUsd: 0.01, maxLatencyMs: 5000 }, // declarative, not enforced
|
|
224
|
+
};
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
The judge is resolved from the provider registry passed in the
|
|
228
|
+
evaluation bindings (or a pinned `judgeProvider`), under the tenant
|
|
229
|
+
policy in those bindings when one is passed. Checks that run in a pack are called with empty
|
|
230
|
+
`bindings` — no provider registry — so a pack check cannot call a model
|
|
231
|
+
itself; use `kind: 'llm-judge'` for model-based rules.
|
|
232
|
+
|
|
233
|
+
## Wiring the guardrail onto an agent
|
|
234
|
+
|
|
235
|
+
Agents reference guardrails by id:
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
// agents/brief-writer/index.ts
|
|
239
|
+
guardrails: ['acme.no-fabricated-quotes'],
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
At the start of each turn, the runtime resolves these ids against the
|
|
243
|
+
guardrails available to the run. An id that isn't registered fails the
|
|
244
|
+
turn before the model is called (`Error [invalid-request]: Agent "…"
|
|
245
|
+
references guardrails not in the registry: <id>`), so register the
|
|
246
|
+
guardrail before an agent references it.
|
|
247
|
+
|
|
248
|
+
## Changing a guardrail
|
|
249
|
+
|
|
250
|
+
Guardrails have no `version` field; the id is the stable identifier.
|
|
251
|
+
Changing a guardrail's check, config, severity or action changes
|
|
252
|
+
behavior for every agent that references it. When you tighten a rule
|
|
253
|
+
(raise severity from `warn` to `error`, switch the action from
|
|
254
|
+
`log-only` to `halt`), check whether the agents that reference it are
|
|
255
|
+
ready for the stricter enforcement.
|
|
256
|
+
|
|
257
|
+
## Common mistakes
|
|
258
|
+
|
|
259
|
+
1. **Confusing guardrail and check.** The id in `agent.guardrails: [...]`
|
|
260
|
+
is the GUARDRAIL id, not the check id. The agent binds to
|
|
261
|
+
guardrails; guardrails reference checks.
|
|
262
|
+
|
|
263
|
+
2. **A check whose `evaluate` always returns `passed: true`.** If you
|
|
264
|
+
are stubbing the check, give the guardrail `action: { 'on-violation':
|
|
265
|
+
'log-only' }` so it is honest about not being enforced.
|
|
266
|
+
|
|
267
|
+
3. **Calling a model from a pack check.** Pack checks receive empty
|
|
268
|
+
`bindings`; there is no provider registry to route through. Declare
|
|
269
|
+
an `llm-judge` guardrail with a rubric instead.
|
|
270
|
+
|
|
271
|
+
4. **Not declaring `configSchema`.** Without it, `config` is
|
|
272
|
+
`Record<string, unknown>` — no validation, no editor completion,
|
|
273
|
+
silent typos. Prefer Zod for TS-side inference on
|
|
274
|
+
`evaluate(config, ...)`.
|
|
275
|
+
|
|
276
|
+
5. **Ignoring the `Result` from `defineGuardrail`.** It returns
|
|
277
|
+
`Result<Guardrail, …>`; check `kind` and throw at load time.
|
|
278
|
+
`defineCheck` itself throws when its `configSchema` can't be
|
|
279
|
+
compiled.
|
|
280
|
+
|
|
281
|
+
## References
|
|
282
|
+
|
|
283
|
+
- Type surface: hover any `@kindgi/sdk/define` export for full JSDoc;
|
|
284
|
+
`Guardrail`, `defineGuardrail` and the built-in checks are in
|
|
285
|
+
`@kindgi/guardrails`.
|
|
286
|
+
- API reference: https://docs.kindgi.com/v0.1/reference/typescript/sdk/kindgi/sdk/define/
|
|
287
|
+
- Built-in check implementations: `packages/guardrails/src/checks.ts`.
|
|
288
|
+
|
|
289
|
+
## When the framework itself is the problem
|
|
290
|
+
|
|
291
|
+
If you diagnose that the bug lives in Kindgi/`@kindgi/sdk` itself
|
|
292
|
+
(guardrail runtime dropping context fields, check-sandbox dispatch
|
|
293
|
+
regression, misleading error message, CLI friction) — not in the
|
|
294
|
+
pack's own code — load the `kindgi-framework-feedback` skill and file
|
|
295
|
+
a structured report with `kindgi feedback write`. That diagnostic is
|
|
296
|
+
high-signal input the maintainers can act on; don't let it disappear
|
|
297
|
+
into the transcript.
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kindgi-authoring-mcp-servers
|
|
3
|
+
description: >
|
|
4
|
+
Wire an MCP server into a Kindgi pack so the coding agent (Claude Code,
|
|
5
|
+
Cursor, VS Code, Windsurf, …) can discover a live external resource
|
|
6
|
+
through tools instead of asking the user to paste schemas or values.
|
|
7
|
+
Uses `kindgi secrets set` for the credential (interactive, no-echo) and
|
|
8
|
+
`kindgi mcp add <preset>` to write `.mcp.json` at the pack root. The
|
|
9
|
+
launcher (`kindgi mcp-launch`) spawns the actual MCP server as a
|
|
10
|
+
subprocess with the secret injected into its env — never onto the
|
|
11
|
+
model's transcript. Load this when the user says "I have a Postgres
|
|
12
|
+
URL, can you look at the schema", "connect to my database", "wire
|
|
13
|
+
MCP", "add a Postgres MCP", "let CC query my DB", "I don't want to
|
|
14
|
+
paste my table shape", or when the model is about to ask the user to
|
|
15
|
+
paste external schema/data that Kindgi could discover through MCP.
|
|
16
|
+
Credential storage is covered by kindgi-authoring-providers's
|
|
17
|
+
`kindgi secrets set` flow.
|
|
18
|
+
type: core
|
|
19
|
+
library: "@kindgi/sdk"
|
|
20
|
+
version: "0.3.0"
|
|
21
|
+
sdk_version: "0.1.1"
|
|
22
|
+
pack_languages: [node, python]
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Wiring an MCP server for a Kindgi pack
|
|
26
|
+
|
|
27
|
+
> **Running `kindgi`:** in a Node project the CLI is a devDependency
|
|
28
|
+
> (`@kindgi/cli`), not a global command. Run it through the project's
|
|
29
|
+
> package manager — `pnpm exec kindgi …`, `npx --no kindgi …` (npm),
|
|
30
|
+
> `yarn kindgi …` or `bun run kindgi …`. A Python pack (`[tool.kindgi]` in
|
|
31
|
+
> `pyproject.toml`) has no Node project: run the `kindgi` on `PATH`.
|
|
32
|
+
> Commands below are written `kindgi …` for brevity.
|
|
33
|
+
|
|
34
|
+
If the user has an external resource (Postgres DB, GitHub org, Notion
|
|
35
|
+
workspace, …) that would be useful to a coding agent, **wire an MCP
|
|
36
|
+
server** rather than asking the user to paste values. Kindgi keeps the
|
|
37
|
+
credential out of the model's transcript by injecting it into the
|
|
38
|
+
subprocess's environment; the model only sees the tools the MCP server
|
|
39
|
+
exposes.
|
|
40
|
+
|
|
41
|
+
## When to reach for this
|
|
42
|
+
|
|
43
|
+
Reach for MCP when the user hands you a live external resource by
|
|
44
|
+
reference (URL, host + credential, workspace id). Signals from the
|
|
45
|
+
user:
|
|
46
|
+
- "I have a Postgres database at $URL"
|
|
47
|
+
- "Connect to my Notion workspace at $TOKEN"
|
|
48
|
+
- "Let CC look at the schema of my DB"
|
|
49
|
+
- "Don't paste it, just query it"
|
|
50
|
+
|
|
51
|
+
**Do NOT reach for MCP when:**
|
|
52
|
+
- The resource is a static file the user has locally (just Read it).
|
|
53
|
+
- The resource is best-inspected once by a human (a one-shot answer, no
|
|
54
|
+
agent tools needed).
|
|
55
|
+
- The user is in a client that hasn't loaded `.mcp.json` yet — they'll
|
|
56
|
+
need to restart their MCP client after `kindgi mcp add` (see gotcha
|
|
57
|
+
#2 below).
|
|
58
|
+
|
|
59
|
+
## Mental model
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Kindgi's SecretBinding .mcp.json (pack root) launcher subprocess MCP server subprocess
|
|
63
|
+
───────────────────── ──────────────────── ────────────────── ────────────────────
|
|
64
|
+
MY_DB_URL=… → { "command": "pnpm", → reads .env + → spawns child with
|
|
65
|
+
(.env / .env.local, or "args": ["exec","kindgi", .env.local (the DATABASE_URI in env,
|
|
66
|
+
`kindgi secrets set`) "mcp-launch", "--", …] } pack env files), stdio piped to CC
|
|
67
|
+
│ substitutes secret ▲ │
|
|
68
|
+
│ into child env │ ▼
|
|
69
|
+
▼ │ MCP protocol (stdio)
|
|
70
|
+
Claude Code / Cursor spawns │ ▲ │
|
|
71
|
+
`kindgi mcp-launch …` at │ │ ▼
|
|
72
|
+
startup ─────────────────────────────┘ ┌─────────────────┐
|
|
73
|
+
│ Claude Code │
|
|
74
|
+
│ (or Cursor…) │
|
|
75
|
+
└─────────────────┘
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Three moving parts:
|
|
79
|
+
|
|
80
|
+
1. **The secret on disk** — for `local`, the project's env files at the
|
|
81
|
+
pack root (`.env`, then `.env.local`; `dev.envFiles` to change);
|
|
82
|
+
other environments use `.env.<envName>`. Add it by hand or with
|
|
83
|
+
`kindgi secrets set` (interactive no-echo prompt; never the value on
|
|
84
|
+
argv), which writes `.env.local`. See `kindgi-authoring-providers`
|
|
85
|
+
for the same flow used for LLM API keys.
|
|
86
|
+
2. **`.mcp.json` at the pack root** — Kindgi writes this via
|
|
87
|
+
`kindgi mcp add`. Every entry runs the project's own `kindgi
|
|
88
|
+
mcp-launch -- <launcher-flags>...` through its package manager
|
|
89
|
+
(`"command": "pnpm", "args": ["exec", "kindgi", "mcp-launch", …]`;
|
|
90
|
+
npm: `npx --no kindgi …`) — never a global `kindgi`, never a
|
|
91
|
+
download. A Python pack has no Node project, so its entries run the
|
|
92
|
+
`kindgi` on `PATH` (`"command": "kindgi", "args": ["mcp-launch", …]`).
|
|
93
|
+
The file is safe to commit — it references secrets by NAME, not
|
|
94
|
+
value.
|
|
95
|
+
3. **The launcher** — `kindgi mcp-launch` is what the coding agent
|
|
96
|
+
actually spawns. It reads the referenced secret from the pack env files,
|
|
97
|
+
injects it into the child MCP server's env, and pipes stdio through.
|
|
98
|
+
|
|
99
|
+
## Path A — Postgres
|
|
100
|
+
|
|
101
|
+
Best-worn path. Uses `crystaldba/postgres-mcp` via Docker with
|
|
102
|
+
read-only access mode by default.
|
|
103
|
+
|
|
104
|
+
**Step 1 — set the DB URL** (interactive, no-echo):
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
kindgi secrets set MY_DB_URL --env=local --scope=tenant
|
|
108
|
+
# paste postgres://user:pass@host:port/db, press enter
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
For pipelines/CI: `pbpaste | kindgi secrets set … --from-stdin`, or
|
|
112
|
+
`--from-file=<path>` on a mode-0600 file. Never pass the value on argv.
|
|
113
|
+
|
|
114
|
+
**Step 2 — wire the MCP server:**
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
kindgi mcp add postgres --secret=MY_DB_URL
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Writes `.mcp.json` at the pack root (or merges into an existing one).
|
|
121
|
+
The server name defaults to `my_db` (derived from the secret
|
|
122
|
+
name — see "Server naming" below). Override with `--server-name=<label>`.
|
|
123
|
+
|
|
124
|
+
**Step 3 — restart your MCP client.** MCP servers are loaded at client
|
|
125
|
+
startup — a fresh `.mcp.json` doesn't take effect mid-session:
|
|
126
|
+
- **Claude Code:** exit + `claude` again in the same pack dir
|
|
127
|
+
- **Cursor:** ⌘⇧P → "Restart Extension Host" (or restart the app)
|
|
128
|
+
- **Claude Desktop:** quit + reopen
|
|
129
|
+
- **Windsurf:** Command Palette → "Restart Windsurf"
|
|
130
|
+
|
|
131
|
+
**Step 4 — use it.** Tools like `execute_sql`, `list_tables`,
|
|
132
|
+
`analyze_index_health` now appear. Ask the agent things like "what
|
|
133
|
+
tables are in this schema?" or "what's the shape of the customers
|
|
134
|
+
table?" or "how many rows are in orders where created_at > 2024?".
|
|
135
|
+
|
|
136
|
+
## Path B — Multiple servers in the same pack
|
|
137
|
+
|
|
138
|
+
Two connections against different DBs? Two `mcp add` invocations,
|
|
139
|
+
each with its own `--secret` and `--server-name`:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
kindgi secrets set MY_DB_URL --env=local --scope=tenant
|
|
143
|
+
kindgi secrets set ANALYTICS_DB_URL --env=local --scope=tenant
|
|
144
|
+
|
|
145
|
+
kindgi mcp add postgres --secret=MY_DB_URL --server-name=my_db
|
|
146
|
+
kindgi mcp add postgres --secret=ANALYTICS_DB_URL --server-name=analytics_db
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`.mcp.json` gets two entries. The agent picks the right one by name
|
|
150
|
+
when it invokes a tool (e.g. `my_db.execute_sql`).
|
|
151
|
+
|
|
152
|
+
## Server naming
|
|
153
|
+
|
|
154
|
+
`--server-name` defaults are derived from the secret name:
|
|
155
|
+
|
|
156
|
+
| Secret name | Default server name |
|
|
157
|
+
|---|---|
|
|
158
|
+
| `MY_DB_URL` | `my_db` |
|
|
159
|
+
| `ANALYTICS_DB_URL` | `analytics_db` |
|
|
160
|
+
| `ANTHROPIC_API_KEY` | `anthropic_api` |
|
|
161
|
+
| `GITHUB_PAT` | `github` |
|
|
162
|
+
| `DB_PASSWORD` | `db` |
|
|
163
|
+
|
|
164
|
+
The suffix-stripping (`_url` / `_uri` / `_key` / `_token` / `_pat` /
|
|
165
|
+
`_secret` / `_password`) is intentional — the server name should
|
|
166
|
+
describe the *resource*, not the *credential shape*. Override with
|
|
167
|
+
`--server-name=<label>` when the default reads wrong.
|
|
168
|
+
|
|
169
|
+
## Path C — Non-Claude-Code clients
|
|
170
|
+
|
|
171
|
+
`.mcp.json` at the pack root is what Claude Code reads natively. Other
|
|
172
|
+
clients read from their own paths (`.cursor/mcp.json`, `.vscode/mcp.json`,
|
|
173
|
+
Claude Desktop's system-wide config). To bridge:
|
|
174
|
+
|
|
175
|
+
1. Establish a symlink from the client's expected path to `.mcp.json`:
|
|
176
|
+
```sh
|
|
177
|
+
mkdir -p .cursor && ln -sfn ../.mcp.json .cursor/mcp.json
|
|
178
|
+
```
|
|
179
|
+
2. Restart the client.
|
|
180
|
+
|
|
181
|
+
Symlinks work because the FILE CONTENTS are portable across every MCP
|
|
182
|
+
client — the `mcpServers` block has the same shape everywhere. Only
|
|
183
|
+
the file LOCATION differs. Edits to `.mcp.json` flow through
|
|
184
|
+
automatically via the symlink; no re-sync needed.
|
|
185
|
+
|
|
186
|
+
Windows users without dev-drive symlinks: `cp .mcp.json .cursor/mcp.json`,
|
|
187
|
+
and re-copy after every `kindgi mcp` edit.
|
|
188
|
+
|
|
189
|
+
## Verifying end-to-end
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
# 1. Check the secret exists
|
|
193
|
+
kindgi secrets list --env=local --scope=tenant
|
|
194
|
+
|
|
195
|
+
# 2. Check .mcp.json
|
|
196
|
+
kindgi mcp list
|
|
197
|
+
|
|
198
|
+
# 3. Check available presets
|
|
199
|
+
kindgi mcp presets
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
`kindgi mcp list` prints the configured servers with their launcher
|
|
203
|
+
argv shape. `kindgi mcp presets` shows what presets are available and
|
|
204
|
+
their audit status. If the postgres preset audit says
|
|
205
|
+
`urlLeakInErrors: "pending"`, that's a known unresolved item — see
|
|
206
|
+
gotcha #4.
|
|
207
|
+
|
|
208
|
+
## Common mistakes
|
|
209
|
+
|
|
210
|
+
1. **Reading `.mcp.json` mid-session and asking about it.** `.mcp.json`
|
|
211
|
+
references secrets by NAME (e.g. `secret:MY_DB_URL@local:tenant`),
|
|
212
|
+
not by value. Safe to Read + describe to the user. **Do NOT** run
|
|
213
|
+
`cat .env`, `env | grep`, or Read `.env` / `.env.local` — those return
|
|
214
|
+
the raw URL, which enters your transcript, gets sent to the model
|
|
215
|
+
provider on every subsequent turn, and can be exfiltrated via
|
|
216
|
+
prompt injection. Once a secret is in a model's context, it's a
|
|
217
|
+
rotation event, not a "clean up the log" event.
|
|
218
|
+
|
|
219
|
+
2. **Expecting the new server to activate without a restart.** MCP
|
|
220
|
+
servers are loaded at client startup. `kindgi mcp add` writes the
|
|
221
|
+
config file; the CLIENT doesn't re-scan it until a restart. Tell
|
|
222
|
+
the user to restart their client after `mcp add`, and don't call
|
|
223
|
+
MCP tools before that restart happens in your current session.
|
|
224
|
+
|
|
225
|
+
3. **`--env` / `--scope` mismatch between `secrets set` and `mcp add`.**
|
|
226
|
+
Both flags need to agree — the launcher looks up the secret using
|
|
227
|
+
whatever `--env` + `--scope` you passed to `mcp add`. Default is
|
|
228
|
+
`--env=local --scope=tenant`; match this on both commands.
|
|
229
|
+
|
|
230
|
+
4. **Trusting a preset's audit metadata that says `pending`.** Every
|
|
231
|
+
preset carries `audit.urlLeakInErrors`. Only `"verified-safe"` means
|
|
232
|
+
someone has confirmed the wrapped MCP server doesn't echo the
|
|
233
|
+
secret in its error/debug output. `"pending"` means the audit
|
|
234
|
+
hasn't run — the server may or may not leak. When you see a
|
|
235
|
+
`pending` preset in a session that handles real credentials, tell
|
|
236
|
+
the user: "this preset works but its URL-echo safety isn't
|
|
237
|
+
verified for this version; watch tool error messages for the raw
|
|
238
|
+
URL, and file feedback if you see one."
|
|
239
|
+
|
|
240
|
+
5. **Trying to use MCP against a `localhost` DB from Docker on Mac
|
|
241
|
+
without the host-remap.** Docker containers on Mac can't reach the
|
|
242
|
+
host's `localhost`. The `postgres` preset carries `hostRemap:
|
|
243
|
+
"docker-desktop"`, which the launcher applies automatically — it
|
|
244
|
+
rewrites `@localhost` / `@127.0.0.1` in the resolved URL to
|
|
245
|
+
`@host.docker.internal` before injecting into the container's env.
|
|
246
|
+
If you author a preset with a Docker runtime + a localhost
|
|
247
|
+
consumer, include `"hostRemap": "docker-desktop"` in the preset JSON.
|
|
248
|
+
|
|
249
|
+
6. **`kindgi mcp add` fails with "Secret X not in .env, .env.local".** The
|
|
250
|
+
secret hasn't been stored yet. Run `kindgi secrets set X --env=local
|
|
251
|
+
--scope=tenant` first. The error message includes this fix pointer.
|
|
252
|
+
|
|
253
|
+
## Security discipline
|
|
254
|
+
|
|
255
|
+
The invariants this skill inherits — every bullet here is enforced by
|
|
256
|
+
you, the coding agent, in the session where MCP is wired:
|
|
257
|
+
|
|
258
|
+
- **Never Read `.env`, `.env.local` or `.env.<envName>` files.** Their contents are the raw
|
|
259
|
+
secret values. Reading them puts the secret in your tool result and
|
|
260
|
+
from there in every subsequent turn's context sent to the model
|
|
261
|
+
provider.
|
|
262
|
+
- **Never run `env | grep SECRET_NAME`, `printenv SECRET_NAME`, or
|
|
263
|
+
equivalent** in a bash tool. Same failure — the value returns in the
|
|
264
|
+
tool result.
|
|
265
|
+
- **When a tool errors, check the error message before summarizing.**
|
|
266
|
+
Some MCP servers echo the connection string in `connection refused`
|
|
267
|
+
errors. If you see the URL in a tool error, redact when
|
|
268
|
+
summarizing to the user, and file the incident via the
|
|
269
|
+
`kindgi-framework-feedback` skill so the preset's audit gets updated.
|
|
270
|
+
- **Prefer `kindgi mcp list` over Reading `.mcp.json`** when the user
|
|
271
|
+
asks "what's configured?" — the list output has the same info in a
|
|
272
|
+
cleaner shape and is safe to include in your reply.
|
|
273
|
+
- **Never repeat the resolved URL back to the user** — even in a
|
|
274
|
+
"here's what I wired up" summary. Refer to the secret by NAME and
|
|
275
|
+
to the server by its `.mcp.json` label. The point of MCP is that
|
|
276
|
+
the value stays out of every layer that a model can see; repeating
|
|
277
|
+
it in your reply defeats the invariant.
|
|
278
|
+
|
|
279
|
+
## When the framework itself is the problem
|
|
280
|
+
|
|
281
|
+
If you diagnose that the bug lives in Kindgi/`@kindgi/cli` itself
|
|
282
|
+
(`kindgi mcp add` writes malformed JSON, `mcp-launch` hangs, a preset
|
|
283
|
+
has bad `defaultArgs`, launcher can't resolve a secret that clearly
|
|
284
|
+
exists in the pack env files, an MCP server echoes the URL in its
|
|
285
|
+
error tool result) — not in your pack's `.mcp.json` or secret setup —
|
|
286
|
+
load the `kindgi-framework-feedback` skill and file a structured
|
|
287
|
+
report with `kindgi feedback write`. That diagnostic is high-signal
|
|
288
|
+
input the maintainers can act on; don't let it disappear into the
|
|
289
|
+
transcript.
|