@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,58 @@
|
|
|
1
|
+
// {{PACK_ID}}.response-not-empty — zero-LLM guardrail that fails when the
|
|
2
|
+
// run's final `output` is empty or whitespace-only. Cheap, deterministic,
|
|
3
|
+
// replayable — the preferred kind of guardrail.
|
|
4
|
+
//
|
|
5
|
+
// The module exports a guardrail object literal whose `check` sub-object
|
|
6
|
+
// carries an inline `evaluate` handler. The indexer picks up `action` +
|
|
7
|
+
// `kind` at the top level; the runtime registers the inline check at
|
|
8
|
+
// boot.
|
|
9
|
+
|
|
10
|
+
import { type DefinedCheck, defineCheck } from '@kindgi/sdk/define';
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
|
|
13
|
+
const ConfigSchema = z.object({
|
|
14
|
+
minLength: z.number().int().min(0).default(1),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const check = defineCheck({
|
|
18
|
+
id: '{{PACK_ID}}.checks.response-not-empty',
|
|
19
|
+
kind: 'zero-llm',
|
|
20
|
+
configSchema: ConfigSchema,
|
|
21
|
+
evaluate: async (config, trace) => {
|
|
22
|
+
const output = trace.output;
|
|
23
|
+
const text = typeof output === 'string' ? output.trim() : '';
|
|
24
|
+
if (text.length < config.minLength) {
|
|
25
|
+
return {
|
|
26
|
+
passed: false,
|
|
27
|
+
reason: `Response too short: got ${text.length} chars, expected >= ${config.minLength}.`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return { passed: true };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// The check as the runtime registers it, typed with the SDK's
|
|
35
|
+
// `DefinedCheck`. Left to inference, its type would name
|
|
36
|
+
// `@kindgi/guardrails`, which the pack reaches only through
|
|
37
|
+
// `@kindgi/sdk` — `tsc` then stops with TS2742 (`declaration: true`).
|
|
38
|
+
type InlineCheck = Pick<DefinedCheck<typeof ConfigSchema>, 'id' | 'evaluate' | 'validateConfig'>;
|
|
39
|
+
|
|
40
|
+
const inlineCheck: InlineCheck = {
|
|
41
|
+
id: check.id,
|
|
42
|
+
evaluate: check.evaluate,
|
|
43
|
+
...(check.validateConfig !== undefined && { validateConfig: check.validateConfig }),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const guardrail = {
|
|
47
|
+
id: '{{PACK_ID}}.response-not-empty',
|
|
48
|
+
name: 'Response is non-empty',
|
|
49
|
+
kind: 'zero-llm' as const,
|
|
50
|
+
check: inlineCheck,
|
|
51
|
+
configSchema: check.configJsonSchema,
|
|
52
|
+
action: { 'on-violation': 'halt' } as const,
|
|
53
|
+
severity: 'error' as const,
|
|
54
|
+
scope: { when: 'runtime-only' as const },
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default guardrail;
|
|
58
|
+
export { check };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Kindgi pack config — scaffolded by `kindgi init --template=sample`.
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
pack: {
|
|
5
|
+
id: '{{PACK_ID}}',
|
|
6
|
+
version: '{{PACK_VERSION}}',
|
|
7
|
+
description: 'A sample Kindgi pack — two tools, one guardrail, one agent, one flow.',
|
|
8
|
+
},
|
|
9
|
+
discovery: {
|
|
10
|
+
tools: 'tools/**/*.ts',
|
|
11
|
+
guardrails: 'guardrails/**/*.ts',
|
|
12
|
+
agents: 'agents/**/*.ts',
|
|
13
|
+
flows: 'flows/**/*.ts',
|
|
14
|
+
},
|
|
15
|
+
// ---------------------------------------------------------------
|
|
16
|
+
// Environments — one entry per deploy target. `kindgi build`
|
|
17
|
+
// reads `.build`, `.registry`, `.signingKey`, `.tenantId` for the
|
|
18
|
+
// chosen env; `kindgi deploy` reads `.endpoint`.
|
|
19
|
+
//
|
|
20
|
+
// Fill these in when you're ready to push a build. Local
|
|
21
|
+
// `kindgi dev` does NOT read this block.
|
|
22
|
+
// ---------------------------------------------------------------
|
|
23
|
+
environments: {
|
|
24
|
+
staging: {
|
|
25
|
+
endpoint: 'https://api.staging.example.com',
|
|
26
|
+
build: 'http://localhost:8787', // your Kindgi build server
|
|
27
|
+
registry: 'ghcr.io/your-org',
|
|
28
|
+
signingKey: '~/.kindgi/keys/staging.pem',
|
|
29
|
+
tenantId: 'tenant-your-org-staging',
|
|
30
|
+
},
|
|
31
|
+
production: {
|
|
32
|
+
endpoint: 'https://api.example.com',
|
|
33
|
+
build: 'https://build.example.com',
|
|
34
|
+
registry: 'ghcr.io/your-org',
|
|
35
|
+
signingKey: '~/.kindgi/keys/production.pem',
|
|
36
|
+
tenantId: 'tenant-your-org-production',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
export default config;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PACK_NAME}}",
|
|
3
|
+
"version": "{{PACK_VERSION}}",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Kindgi pack — scaffolded by `kindgi init --template=sample`. Two tools, one guardrail, one agent, one flow.",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.0.0"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"typecheck": "tsc --noEmit",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@kindgi/sdk": "workspace:*",
|
|
17
|
+
"zod": "^4.0.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@kindgi/cli": "workspace:*",
|
|
21
|
+
"@types/node": "^22.0.0",
|
|
22
|
+
"typescript": "^5.7.3",
|
|
23
|
+
"vitest": "^3.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# pnpm 12+ reads settings from this file, not from `package.json`'s
|
|
2
|
+
# `pnpm` block. `allowBuilds` records, per dependency, whether pnpm runs
|
|
3
|
+
# its install script (true) or skips it (false); pnpm 11+ stops an install
|
|
4
|
+
# until each one has a decision. esbuild (the CLI's bundler, and vitest's
|
|
5
|
+
# transform) works without its script: its native binary comes from its
|
|
6
|
+
# `@esbuild/<platform>` package, so the script stays off.
|
|
7
|
+
allowBuilds:
|
|
8
|
+
esbuild: false
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// {{PACK_ID}}.echo — smoke test verifying the tool compiles + the
|
|
2
|
+
// handler returns the expected shape. Scaffolded by `kindgi init`
|
|
3
|
+
// so `kindgi test` has something to run out of the box.
|
|
4
|
+
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import type { ToolContext } from '@kindgi/sdk/define';
|
|
8
|
+
import type { TenantId } from '@kindgi/sdk/types';
|
|
9
|
+
|
|
10
|
+
import echo from './index.js';
|
|
11
|
+
|
|
12
|
+
function makeCtx(): ToolContext {
|
|
13
|
+
return {
|
|
14
|
+
tenantId: '00000000-0000-0000-0000-000000000001' as TenantId,
|
|
15
|
+
abortSignal: new AbortController().signal,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('{{PACK_ID}}.echo', () => {
|
|
20
|
+
test('compiles with the expected id', () => {
|
|
21
|
+
expect(echo.id).toBe('{{PACK_ID}}.echo');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('handler round-trips the message + count', async () => {
|
|
25
|
+
if (echo.handler === undefined) throw new Error('handler missing');
|
|
26
|
+
const out = await echo.handler({ message: 'hello' }, makeCtx());
|
|
27
|
+
expect(out.echo).toBe('hello');
|
|
28
|
+
expect(out.characterCount).toBe(5);
|
|
29
|
+
expect(typeof out.echoedAt).toBe('string');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// {{PACK_ID}}.echo — echoes the caller-provided message back with a UTC
|
|
2
|
+
// timestamp. Zod-authored — the wire form is JSON Schema, converted at
|
|
3
|
+
// author time by `defineTool`.
|
|
4
|
+
|
|
5
|
+
import { defineTool } from '@kindgi/sdk/define';
|
|
6
|
+
import type { ToolId } from '@kindgi/sdk/types';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
const EchoInput = z.object({
|
|
10
|
+
message: z.string().min(1).max(500),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const EchoOutput = z.object({
|
|
14
|
+
echo: z.string(),
|
|
15
|
+
echoedAt: z.string(),
|
|
16
|
+
characterCount: z.number().int().nonnegative(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const defined = defineTool({
|
|
20
|
+
id: '{{PACK_ID}}.echo' as ToolId,
|
|
21
|
+
description: 'Echoes the caller-provided message with a UTC timestamp + character count.',
|
|
22
|
+
version: '{{PACK_VERSION}}',
|
|
23
|
+
input: EchoInput,
|
|
24
|
+
output: EchoOutput,
|
|
25
|
+
effects: [],
|
|
26
|
+
handler: async (input) => ({
|
|
27
|
+
echo: input.message,
|
|
28
|
+
echoedAt: new Date().toISOString(),
|
|
29
|
+
characterCount: input.message.length,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (defined.kind === 'err') {
|
|
34
|
+
throw new Error(`{{PACK_ID}}.echo failed to compile: ${defined.error.message}`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default defined.value;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// {{PACK_ID}}.fetch-httpbin — declarative tool example (spec form).
|
|
2
|
+
//
|
|
3
|
+
// Uses `defineTool({spec: {kind: 'http', ...}})` — no imperative
|
|
4
|
+
// handler code. The runtime synthesizes the fetch call from the
|
|
5
|
+
// spec at register time. Handler receives validated input; URL
|
|
6
|
+
// template placeholders substitute from that input.
|
|
7
|
+
//
|
|
8
|
+
// This tool hits httpbin.org (a free HTTP debugging service) so
|
|
9
|
+
// it works without any secret configuration. For a real API with
|
|
10
|
+
// authentication, add:
|
|
11
|
+
//
|
|
12
|
+
// authorization: {
|
|
13
|
+
// kind: 'bearer',
|
|
14
|
+
// secretRef: { envName: 'local', name: 'MY_TOKEN' },
|
|
15
|
+
// },
|
|
16
|
+
//
|
|
17
|
+
// The runtime resolves the secret on every call from its secrets
|
|
18
|
+
// store, in the env the ref names — under `kindgi dev`, env `local`
|
|
19
|
+
// is your `.env` / `.env.local`. A secret it can't find fails the
|
|
20
|
+
// call with `secret-unavailable`, naming it.
|
|
21
|
+
|
|
22
|
+
import { defineTool } from '@kindgi/sdk/define';
|
|
23
|
+
import type { ToolId } from '@kindgi/sdk/types';
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
|
|
26
|
+
const FetchInput = z.object({
|
|
27
|
+
path: z.string().regex(/^[a-z0-9\-\/]+$/, 'lowercase path segments only'),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const FetchOutput = z
|
|
31
|
+
.object({
|
|
32
|
+
url: z.string(),
|
|
33
|
+
origin: z.string().optional(),
|
|
34
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
35
|
+
args: z.record(z.string(), z.string()).optional(),
|
|
36
|
+
})
|
|
37
|
+
.passthrough();
|
|
38
|
+
|
|
39
|
+
const defined = defineTool({
|
|
40
|
+
id: '{{PACK_ID}}.fetch-httpbin' as ToolId,
|
|
41
|
+
description:
|
|
42
|
+
'Fetch a path from httpbin.org (an HTTP request debugging service). Useful for testing the framework declarative-tool primitive end-to-end without needing real API credentials.',
|
|
43
|
+
version: '{{PACK_VERSION}}',
|
|
44
|
+
input: FetchInput,
|
|
45
|
+
output: FetchOutput,
|
|
46
|
+
effects: [{ kind: 'reads', resource: 'external:httpbin.org' }],
|
|
47
|
+
spec: {
|
|
48
|
+
kind: 'http',
|
|
49
|
+
method: 'GET',
|
|
50
|
+
urlTemplate: 'https://httpbin.org/{path}',
|
|
51
|
+
headers: [{ name: 'Accept', value: 'application/json' }],
|
|
52
|
+
timeoutMs: 10_000,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
if (defined.kind === 'err') {
|
|
57
|
+
throw new Error(`{{PACK_ID}}.fetch-httpbin failed to compile: ${defined.error.message}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default defined.value;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// {{PACK_ID}}.greet — greets a named recipient. Second Zod-authored tool
|
|
2
|
+
// alongside `echo` to show how a pack composes multiple primitives. It is
|
|
3
|
+
// read-only (`mutating: false`), so it also runs in a dry run.
|
|
4
|
+
|
|
5
|
+
import { defineTool } from '@kindgi/sdk/define';
|
|
6
|
+
import type { ToolId } from '@kindgi/sdk/types';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
const GreetInput = z.object({
|
|
10
|
+
name: z.string().min(1).max(100),
|
|
11
|
+
greeting: z.string().min(1).max(50).default('Hello'),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const GreetOutput = z.object({
|
|
15
|
+
message: z.string(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const defined = defineTool({
|
|
19
|
+
id: '{{PACK_ID}}.greet' as ToolId,
|
|
20
|
+
description: 'Formats a greeting for the named recipient.',
|
|
21
|
+
version: '{{PACK_VERSION}}',
|
|
22
|
+
input: GreetInput,
|
|
23
|
+
output: GreetOutput,
|
|
24
|
+
effects: [],
|
|
25
|
+
mutating: false,
|
|
26
|
+
handler: async (input) => ({
|
|
27
|
+
message: `${input.greeting}, ${input.name}!`,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (defined.kind === 'err') {
|
|
32
|
+
throw new Error(`{{PACK_ID}}.greet failed to compile: ${defined.error.message}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default defined.value;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2023", "DOM"],
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": true
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"tools/**/*.ts",
|
|
21
|
+
"guardrails/**/*.ts",
|
|
22
|
+
"agents/**/*.ts",
|
|
23
|
+
"flows/**/*.ts",
|
|
24
|
+
"kindgi.config.ts"
|
|
25
|
+
],
|
|
26
|
+
"exclude": ["node_modules", "dist", ".kindgi"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Vitest configuration for {{PACK_NAME}}. Scaffolded by `kindgi init`.
|
|
2
|
+
// `kindgi test` shells out to the pack's local vitest install using
|
|
3
|
+
// this config — the CLI does NOT force a vitest version through.
|
|
4
|
+
|
|
5
|
+
import { defineConfig } from 'vitest/config';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
test: {
|
|
9
|
+
include: ['**/*.test.ts'],
|
|
10
|
+
exclude: ['node_modules/**', '.kindgi/**', 'dist/**'],
|
|
11
|
+
reporters: ['default'],
|
|
12
|
+
passWithNoTests: true,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A prompt whose answer isn't echoed. Tests hand in a fake. */
|
|
2
|
+
export interface TtySeam {
|
|
3
|
+
/** Rejects with `PromptCancelled` when the person presses Ctrl+C (or Ctrl+D) instead. */
|
|
4
|
+
promptHidden(prompt: string): Promise<string>;
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
/** The person cancelled a prompt (Ctrl+C, or Ctrl+D): no answer, not an empty one. */
|
|
8
|
+
export declare class PromptCancelled extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
/** Whether stdin is a terminal, so a hidden prompt can read from it. */
|
|
12
|
+
export declare function stdinIsTty(): boolean;
|
|
13
|
+
export declare function stripTrailingNewline(s: string): string;
|
|
14
|
+
export declare function readStdinToEnd(): Promise<string>;
|
|
15
|
+
/** The hidden prompt on the real terminal: the prompt on stderr, keystrokes from stdin. */
|
|
16
|
+
export declare function realTtySeam(): TtySeam;
|
|
17
|
+
//# sourceMappingURL=terminal-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-input.d.ts","sourceRoot":"","sources":["../src/terminal-input.ts"],"names":[],"mappings":"AAaA,gEAAgE;AAChE,MAAM,WAAW,OAAO;IACtB,yFAAyF;IACzF,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,KAAK,IAAI,IAAI,CAAC;CACf;AAED,sFAAsF;AACtF,qBAAa,eAAgB,SAAQ,KAAK;;CAKzC;AAED,wEAAwE;AACxE,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAMtD;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,IAAI,OAAO,CAsDrC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/**
|
|
4
|
+
* Reading a secret from the person at the terminal (a hidden prompt) or
|
|
5
|
+
* from stdin: the value of `kindgi secrets set`, the registry token of
|
|
6
|
+
* `kindgi auth registry`. Nothing here echoes or logs what it reads.
|
|
7
|
+
*/
|
|
8
|
+
import { EOL } from 'node:os';
|
|
9
|
+
import * as readline from 'node:readline';
|
|
10
|
+
/** The person cancelled a prompt (Ctrl+C, or Ctrl+D): no answer, not an empty one. */
|
|
11
|
+
export class PromptCancelled extends Error {
|
|
12
|
+
constructor() {
|
|
13
|
+
super('Cancelled.');
|
|
14
|
+
this.name = 'PromptCancelled';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** Whether stdin is a terminal, so a hidden prompt can read from it. */
|
|
18
|
+
export function stdinIsTty() {
|
|
19
|
+
return Boolean(process.stdin.isTTY);
|
|
20
|
+
}
|
|
21
|
+
export function stripTrailingNewline(s) {
|
|
22
|
+
if (s.endsWith(EOL))
|
|
23
|
+
return s.slice(0, -EOL.length);
|
|
24
|
+
if (s.endsWith('\n'))
|
|
25
|
+
return s.slice(0, -1);
|
|
26
|
+
return s;
|
|
27
|
+
}
|
|
28
|
+
export async function readStdinToEnd() {
|
|
29
|
+
const chunks = [];
|
|
30
|
+
for await (const chunk of process.stdin) {
|
|
31
|
+
chunks.push(chunk);
|
|
32
|
+
}
|
|
33
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
34
|
+
}
|
|
35
|
+
/** The hidden prompt on the real terminal: the prompt on stderr, keystrokes from stdin. */
|
|
36
|
+
export function realTtySeam() {
|
|
37
|
+
const rl = readline.createInterface({
|
|
38
|
+
input: process.stdin,
|
|
39
|
+
output: process.stderr,
|
|
40
|
+
terminal: true,
|
|
41
|
+
});
|
|
42
|
+
// Silence output while user types. `readline` doesn't expose a
|
|
43
|
+
// built-in "no-echo" mode; the standard trick is to override the
|
|
44
|
+
// internal `_writeToOutput` on the interface. This is portable
|
|
45
|
+
// enough across Node 22.x + prints only the prompt itself.
|
|
46
|
+
const rlAny = rl;
|
|
47
|
+
return {
|
|
48
|
+
promptHidden: (prompt) => new Promise((resolve, reject) => {
|
|
49
|
+
const originalWrite = rlAny._writeToOutput;
|
|
50
|
+
const done = () => {
|
|
51
|
+
rl.off('SIGINT', cancel);
|
|
52
|
+
rl.off('close', cancel);
|
|
53
|
+
if (originalWrite !== undefined) {
|
|
54
|
+
rlAny._writeToOutput = originalWrite;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// biome-ignore lint/performance/noDelete: readline distinguishes missing property from undefined
|
|
58
|
+
delete rlAny._writeToOutput;
|
|
59
|
+
}
|
|
60
|
+
(rlAny.output ?? process.stderr).write('\n');
|
|
61
|
+
};
|
|
62
|
+
// Ctrl+C in a raw-mode prompt reaches readline, not the process:
|
|
63
|
+
// without these, readline closes, the answer never comes, and the
|
|
64
|
+
// process exits 0 as if nothing went wrong.
|
|
65
|
+
const cancel = () => {
|
|
66
|
+
done();
|
|
67
|
+
reject(new PromptCancelled());
|
|
68
|
+
};
|
|
69
|
+
rl.once('SIGINT', cancel);
|
|
70
|
+
rl.once('close', cancel);
|
|
71
|
+
rlAny._writeToOutput = function overrideWrite(str) {
|
|
72
|
+
// Write only the prompt itself (rl.question emits the
|
|
73
|
+
// prompt via the same channel); swallow keystrokes.
|
|
74
|
+
if (str === prompt) {
|
|
75
|
+
(rlAny.output ?? process.stderr).write(str);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
rl.question(prompt, (answer) => {
|
|
79
|
+
done();
|
|
80
|
+
resolve(answer);
|
|
81
|
+
});
|
|
82
|
+
}),
|
|
83
|
+
close: () => {
|
|
84
|
+
rl.close();
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=terminal-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-input.js","sourceRoot":"","sources":["../src/terminal-input.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAU1C,sFAAsF;AACtF,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC;QACE,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,wEAAwE;AACxE,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,CAAE,OAAO,CAAC,KAAoB,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,CAAS;IAC5C,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpD,IAAI,CAAC,CAAC,QAAQ,CAA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AC,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/C,CAAC,CAAC;YACF,iEAAiE;YACjE,kEAAkE;YAClE,4CAA4C;YAC5C,MAAM,MAAM,GAAG,GAAS,EAAE;gBACxB,IAAI,EAAE,CAAC;gBACP,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;YAChC,CAAC,CAAC;YACF,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1B,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACzB,KAAK,CAAC,cAAc,GAAG,SAAS,aAAa,CAAC,GAAW;gBACvD,sDAAsD;gBACtD,oDAAoD;gBACpD,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;oBACnB,CAAC,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC,CAAC;YACF,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;gBAC7B,IAAI,EAAE,CAAC;gBACP,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACJ,KAAK,EAAE,GAAG,EAAE;YACV,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/test/defaults.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAmC,WAAW,EAAE,MAAM,cAAc,CAAC;AASjF,eAAO,MAAM,iBAAiB,EAAE,WAc/B,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/**
|
|
4
|
+
* Production wiring for `kindgi test`. Uses `pnpm exec vitest` when
|
|
5
|
+
* the pack root has a `pnpm-workspace.yaml` or `pnpm-lock.yaml` above
|
|
6
|
+
* it, otherwise falls back to `npx --no-install vitest`. Either way,
|
|
7
|
+
* the runner used is the pack's OWN installed vitest — the CLI never
|
|
8
|
+
* forces a version through.
|
|
9
|
+
*/
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import { stat } from 'node:fs/promises';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
const VITEST_CONFIGS = [
|
|
14
|
+
'vitest.config.ts',
|
|
15
|
+
'vitest.config.mjs',
|
|
16
|
+
'vitest.config.js',
|
|
17
|
+
'vitest.config.cjs',
|
|
18
|
+
];
|
|
19
|
+
export const REAL_TEST_RUNNERS = {
|
|
20
|
+
hasVitestConfig: async ({ packDir }) => {
|
|
21
|
+
for (const name of VITEST_CONFIGS) {
|
|
22
|
+
const abs = join(packDir, name);
|
|
23
|
+
try {
|
|
24
|
+
const s = await stat(abs);
|
|
25
|
+
if (s.isFile())
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// try next
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
},
|
|
34
|
+
runTests: async (opts) => spawnRunner(opts),
|
|
35
|
+
};
|
|
36
|
+
async function spawnRunner(opts) {
|
|
37
|
+
// Prefer `pnpm exec` when a lockfile shape suggests pnpm; else npx.
|
|
38
|
+
const usePnpm = await hasFile(opts.packDir, ['pnpm-lock.yaml', 'pnpm-workspace.yaml']);
|
|
39
|
+
const binary = usePnpm ? 'pnpm' : 'npx';
|
|
40
|
+
const args = usePnpm
|
|
41
|
+
? ['exec', 'vitest', ...opts.args]
|
|
42
|
+
: ['--no-install', 'vitest', ...opts.args];
|
|
43
|
+
return new Promise((resolvePromise) => {
|
|
44
|
+
let child;
|
|
45
|
+
try {
|
|
46
|
+
child = spawn(binary, args, {
|
|
47
|
+
cwd: opts.packDir,
|
|
48
|
+
env: { ...process.env, ...opts.env },
|
|
49
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
50
|
+
...(opts.signal !== undefined && { signal: opts.signal }),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
resolvePromise({
|
|
55
|
+
spawned: false,
|
|
56
|
+
exitCode: 1,
|
|
57
|
+
reason: 'runner-spawn-error',
|
|
58
|
+
resolvedBinary: binary,
|
|
59
|
+
});
|
|
60
|
+
// Note the closure — err isn't surfaced structurally here; the
|
|
61
|
+
// command's stderr hint is generic. If we ever need typed spawn
|
|
62
|
+
// errors, extend RunTestsResult with an `errorMessage` field.
|
|
63
|
+
void err;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
child.stdout?.on('data', (chunk) => {
|
|
67
|
+
opts.onLog?.(chunk.toString('utf8'));
|
|
68
|
+
});
|
|
69
|
+
child.stderr?.on('data', (chunk) => {
|
|
70
|
+
opts.onLog?.(chunk.toString('utf8'));
|
|
71
|
+
});
|
|
72
|
+
child.on('error', (err) => {
|
|
73
|
+
// ENOENT surfaces here (binary not found on PATH).
|
|
74
|
+
const code = err.code;
|
|
75
|
+
resolvePromise({
|
|
76
|
+
spawned: false,
|
|
77
|
+
exitCode: 1,
|
|
78
|
+
reason: code === 'ENOENT' ? 'runner-binary-not-found' : 'runner-spawn-error',
|
|
79
|
+
resolvedBinary: binary,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
child.on('close', (code) => {
|
|
83
|
+
resolvePromise({
|
|
84
|
+
spawned: true,
|
|
85
|
+
exitCode: code ?? 1,
|
|
86
|
+
resolvedBinary: binary,
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async function hasFile(dir, names) {
|
|
92
|
+
for (const name of names) {
|
|
93
|
+
try {
|
|
94
|
+
const s = await stat(join(dir, name));
|
|
95
|
+
if (s.isFile())
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// try next
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/test/defaults.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC;;;;;;GAMG;AAEH,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,MAAM,cAAc,GAAG;IACrB,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,eAAe,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACrC,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC1B,IAAI,CAAC,CAAC,MAAM,EAAE;oBAAE,OAAO,IAAI,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,WAAW;YACb,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,QAAQ,EAAE,KAAK,EAAE,IAAI,EAA2B,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;CACrE,CAAC;AAEF,KAAK,UAAU,WAAW,CAAC,IAAqB;IAC9C,oEAAoE;IACpE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAA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injectable seams for `kindgi test`. The test-runner shellout
|
|
3
|
+
* flows through this shape so tests inspect the invocation without
|
|
4
|
+
* spawning real vitest.
|
|
5
|
+
*/
|
|
6
|
+
export interface RunTestsOptions {
|
|
7
|
+
/** Absolute pack directory the runner spawns in. */
|
|
8
|
+
readonly packDir: string;
|
|
9
|
+
/** Which runner to invoke. v0.1 only `vitest` is supported. */
|
|
10
|
+
readonly runner: 'vitest';
|
|
11
|
+
/**
|
|
12
|
+
* Arguments to append to the runner invocation. `--watch` /
|
|
13
|
+
* `--reporter <name>` / any pass-through `-- ...` tokens land here.
|
|
14
|
+
*/
|
|
15
|
+
readonly args: readonly string[];
|
|
16
|
+
/** Env vars threaded to the child process. */
|
|
17
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
18
|
+
/**
|
|
19
|
+
* Abort signal to forward to the child process. Watch-mode test
|
|
20
|
+
* runs listen on this to exit gracefully.
|
|
21
|
+
*/
|
|
22
|
+
readonly signal?: AbortSignal;
|
|
23
|
+
/**
|
|
24
|
+
* Optional log sink for the child's stdout/stderr. Production wiring
|
|
25
|
+
* pipes directly to the current process; tests capture into an array.
|
|
26
|
+
*/
|
|
27
|
+
readonly onLog?: (chunk: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface RunTestsResult {
|
|
30
|
+
/** Runner exit code — 0 on success, non-zero on failed tests. */
|
|
31
|
+
readonly exitCode: number;
|
|
32
|
+
/**
|
|
33
|
+
* `true` if the runner binary was resolved + spawned. `false` when
|
|
34
|
+
* the CLI probed for the local install and came back empty; the
|
|
35
|
+
* caller surfaces the missing-binary hint in that path.
|
|
36
|
+
*/
|
|
37
|
+
readonly spawned: boolean;
|
|
38
|
+
/** When `spawned=false`, a machine-readable code explaining why. */
|
|
39
|
+
readonly reason?: 'runner-binary-not-found' | 'runner-spawn-error';
|
|
40
|
+
/** Runner binary path (or command name) resolved by the runner. */
|
|
41
|
+
readonly resolvedBinary?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface HasVitestConfigOptions {
|
|
44
|
+
readonly packDir: string;
|
|
45
|
+
}
|
|
46
|
+
export interface TestRunners {
|
|
47
|
+
/**
|
|
48
|
+
* Check whether the pack ships a vitest config. `kindgi test`
|
|
49
|
+
* refuses to spawn without one — a bare `vitest` invocation would
|
|
50
|
+
* either sweep the whole repo (dev machines) or fail cryptically
|
|
51
|
+
* (fresh clones).
|
|
52
|
+
*/
|
|
53
|
+
readonly hasVitestConfig: (opts: HasVitestConfigOptions) => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Spawn the runner. Blocks until the runner exits; forwards logs to
|
|
56
|
+
* `opts.onLog` line-by-line.
|
|
57
|
+
*/
|
|
58
|
+
readonly runTests: (opts: RunTestsOptions) => Promise<RunTestsResult>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=runners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runners.d.ts","sourceRoot":"","sources":["../../src/test/runners.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;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