@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,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kindgi-python-authoring-agents
|
|
3
|
+
description: >
|
|
4
|
+
Covers writing agents for a Kindgi pack in Python (the `kindgi`
|
|
5
|
+
package): declaring an `Agent(...)` at module level, wiring tools
|
|
6
|
+
(Tool objects or {id, version} refs) and guardrails, capabilities and
|
|
7
|
+
model choice (preferred_provider / preferred_model), conversation
|
|
8
|
+
policy, turn budgets, prompt template parameters, typed output from a
|
|
9
|
+
pydantic model, and tool-error retries. Load this whenever you are
|
|
10
|
+
authoring or editing code inside a Python pack's agents/ directory
|
|
11
|
+
(a pack whose config is `[tool.kindgi]` in pyproject.toml), defining
|
|
12
|
+
an agent, or when the user asks to add, modify or refactor one.
|
|
13
|
+
Python tools are covered by kindgi-python-authoring-tools, Python
|
|
14
|
+
guardrails by kindgi-python-authoring-guardrails, connecting a real
|
|
15
|
+
model by kindgi-authoring-providers.
|
|
16
|
+
type: core
|
|
17
|
+
library: "kindgi (Python)"
|
|
18
|
+
version: "0.1.0"
|
|
19
|
+
sdk_version: "0.1.0"
|
|
20
|
+
pack_languages: [python]
|
|
21
|
+
sources:
|
|
22
|
+
- sdks/python/src/kindgi/pack/define.py
|
|
23
|
+
- sdks/python/src/kindgi/pack/index.py
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Authoring Kindgi agents in Python
|
|
27
|
+
|
|
28
|
+
> **Running `kindgi`:** a Python pack has no Node project, so the
|
|
29
|
+
> `kindgi` CLI is the one on `PATH`. Python commands run in the pack's
|
|
30
|
+
> environment: `uv run …` (or `.venv/bin/python …`).
|
|
31
|
+
|
|
32
|
+
An **agent** is a versioned, model-driven orchestrator: instructions (a
|
|
33
|
+
prompt template), the tools it may call, the capabilities its model
|
|
34
|
+
needs, guardrails that gate its answer, and an optional conversation
|
|
35
|
+
policy. In a Python pack it is **data**: an `Agent(...)` assigned at
|
|
36
|
+
module level in a file under `agents/`. The model runs in the Kindgi
|
|
37
|
+
runtime, not in your Python process; your Python code runs only inside
|
|
38
|
+
the agent's tools and guardrail checks.
|
|
39
|
+
|
|
40
|
+
## Ask before building
|
|
41
|
+
|
|
42
|
+
"Add an agent" is a conversation opener, not a ticket. Before writing a
|
|
43
|
+
file, ask:
|
|
44
|
+
|
|
45
|
+
- **What should the agent do?** The purpose drives everything else.
|
|
46
|
+
- **Which tools does it need?** New ones, or existing ones?
|
|
47
|
+
- **Multi-turn or one-shot?** History changes the shape.
|
|
48
|
+
- **Any rules it must respect?** Those become guardrails.
|
|
49
|
+
|
|
50
|
+
The pack's sample agent proves the runtime works end to end. It is not
|
|
51
|
+
the shape to imitate unless the user asks for that.
|
|
52
|
+
|
|
53
|
+
## An agent
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
# agents/brief_writer.py
|
|
57
|
+
from pydantic import BaseModel
|
|
58
|
+
|
|
59
|
+
from kindgi import Agent
|
|
60
|
+
|
|
61
|
+
from ..guardrails.citations import no_fabricated_quotes
|
|
62
|
+
from ..tools.citations import fetch_precedent, verify_citation
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class Brief(BaseModel):
|
|
66
|
+
argument: str
|
|
67
|
+
citations: list[str]
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
brief_writer = Agent(
|
|
71
|
+
id="acme.brief-writer",
|
|
72
|
+
version="0.1.0",
|
|
73
|
+
name="Brief Writer",
|
|
74
|
+
description="Drafts appellate briefs from a case file; cites precedents.",
|
|
75
|
+
instructions=(
|
|
76
|
+
"You are drafting a brief in {{ jurisdiction }}. The user provides the case "
|
|
77
|
+
"facts; you produce a Section IV argument citing at least two precedents. "
|
|
78
|
+
"Call acme.verify-citation on every cite before using it. Never invent one."
|
|
79
|
+
),
|
|
80
|
+
capabilities=[{"needs": [{"feature": "tool-use"}]}],
|
|
81
|
+
tools=[verify_citation, fetch_precedent], # Tool objects — or {"id", "version"} refs
|
|
82
|
+
guardrails=[no_fabricated_quotes], # Guardrail objects — or ids
|
|
83
|
+
parameters=[{"name": "jurisdiction", "type": "string", "required": True}],
|
|
84
|
+
conversation_policy={"historyLimit": 20},
|
|
85
|
+
budget={"maxSteps": 8, "maxCostUsd": 0.5, "maxWallMs": 60_000},
|
|
86
|
+
output=Brief, # typed answer (optional)
|
|
87
|
+
)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- Import tools and guardrails with **relative imports** — every file in
|
|
91
|
+
the pack is imported as part of one package rooted at the pack.
|
|
92
|
+
- **Dict-valued fields keep the wire's camelCase keys**: `maxSteps`,
|
|
93
|
+
`maxCostUsd`, `maxWallMs`, `historyLimit`, `maxRetries`, `retryOn`.
|
|
94
|
+
Only the `Agent` keyword arguments themselves are snake_case.
|
|
95
|
+
- A file may define several agents; each must be assigned at module
|
|
96
|
+
level (an agent built inside a function is invisible to the indexer).
|
|
97
|
+
- `Agent(...)` checks the id (non-empty) and the version (an exact
|
|
98
|
+
semver) where it is written. Everything else is checked when Kindgi
|
|
99
|
+
reads the pack: `uv run python -m kindgi.pack index --pack-dir .`
|
|
100
|
+
shows what it sees, and `kindgi dev` reports a problem with its file.
|
|
101
|
+
|
|
102
|
+
## Field by field
|
|
103
|
+
|
|
104
|
+
- **`id`** — `<pack-id>.<agent-name>`, kebab-case, dot-namespaced.
|
|
105
|
+
- **`version`** — exact semver. Conversations pin the version they
|
|
106
|
+
started on.
|
|
107
|
+
- **`name`**, **`description`**, **`tags`** — for people and listings.
|
|
108
|
+
- **`instructions`** — a LiquidJS template. `{{ variable }}` comes from
|
|
109
|
+
`parameters` or the runtime's own variables (`today`, `now`,
|
|
110
|
+
`agent.*`, `conversation.*`), rendered strictly: an unknown variable
|
|
111
|
+
fails the turn. Write it as a brief for a capable colleague: what to
|
|
112
|
+
do, which tools to prefer, what to refuse, the quality bar.
|
|
113
|
+
- **`capabilities`** — what the model must support, e.g.
|
|
114
|
+
`[{"needs": [{"feature": "tool-use"}]}]`. The turn routes its first
|
|
115
|
+
capability to pick a provider and model; none declared fails the turn.
|
|
116
|
+
- **`tools`** — `Tool` objects (pinned to that tool's version, or the
|
|
117
|
+
pack's) or `{"id": "acme.x", "version": "^0.1.0"}` refs, where
|
|
118
|
+
`version` is a semver **range**; the highest active matching version
|
|
119
|
+
is picked at turn start. A bare string is rejected. Empty = a
|
|
120
|
+
chat-only agent.
|
|
121
|
+
- **`guardrails`** — `Guardrail` objects or ids. Evaluated once per
|
|
122
|
+
turn on the final answer, before it is stored. An id with no
|
|
123
|
+
registered guardrail fails the turn (`unresolved-guardrail`).
|
|
124
|
+
- **`parameters`** — inputs the caller supplies per run
|
|
125
|
+
(`{"name", "type", "required"}`); they fill `{{ … }}` in the
|
|
126
|
+
instructions.
|
|
127
|
+
- **`preferred_provider`** / **`preferred_model`** — soft hints: the
|
|
128
|
+
router prefers that provider id (e.g. `"anthropic"`) and/or model name
|
|
129
|
+
(e.g. `"claude-haiku-4-5"`) when they satisfy the capabilities. To
|
|
130
|
+
*require* a model, put it in the capability:
|
|
131
|
+
`{"needs": [{"feature": "tool-use"}, {"models": {"allow": ["claude-haiku-4-5"]}}]}`.
|
|
132
|
+
- **`conversation_policy`** — `{"historyLimit": n}` caps the prior
|
|
133
|
+
messages loaded; `hitl` configures approval gates. Absent = the full
|
|
134
|
+
history, no gates. A tenant's `hitl` policy can tighten the gates
|
|
135
|
+
(shorter timeout, higher reviewer role, stricter per tool), never
|
|
136
|
+
loosen them.
|
|
137
|
+
- **`budget`** — per turn: `maxSteps` (model calls, default 8),
|
|
138
|
+
`maxCostUsd`, `maxWallMs` (default 120 000). Steps or cost exceeded
|
|
139
|
+
fails the turn (`budget-exceeded`); out of wall time aborts it. Leave
|
|
140
|
+
room for real models: a turn with tool calls can take tens of seconds.
|
|
141
|
+
- **`output`** — a typed answer: a pydantic model class (or any type
|
|
142
|
+
pydantic understands, or a JSON Schema dict), or the full
|
|
143
|
+
`{"schema", "name", "maxRepairs"}` object. The final answer must be
|
|
144
|
+
JSON matching it; a wrong one goes back to the model with the problems
|
|
145
|
+
(`maxRepairs`, default 1), then the turn fails
|
|
146
|
+
(`output-schema-violation`). The parsed answer is the turn result's
|
|
147
|
+
`output` — a dict on the wire (with `kindgi.client`:
|
|
148
|
+
`Brief.model_validate(run.output["output"])`), and in a flow
|
|
149
|
+
`nodeOutputs.<step>.output.<field>`.
|
|
150
|
+
- **`tool_errors`** — `{"maxRetries": 1, "retryOn": [...]}`: a failed
|
|
151
|
+
tool call goes back to the model as the call's result so it can fix
|
|
152
|
+
the call. Default kinds are `invalid-arguments` and `unknown-tool`
|
|
153
|
+
(nothing ran); add `tool-error` only when retrying the tool is safe.
|
|
154
|
+
Each retry costs a step.
|
|
155
|
+
- **`retrieval`** — memory retrieval declarations; usually `[]`.
|
|
156
|
+
|
|
157
|
+
## Which model answers
|
|
158
|
+
|
|
159
|
+
Agents run on a registered model provider; the router picks one whose
|
|
160
|
+
models satisfy `capabilities`. `kindgi dev` gives a new pack `dev-echo`,
|
|
161
|
+
a **fallback** that answers only while no other provider fits — it
|
|
162
|
+
calls the first tool and replies "Tool responded: …", and the turn
|
|
163
|
+
carries a `fallback-provider` warning. Register a real model and it
|
|
164
|
+
takes over: see `kindgi-authoring-providers`
|
|
165
|
+
(`kindgi providers register --preset=anthropic`).
|
|
166
|
+
|
|
167
|
+
## Iterating
|
|
168
|
+
|
|
169
|
+
Save the file; `kindgi dev` re-indexes and the next run uses it. No
|
|
170
|
+
version bump, no restart. Bump `version` when you break what callers
|
|
171
|
+
rely on (a removed parameter, an incompatible output), not on every
|
|
172
|
+
save.
|
|
173
|
+
|
|
174
|
+
Run an agent from another terminal in the pack directory:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
kindgi runs start --agent=acme.brief-writer --input='{"userMessage":"…"}'
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
or from Python with `kindgi.client` (`Kindgi().runs.start(agent=…, input=…)`).
|
|
181
|
+
|
|
182
|
+
## Common mistakes
|
|
183
|
+
|
|
184
|
+
1. **Building an agent without asking what it should do.** Copying the
|
|
185
|
+
sample's shape answers the wrong question.
|
|
186
|
+
2. **`tools=["acme.x"]`.** A tool is a `Tool` object or an
|
|
187
|
+
`{"id", "version"}` ref; a bare string fails the index.
|
|
188
|
+
3. **snake_case inside the dicts.** `budget={"max_steps": 4}` is not a
|
|
189
|
+
budget; the keys are `maxSteps`, `historyLimit`, `maxRetries`, ….
|
|
190
|
+
4. **An unregistered guardrail id.** Pass the `Guardrail` object you
|
|
191
|
+
import, or make sure the id is one the tenant has.
|
|
192
|
+
5. **`{{ variable }}` not in `parameters`.** The turn fails when the
|
|
193
|
+
instructions render.
|
|
194
|
+
6. **No `capabilities`.** The turn can't pick a model.
|
|
195
|
+
7. **Defining the agent inside a function or under `if __name__`.** Only
|
|
196
|
+
module-level primitives are collected.
|
|
197
|
+
8. **A tight `maxWallMs` with a real model.** 15 s aborts real turns
|
|
198
|
+
under load; 60 s is a safer start.
|
|
199
|
+
|
|
200
|
+
## When the framework itself is the problem
|
|
201
|
+
|
|
202
|
+
If the bug is in Kindgi or the `kindgi` package itself (the index
|
|
203
|
+
dropping a field, a misleading error, the router picking the wrong
|
|
204
|
+
model) and not in the pack's code, load `kindgi-framework-feedback` and
|
|
205
|
+
file it with `kindgi feedback write`.
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kindgi-python-authoring-flows
|
|
3
|
+
description: >
|
|
4
|
+
Covers writing flows for a Kindgi pack in Python (the `kindgi`
|
|
5
|
+
package): declaring a `Flow(...)` at module level, tool and agent
|
|
6
|
+
steps (Tool and Agent objects as refs), edges and `when` conditions,
|
|
7
|
+
branches that join again, inputMapping from runInput / nodeOutputs,
|
|
8
|
+
typed agent output in a flow, the flow's declared output, loops
|
|
9
|
+
(foreach / while) and fanout, per-edge retry and timeout, and running
|
|
10
|
+
a flow (kindgi runs start --flow, in the background, as a dry run) and
|
|
11
|
+
reading its journal. Load this whenever you are authoring or editing
|
|
12
|
+
code inside a Python pack's flows/ directory (a pack whose config is
|
|
13
|
+
`[tool.kindgi]` in pyproject.toml), defining a flow, or when the user
|
|
14
|
+
asks to add, change or debug one. Python tools are covered by
|
|
15
|
+
kindgi-python-authoring-tools, Python agents by
|
|
16
|
+
kindgi-python-authoring-agents.
|
|
17
|
+
type: core
|
|
18
|
+
library: "kindgi (Python)"
|
|
19
|
+
version: "0.1.0"
|
|
20
|
+
sdk_version: "0.1.0"
|
|
21
|
+
pack_languages: [python]
|
|
22
|
+
sources:
|
|
23
|
+
- sdks/python/src/kindgi/pack/define.py
|
|
24
|
+
- sdks/python/src/kindgi/pack/index.py
|
|
25
|
+
- packages/specs/schemas/flow.schema.json
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Authoring Kindgi flows in Python
|
|
29
|
+
|
|
30
|
+
> **Running `kindgi`:** a Python pack has no Node project, so the
|
|
31
|
+
> `kindgi` CLI is the one on `PATH`. Python commands run in the pack's
|
|
32
|
+
> environment: `uv run …` (or `.venv/bin/python …`).
|
|
33
|
+
|
|
34
|
+
A **flow** is a versioned, durable graph of steps: tools (your code) and
|
|
35
|
+
agents (a model's judgment), joined by edges that can carry conditions.
|
|
36
|
+
It is **data**, not code: a `Flow(...)` at module level in
|
|
37
|
+
`flows/<name>.py`. The runtime runs it step by step, journals every
|
|
38
|
+
step, and can resume a run that was interrupted. A run pins the flow
|
|
39
|
+
version it started on.
|
|
40
|
+
|
|
41
|
+
Use a flow when the order of the work is known: parse, then classify,
|
|
42
|
+
then branch, then write. Use a single agent when the model should decide
|
|
43
|
+
the order.
|
|
44
|
+
|
|
45
|
+
## Ask before building
|
|
46
|
+
|
|
47
|
+
- **What goes in, and what comes out?** The run input's shape and the
|
|
48
|
+
output the caller reads. They become `runInput.*` paths and `output`.
|
|
49
|
+
- **Which steps are code, which are judgment?** Deterministic work
|
|
50
|
+
(parse, rank, look up, write) is a tool; judgment (classify, draft,
|
|
51
|
+
summarize) is an agent with a typed `output`.
|
|
52
|
+
- **Where does it branch?** Every branch needs a condition, and the
|
|
53
|
+
steps after a branch must cope with the branch that didn't run.
|
|
54
|
+
- **What does it change outside Kindgi?** Know which tools write: a dry
|
|
55
|
+
run stops before them (see "Running a flow").
|
|
56
|
+
|
|
57
|
+
## A flow
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# flows/triage_ticket.py
|
|
61
|
+
from kindgi import Flow
|
|
62
|
+
|
|
63
|
+
from ..agents.ticket_classifier import ticket_classifier
|
|
64
|
+
from ..tools.tickets import draft_reply, lookup_invoice, parse_ticket
|
|
65
|
+
|
|
66
|
+
IS_BILLING = {
|
|
67
|
+
"op": "eq",
|
|
68
|
+
"left": {"path": "nodeOutputs.classify.output.category"},
|
|
69
|
+
"right": {"literal": "billing"},
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
triage_ticket = Flow(
|
|
73
|
+
id="acme.triage-ticket",
|
|
74
|
+
version="0.1.0",
|
|
75
|
+
name="Triage a support ticket",
|
|
76
|
+
description="Parses a ticket, classifies it, looks up billing when needed, drafts a reply.",
|
|
77
|
+
nodes=[
|
|
78
|
+
{
|
|
79
|
+
"id": "parse",
|
|
80
|
+
"kind": "tool",
|
|
81
|
+
"ref": parse_ticket,
|
|
82
|
+
"inputMapping": {"ticket": {"path": "runInput.ticket"}},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "classify",
|
|
86
|
+
"kind": "agent",
|
|
87
|
+
"ref": ticket_classifier, # an Agent with output=
|
|
88
|
+
"inputMapping": {"text": {"path": "nodeOutputs.parse.text"}},
|
|
89
|
+
"config": {"parameters": {"product": "acme-cloud"}},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "billing",
|
|
93
|
+
"kind": "tool",
|
|
94
|
+
"ref": lookup_invoice,
|
|
95
|
+
"inputMapping": {"customer_id": {"path": "runInput.ticket.customer_id"}},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "reply",
|
|
99
|
+
"kind": "tool",
|
|
100
|
+
"ref": draft_reply,
|
|
101
|
+
"inputMapping": {
|
|
102
|
+
"category": {"path": "nodeOutputs.classify.output.category"},
|
|
103
|
+
"invoice": {"path": "nodeOutputs.billing.invoice"}, # absent when billing didn't run
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
edges=[
|
|
108
|
+
{"id": "e0", "from": "$start", "to": "parse"},
|
|
109
|
+
{"id": "e1", "from": "parse", "to": "classify"},
|
|
110
|
+
{"id": "e2", "from": "classify", "to": "billing", "when": IS_BILLING},
|
|
111
|
+
{"id": "e3", "from": "classify", "to": "reply", "when": {"op": "not", "child": IS_BILLING}},
|
|
112
|
+
{"id": "e4", "from": "billing", "to": "reply"},
|
|
113
|
+
{"id": "e5", "from": "reply", "to": "$end"},
|
|
114
|
+
],
|
|
115
|
+
output={
|
|
116
|
+
"mapping": {
|
|
117
|
+
"category": {"path": "nodeOutputs.classify.output.category"},
|
|
118
|
+
"reply": {"path": "nodeOutputs.reply.text"},
|
|
119
|
+
},
|
|
120
|
+
"schema": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {"category": {"type": "string"}, "reply": {"type": "string"}},
|
|
123
|
+
"required": ["category", "reply"],
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- **Refs** are the `Tool` / `Agent` (or `Flow`) objects, imported
|
|
130
|
+
relatively from the pack's own modules — anywhere in the flow, loop
|
|
131
|
+
bodies and fanout branches included. A primitive from another pack is
|
|
132
|
+
its id string. Ids are plain strings; no casts.
|
|
133
|
+
- **The dicts are the wire shape**, so their keys are camelCase
|
|
134
|
+
(`inputMapping`, `loopKind`, `maxIterations`); `Flow`'s own keywords
|
|
135
|
+
are snake_case (`max_parallelism`).
|
|
136
|
+
- **Where it's checked:** `Flow(...)` checks the id when the module
|
|
137
|
+
loads. The indexer checks the rest against `flow.schema.json` —
|
|
138
|
+
version, node and edge shapes, `$start` / `$end` — and `kindgi dev`
|
|
139
|
+
reports a mistake as a file error that says what and where
|
|
140
|
+
(`flow 'acme.triage-ticket' is invalid at /nodes/0: must NOT have
|
|
141
|
+
additional properties ('input_mapping')`), while the pack's other
|
|
142
|
+
primitives keep serving. That a ref's tool or agent
|
|
143
|
+
exists is checked when a run starts (see "Running a flow").
|
|
144
|
+
|
|
145
|
+
## Nodes
|
|
146
|
+
|
|
147
|
+
- **`"kind": "tool"`** runs the tool `ref`. The tool's input is what the
|
|
148
|
+
node's `inputMapping` builds, else the output of the node's single
|
|
149
|
+
upstream node (the run input after `$start`). It is validated against
|
|
150
|
+
the tool's input schema, so a mismatch fails the step with
|
|
151
|
+
`input-validation-failed`. The node's output is the tool's return
|
|
152
|
+
value, as JSON (field aliases, if the model has any).
|
|
153
|
+
- **`"kind": "agent"`** runs one turn of the agent `ref` as a child run
|
|
154
|
+
of the flow run. The agent gets the node's input in two ways:
|
|
155
|
+
- as **structured input**: `{{ input.text }}` in its instructions;
|
|
156
|
+
- as its user message (the input as JSON).
|
|
157
|
+
|
|
158
|
+
`"config": {"parameters": {…}}` fills the agent's `parameters`
|
|
159
|
+
(string, number or boolean values). `"config": {"version": "1.2.0"}`
|
|
160
|
+
pins an agent version; without it the latest active version runs.
|
|
161
|
+
|
|
162
|
+
The node's output:
|
|
163
|
+
- `output` is the agent's typed answer (its `output=` model);
|
|
164
|
+
- `text` is the answer as text;
|
|
165
|
+
- `runId` and `conversationId` belong to the child run.
|
|
166
|
+
|
|
167
|
+
Read a field as `nodeOutputs.<node>.output.<field>`. An answer that
|
|
168
|
+
doesn't fit the agent's `output`, after its repairs, fails the step
|
|
169
|
+
with `output-schema-violation`. An approval inside the agent's turn
|
|
170
|
+
parks the flow until it's decided.
|
|
171
|
+
- **`"kind": "loop"`** repeats a body: `"loopKind": "foreach"` once per
|
|
172
|
+
element of `iterateOver` (`concurrency` up to 32 in parallel), or
|
|
173
|
+
`"loopKind": "while"` until `exitCondition`.
|
|
174
|
+
- The body (`"body": {"nodes": [...], "edges": [...]}`) has its own
|
|
175
|
+
nodes and edges, with `$loop-start` / `$loop-end`; the element is
|
|
176
|
+
the body's input.
|
|
177
|
+
- `maxIterations` and `outputSchema` are required.
|
|
178
|
+
- The loop's output is `finalOutput`, plus `outputs` with
|
|
179
|
+
`"collectAllIterations": True`.
|
|
180
|
+
- Node ids must be unique across the whole flow, bodies included.
|
|
181
|
+
- **`"kind": "fanout"`** runs several handlers on the same input at
|
|
182
|
+
once, each a branch (`branchId`, `handler` — a `Tool` or an id —
|
|
183
|
+
and `outputSchema`). `convergence` decides the result: `all-succeed`,
|
|
184
|
+
`any-succeed` (the first success wins), or `settle-all` (wait for
|
|
185
|
+
every branch and report each).
|
|
186
|
+
- **`"kind": "subgraph"`** (a sub-flow) is part of the flow schema, but a
|
|
187
|
+
run refuses it today (`flow-unbound`). Inline the steps instead.
|
|
188
|
+
|
|
189
|
+
## Edges and conditions
|
|
190
|
+
|
|
191
|
+
An edge goes from a node (or `$start`) to a node (or `$end`). Without
|
|
192
|
+
`when` it fires when its source completes; with `when` it fires only if
|
|
193
|
+
the condition is true. Conditions are dicts:
|
|
194
|
+
|
|
195
|
+
| Operator | Shape |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `eq` `ne` `lt` `lte` `gt` `gte` | `{"op", "left", "right"}` |
|
|
198
|
+
| `in` `notIn` | `{"op", "value", "set"}` |
|
|
199
|
+
| `exists` `notExists` `truthy` `falsy` | `{"op", "value"}` |
|
|
200
|
+
| `and` `or` | `{"op", "children": [...]}` |
|
|
201
|
+
| `not` | `{"op", "child"}` |
|
|
202
|
+
|
|
203
|
+
Each operand is `{"literal": …}` or `{"path": …}`. A comparison whose
|
|
204
|
+
path doesn't resolve is **false**, `ne` included. So to branch on "not
|
|
205
|
+
billing", write `not` around the `eq` (as above), not `ne`. A condition
|
|
206
|
+
used twice is easiest as a module-level constant (`IS_BILLING`).
|
|
207
|
+
|
|
208
|
+
**Joining branches.** A node with several incoming edges runs once every
|
|
209
|
+
one of them is decided and at least one fired. In the example, `reply`
|
|
210
|
+
runs after `billing` on the billing branch, and straight after
|
|
211
|
+
`classify` otherwise. A node none of whose incoming edges fired is
|
|
212
|
+
skipped, and so is everything only it leads to.
|
|
213
|
+
|
|
214
|
+
**Edge policy** (`"policy"` on the edge into a node with a single
|
|
215
|
+
incoming edge):
|
|
216
|
+
- `"retry": {"maxAttempts", "delayMs"?, "backoff"?, "maxDelayMs"?}`: up
|
|
217
|
+
to 10 attempts in all;
|
|
218
|
+
- `"timeoutMs"`: a step that takes longer fails with `reason: timeout`;
|
|
219
|
+
- `"concurrencyKey"`: at most one such step at a time in the tenant;
|
|
220
|
+
- `"priority"`: −100 to 100.
|
|
221
|
+
|
|
222
|
+
A node with several incoming edges ignores them.
|
|
223
|
+
|
|
224
|
+
## Inputs and the output
|
|
225
|
+
|
|
226
|
+
`inputMapping` maps each key to a `{"literal": …}` or a `{"path": …}`.
|
|
227
|
+
Its keys are the tool's input **as it travels**: a pydantic field's name,
|
|
228
|
+
or its alias if it has one (a `customer_id` field is the key
|
|
229
|
+
`customer_id`; with `alias="customerId"`, it's `customerId`). Paths are
|
|
230
|
+
dot-separated, with no array indexing, rooted at:
|
|
231
|
+
- `runInput.…`: the input the run was started with;
|
|
232
|
+
- `nodeOutputs.<nodeId>.…`: a step's output. For an agent step, add
|
|
233
|
+
`.output.<field>` to read its typed answer;
|
|
234
|
+
- `state.…`: values written by the runtime's own handlers. Pack tools
|
|
235
|
+
don't write it, so use `nodeOutputs`.
|
|
236
|
+
|
|
237
|
+
A path that doesn't resolve leaves its key out. A step after a branch
|
|
238
|
+
that didn't run gets no `invoice` key at all, rather than `None`. Give
|
|
239
|
+
that field a default in the tool's input model
|
|
240
|
+
(`invoice: Invoice | None = None`).
|
|
241
|
+
|
|
242
|
+
`output` is what the run returns: a `mapping` resolved when the run
|
|
243
|
+
finishes, checked against `schema` if you give one. A run whose output
|
|
244
|
+
doesn't match fails. Without `output`, the run returns the output of the
|
|
245
|
+
step that reached `$end`.
|
|
246
|
+
|
|
247
|
+
## Running a flow
|
|
248
|
+
|
|
249
|
+
From another terminal in the pack directory, while `kindgi dev` runs:
|
|
250
|
+
|
|
251
|
+
```sh
|
|
252
|
+
kindgi runs start --flow=acme.triage-ticket --input='{"ticket":{"customer_id":"c-1","body":"Charged twice"}}'
|
|
253
|
+
kindgi runs start --flow=acme.triage-ticket --input=@ticket.json --no-wait # the run id now; it finishes in the background
|
|
254
|
+
kindgi runs start --flow=acme.triage-ticket --input=@ticket.json --dry-run # stops before a tool that may write
|
|
255
|
+
kindgi runs get <run-id> # status, output, failureMessage
|
|
256
|
+
kindgi runs journal <run-id> # every step.started / step.completed / edge.evaluated
|
|
257
|
+
kindgi runs stream <run-id> # follow a running one
|
|
258
|
+
kindgi runs cancel <run-id>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Or from Python, with `kindgi.client`:
|
|
262
|
+
`Kindgi().runs.start(flow="acme.triage-ticket", input={...})`.
|
|
263
|
+
|
|
264
|
+
- **A refusal before the run exists:** `422 flow-unbound` names the
|
|
265
|
+
nodes a run can't bind: a tool or agent id the tenant doesn't have, or
|
|
266
|
+
a sub-flow. Fix the ids; nothing ran.
|
|
267
|
+
- **A failed step fails the run**, and `failureMessage` says which step
|
|
268
|
+
and why. Retry it on its edge with `policy.retry` only if running the
|
|
269
|
+
step twice is safe.
|
|
270
|
+
- **`--no-wait`** is how an application starts runs
|
|
271
|
+
(`options={"wait": False}`). It answers with the run id at once; poll
|
|
272
|
+
the run or follow its stream.
|
|
273
|
+
- **`--dry-run`** runs a tool only if it's declared read-only:
|
|
274
|
+
`@tool(..., mutating=False)` (or `http_tool(..., mutating=False)`),
|
|
275
|
+
and no `writes`, `deletes`, `spawns-run`, `emits-event` or
|
|
276
|
+
`external-side-effect` effect. The first other tool stops the run with
|
|
277
|
+
`dry-run-effectful-tool`, and everything before it really ran. That's
|
|
278
|
+
useful for checking the wiring without the writes.
|
|
279
|
+
|
|
280
|
+
## Iterating on a flow
|
|
281
|
+
|
|
282
|
+
Save the file and `kindgi dev` re-indexes; the next run uses the new
|
|
283
|
+
definition, with no restart. A run already in flight keeps the version it
|
|
284
|
+
started on. Bump `version` when callers' contract changes (the input or
|
|
285
|
+
the output), not on every save.
|
|
286
|
+
|
|
287
|
+
## Common mistakes
|
|
288
|
+
|
|
289
|
+
1. **Building a flow without asking what goes in and comes out.** The
|
|
290
|
+
pack's `echo_flow` proves the runtime works. It isn't a template for
|
|
291
|
+
the user's flow.
|
|
292
|
+
2. **`ne` on a path that may be missing, to mean "otherwise".** A missing
|
|
293
|
+
path makes every comparison false, so neither branch fires and
|
|
294
|
+
everything after is skipped. Use `not` around the positive condition.
|
|
295
|
+
3. **Reading an agent step's answer at `nodeOutputs.<step>.<field>`.**
|
|
296
|
+
The typed answer is under `.output`: `nodeOutputs.<step>.output.<field>`.
|
|
297
|
+
An agent without `output=` has only `text`.
|
|
298
|
+
4. **A required input field fed by a branch that may not run.** The key
|
|
299
|
+
is omitted, the tool's input check fails, and so does the step. Give
|
|
300
|
+
the field a default.
|
|
301
|
+
5. **`inputMapping` keys in the wrong spelling.** They're the input's
|
|
302
|
+
wire names (field names, or aliases): `customerId` doesn't fill a
|
|
303
|
+
`customer_id` field that has no alias.
|
|
304
|
+
6. **snake_case keys inside the dicts** (`input_mapping`,
|
|
305
|
+
`max_iterations`). The indexer refuses them, naming the key; the
|
|
306
|
+
dicts are camelCase.
|
|
307
|
+
7. **A sub-flow node.** A run refuses it (`flow-unbound`) until
|
|
308
|
+
sub-flows are supported.
|
|
309
|
+
8. **Duplicate node ids inside a loop body.** Ids are unique across the
|
|
310
|
+
whole flow, bodies included.
|
|
311
|
+
9. **`mutating=False` on a tool that writes.** A dry run then runs it for
|
|
312
|
+
real, and an agent's tool approval gate (when it falls back on
|
|
313
|
+
`mutating`) won't ask before it.
|
|
314
|
+
10. **A read-only tool without `mutating=False`.** A dry run stops at it,
|
|
315
|
+
and an agent's tool approval gate asks before it on first use.
|
|
316
|
+
|
|
317
|
+
## When the framework itself is the problem
|
|
318
|
+
|
|
319
|
+
If the bug is in Kindgi or the `kindgi` package (a step's output missing
|
|
320
|
+
a field, a condition that evaluates wrongly, a misleading error) and not
|
|
321
|
+
in the pack's code, load `kindgi-framework-feedback` and file it with
|
|
322
|
+
`kindgi feedback write`.
|