@kindgi/cli 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +690 -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 +45 -0
- package/dist/build/bundle.d.ts.map +1 -0
- package/dist/build/bundle.js +121 -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 +196 -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 +586 -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 +48 -0
- package/dist/build/host-install.d.ts.map +1 -0
- package/dist/build/host-install.js +375 -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 +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +88 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/build.d.ts +39 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +872 -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 +44 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +1032 -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 +37 -0
- package/dist/commands/helpers.d.ts.map +1 -0
- package/dist/commands/helpers.js +93 -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 +455 -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 +202 -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 +221 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/secrets.d.ts +21 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +750 -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 +153 -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 +17 -0
- package/dist/commands/unwired.d.ts.map +1 -0
- package/dist/commands/unwired.js +41 -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 +153 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +44 -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 +8 -0
- package/dist/dev/bundler.d.ts.map +1 -0
- package/dist/dev/bundler.js +154 -0
- package/dist/dev/bundler.js.map +1 -0
- package/dist/dev/defaults.d.ts +138 -0
- package/dist/dev/defaults.d.ts.map +1 -0
- package/dist/dev/defaults.js +691 -0
- package/dist/dev/defaults.js.map +1 -0
- package/dist/dev/docker-compose.dev.yml +56 -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 +32 -0
- package/dist/dev/pack-service.d.ts.map +1 -0
- package/dist/dev/pack-service.js +188 -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/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 +287 -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 +62 -0
- package/dist/dev/runtime-container.d.ts.map +1 -0
- package/dist/dev/runtime-container.js +164 -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 +13 -0
- package/dist/dev/runtime-image.d.ts.map +1 -0
- package/dist/dev/runtime-image.js +15 -0
- package/dist/dev/runtime-image.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 +107 -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 +74 -0
- package/dist/init/augment-scaffolder.d.ts.map +1 -0
- package/dist/init/augment-scaffolder.js +459 -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/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 +16 -0
- package/dist/init/template-files.d.ts.map +1 -0
- package/dist/init/template-files.js +38 -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 +106 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +198 -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 +82 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +99 -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 +253 -0
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +299 -0
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +291 -0
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +289 -0
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +704 -0
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +288 -0
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +211 -0
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +181 -0
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +205 -0
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +322 -0
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +173 -0
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +299 -0
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +240 -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/.gitignore +8 -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/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 +6 -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/.gitignore +9 -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/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/.gitignore +8 -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/guardrails/response-not-empty/index.ts.tmpl +50 -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 +6 -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/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 @@
|
|
|
1
|
+
{"version":3,"file":"pack-service.js","sourceRoot":"","sources":["../../src/dev/pack-service.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA8BtF,MAAM,UAAU,mBAAmB,CAAC,IAAuB;IACzD,IAAI,IAAI,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IAC/C,IAAI,OAA4B,CAAC;IACjC,IAAI,QAA+B,CAAC;IAEpC,KAAK,UAAU,WAAW,CAAC,KAA4B;QACrD,MAAM,KAAK,GAAG,KAAK,IAAI,QAAQ,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACzB,OAAO;gBACL,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,yCAAyC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;aAClF,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,KAAK,CAAC;QACjB,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,I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K,MAAM,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI;QAC5C,CAAC,CAAC,cAAc,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;QACpD,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiC;IACjE,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,4BAA4B,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,gBAAgB,CAAC;QAChF,KAAK,SAAS;YACZ,OAAO,kCAAkC,KAAK,CAAC,QAAQ,6CAA6C,CAAC;QACvG,KAAK,KAAK;YACR,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACtC;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where `kindgi dev` writes the pack index and the dev api-server reads
|
|
3
|
+
* it — inside Kindgi's own `.kindgi/` (gitignored), never the pack root,
|
|
4
|
+
* which may be an existing application's root.
|
|
5
|
+
*/
|
|
6
|
+
export declare function devIndexPath(packDir: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Where a re-index writes before the pack service has loaded it. It
|
|
9
|
+
* becomes `devIndexPath` only once a pack service is serving that code,
|
|
10
|
+
* so the api-server never lists tools whose code isn't running.
|
|
11
|
+
*/
|
|
12
|
+
export declare function devStagedIndexPath(packDir: string): string;
|
|
13
|
+
/** Where `kindgi dev` bundles the pack's code. */
|
|
14
|
+
export declare function devDistDir(packDir: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The staged index as the pack service reads it: the same index, with
|
|
17
|
+
* each module path pointing at its bundle.
|
|
18
|
+
*/
|
|
19
|
+
export declare function devStagedPackIndexPath(packDir: string): string;
|
|
20
|
+
/** The source → bundle map the indexer child reads. */
|
|
21
|
+
export declare function devBundleMapPath(packDir: string): string;
|
|
22
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/dev/paths.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* Where `kindgi dev` writes the pack index and the dev api-server reads
|
|
6
|
+
* it — inside Kindgi's own `.kindgi/` (gitignored), never the pack root,
|
|
7
|
+
* which may be an existing application's root.
|
|
8
|
+
*/
|
|
9
|
+
export function devIndexPath(packDir) {
|
|
10
|
+
return join(packDir, '.kindgi', 'dev', 'index.json');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Where a re-index writes before the pack service has loaded it. It
|
|
14
|
+
* becomes `devIndexPath` only once a pack service is serving that code,
|
|
15
|
+
* so the api-server never lists tools whose code isn't running.
|
|
16
|
+
*/
|
|
17
|
+
export function devStagedIndexPath(packDir) {
|
|
18
|
+
return join(packDir, '.kindgi', 'dev', 'index.next.json');
|
|
19
|
+
}
|
|
20
|
+
/** Where `kindgi dev` bundles the pack's code. */
|
|
21
|
+
export function devDistDir(packDir) {
|
|
22
|
+
return join(packDir, '.kindgi', 'dev', 'dist');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The staged index as the pack service reads it: the same index, with
|
|
26
|
+
* each module path pointing at its bundle.
|
|
27
|
+
*/
|
|
28
|
+
export function devStagedPackIndexPath(packDir) {
|
|
29
|
+
return join(packDir, '.kindgi', 'dev', 'index.next.pack.json');
|
|
30
|
+
}
|
|
31
|
+
/** The source → bundle map the indexer child reads. */
|
|
32
|
+
export function devBundleMapPath(packDir) {
|
|
33
|
+
return join(packDir, '.kindgi', 'dev', 'bundle-map.json');
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/dev/paths.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC5D,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACpD,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC;AACjE,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { watch } from 'node:fs';
|
|
2
|
+
import type { PackBuilder } from './runners.js';
|
|
3
|
+
export interface PythonPackBuilderOptions {
|
|
4
|
+
readonly packDir: string;
|
|
5
|
+
/** The pack's interpreter (an argv prefix). */
|
|
6
|
+
readonly python: readonly [string, ...string[]];
|
|
7
|
+
/** The pack's environment. */
|
|
8
|
+
readonly env: () => Promise<Readonly<Record<string, string>>>;
|
|
9
|
+
readonly debounceMs?: number;
|
|
10
|
+
/** Test seam: `node:fs.watch`. */
|
|
11
|
+
readonly watchFs?: typeof watch;
|
|
12
|
+
}
|
|
13
|
+
/** Whether a change to `relPath` (relative to the pack root) is a change to the pack's code. */
|
|
14
|
+
export declare function isPythonSourceChange(relPath: string): boolean;
|
|
15
|
+
export declare function createPythonPackBuilder(options: PythonPackBuilderOptions): PackBuilder;
|
|
16
|
+
//# sourceMappingURL=python-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-builder.d.ts","sourceRoot":"","sources":["../../src/dev/python-builder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAkB,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,cAAc,CAAC;AAgC3D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAChD,8BAA8B;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACjC;AAED,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAM7D;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,CAmEtF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/**
|
|
4
|
+
* The `PackBuilder` of a Python pack. Python runs its sources, so a build
|
|
5
|
+
* produces no bundles (an empty bundle map); what it does is the job the
|
|
6
|
+
* bundler's parse does for a Node pack: compile every `.py` file under the
|
|
7
|
+
* pack root with the pack's own interpreter and report syntax errors
|
|
8
|
+
* located `file:line:col`. A build with errors leaves the previous pack
|
|
9
|
+
* service and index in place, as a bundle error does.
|
|
10
|
+
*
|
|
11
|
+
* The watch covers any `.py` file under the pack root — shared modules
|
|
12
|
+
* outside the discovery folders included — and `pyproject.toml`.
|
|
13
|
+
*/
|
|
14
|
+
import { spawn } from 'node:child_process';
|
|
15
|
+
import { watch } from 'node:fs';
|
|
16
|
+
const SKIPPED_DIRS = ['__pycache__', 'node_modules', 'venv', 'site-packages'];
|
|
17
|
+
const DEFAULT_DEBOUNCE_MS = 150;
|
|
18
|
+
/**
|
|
19
|
+
* Compiles every source under the pack root (argv[1]); prints a JSON list of
|
|
20
|
+
* `{file, line, col, message}` for the ones that don't. Self-contained:
|
|
21
|
+
* nothing of the pack is imported.
|
|
22
|
+
*/
|
|
23
|
+
const COMPILE_SCRIPT = `
|
|
24
|
+
import json, os, sys
|
|
25
|
+
root = sys.argv[1]
|
|
26
|
+
skip = set(${JSON.stringify(SKIPPED_DIRS)})
|
|
27
|
+
errors = []
|
|
28
|
+
for dirpath, dirnames, filenames in os.walk(root):
|
|
29
|
+
dirnames[:] = sorted(d for d in dirnames if not d.startswith(".") and d not in skip)
|
|
30
|
+
for name in sorted(filenames):
|
|
31
|
+
if not name.endswith(".py") or name.startswith("."):
|
|
32
|
+
continue
|
|
33
|
+
path = os.path.join(dirpath, name)
|
|
34
|
+
rel = os.path.relpath(path, root).replace(os.sep, "/")
|
|
35
|
+
try:
|
|
36
|
+
with open(path, "rb") as f:
|
|
37
|
+
compile(f.read(), rel, "exec", dont_inherit=True)
|
|
38
|
+
except SyntaxError as e:
|
|
39
|
+
errors.append({"file": rel, "line": e.lineno or 0, "col": e.offset or 0, "message": f"{type(e).__name__}: {e.msg}"})
|
|
40
|
+
except (ValueError, OSError) as e:
|
|
41
|
+
errors.append({"file": rel, "line": 0, "col": 0, "message": f"{type(e).__name__}: {e}"})
|
|
42
|
+
print(json.dumps(errors))
|
|
43
|
+
`;
|
|
44
|
+
/** Whether a change to `relPath` (relative to the pack root) is a change to the pack's code. */
|
|
45
|
+
export function isPythonSourceChange(relPath) {
|
|
46
|
+
const segments = relPath.split(/[\\/]/);
|
|
47
|
+
const dirs = segments.slice(0, -1);
|
|
48
|
+
if (dirs.some((s) => s.startsWith('.') || SKIPPED_DIRS.includes(s)))
|
|
49
|
+
return false;
|
|
50
|
+
const name = segments[segments.length - 1] ?? '';
|
|
51
|
+
return relPath === 'pyproject.toml' || (name.endsWith('.py') && !name.startsWith('.'));
|
|
52
|
+
}
|
|
53
|
+
export function createPythonPackBuilder(options) {
|
|
54
|
+
const watchFs = options.watchFs ?? watch;
|
|
55
|
+
let watcher;
|
|
56
|
+
let timer;
|
|
57
|
+
async function build() {
|
|
58
|
+
const [program, ...prefix] = options.python;
|
|
59
|
+
const env = await options.env();
|
|
60
|
+
const run = await new Promise((resolve) => {
|
|
61
|
+
const child = spawn(program, [...prefix, '-c', COMPILE_SCRIPT, options.packDir], {
|
|
62
|
+
env,
|
|
63
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
64
|
+
});
|
|
65
|
+
let stdout = '';
|
|
66
|
+
let stderr = '';
|
|
67
|
+
child.stdout.on('data', (chunk) => {
|
|
68
|
+
stdout += chunk.toString('utf8');
|
|
69
|
+
});
|
|
70
|
+
child.stderr.on('data', (chunk) => {
|
|
71
|
+
stderr += chunk.toString('utf8');
|
|
72
|
+
});
|
|
73
|
+
child.once('error', (cause) => resolve({ code: null, stdout, stderr: cause.message }));
|
|
74
|
+
child.once('close', (code) => resolve({ code, stdout, stderr }));
|
|
75
|
+
});
|
|
76
|
+
let errors;
|
|
77
|
+
try {
|
|
78
|
+
errors = JSON.parse(run.stdout.trim().split('\n').pop() ?? '');
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return {
|
|
82
|
+
kind: 'err',
|
|
83
|
+
errors: [
|
|
84
|
+
`the pack's Python could not check the sources (${run.code}): ${run.stderr.trim()}`,
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (errors.length > 0) {
|
|
89
|
+
return {
|
|
90
|
+
kind: 'err',
|
|
91
|
+
errors: errors.map((e) => `${e.file}:${e.line}:${e.col}: ${e.message}`),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return { kind: 'ok', bundleMap: {} };
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
build,
|
|
98
|
+
async watch(onBuild) {
|
|
99
|
+
if (watcher !== undefined)
|
|
100
|
+
return;
|
|
101
|
+
watcher = watchFs(options.packDir, { recursive: true }, (_event, filename) => {
|
|
102
|
+
if (filename === null || !isPythonSourceChange(filename.toString()))
|
|
103
|
+
return;
|
|
104
|
+
if (timer !== undefined)
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
timer = setTimeout(() => {
|
|
107
|
+
timer = undefined;
|
|
108
|
+
void build().then(onBuild);
|
|
109
|
+
}, options.debounceMs ?? DEFAULT_DEBOUNCE_MS);
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
// New or removed files need no entry list: the next build sees what is there.
|
|
113
|
+
syncEntries: () => Promise.resolve(false),
|
|
114
|
+
async dispose() {
|
|
115
|
+
if (timer !== undefined)
|
|
116
|
+
clearTimeout(timer);
|
|
117
|
+
watcher?.close();
|
|
118
|
+
watcher = undefined;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=python-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-builder.js","sourceRoot":"","sources":["../../src/dev/python-builder.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAkB,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhD,MAAM,YAAY,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;AAC9E,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC;;;;GAIG;AACH,MAAM,cAAc,GAAG;;;aAGV,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;CAiBxC,CAAC;AAaF,gGAAgG;AAChG,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAClF,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,OAAO,OAAO,KAAK,gBAAgB,IAAI,CAAC,IAAI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AQ,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBAAE,OAAO;gBAC5E,IAAI,KAAK,KAAK,SAAS;oBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC7C,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;oBACtB,KAAK,GAAG,SAAS,CAAC;oBAClB,KAAK,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC7B,CAAC,EAAE,OAAO,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC;QACD,8EAA8E;QAC9E,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;QACzC,KAAK,CAAC,OAAO;YACX,IAAI,KAAK,KAAK,SAAS;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,EAAE,KAAK,EAAE,CAAC;YACjB,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registration bridge — reports the four pack primitives from the
|
|
3
|
+
* parsed `index.json` produced by `runIndexer`. This is a pure
|
|
4
|
+
* read-side reporter: the api-server's disk bindings serve
|
|
5
|
+
* tool / agent / guardrail / flow manifests directly from disk, so
|
|
6
|
+
* the CLI doesn't need to POST anything for these primitives.
|
|
7
|
+
*
|
|
8
|
+
* Kept as a boundary so `dev.ts` still gets a `RegistrationReport`
|
|
9
|
+
* shape for boot + watch-tick summaries. Prod deploy path (when
|
|
10
|
+
* `kindgi deploy` lands) will bring back the transformation +
|
|
11
|
+
* POST loop this file used to contain, likely in a dedicated
|
|
12
|
+
* server-side helper rather than the CLI.
|
|
13
|
+
*/
|
|
14
|
+
import type { KindgiClient } from '@kindgi/client';
|
|
15
|
+
import type { AgentId, FlowId, GuardrailId, Semver, ToolId } from '@kindgi/types';
|
|
16
|
+
export interface RegistrationOutcome {
|
|
17
|
+
readonly kind: 'tool' | 'guardrail' | 'agent' | 'flow';
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly ok: boolean;
|
|
20
|
+
readonly message?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Non-fatal advisory the CLI surfaces even when `ok === true`.
|
|
23
|
+
* Currently unused: it used to carry the "bump version to
|
|
24
|
+
* publish local edits" nudge on `already-registered` outcomes,
|
|
25
|
+
* but the authoring-tools skill (v0.3.0) explicitly
|
|
26
|
+
* teaches "don't bump on save" — the advice contradicted itself
|
|
27
|
+
* and fired every watch tick regardless of whether the primitive
|
|
28
|
+
* had actually changed. Kept on the interface for future
|
|
29
|
+
* drift-detection use (compare stored vs. local hash → warn only
|
|
30
|
+
* on real drift).
|
|
31
|
+
*/
|
|
32
|
+
readonly warning?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface RegistrationReport {
|
|
35
|
+
readonly registered: RegistrationOutcome[];
|
|
36
|
+
readonly failed: RegistrationOutcome[];
|
|
37
|
+
}
|
|
38
|
+
export interface RegisterInputs {
|
|
39
|
+
readonly index: unknown;
|
|
40
|
+
readonly apiUrl: string;
|
|
41
|
+
readonly token: string;
|
|
42
|
+
readonly client: KindgiClient;
|
|
43
|
+
readonly fetchImpl: typeof fetch;
|
|
44
|
+
/**
|
|
45
|
+
* Tenant's Default project id, resolved by `kindgi dev` from
|
|
46
|
+
* `RunningApiServer.defaultProjectId`. Included in every POST body
|
|
47
|
+
* because tools/agents/guardrails/flows routes require it.
|
|
48
|
+
* Without this, all registrations fail with
|
|
49
|
+
* `bad-input: projectId is required`.
|
|
50
|
+
*/
|
|
51
|
+
readonly projectId: string;
|
|
52
|
+
/**
|
|
53
|
+
* Absolute path to the pack root. Used to resolve indexer-emitted
|
|
54
|
+
* relative `modulePath` / `checkModulePath` into absolute paths
|
|
55
|
+
* before they land in `codeArtifactRef.modulePath` — the sandbox
|
|
56
|
+
* worker imports them by absolute path, so relative-to-pack won't
|
|
57
|
+
* resolve after the api-server process (a different cwd) picks
|
|
58
|
+
* them up.
|
|
59
|
+
*/
|
|
60
|
+
readonly packDir: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Register every primitive in the parsed index into the running
|
|
64
|
+
* api-server. Never throws; per-primitive failures land in
|
|
65
|
+
* `report.failed`. Idempotent-friendly: `409 tool-already-registered`
|
|
66
|
+
* outcomes are treated as success — dev mode is meant to be safe to
|
|
67
|
+
* re-run after a save.
|
|
68
|
+
*/
|
|
69
|
+
export declare function registerFromIndex(inputs: RegisterInputs): Promise<RegistrationReport>;
|
|
70
|
+
export type { AgentId, FlowId, GuardrailId, Semver, ToolId };
|
|
71
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/dev/register.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAElF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,KAAK,CAAC;IACjC;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AASD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6C3F;AAKD,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/**
|
|
4
|
+
* Register every primitive in the parsed index into the running
|
|
5
|
+
* api-server. Never throws; per-primitive failures land in
|
|
6
|
+
* `report.failed`. Idempotent-friendly: `409 tool-already-registered`
|
|
7
|
+
* outcomes are treated as success — dev mode is meant to be safe to
|
|
8
|
+
* re-run after a save.
|
|
9
|
+
*/
|
|
10
|
+
export async function registerFromIndex(inputs) {
|
|
11
|
+
const idx = (inputs.index ?? {});
|
|
12
|
+
const registered = [];
|
|
13
|
+
const failed = [];
|
|
14
|
+
// All four pack primitives are served from disk in dev — the api-
|
|
15
|
+
// server's disk bindings (tools, agents, guardrails, flows) read
|
|
16
|
+
// `index.json` directly. POSTing them
|
|
17
|
+
// here would round-trip to read-only endpoints. Reporting as
|
|
18
|
+
// `from-disk` `ok` outcomes so the boot / watch-tick summary line
|
|
19
|
+
// still shows accurate counts.
|
|
20
|
+
for (const rawTool of idx.tools ?? []) {
|
|
21
|
+
registered.push({
|
|
22
|
+
kind: 'tool',
|
|
23
|
+
id: String(rawTool.id ?? '(unknown-tool)'),
|
|
24
|
+
ok: true,
|
|
25
|
+
message: 'from-disk',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
for (const rawInv of idx.guardrails ?? []) {
|
|
29
|
+
registered.push({
|
|
30
|
+
kind: 'guardrail',
|
|
31
|
+
id: String(rawInv.id ?? '(unknown-guardrail)'),
|
|
32
|
+
ok: true,
|
|
33
|
+
message: 'from-disk',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
for (const rawAgent of idx.agents ?? []) {
|
|
37
|
+
registered.push({
|
|
38
|
+
kind: 'agent',
|
|
39
|
+
id: String(rawAgent.id ?? '(unknown-agent)'),
|
|
40
|
+
ok: true,
|
|
41
|
+
message: 'from-disk',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
for (const rawGraph of idx.flows ?? []) {
|
|
45
|
+
registered.push({
|
|
46
|
+
kind: 'flow',
|
|
47
|
+
id: String(rawGraph.id ?? '(unknown-flow)'),
|
|
48
|
+
ok: true,
|
|
49
|
+
message: 'from-disk',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return { registered, failed };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/dev/register.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AA2EjC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAsB;IAC5D,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAe,CAAC;IAC/C,MAAM,UAAU,GAA0B,EAAE,CAAC;IAC7C,MAAM,MAAM,GAA0B,EAAE,CAAC;IAEzC,kEAAkE;IAClE,iEAAiE;IACjE,sCAAsC;IACtC,6DAA6D;IAC7D,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for `kindgi dev`. The command consumes only these
|
|
3
|
+
* interfaces so tests can hand in a mock runtime / indexer / watcher
|
|
4
|
+
* without touching Docker, Postgres, the filesystem, or `fs.watch`'s
|
|
5
|
+
* cross-platform caveats. Production callers wire the real ones from
|
|
6
|
+
* `packages/cli/src/dev/defaults.ts`: the Kindgi runtime as a container,
|
|
7
|
+
* `runIndexer` (`@kindgi/handler-runtime`), and an `fs.watch` bridge.
|
|
8
|
+
*/
|
|
9
|
+
import type { PackServiceSupervisor, PackServiceSupervisorEvent } from '@kindgi/handler-runtime/pack-service';
|
|
10
|
+
import type { PackCode } from './pack-code.js';
|
|
11
|
+
/** The running Kindgi runtime `kindgi dev` talks to. */
|
|
12
|
+
export interface RunningApiServer {
|
|
13
|
+
readonly baseUrl: string;
|
|
14
|
+
readonly port: number;
|
|
15
|
+
readonly tenantId: string;
|
|
16
|
+
/** The user the dev token resolves to. */
|
|
17
|
+
readonly userId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Default project id for the boot tenant. Required for POST-body
|
|
20
|
+
* primitive-registration routes. `kindgi dev`
|
|
21
|
+
* threads this into `registerFromIndex` so scaffolded packs land
|
|
22
|
+
* under the tenant's Default project.
|
|
23
|
+
*/
|
|
24
|
+
readonly defaultProjectId: string;
|
|
25
|
+
readonly token: string;
|
|
26
|
+
readonly banner: string;
|
|
27
|
+
/**
|
|
28
|
+
* True when the api-server has the console SPA mounted at
|
|
29
|
+
* `${baseUrl}/console/`. Depends on the bundled console-assets
|
|
30
|
+
* directory being present next to the CLI dist — the shipped CLI
|
|
31
|
+
* ships them; a broken install may not. Absent = console URL
|
|
32
|
+
* should not be advertised.
|
|
33
|
+
*/
|
|
34
|
+
readonly consoleMounted?: boolean;
|
|
35
|
+
shutdown(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export interface StartApiServerOptions {
|
|
38
|
+
/** The host port the API is reached on (`127.0.0.1` only). */
|
|
39
|
+
readonly port: number;
|
|
40
|
+
/** Postgres, as this machine reaches it. */
|
|
41
|
+
readonly databaseUrl: string;
|
|
42
|
+
readonly tenantId: string;
|
|
43
|
+
readonly token: string;
|
|
44
|
+
/** The user the dev token resolves to — the previous boot's, so reviewer registrations carry over. */
|
|
45
|
+
readonly userId: string;
|
|
46
|
+
/** The pack directory: the runtime reads its index and its `.env` files there. */
|
|
47
|
+
readonly packDir: string;
|
|
48
|
+
/** `dev.envFiles` from `kindgi.config.ts`; default `.env`, `.env.local`. */
|
|
49
|
+
readonly localEnvFiles?: readonly string[];
|
|
50
|
+
/**
|
|
51
|
+
* The CLI's environment: values for `${VAR}` references the env files
|
|
52
|
+
* don't define, and `HOME` (Google credentials).
|
|
53
|
+
*/
|
|
54
|
+
readonly hostEnv: Readonly<Record<string, string | undefined>>;
|
|
55
|
+
/** The local pack service's front, which the runtime calls the pack's code through. */
|
|
56
|
+
readonly packService: {
|
|
57
|
+
readonly url: string;
|
|
58
|
+
readonly token: string;
|
|
59
|
+
};
|
|
60
|
+
/** `KINDGI_PUBLIC_TOKEN_SIGNING_KEY_PATH`: the developer's key file, if set. Otherwise the runtime makes one. */
|
|
61
|
+
readonly publicRunTokenKeyPath?: string;
|
|
62
|
+
/** `KINDGI_CORS_ORIGINS`: the browser app's origins, allowed on the run progress routes. */
|
|
63
|
+
readonly corsOrigins?: readonly string[];
|
|
64
|
+
/** The runtime image (`--runtime-image`). */
|
|
65
|
+
readonly runtimeImage: string;
|
|
66
|
+
/**
|
|
67
|
+
* `--runtime-url`: a runtime the developer runs themselves (from
|
|
68
|
+
* source). No container: `kindgi dev` writes `runtime.env` for it and
|
|
69
|
+
* waits until it serves with this session's dev token.
|
|
70
|
+
*/
|
|
71
|
+
readonly runtimeUrl?: string;
|
|
72
|
+
/** Lines the runtime writes. */
|
|
73
|
+
readonly onLog?: (line: string) => void;
|
|
74
|
+
/** Progress while preparing (an image pull). */
|
|
75
|
+
readonly onProgress?: (line: string) => void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One bundle of the pack's code: each primitive's source path (as the
|
|
79
|
+
* index records it) mapped to its bundle, both relative to the pack
|
|
80
|
+
* root — or the build errors, located `file:line:column`.
|
|
81
|
+
*/
|
|
82
|
+
export type PackBuild = {
|
|
83
|
+
readonly kind: 'ok';
|
|
84
|
+
readonly bundleMap: Readonly<Record<string, string>>;
|
|
85
|
+
} | {
|
|
86
|
+
readonly kind: 'err';
|
|
87
|
+
readonly errors: readonly string[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Makes the pack's code ready for the pack service: esbuild bundles for a
|
|
91
|
+
* Node pack, the sources themselves for a Python one.
|
|
92
|
+
*/
|
|
93
|
+
export interface PackBuilder {
|
|
94
|
+
/** Build once; picks up added or removed primitive files. */
|
|
95
|
+
build(): Promise<PackBuild>;
|
|
96
|
+
/** Rebuild whenever a file any bundle read changes, reporting every build. */
|
|
97
|
+
watch(onBuild: (build: PackBuild) => void): Promise<void>;
|
|
98
|
+
/** Pick up added or removed primitive files; resolves `true` when the entries changed. */
|
|
99
|
+
syncEntries(): Promise<boolean>;
|
|
100
|
+
dispose(): Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
export interface IndexerRunOptions {
|
|
103
|
+
/** Import each primitive's bundle instead of its source (source path → bundle path). */
|
|
104
|
+
readonly bundleMap?: Readonly<Record<string, string>>;
|
|
105
|
+
/** Run the indexer in a child process with this environment. */
|
|
106
|
+
readonly env?: () => Promise<Readonly<Record<string, string>>>;
|
|
107
|
+
/** Which indexer: the TypeScript one (default) or the pack's Python. */
|
|
108
|
+
readonly code?: PackCode;
|
|
109
|
+
}
|
|
110
|
+
/** The local pack service `kindgi dev` runs the pack's code in. */
|
|
111
|
+
export interface DevPackServiceOptions {
|
|
112
|
+
readonly packDir: string;
|
|
113
|
+
/** Which pack service runs the code: the Node one, or the pack's Python. */
|
|
114
|
+
readonly code: PackCode;
|
|
115
|
+
/** The pack service's whole environment, read at every start. */
|
|
116
|
+
readonly env: () => Promise<Readonly<Record<string, string>>>;
|
|
117
|
+
/** Lines the pack's code writes. */
|
|
118
|
+
readonly onLog: (line: string, stream: 'stdout' | 'stderr') => void;
|
|
119
|
+
readonly onEvent: (event: PackServiceSupervisorEvent) => void;
|
|
120
|
+
/**
|
|
121
|
+
* The front's port and token: the previous session's, so a runtime
|
|
122
|
+
* started with them (`--runtime-url`) keeps reaching it. Default: any
|
|
123
|
+
* free port, a new token.
|
|
124
|
+
*/
|
|
125
|
+
readonly port?: number;
|
|
126
|
+
readonly token?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The local pack service: the public supervisor, children behind a
|
|
130
|
+
* stable front. The runtime calls the front by URL and token.
|
|
131
|
+
*/
|
|
132
|
+
export type DevPackService = PackServiceSupervisor;
|
|
133
|
+
/**
|
|
134
|
+
* Shape of `IndexerReport.counts` — kept structural so tests can hand
|
|
135
|
+
* back plain objects without importing `@kindgi/handler-runtime`.
|
|
136
|
+
*/
|
|
137
|
+
export interface IndexedCounts {
|
|
138
|
+
readonly tools: number;
|
|
139
|
+
readonly guardrails: number;
|
|
140
|
+
readonly agents: number;
|
|
141
|
+
readonly flows: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The subset of `IndexerReport` `kindgi dev` needs at the callsite.
|
|
145
|
+
* The full runtime report (published-at, artifact version, etc.) is
|
|
146
|
+
* present in the manifest but the CLI only surfaces counts + the read
|
|
147
|
+
* `index.json` bytes.
|
|
148
|
+
*/
|
|
149
|
+
export interface IndexOutcome {
|
|
150
|
+
readonly kind: 'ok';
|
|
151
|
+
readonly packId: string;
|
|
152
|
+
readonly packVersion: string;
|
|
153
|
+
readonly counts: IndexedCounts;
|
|
154
|
+
/**
|
|
155
|
+
* Per-file errors accumulated during indexing. One bad file no
|
|
156
|
+
* longer aborts the whole pass — registration proceeds on healthy
|
|
157
|
+
* primitives and the errors surface here for `kindgi dev` to
|
|
158
|
+
* print. Empty on a fully-clean pass.
|
|
159
|
+
*/
|
|
160
|
+
readonly fileErrors: readonly {
|
|
161
|
+
readonly code: string;
|
|
162
|
+
readonly message: string;
|
|
163
|
+
readonly filePath?: string;
|
|
164
|
+
}[];
|
|
165
|
+
/**
|
|
166
|
+
* The parsed `index.json` payload — passed straight to the
|
|
167
|
+
* registration bridge. Kept as `unknown` because the CLI does not
|
|
168
|
+
* re-validate the shape (`runIndexer` is the authority).
|
|
169
|
+
*/
|
|
170
|
+
readonly index: unknown;
|
|
171
|
+
}
|
|
172
|
+
export interface IndexFailure {
|
|
173
|
+
readonly kind: 'err';
|
|
174
|
+
readonly code: string;
|
|
175
|
+
readonly message: string;
|
|
176
|
+
readonly filePath?: string;
|
|
177
|
+
}
|
|
178
|
+
export type IndexResult = IndexOutcome | IndexFailure;
|
|
179
|
+
/**
|
|
180
|
+
* Watcher handle. `close()` is idempotent — the command may call it
|
|
181
|
+
* from the graceful-shutdown path after the abort-signal has fired.
|
|
182
|
+
*/
|
|
183
|
+
export interface WatchHandle {
|
|
184
|
+
close(): Promise<void>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Handle returned by `startServices` when auto-start succeeded.
|
|
188
|
+
* `databaseUrl` is the connection string the runtime should use;
|
|
189
|
+
* `services` names what runs, for the banner.
|
|
190
|
+
*
|
|
191
|
+
* The services aren't stopped when `kindgi dev` exits: every `kindgi dev`
|
|
192
|
+
* on the machine shares the one `kindgi-dev` compose project, so another
|
|
193
|
+
* session's runtime may be using them. The next boot picks them up;
|
|
194
|
+
* `kindgi dev --reset` removes them and their data.
|
|
195
|
+
*/
|
|
196
|
+
export interface StartedServicesHandle {
|
|
197
|
+
readonly databaseUrl: string;
|
|
198
|
+
readonly services: readonly string[];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Outcome of `startServices`. `kind: 'ok'` = docker-compose available
|
|
202
|
+
* AND all containers healthy. `kind: 'unavailable'` = docker-compose
|
|
203
|
+
* not detected (or docker not installed); caller falls back to the
|
|
204
|
+
* missing-KINDGI_DATABASE_URL error. `kind: 'error'` = docker-compose was
|
|
205
|
+
* available but the boot failed (image pull, port collision, health
|
|
206
|
+
* timeout) — caller surfaces the reason.
|
|
207
|
+
*/
|
|
208
|
+
export type StartServicesResult = {
|
|
209
|
+
readonly kind: 'ok';
|
|
210
|
+
readonly handle: StartedServicesHandle;
|
|
211
|
+
} | {
|
|
212
|
+
readonly kind: 'unavailable';
|
|
213
|
+
readonly reason: string;
|
|
214
|
+
} | {
|
|
215
|
+
readonly kind: 'error';
|
|
216
|
+
readonly message: string;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Injected fixture-friendly runners. Every field has a real
|
|
220
|
+
* implementation in `dev/defaults.ts`; tests replace individual fields
|
|
221
|
+
* to bypass Postgres, real file watchers, or the real indexer.
|
|
222
|
+
*/
|
|
223
|
+
export interface DevRunners {
|
|
224
|
+
/** Boot the api-server. Resolves once the HTTP listener is bound. */
|
|
225
|
+
readonly startApiServer: (opts: StartApiServerOptions) => Promise<RunningApiServer>;
|
|
226
|
+
/**
|
|
227
|
+
* Run the indexer against a pack root + return the parsed
|
|
228
|
+
* `index.json`, written to `outputPath` (default: the dev index).
|
|
229
|
+
* Failures are captured — this function never throws.
|
|
230
|
+
*/
|
|
231
|
+
readonly runIndexer: (packDir: string, outputPath?: string, options?: IndexerRunOptions) => Promise<IndexResult>;
|
|
232
|
+
/** The builder for the pack's code (esbuild for Node, the sources for Python). */
|
|
233
|
+
readonly createPackBuilder: (opts: {
|
|
234
|
+
readonly packDir: string;
|
|
235
|
+
readonly patterns: readonly string[];
|
|
236
|
+
readonly code: PackCode;
|
|
237
|
+
/** The pack's environment (a Python build runs the pack's interpreter with it). */
|
|
238
|
+
readonly env: () => Promise<Readonly<Record<string, string>>>;
|
|
239
|
+
}) => PackBuilder;
|
|
240
|
+
/** The local pack service (not yet started). */
|
|
241
|
+
readonly createPackService: (opts: DevPackServiceOptions) => DevPackService;
|
|
242
|
+
/**
|
|
243
|
+
* Check a Python pack's interpreter can run pack code (`import kindgi`),
|
|
244
|
+
* with the pack's environment: a one-line description, or why not.
|
|
245
|
+
*/
|
|
246
|
+
readonly checkPackPython: (python: readonly [string, ...string[]], env: Readonly<Record<string, string>>, packDir?: string) => Promise<{
|
|
247
|
+
readonly kind: 'ok';
|
|
248
|
+
readonly value: string;
|
|
249
|
+
} | {
|
|
250
|
+
readonly kind: 'err';
|
|
251
|
+
readonly message: string;
|
|
252
|
+
}>;
|
|
253
|
+
/** Make a staged index the one the api-server reads. */
|
|
254
|
+
readonly publishIndex: (stagedPath: string, indexPath: string) => Promise<void>;
|
|
255
|
+
/**
|
|
256
|
+
* Start watching the pack's discovery patterns (default: the
|
|
257
|
+
* indexer's `DEFAULT_DISCOVERY`). The callback fires (debounced) when
|
|
258
|
+
* a file a pattern matches changes, or one of `files` (absolute
|
|
259
|
+
* paths — the env files). Returns a handle with an idempotent
|
|
260
|
+
* `close()`.
|
|
261
|
+
*/
|
|
262
|
+
readonly watchPack: (packDir: string, onChange: () => void, opts?: {
|
|
263
|
+
readonly debounceMs?: number;
|
|
264
|
+
readonly patterns?: readonly string[];
|
|
265
|
+
readonly files?: readonly string[];
|
|
266
|
+
}) => Promise<WatchHandle>;
|
|
267
|
+
/**
|
|
268
|
+
* Auto-start the bundled `docker-compose.dev.yml` (Postgres) with
|
|
269
|
+
* `docker compose`, in the `kindgi-dev` project. Called only when the user did NOT
|
|
270
|
+
* provide `--database-url` / `KINDGI_DATABASE_URL`. Returns an outcome
|
|
271
|
+
* enum: `ok` (fall through with the container's URL), `unavailable`
|
|
272
|
+
* (docker-compose not detected — caller falls back to the manual
|
|
273
|
+
* error), or `error` (docker was available but boot failed).
|
|
274
|
+
*
|
|
275
|
+
* Optional so tests can leave it unset (falls through to the
|
|
276
|
+
* current "manual KINDGI_DATABASE_URL required" error).
|
|
277
|
+
*/
|
|
278
|
+
/**
|
|
279
|
+
* `recreate`: let compose recreate the shared Postgres when its
|
|
280
|
+
* definition changed (`--recreate-services`). Default: an existing
|
|
281
|
+
* container is reused as it is — another `kindgi dev` may be using it.
|
|
282
|
+
*/
|
|
283
|
+
readonly startServices?: (options: {
|
|
284
|
+
readonly recreate: boolean;
|
|
285
|
+
}) => Promise<StartServicesResult>;
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=runners.d.ts.map
|