@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,89 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { projectIdFlag, readJsonInput, requiredPositional, runSdk, stringFlag } from './helpers.js';
|
|
4
|
+
const list = {
|
|
5
|
+
kind: 'leaf',
|
|
6
|
+
name: 'list',
|
|
7
|
+
description: 'List registered guardrails.',
|
|
8
|
+
usage: 'kindgi guardrails list [--name=<prefix>] [--limit=<n>] [--cursor=<c>]',
|
|
9
|
+
optionSpec: {
|
|
10
|
+
name: { type: 'string', description: 'Only the guardrails whose id starts with this prefix.' },
|
|
11
|
+
limit: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'The most guardrails to return (default 25, at most 100).',
|
|
14
|
+
},
|
|
15
|
+
cursor: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: "Resume after this cursor, from the previous page's `nextCursor`.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
run: (ctx) => runSdk(ctx, 'guardrails list', async () => {
|
|
21
|
+
const name = stringFlag(ctx, 'name');
|
|
22
|
+
const cursor = stringFlag(ctx, 'cursor');
|
|
23
|
+
const limitStr = stringFlag(ctx, 'limit');
|
|
24
|
+
const limit = limitStr !== undefined ? Number.parseInt(limitStr, 10) : undefined;
|
|
25
|
+
if (limit !== undefined && Number.isNaN(limit)) {
|
|
26
|
+
throw new Error(`--limit must be an integer, got "${limitStr}"`);
|
|
27
|
+
}
|
|
28
|
+
return await ctx.client().guardrails.list({
|
|
29
|
+
...(name !== undefined && { name }),
|
|
30
|
+
...(cursor !== undefined && { cursor: cursor }),
|
|
31
|
+
...(limit !== undefined && { limit }),
|
|
32
|
+
});
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
const get = {
|
|
36
|
+
kind: 'leaf',
|
|
37
|
+
name: 'get',
|
|
38
|
+
description: 'Fetch a guardrail by id.',
|
|
39
|
+
usage: 'kindgi guardrails get <guardrail-id>',
|
|
40
|
+
run: (ctx) => runSdk(ctx, 'guardrails get', async () => {
|
|
41
|
+
const id = requiredPositional(ctx, 0, 'guardrail-id');
|
|
42
|
+
return await ctx.client().guardrails.get(id);
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
const register = {
|
|
46
|
+
kind: 'leaf',
|
|
47
|
+
name: 'register',
|
|
48
|
+
description: 'Register a guardrail.',
|
|
49
|
+
usage: 'kindgi guardrails register --spec=<json-or-@file> [--project=<project-id>]',
|
|
50
|
+
optionSpec: {
|
|
51
|
+
spec: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'The guardrail definition as JSON, or `@<file>` to read it from a file. Required.',
|
|
54
|
+
},
|
|
55
|
+
project: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: "The project to register the guardrail in, by id (default: the tenant's Default project).",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
run: (ctx) => runSdk(ctx, 'guardrails register', async () => {
|
|
61
|
+
const specText = stringFlag(ctx, 'spec');
|
|
62
|
+
if (specText === undefined)
|
|
63
|
+
throw new Error('--spec=<json-or-@file> is required');
|
|
64
|
+
const spec = await readJsonInput(specText);
|
|
65
|
+
const projectId = await projectIdFlag(ctx);
|
|
66
|
+
return await ctx.client().guardrails.author(spec, { projectId });
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
const unregister = {
|
|
70
|
+
kind: 'leaf',
|
|
71
|
+
name: 'unregister',
|
|
72
|
+
description: 'Unregister a guardrail.',
|
|
73
|
+
usage: 'kindgi guardrails unregister <guardrail-id>',
|
|
74
|
+
run: (ctx) => runSdk(ctx, 'guardrails unregister', async () => {
|
|
75
|
+
const id = requiredPositional(ctx, 0, 'guardrail-id');
|
|
76
|
+
// SDK calls it `delete` — the api-server route is POST
|
|
77
|
+
// /v1/guardrails/{id}/unregister (soft-tombstone semantics).
|
|
78
|
+
// The CLI verb name matches the wire route + prod ops muscle
|
|
79
|
+
// memory; the client mapping happens at the SDK boundary.
|
|
80
|
+
return await ctx.client().guardrails.delete(id);
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
export const guardrailsCommand = {
|
|
84
|
+
kind: 'group',
|
|
85
|
+
name: 'guardrails',
|
|
86
|
+
description: 'Manage guardrail registrations.',
|
|
87
|
+
subcommands: [list, get, register, unregister],
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=guardrails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardrails.js","sourceRoot":"","sources":["../../src/commands/guardrails.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAIjC,OAAO,EAAE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aAAa,CAAC,GAAG,CAAC,CAAC;QAC3C,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAa,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,UAAU,GAAgB;IAC9B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE,6CAA6C;IACpD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CACX,MAAM,CAAC,GAAG,EAAE,uBAAuB,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,EAAE,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAgB,CAAC;QACrE,uDAAuD;QACvD,6DAA6D;QAC7D,6DAA6D;QAC7D,0DAA0D;QAC1D,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAY;IACxC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command, LeafCommand } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* GET /health — public route, no auth required. Uses direct fetch
|
|
4
|
+
* because the SDK has no `client.health()` method.
|
|
5
|
+
*/
|
|
6
|
+
export declare const healthCommand: LeafCommand;
|
|
7
|
+
export declare function healthLeaf(): Command;
|
|
8
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WA2B3B,CAAC;AAEF,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { renderJson } from '../output.js';
|
|
4
|
+
/**
|
|
5
|
+
* GET /health — public route, no auth required. Uses direct fetch
|
|
6
|
+
* because the SDK has no `client.health()` method.
|
|
7
|
+
*/
|
|
8
|
+
export const healthCommand = {
|
|
9
|
+
kind: 'leaf',
|
|
10
|
+
name: 'health',
|
|
11
|
+
description: 'Ping the API server (GET /health).',
|
|
12
|
+
usage: 'kindgi health',
|
|
13
|
+
run: async (ctx) => {
|
|
14
|
+
const base = ctx.apiUrl();
|
|
15
|
+
const url = `${base.replace(/\/+$/, '')}/health`;
|
|
16
|
+
try {
|
|
17
|
+
const res = await ctx.fetch(url, { method: 'GET' });
|
|
18
|
+
if (!res.ok) {
|
|
19
|
+
return {
|
|
20
|
+
kind: 'error',
|
|
21
|
+
stderr: `Health check failed: HTTP ${res.status}\n`,
|
|
22
|
+
exitCode: 1,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const body = (await res.json().catch(() => ({})));
|
|
26
|
+
return { kind: 'ok', rendered: renderJson(body, ctx.globals.format) };
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return {
|
|
30
|
+
kind: 'error',
|
|
31
|
+
stderr: `Health check failed: ${err.message}\n`,
|
|
32
|
+
exitCode: 1,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export function healthLeaf() {
|
|
38
|
+
return healthCommand;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0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CAAC;aACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,UAAU;IACxB,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CommandContext } from '../context.js';
|
|
2
|
+
import { type Column, type Rendered } from '../output.js';
|
|
3
|
+
import type { CommandResult } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How a list command's page renders under `--table`: its rows and the
|
|
6
|
+
* columns to show. A command without one prints JSON under `--table`.
|
|
7
|
+
*/
|
|
8
|
+
export interface TableSpec<Page, Row> {
|
|
9
|
+
readonly rows: (page: Page) => readonly Row[];
|
|
10
|
+
readonly columns: readonly Column<Row>[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Wrap an SDK call so any thrown value maps to a `CommandResult`. Any
|
|
14
|
+
* `KindgiApiError` — including the preview `not-implemented-in-preview`
|
|
15
|
+
* stub — is rendered via `formatThrown`. With `table`, `--table` renders
|
|
16
|
+
* the page as a table.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runSdk<T, Row = never>(ctx: CommandContext, commandLabel: string, fn: () => Promise<T>, table?: TableSpec<T, Row>): Promise<CommandResult>;
|
|
19
|
+
/** `text` cut to `max` characters, ending in `…` when cut — for a table cell. */
|
|
20
|
+
export declare function truncateCell(text: string, max: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Call a leaf that has already produced a `Rendered` (custom formatting
|
|
23
|
+
* such as tables), still routing any thrown value through the standard
|
|
24
|
+
* error formatter.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runSdkRendered(ctx: CommandContext, commandLabel: string, fn: () => Promise<Rendered>): Promise<CommandResult>;
|
|
27
|
+
export declare function commandResultFromThrown(err: unknown, ctx: CommandContext, commandLabel: string): CommandResult;
|
|
28
|
+
/**
|
|
29
|
+
* Ensure a stubbed SDK method surfaces the same "not wired yet" error
|
|
30
|
+
* shape as the SDK itself throws when the method exists but the
|
|
31
|
+
* transport body is a stub. Used for CLI commands that map to routes
|
|
32
|
+
* whose SDK method is missing entirely today.
|
|
33
|
+
*/
|
|
34
|
+
export declare function throwUnwired(methodName: string): never;
|
|
35
|
+
/** Read a JSON value from either a file path (with `@` prefix) or an inline string. */
|
|
36
|
+
export declare function readJsonInput(spec: string): Promise<unknown>;
|
|
37
|
+
/** Extract a required positional arg from `ctx.positionals`. */
|
|
38
|
+
export declare function requiredPositional(ctx: CommandContext, index: number, label: string): string;
|
|
39
|
+
/** Extract an optional string flag. */
|
|
40
|
+
export declare function stringFlag(ctx: CommandContext, name: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The project a command writes into: `--project=<id>`, or the tenant's
|
|
43
|
+
* Default project when the flag is absent.
|
|
44
|
+
*/
|
|
45
|
+
export declare function projectIdFlag(ctx: CommandContext): Promise<string>;
|
|
46
|
+
/** Extract an optional integer flag; throws on non-integer values. */
|
|
47
|
+
export declare function integerFlag(ctx: CommandContext, name: string): number | undefined;
|
|
48
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/commands/helpers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAA2B,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,IAAI,EAAE,GAAG;IAClC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,GAAG,EAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAAE,GAA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110 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { KindgiApiError } from '@kindgi/client';
|
|
5
|
+
import { formatThrown } from '../errors.js';
|
|
6
|
+
import { renderJson, renderTable } from '../output.js';
|
|
7
|
+
/**
|
|
8
|
+
* Wrap an SDK call so any thrown value maps to a `CommandResult`. Any
|
|
9
|
+
* `KindgiApiError` — including the preview `not-implemented-in-preview`
|
|
10
|
+
* stub — is rendered via `formatThrown`. With `table`, `--table` renders
|
|
11
|
+
* the page as a table.
|
|
12
|
+
*/
|
|
13
|
+
export async function runSdk(ctx, commandLabel, fn, table) {
|
|
14
|
+
try {
|
|
15
|
+
const value = await fn();
|
|
16
|
+
if (table !== undefined && ctx.globals.format === 'table') {
|
|
17
|
+
return { kind: 'ok', rendered: renderPageTable(value, table) };
|
|
18
|
+
}
|
|
19
|
+
return { kind: 'ok', rendered: renderJson(value, ctx.globals.format) };
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
return commandResultFromThrown(err, ctx, commandLabel);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** A page as a table; the next page's `--cursor`, which the table has no room for, on stderr. */
|
|
26
|
+
function renderPageTable(page, table) {
|
|
27
|
+
const rendered = renderTable(table.rows(page), table.columns);
|
|
28
|
+
const next = page.nextCursor;
|
|
29
|
+
return typeof next === 'string' && next !== ''
|
|
30
|
+
? { ...rendered, stderr: `Next page: --cursor=${next}\n` }
|
|
31
|
+
: rendered;
|
|
32
|
+
}
|
|
33
|
+
/** `text` cut to `max` characters, ending in `…` when cut — for a table cell. */
|
|
34
|
+
export function truncateCell(text, max) {
|
|
35
|
+
const oneLine = text.replace(/\s+/g, ' ').trim();
|
|
36
|
+
return oneLine.length > max ? `${oneLine.slice(0, max - 1)}…` : oneLine;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Call a leaf that has already produced a `Rendered` (custom formatting
|
|
40
|
+
* such as tables), still routing any thrown value through the standard
|
|
41
|
+
* error formatter.
|
|
42
|
+
*/
|
|
43
|
+
export async function runSdkRendered(ctx, commandLabel, fn) {
|
|
44
|
+
try {
|
|
45
|
+
const rendered = await fn();
|
|
46
|
+
return { kind: 'ok', rendered };
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return commandResultFromThrown(err, ctx, commandLabel);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export function commandResultFromThrown(err, ctx, commandLabel) {
|
|
53
|
+
const cliErr = formatThrown(err, { commandLabel, verbose: ctx.globals.verbose });
|
|
54
|
+
return { kind: 'error', stderr: cliErr.stderr, exitCode: cliErr.exitCode };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Ensure a stubbed SDK method surfaces the same "not wired yet" error
|
|
58
|
+
* shape as the SDK itself throws when the method exists but the
|
|
59
|
+
* transport body is a stub. Used for CLI commands that map to routes
|
|
60
|
+
* whose SDK method is missing entirely today.
|
|
61
|
+
*/
|
|
62
|
+
export function throwUnwired(methodName) {
|
|
63
|
+
throw new KindgiApiError({
|
|
64
|
+
code: 'not-implemented-in-preview',
|
|
65
|
+
message: `${methodName}: transport not implemented — SDK method not yet exposed in this preview release`,
|
|
66
|
+
method: methodName,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** Read a JSON value from either a file path (with `@` prefix) or an inline string. */
|
|
70
|
+
export async function readJsonInput(spec) {
|
|
71
|
+
const raw = spec.startsWith('@') ? await readFile(spec.slice(1), 'utf8') : spec;
|
|
72
|
+
try {
|
|
73
|
+
return JSON.parse(raw);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
throw new Error(`Malformed JSON input: ${err.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Extract a required positional arg from `ctx.positionals`. */
|
|
80
|
+
export function requiredPositional(ctx, index, label) {
|
|
81
|
+
const value = ctx.positionals[index];
|
|
82
|
+
if (typeof value !== 'string' || value === '') {
|
|
83
|
+
throw new Error(`Missing required argument: ${label}`);
|
|
84
|
+
}
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
/** Extract an optional string flag. */
|
|
88
|
+
export function stringFlag(ctx, name) {
|
|
89
|
+
const raw = ctx.options[name];
|
|
90
|
+
return typeof raw === 'string' && raw !== '' ? raw : undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The project a command writes into: `--project=<id>`, or the tenant's
|
|
94
|
+
* Default project when the flag is absent.
|
|
95
|
+
*/
|
|
96
|
+
export async function projectIdFlag(ctx) {
|
|
97
|
+
return stringFlag(ctx, 'project') ?? (await ctx.client().projects.getDefault()).id;
|
|
98
|
+
}
|
|
99
|
+
/** Extract an optional integer flag; throws on non-integer values. */
|
|
100
|
+
export function integerFlag(ctx, name) {
|
|
101
|
+
const raw = ctx.options[name];
|
|
102
|
+
if (typeof raw !== 'string' || raw === '')
|
|
103
|
+
return undefined;
|
|
104
|
+
const n = Number(raw);
|
|
105
|
+
if (!Number.isInteger(n)) {
|
|
106
|
+
throw new Error(`--${name} must be an integer, got '${raw}'`);
|
|
107
|
+
}
|
|
108
|
+
return n;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/commands/helpers.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAA8B,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAYnF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UA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AM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,6BAA6B,GAAG,GAAG,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAiC3C,CAAC;AAEF,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/C"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { adaptersCommand } from './adapters.js';
|
|
4
|
+
import { agentsCommand } from './agents.js';
|
|
5
|
+
import { approvalsCommand } from './approvals.js';
|
|
6
|
+
import { artifactsCommand } from './artifacts.js';
|
|
7
|
+
import { authCommand } from './auth.js';
|
|
8
|
+
import { buildCommand } from './build.js';
|
|
9
|
+
import { capabilitiesCommand } from './capabilities.js';
|
|
10
|
+
import { conversationsCommand } from './conversations.js';
|
|
11
|
+
import { deployCommand } from './deploy.js';
|
|
12
|
+
import { devCommand } from './dev.js';
|
|
13
|
+
import { envCommand } from './env.js';
|
|
14
|
+
import { feedbackCommand } from './feedback.js';
|
|
15
|
+
import { flowsCommand } from './flows.js';
|
|
16
|
+
import { guardrailsCommand } from './guardrails.js';
|
|
17
|
+
import { healthCommand } from './health.js';
|
|
18
|
+
import { initCommand } from './init.js';
|
|
19
|
+
import { keyCommand } from './key.js';
|
|
20
|
+
import { mcpCommand, mcpLaunchCommand } from './mcp.js';
|
|
21
|
+
import { memoryCommand } from './memory.js';
|
|
22
|
+
import { observationsCommand } from './observations.js';
|
|
23
|
+
import { proposalsCommand } from './proposals.js';
|
|
24
|
+
import { provenanceCommand } from './provenance.js';
|
|
25
|
+
import { providersCommand } from './providers.js';
|
|
26
|
+
import { reviewersCommand } from './reviewers.js';
|
|
27
|
+
import { runsCommand } from './runs.js';
|
|
28
|
+
import { secretsCommand } from './secrets.js';
|
|
29
|
+
import { skillsCommand } from './skills.js';
|
|
30
|
+
import { testCommand } from './test.js';
|
|
31
|
+
import { tokensCommand } from './tokens.js';
|
|
32
|
+
import { toolsCommand } from './tools.js';
|
|
33
|
+
import { versionCommand } from './version.js';
|
|
34
|
+
export const ROOT_COMMANDS = [
|
|
35
|
+
authCommand,
|
|
36
|
+
initCommand,
|
|
37
|
+
devCommand,
|
|
38
|
+
buildCommand,
|
|
39
|
+
deployCommand,
|
|
40
|
+
testCommand,
|
|
41
|
+
envCommand,
|
|
42
|
+
secretsCommand,
|
|
43
|
+
keyCommand,
|
|
44
|
+
mcpCommand,
|
|
45
|
+
mcpLaunchCommand,
|
|
46
|
+
runsCommand,
|
|
47
|
+
agentsCommand,
|
|
48
|
+
conversationsCommand,
|
|
49
|
+
toolsCommand,
|
|
50
|
+
guardrailsCommand,
|
|
51
|
+
memoryCommand,
|
|
52
|
+
proposalsCommand,
|
|
53
|
+
provenanceCommand,
|
|
54
|
+
artifactsCommand,
|
|
55
|
+
flowsCommand,
|
|
56
|
+
approvalsCommand,
|
|
57
|
+
reviewersCommand,
|
|
58
|
+
observationsCommand,
|
|
59
|
+
tokensCommand,
|
|
60
|
+
capabilitiesCommand,
|
|
61
|
+
providersCommand,
|
|
62
|
+
adaptersCommand,
|
|
63
|
+
skillsCommand,
|
|
64
|
+
feedbackCommand,
|
|
65
|
+
healthCommand,
|
|
66
|
+
versionCommand,
|
|
67
|
+
];
|
|
68
|
+
export function findCommand(tokens) {
|
|
69
|
+
if (tokens.length === 0)
|
|
70
|
+
return null;
|
|
71
|
+
const [first, ...rest] = tokens;
|
|
72
|
+
const top = ROOT_COMMANDS.find((c) => c.name === first);
|
|
73
|
+
if (top === undefined)
|
|
74
|
+
return null;
|
|
75
|
+
if (top.kind === 'leaf')
|
|
76
|
+
return { command: top, consumed: 1 };
|
|
77
|
+
return descend(top, rest, 1);
|
|
78
|
+
}
|
|
79
|
+
function descend(group, tokens, consumedSoFar) {
|
|
80
|
+
if (tokens.length === 0)
|
|
81
|
+
return { command: group, consumed: consumedSoFar };
|
|
82
|
+
const [first, ...rest] = tokens;
|
|
83
|
+
const child = group.subcommands.find((c) => c.name === first);
|
|
84
|
+
if (child === undefined)
|
|
85
|
+
return { command: group, consumed: consumedSoFar };
|
|
86
|
+
if (child.kind === 'leaf')
|
|
87
|
+
return { command: child, consumed: consumedSoFar + 1 };
|
|
88
|
+
return descend(child, rest, consumedSoFar + 1);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAA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AAK,KAAK,CAAC,CAAC;IAC9D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC5E,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,GAAG,CAAC,EAAE,CAAC;IAClF,OAAO,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CommandContext } from '../context.js';
|
|
2
|
+
import type { CommandResult, LeafCommand } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* `kindgi init <pack-name>` — scaffolds a fresh pack repo.
|
|
5
|
+
*
|
|
6
|
+
* Writes the pack anatomy (config, the four primitives' folders,
|
|
7
|
+
* agent instructions and skills) that the other commands — `dev`,
|
|
8
|
+
* `build`, `deploy`, `test`, `env`, `key` — work on.
|
|
9
|
+
*
|
|
10
|
+
* Templates live under `src/templates/<name>/`. Files ending in `.tmpl`
|
|
11
|
+
* are treated as templates (suffix stripped on write, placeholders
|
|
12
|
+
* substituted); files without the suffix are copied verbatim. Placeholders
|
|
13
|
+
* are simple string replaces — `{{PACK_NAME}}`, `{{PACK_ID}}`,
|
|
14
|
+
* `{{PACK_VERSION}}`. No template engine: the framework's job isn't to be
|
|
15
|
+
* a template engine.
|
|
16
|
+
*/
|
|
17
|
+
export declare const initCommand: LeafCommand;
|
|
18
|
+
/** Pack ids: lowercase dot-separated segments, e.g. `acme.billing`. */
|
|
19
|
+
export declare const PACK_ID_REGEX: RegExp;
|
|
20
|
+
export declare const AVAILABLE_TEMPLATES: readonly ["minimal", "sample", "python"];
|
|
21
|
+
export type TemplateName = (typeof AVAILABLE_TEMPLATES)[number];
|
|
22
|
+
/**
|
|
23
|
+
* Test-friendly entry point — takes an explicit templates root + skills
|
|
24
|
+
* root so tests can point at either the source tree or a temp fixture.
|
|
25
|
+
* `skillsRoot` is optional; when undefined, no skills are copied (the
|
|
26
|
+
* default when the CLI is run from source without a build).
|
|
27
|
+
*/
|
|
28
|
+
export declare function runInit(ctx: CommandContext, templatesRoot: string, skillsRoot?: string): Promise<CommandResult>;
|
|
29
|
+
export declare function defaultTemplatesRoot(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Absolute path to the bundled `@kindgi/sdk` skills the CLI copies
|
|
32
|
+
* into the scaffolded pack's `.claude/skills/`. Two candidate
|
|
33
|
+
* locations, checked in order:
|
|
34
|
+
*
|
|
35
|
+
* 1. `../sdk-skills/` relative to this file — the built form, where
|
|
36
|
+
* `scripts/copy-build-assets.mjs` bundled the skills at CLI build.
|
|
37
|
+
* 2. `skills/` inside the resolved `@kindgi/sdk` package — the source
|
|
38
|
+
* form, used when running the CLI from source (tests,
|
|
39
|
+
* `pnpm --filter @kindgi/cli test`). Resolved by package name, so it
|
|
40
|
+
* works in any repo layout.
|
|
41
|
+
*
|
|
42
|
+
* Returns `undefined` when neither exists — a broken install; callers
|
|
43
|
+
* scaffold the pack without skills.
|
|
44
|
+
*/
|
|
45
|
+
export declare function defaultSdkSkillsRoot(): string | undefined;
|
|
46
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAoBpD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,WAgDzB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,aAAa,QAA0C,CAAC;AAErE,eAAO,MAAM,mBAAmB,0CAA2C,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAoBhE;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,GAAG,EAAE,cAAc,EACnB,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC,CAiDxB;AA0TD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAMzD"}
|