@oscharko-dev/keiko 0.1.0-beta.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 +202 -0
- package/NOTICE +7 -0
- package/README.md +621 -0
- package/TRADEMARKS.md +41 -0
- package/dist/audit/aggregate.d.ts +5 -0
- package/dist/audit/aggregate.js +25 -0
- package/dist/audit/build.d.ts +2 -0
- package/dist/audit/build.js +224 -0
- package/dist/audit/errors.d.ts +25 -0
- package/dist/audit/errors.js +39 -0
- package/dist/audit/index-api.d.ts +14 -0
- package/dist/audit/index-api.js +131 -0
- package/dist/audit/index.d.ts +12 -0
- package/dist/audit/index.js +17 -0
- package/dist/audit/persist.d.ts +8 -0
- package/dist/audit/persist.js +40 -0
- package/dist/audit/redaction.d.ts +3 -0
- package/dist/audit/redaction.js +61 -0
- package/dist/audit/report.d.ts +18 -0
- package/dist/audit/report.js +50 -0
- package/dist/audit/retention.d.ts +3 -0
- package/dist/audit/retention.js +95 -0
- package/dist/audit/runid.d.ts +1 -0
- package/dist/audit/runid.js +29 -0
- package/dist/audit/side-file.d.ts +12 -0
- package/dist/audit/side-file.js +82 -0
- package/dist/audit/store.d.ts +12 -0
- package/dist/audit/store.js +198 -0
- package/dist/audit/types.d.ts +188 -0
- package/dist/audit/types.js +8 -0
- package/dist/audit/workflow-evidence.d.ts +27 -0
- package/dist/audit/workflow-evidence.js +145 -0
- package/dist/cli/context.d.ts +2 -0
- package/dist/cli/context.js +102 -0
- package/dist/cli/evaluate.d.ts +7 -0
- package/dist/cli/evaluate.js +207 -0
- package/dist/cli/evidence.d.ts +8 -0
- package/dist/cli/evidence.js +88 -0
- package/dist/cli/gateway-config.d.ts +10 -0
- package/dist/cli/gateway-config.js +12 -0
- package/dist/cli/gen-tests.d.ts +7 -0
- package/dist/cli/gen-tests.js +208 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +14 -0
- package/dist/cli/investigate.d.ts +8 -0
- package/dist/cli/investigate.js +242 -0
- package/dist/cli/models.d.ts +3 -0
- package/dist/cli/models.js +64 -0
- package/dist/cli/run.d.ts +7 -0
- package/dist/cli/run.js +187 -0
- package/dist/cli/runner.d.ts +6 -0
- package/dist/cli/runner.js +83 -0
- package/dist/cli/ui.d.ts +31 -0
- package/dist/cli/ui.js +240 -0
- package/dist/cli/verify.d.ts +2 -0
- package/dist/cli/verify.js +103 -0
- package/dist/evaluations/fixtures/bug-investigation/happy-path.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/happy-path.js +66 -0
- package/dist/evaluations/fixtures/bug-investigation/investigation-only.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/investigation-only.js +39 -0
- package/dist/evaluations/fixtures/bug-investigation/unsafe-action.d.ts +2 -0
- package/dist/evaluations/fixtures/bug-investigation/unsafe-action.js +37 -0
- package/dist/evaluations/fixtures/index.d.ts +7 -0
- package/dist/evaluations/fixtures/index.js +35 -0
- package/dist/evaluations/fixtures/support.d.ts +5 -0
- package/dist/evaluations/fixtures/support.js +42 -0
- package/dist/evaluations/fixtures/unit-tests/happy-path.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/happy-path.js +40 -0
- package/dist/evaluations/fixtures/unit-tests/retry-then-accept.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/retry-then-accept.js +39 -0
- package/dist/evaluations/fixtures/unit-tests/unsafe-action.d.ts +2 -0
- package/dist/evaluations/fixtures/unit-tests/unsafe-action.js +32 -0
- package/dist/evaluations/index.d.ts +12 -0
- package/dist/evaluations/index.js +12 -0
- package/dist/evaluations/manifest-check.d.ts +1 -0
- package/dist/evaluations/manifest-check.js +48 -0
- package/dist/evaluations/model-provider.d.ts +12 -0
- package/dist/evaluations/model-provider.js +26 -0
- package/dist/evaluations/render.d.ts +2 -0
- package/dist/evaluations/render.js +59 -0
- package/dist/evaluations/runner-support.d.ts +27 -0
- package/dist/evaluations/runner-support.js +163 -0
- package/dist/evaluations/runner.d.ts +20 -0
- package/dist/evaluations/runner.js +174 -0
- package/dist/evaluations/scorer.d.ts +14 -0
- package/dist/evaluations/scorer.js +131 -0
- package/dist/evaluations/scripted-model.d.ts +6 -0
- package/dist/evaluations/scripted-model.js +26 -0
- package/dist/evaluations/surface-parity.d.ts +2 -0
- package/dist/evaluations/surface-parity.js +184 -0
- package/dist/evaluations/types.d.ts +74 -0
- package/dist/evaluations/types.js +16 -0
- package/dist/gateway/capabilities.d.ts +11 -0
- package/dist/gateway/capabilities.data.d.ts +2 -0
- package/dist/gateway/capabilities.data.js +203 -0
- package/dist/gateway/capabilities.js +41 -0
- package/dist/gateway/config.d.ts +15 -0
- package/dist/gateway/config.js +154 -0
- package/dist/gateway/errors.d.ts +72 -0
- package/dist/gateway/errors.js +82 -0
- package/dist/gateway/gateway.d.ts +19 -0
- package/dist/gateway/gateway.js +94 -0
- package/dist/gateway/index.d.ts +10 -0
- package/dist/gateway/index.js +11 -0
- package/dist/gateway/model-selection.d.ts +9 -0
- package/dist/gateway/model-selection.js +36 -0
- package/dist/gateway/normalize.d.ts +7 -0
- package/dist/gateway/normalize.js +93 -0
- package/dist/gateway/openai-adapter.d.ts +20 -0
- package/dist/gateway/openai-adapter.js +263 -0
- package/dist/gateway/redaction.d.ts +1 -0
- package/dist/gateway/redaction.js +51 -0
- package/dist/gateway/resilience.d.ts +24 -0
- package/dist/gateway/resilience.js +166 -0
- package/dist/gateway/types.d.ts +108 -0
- package/dist/gateway/types.js +2 -0
- package/dist/harness/adapters.d.ts +23 -0
- package/dist/harness/adapters.js +38 -0
- package/dist/harness/context.d.ts +33 -0
- package/dist/harness/context.js +21 -0
- package/dist/harness/emitter.d.ts +15 -0
- package/dist/harness/emitter.js +72 -0
- package/dist/harness/errors.d.ts +21 -0
- package/dist/harness/errors.js +39 -0
- package/dist/harness/executor.d.ts +3 -0
- package/dist/harness/executor.js +211 -0
- package/dist/harness/fingerprint.d.ts +6 -0
- package/dist/harness/fingerprint.js +43 -0
- package/dist/harness/index.d.ts +9 -0
- package/dist/harness/index.js +13 -0
- package/dist/harness/loop.d.ts +3 -0
- package/dist/harness/loop.js +159 -0
- package/dist/harness/patcher.d.ts +4 -0
- package/dist/harness/patcher.js +49 -0
- package/dist/harness/planner.d.ts +3 -0
- package/dist/harness/planner.js +21 -0
- package/dist/harness/ports.d.ts +61 -0
- package/dist/harness/ports.js +4 -0
- package/dist/harness/session.d.ts +25 -0
- package/dist/harness/session.js +116 -0
- package/dist/harness/sinks.d.ts +30 -0
- package/dist/harness/sinks.js +72 -0
- package/dist/harness/tasks/explain-plan.d.ts +3 -0
- package/dist/harness/tasks/explain-plan.js +29 -0
- package/dist/harness/tasks/generate-unit-tests.d.ts +3 -0
- package/dist/harness/tasks/generate-unit-tests.js +28 -0
- package/dist/harness/tasks/investigate-bug.d.ts +3 -0
- package/dist/harness/tasks/investigate-bug.js +31 -0
- package/dist/harness/tasks/policy.d.ts +11 -0
- package/dist/harness/tasks/policy.js +22 -0
- package/dist/harness/tasks/verify.d.ts +3 -0
- package/dist/harness/tasks/verify.js +16 -0
- package/dist/harness/types.d.ts +270 -0
- package/dist/harness/types.js +33 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +36 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.js +37 -0
- package/dist/sdk/run-agent.d.ts +16 -0
- package/dist/sdk/run-agent.js +56 -0
- package/dist/tools/browser/cdp-client.d.ts +35 -0
- package/dist/tools/browser/cdp-client.js +218 -0
- package/dist/tools/browser/errors.d.ts +25 -0
- package/dist/tools/browser/errors.js +55 -0
- package/dist/tools/browser/index.d.ts +5 -0
- package/dist/tools/browser/index.js +6 -0
- package/dist/tools/browser/session.d.ts +44 -0
- package/dist/tools/browser/session.js +748 -0
- package/dist/tools/browser/types.d.ts +48 -0
- package/dist/tools/browser/types.js +2 -0
- package/dist/tools/browser/validators.d.ts +5 -0
- package/dist/tools/browser/validators.js +97 -0
- package/dist/tools/errors.d.ts +59 -0
- package/dist/tools/errors.js +94 -0
- package/dist/tools/exec.d.ts +42 -0
- package/dist/tools/exec.js +327 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.js +14 -0
- package/dist/tools/patch-content.d.ts +10 -0
- package/dist/tools/patch-content.js +126 -0
- package/dist/tools/patch-normalize.d.ts +1 -0
- package/dist/tools/patch-normalize.js +80 -0
- package/dist/tools/patch-parse.d.ts +8 -0
- package/dist/tools/patch-parse.js +201 -0
- package/dist/tools/patch.d.ts +18 -0
- package/dist/tools/patch.js +403 -0
- package/dist/tools/registry.d.ts +36 -0
- package/dist/tools/registry.js +231 -0
- package/dist/tools/sandbox.d.ts +8 -0
- package/dist/tools/sandbox.js +121 -0
- package/dist/tools/schemas.d.ts +2 -0
- package/dist/tools/schemas.js +51 -0
- package/dist/tools/terminal-policy.d.ts +9 -0
- package/dist/tools/terminal-policy.js +313 -0
- package/dist/tools/types.d.ts +99 -0
- package/dist/tools/types.js +103 -0
- package/dist/tools/writer.d.ts +7 -0
- package/dist/tools/writer.js +20 -0
- package/dist/ui/browser.d.ts +10 -0
- package/dist/ui/browser.js +231 -0
- package/dist/ui/chat-handlers.d.ts +4 -0
- package/dist/ui/chat-handlers.js +281 -0
- package/dist/ui/csp-hashes.json +17 -0
- package/dist/ui/csp.d.ts +2 -0
- package/dist/ui/csp.js +66 -0
- package/dist/ui/deps.d.ts +34 -0
- package/dist/ui/deps.js +137 -0
- package/dist/ui/evidence.d.ts +27 -0
- package/dist/ui/evidence.js +142 -0
- package/dist/ui/files-deny.d.ts +2 -0
- package/dist/ui/files-deny.js +12 -0
- package/dist/ui/files.d.ts +65 -0
- package/dist/ui/files.js +492 -0
- package/dist/ui/headers.d.ts +2 -0
- package/dist/ui/headers.js +21 -0
- package/dist/ui/host-check.d.ts +2 -0
- package/dist/ui/host-check.js +58 -0
- package/dist/ui/index.d.ts +20 -0
- package/dist/ui/index.js +23 -0
- package/dist/ui/load-csp.d.ts +1 -0
- package/dist/ui/load-csp.js +28 -0
- package/dist/ui/read-handlers.d.ts +8 -0
- package/dist/ui/read-handlers.js +247 -0
- package/dist/ui/routes.d.ts +36 -0
- package/dist/ui/routes.js +129 -0
- package/dist/ui/run-engine.d.ts +20 -0
- package/dist/ui/run-engine.js +345 -0
- package/dist/ui/run-handlers.d.ts +8 -0
- package/dist/ui/run-handlers.js +431 -0
- package/dist/ui/run-request.d.ts +13 -0
- package/dist/ui/run-request.js +219 -0
- package/dist/ui/runs.d.ts +43 -0
- package/dist/ui/runs.js +92 -0
- package/dist/ui/server.d.ts +11 -0
- package/dist/ui/server.js +143 -0
- package/dist/ui/sink.d.ts +27 -0
- package/dist/ui/sink.js +80 -0
- package/dist/ui/sse.d.ts +7 -0
- package/dist/ui/sse.js +27 -0
- package/dist/ui/static/404.html +1 -0
- package/dist/ui/static/_next/static/ca-A01hy9W98aRvMZKdAw/_buildManifest.js +1 -0
- package/dist/ui/static/_next/static/ca-A01hy9W98aRvMZKdAw/_ssgManifest.js +1 -0
- package/dist/ui/static/_next/static/chunks/255-d47fd57964443afe.js +1 -0
- package/dist/ui/static/_next/static/chunks/4-be1fef693af8e088.js +1 -0
- package/dist/ui/static/_next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/_not-found/page-75825b09bcecad97.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/launch/page-9c86a13c29884245.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/layout-bdea63fe87947d50.js +1 -0
- package/dist/ui/static/_next/static/chunks/app/page-4168c12c68b7a853.js +1 -0
- package/dist/ui/static/_next/static/chunks/framework-a6e0b7e30f98059a.js +1 -0
- package/dist/ui/static/_next/static/chunks/main-778a50aebff02192.js +1 -0
- package/dist/ui/static/_next/static/chunks/main-app-30679af7240d63e9.js +1 -0
- package/dist/ui/static/_next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
- package/dist/ui/static/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
- package/dist/ui/static/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/ui/static/_next/static/chunks/webpack-4a462cecab786e93.js +1 -0
- package/dist/ui/static/_next/static/css/be7cb54d5c5673b6.css +1 -0
- package/dist/ui/static/assets/editors/goland.svg +35 -0
- package/dist/ui/static/assets/editors/intellij.svg +39 -0
- package/dist/ui/static/assets/editors/pycharm.svg +58 -0
- package/dist/ui/static/assets/editors/rustrover.svg +19 -0
- package/dist/ui/static/assets/editors/vscode.svg +1 -0
- package/dist/ui/static/assets/editors/webstorm.svg +21 -0
- package/dist/ui/static/assets/icons/anthropic.svg +1 -0
- package/dist/ui/static/assets/icons/brave.svg +1 -0
- package/dist/ui/static/assets/icons/css3.svg +1 -0
- package/dist/ui/static/assets/icons/docker.svg +1 -0
- package/dist/ui/static/assets/icons/git.svg +1 -0
- package/dist/ui/static/assets/icons/github.svg +1 -0
- package/dist/ui/static/assets/icons/go.svg +1 -0
- package/dist/ui/static/assets/icons/gradle.svg +1 -0
- package/dist/ui/static/assets/icons/grafana.svg +1 -0
- package/dist/ui/static/assets/icons/graphql.svg +1 -0
- package/dist/ui/static/assets/icons/html5.svg +1 -0
- package/dist/ui/static/assets/icons/image.svg +1 -0
- package/dist/ui/static/assets/icons/java.svg +1 -0
- package/dist/ui/static/assets/icons/javascript.svg +1 -0
- package/dist/ui/static/assets/icons/json.svg +1 -0
- package/dist/ui/static/assets/icons/kafka.svg +1 -0
- package/dist/ui/static/assets/icons/kubernetes.svg +1 -0
- package/dist/ui/static/assets/icons/linear.svg +1 -0
- package/dist/ui/static/assets/icons/markdown.svg +1 -0
- package/dist/ui/static/assets/icons/nginx.svg +1 -0
- package/dist/ui/static/assets/icons/nodejs.svg +1 -0
- package/dist/ui/static/assets/icons/notion.svg +1 -0
- package/dist/ui/static/assets/icons/openai.svg +1 -0
- package/dist/ui/static/assets/icons/playwright.svg +1 -0
- package/dist/ui/static/assets/icons/postgresql.svg +1 -0
- package/dist/ui/static/assets/icons/prometheus.svg +1 -0
- package/dist/ui/static/assets/icons/properties.svg +1 -0
- package/dist/ui/static/assets/icons/puppeteer.svg +1 -0
- package/dist/ui/static/assets/icons/python.svg +1 -0
- package/dist/ui/static/assets/icons/react.svg +1 -0
- package/dist/ui/static/assets/icons/redis.svg +1 -0
- package/dist/ui/static/assets/icons/rust.svg +1 -0
- package/dist/ui/static/assets/icons/sentry.svg +1 -0
- package/dist/ui/static/assets/icons/slack.svg +1 -0
- package/dist/ui/static/assets/icons/spring.svg +1 -0
- package/dist/ui/static/assets/icons/typescript.svg +1 -0
- package/dist/ui/static/assets/icons/upstash.svg +1 -0
- package/dist/ui/static/assets/icons/yaml.svg +1 -0
- package/dist/ui/static/assets/keiko-logo.svg +10 -0
- package/dist/ui/static/index.html +1 -0
- package/dist/ui/static/index.txt +19 -0
- package/dist/ui/static/keiko-logo.svg +10 -0
- package/dist/ui/static/launch.html +1 -0
- package/dist/ui/static/launch.txt +19 -0
- package/dist/ui/static.d.ts +3 -0
- package/dist/ui/static.js +72 -0
- package/dist/ui/store/chats.d.ts +14 -0
- package/dist/ui/store/chats.js +110 -0
- package/dist/ui/store/db.d.ts +6 -0
- package/dist/ui/store/db.js +182 -0
- package/dist/ui/store/errors.d.ts +12 -0
- package/dist/ui/store/errors.js +30 -0
- package/dist/ui/store/index.d.ts +6 -0
- package/dist/ui/store/index.js +6 -0
- package/dist/ui/store/messages.d.ts +5 -0
- package/dist/ui/store/messages.js +137 -0
- package/dist/ui/store/paths.d.ts +4 -0
- package/dist/ui/store/paths.js +69 -0
- package/dist/ui/store/projects.d.ts +7 -0
- package/dist/ui/store/projects.js +61 -0
- package/dist/ui/store/schema.d.ts +3 -0
- package/dist/ui/store/schema.js +77 -0
- package/dist/ui/store/types.d.ts +80 -0
- package/dist/ui/store/types.js +3 -0
- package/dist/ui/store/validation.d.ts +4 -0
- package/dist/ui/store/validation.js +72 -0
- package/dist/ui/store-handlers.d.ts +16 -0
- package/dist/ui/store-handlers.js +465 -0
- package/dist/ui/terminal-errors.d.ts +21 -0
- package/dist/ui/terminal-errors.js +45 -0
- package/dist/ui/terminal-evidence.d.ts +20 -0
- package/dist/ui/terminal-evidence.js +65 -0
- package/dist/ui/terminal-routes.d.ts +9 -0
- package/dist/ui/terminal-routes.js +219 -0
- package/dist/ui/terminal.d.ts +67 -0
- package/dist/ui/terminal.js +835 -0
- package/dist/verification/classify.d.ts +10 -0
- package/dist/verification/classify.js +53 -0
- package/dist/verification/detect.d.ts +4 -0
- package/dist/verification/detect.js +81 -0
- package/dist/verification/errors.d.ts +11 -0
- package/dist/verification/errors.js +21 -0
- package/dist/verification/index.d.ts +17 -0
- package/dist/verification/index.js +13 -0
- package/dist/verification/limits.d.ts +3 -0
- package/dist/verification/limits.js +40 -0
- package/dist/verification/monitor.d.ts +4 -0
- package/dist/verification/monitor.js +58 -0
- package/dist/verification/orchestrator.d.ts +16 -0
- package/dist/verification/orchestrator.js +363 -0
- package/dist/verification/plan.d.ts +9 -0
- package/dist/verification/plan.js +125 -0
- package/dist/verification/summary.d.ts +40 -0
- package/dist/verification/summary.js +67 -0
- package/dist/verification/types.d.ts +63 -0
- package/dist/verification/types.js +13 -0
- package/dist/workflows/bug-investigation/context.d.ts +7 -0
- package/dist/workflows/bug-investigation/context.js +119 -0
- package/dist/workflows/bug-investigation/descriptor.d.ts +3 -0
- package/dist/workflows/bug-investigation/descriptor.js +46 -0
- package/dist/workflows/bug-investigation/emit.d.ts +12 -0
- package/dist/workflows/bug-investigation/emit.js +35 -0
- package/dist/workflows/bug-investigation/events.d.ts +81 -0
- package/dist/workflows/bug-investigation/events.js +9 -0
- package/dist/workflows/bug-investigation/failure-parse.d.ts +3 -0
- package/dist/workflows/bug-investigation/failure-parse.js +154 -0
- package/dist/workflows/bug-investigation/guard.d.ts +2 -0
- package/dist/workflows/bug-investigation/guard.js +69 -0
- package/dist/workflows/bug-investigation/index.d.ts +7 -0
- package/dist/workflows/bug-investigation/index.js +13 -0
- package/dist/workflows/bug-investigation/internal.d.ts +37 -0
- package/dist/workflows/bug-investigation/internal.js +64 -0
- package/dist/workflows/bug-investigation/model-loop.d.ts +4 -0
- package/dist/workflows/bug-investigation/model-loop.js +223 -0
- package/dist/workflows/bug-investigation/parse.d.ts +3 -0
- package/dist/workflows/bug-investigation/parse.js +123 -0
- package/dist/workflows/bug-investigation/prompt.d.ts +4 -0
- package/dist/workflows/bug-investigation/prompt.js +107 -0
- package/dist/workflows/bug-investigation/report.d.ts +23 -0
- package/dist/workflows/bug-investigation/report.js +151 -0
- package/dist/workflows/bug-investigation/stages.d.ts +13 -0
- package/dist/workflows/bug-investigation/stages.js +242 -0
- package/dist/workflows/bug-investigation/types.d.ts +91 -0
- package/dist/workflows/bug-investigation/types.js +14 -0
- package/dist/workflows/bug-investigation/verify-stage.d.ts +10 -0
- package/dist/workflows/bug-investigation/verify-stage.js +91 -0
- package/dist/workflows/bug-investigation/workflow.d.ts +2 -0
- package/dist/workflows/bug-investigation/workflow.js +74 -0
- package/dist/workflows/descriptor.d.ts +20 -0
- package/dist/workflows/descriptor.js +8 -0
- package/dist/workflows/index.d.ts +3 -0
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/unit-tests/context.d.ts +7 -0
- package/dist/workflows/unit-tests/context.js +129 -0
- package/dist/workflows/unit-tests/conventions.d.ts +4 -0
- package/dist/workflows/unit-tests/conventions.js +87 -0
- package/dist/workflows/unit-tests/descriptor.d.ts +4 -0
- package/dist/workflows/unit-tests/descriptor.js +43 -0
- package/dist/workflows/unit-tests/emit.d.ts +12 -0
- package/dist/workflows/unit-tests/emit.js +35 -0
- package/dist/workflows/unit-tests/events.d.ts +78 -0
- package/dist/workflows/unit-tests/events.js +7 -0
- package/dist/workflows/unit-tests/index.d.ts +6 -0
- package/dist/workflows/unit-tests/index.js +10 -0
- package/dist/workflows/unit-tests/internal.d.ts +35 -0
- package/dist/workflows/unit-tests/internal.js +43 -0
- package/dist/workflows/unit-tests/model-loop.d.ts +4 -0
- package/dist/workflows/unit-tests/model-loop.js +95 -0
- package/dist/workflows/unit-tests/parse.d.ts +6 -0
- package/dist/workflows/unit-tests/parse.js +68 -0
- package/dist/workflows/unit-tests/prompt.d.ts +4 -0
- package/dist/workflows/unit-tests/prompt.js +71 -0
- package/dist/workflows/unit-tests/report.d.ts +21 -0
- package/dist/workflows/unit-tests/report.js +90 -0
- package/dist/workflows/unit-tests/stages.d.ts +9 -0
- package/dist/workflows/unit-tests/stages.js +155 -0
- package/dist/workflows/unit-tests/types.d.ts +70 -0
- package/dist/workflows/unit-tests/types.js +11 -0
- package/dist/workflows/unit-tests/verify-stage.d.ts +9 -0
- package/dist/workflows/unit-tests/verify-stage.js +56 -0
- package/dist/workflows/unit-tests/workflow.d.ts +2 -0
- package/dist/workflows/unit-tests/workflow.js +58 -0
- package/dist/workspace/contextPack.d.ts +9 -0
- package/dist/workspace/contextPack.js +94 -0
- package/dist/workspace/detect.d.ts +3 -0
- package/dist/workspace/detect.js +135 -0
- package/dist/workspace/discovery.d.ts +9 -0
- package/dist/workspace/discovery.js +167 -0
- package/dist/workspace/errors.d.ts +39 -0
- package/dist/workspace/errors.js +66 -0
- package/dist/workspace/fs.d.ts +21 -0
- package/dist/workspace/fs.js +36 -0
- package/dist/workspace/ignore.d.ts +14 -0
- package/dist/workspace/ignore.js +176 -0
- package/dist/workspace/index.d.ts +11 -0
- package/dist/workspace/index.js +13 -0
- package/dist/workspace/paths.d.ts +2 -0
- package/dist/workspace/paths.js +38 -0
- package/dist/workspace/realpath.d.ts +7 -0
- package/dist/workspace/realpath.js +72 -0
- package/dist/workspace/retrieval.d.ts +9 -0
- package/dist/workspace/retrieval.js +74 -0
- package/dist/workspace/summary.d.ts +3 -0
- package/dist/workspace/summary.js +54 -0
- package/dist/workspace/types.d.ts +103 -0
- package/dist/workspace/types.js +27 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
# Keiko
|
|
2
|
+
|
|
3
|
+
Keiko is an enterprise, model-agnostic developer-assist coding agent for regulated engineering teams.
|
|
4
|
+
|
|
5
|
+
It runs bounded, reviewable coding workflows against a configurable gateway of language models, across three surfaces: a command-line tool (`keiko`), a programmatic SDK, and a local web UI. Dry-run workflows are the default, and the manifest-producing surfaces emit redacted evidence for audit. Keiko assists a developer; it does not merge code on its own.
|
|
6
|
+
|
|
7
|
+
This README is the package's primary shipped guide. It contains the package-facing essentials and links to the repository [`docs/`](https://github.com/oscharko-dev/Keiko/tree/dev/docs) for deeper operational guidance.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
- [What Keiko is](#what-keiko-is)
|
|
14
|
+
- [Wave 1 scope](#wave-1-scope)
|
|
15
|
+
- [Requirements](#requirements)
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Quick start](#quick-start)
|
|
18
|
+
- [Build and test](#build-and-test)
|
|
19
|
+
- [Configuration and secrets](#configuration-and-secrets)
|
|
20
|
+
- [CLI usage](#cli-usage)
|
|
21
|
+
- [SDK usage](#sdk-usage)
|
|
22
|
+
- [Evidence output](#evidence-output)
|
|
23
|
+
- [Local UI](#local-ui)
|
|
24
|
+
- [Security and audit boundaries](#security-and-audit-boundaries)
|
|
25
|
+
- [Evaluation and Go/No-Go](#evaluation-and-gono-go)
|
|
26
|
+
- [Packaging](#packaging)
|
|
27
|
+
- [Future architecture path](#future-architecture-path)
|
|
28
|
+
- [Documentation index](#documentation-index)
|
|
29
|
+
- [Development](#development)
|
|
30
|
+
- [License and attribution](#license-and-attribution)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What Keiko is
|
|
35
|
+
|
|
36
|
+
Keiko is a coding agent for teams who must show their work. It targets regulated engineering — banking, insurance, and similar — where every automated change needs a human reviewer and an audit trail.
|
|
37
|
+
|
|
38
|
+
Three properties define it:
|
|
39
|
+
|
|
40
|
+
- **Model-agnostic.** Route each task to a model that fits the work and the budget, from one config file. The gateway exposes each model's declared capabilities; the caller chooses.
|
|
41
|
+
- **Bounded and reviewable.** Workflows run as deterministic pipelines, not open-ended autonomy. Changes are dry-run by default and returned as a diff for human review. No change reaches a branch without a person.
|
|
42
|
+
- **Auditable.** Manifest-producing surfaces emit structured, redacted evidence. Credentials never enter logs, events, or evidence.
|
|
43
|
+
|
|
44
|
+
Keiko provides bounded developer assistance with measurable output and regulated reviewability. It is not a replacement for engineering judgment, and it does not claim parity with general-purpose autonomous agents.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Wave 1 scope
|
|
49
|
+
|
|
50
|
+
Wave 1 is feature-complete for its defined scope. The shipped capabilities are:
|
|
51
|
+
|
|
52
|
+
- **Bounded repository context** — a redacted, byte-budgeted view of a workspace.
|
|
53
|
+
- **Unit-test generation** — generate a reviewable test patch for an existing source file.
|
|
54
|
+
- **Bug investigation** — propose a fix and a regression test for a reported symptom.
|
|
55
|
+
- **Safe tool and command execution** — an allowlisted, bounded command runner.
|
|
56
|
+
- **Verification** — run the project's gates (lint, typecheck, test, build) under resource limits.
|
|
57
|
+
- **Audit evidence** — redacted, durable evidence manifests with retention.
|
|
58
|
+
- **Local UI** — a single-user, local-only web surface for the workflows and evidence.
|
|
59
|
+
- **Evaluation harness** — an offline (default) or live scorecard for pilot decisions.
|
|
60
|
+
|
|
61
|
+
Surface coverage is intentionally not identical. The CLI exposes the full command set; the SDK exposes programmatic workflows, workspace, verification, gateway, evaluation, and evidence APIs; the local UI exposes workflow launch/review/apply, live run observation, evidence browsing, config/model inspection, and workspace summary.
|
|
62
|
+
|
|
63
|
+
Two model kinds in the portfolio are registered but not yet callable: OCR-vision (`callOcr`) and embedding (`callEmbedding`) methods are Wave 2. See the [model capability guide](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/model-capability-guide.md).
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Requirements
|
|
68
|
+
|
|
69
|
+
- Node.js >= 22 (ESM-only package)
|
|
70
|
+
- npm >= 10
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install @oscharko-dev/keiko
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Keiko ships ESM only with a minimal runtime dependency set. Use `import`, not `require`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Quick start
|
|
85
|
+
|
|
86
|
+
A dry-run pass that writes nothing: inspect context, generate a test patch, review the diff.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# 1. List the models your gateway knows about (no credentials needed)
|
|
90
|
+
keiko models list
|
|
91
|
+
|
|
92
|
+
# 2. Print a redacted summary of what the workspace layer would read
|
|
93
|
+
keiko context --dir .
|
|
94
|
+
|
|
95
|
+
# 3. Generate a unit-test patch for a source file (dry-run by default)
|
|
96
|
+
keiko gen-tests --file src/foo.ts
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Step 3 prints the proposed diff and writes nothing. Review it, then re-run with `--apply` to write the test file, which triggers verification.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Build and test
|
|
104
|
+
|
|
105
|
+
From a clone of the repository:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm install
|
|
109
|
+
npm run build # compile TypeScript to dist/
|
|
110
|
+
npm test # run the test suite (vitest)
|
|
111
|
+
npm run lint # eslint
|
|
112
|
+
npm run typecheck # tsc --noEmit
|
|
113
|
+
npm run format # prettier --write
|
|
114
|
+
npm --prefix ui ci --ignore-scripts # install UI build tooling when packaging or testing the UI
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Configuration and secrets
|
|
120
|
+
|
|
121
|
+
Keiko reads model credentials from **environment variables** or a **JSON config file** — never from CLI flags. This keeps credentials out of shell history and process listings.
|
|
122
|
+
|
|
123
|
+
### Precedence
|
|
124
|
+
|
|
125
|
+
The first match wins:
|
|
126
|
+
|
|
127
|
+
1. Per-model environment variables: `KEIKO_MODEL_<UPPER_MODEL_ID>_API_KEY` / `_BASE_URL`
|
|
128
|
+
2. Config-file value for that model's `apiKey` / `baseUrl`
|
|
129
|
+
3. Global environment variables: `KEIKO_DEFAULT_API_KEY` / `_BASE_URL`
|
|
130
|
+
|
|
131
|
+
Live model CLI surfaces (`keiko models validate`, `keiko gen-tests`, `keiko investigate`, and `keiko evaluate --live`) read a config only from `--config PATH` or `KEIKO_CONFIG_FILE`. `keiko ui` requires `--config PATH` for model-backed runs. Keiko does not implicitly trust `./keiko.config.json` from the target repository.
|
|
132
|
+
|
|
133
|
+
Provider `baseUrl` values must use `https:` unless they target `localhost` or loopback for local development.
|
|
134
|
+
|
|
135
|
+
### Per-model variables
|
|
136
|
+
|
|
137
|
+
Derive the variable name from the model id: uppercase it, then replace every non-alphanumeric character with `_`. Suffix with `_API_KEY` or `_BASE_URL`.
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
gpt-oss-120b → KEIKO_MODEL_GPT_OSS_120B_API_KEY
|
|
141
|
+
KEIKO_MODEL_GPT_OSS_120B_BASE_URL
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Global fallback
|
|
145
|
+
|
|
146
|
+
Used when neither a per-model environment variable nor a config-file value supplies the secret:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
KEIKO_DEFAULT_API_KEY
|
|
150
|
+
KEIKO_DEFAULT_BASE_URL
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Credentials are held in memory for the duration of a call and are never logged or serialized. See [`.env.example`](https://github.com/oscharko-dev/Keiko/blob/dev/.env.example) for a template and [ADR-0003](https://github.com/oscharko-dev/Keiko/blob/dev/docs/adr/README.md#adr-0003) for the rationale.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## CLI usage
|
|
158
|
+
|
|
159
|
+
The CLI provides nine subcommands (`models`, `run`, `context`, `verify`, `gen-tests`, `investigate`, `evidence`, `evaluate`, `ui`); `models` and `evidence` each take a sub-action. Top-level `keiko --help` and `keiko --version` print usage; `keiko evaluate --help` prints its own usage. Global options:
|
|
160
|
+
|
|
161
|
+
| Option | Effect |
|
|
162
|
+
| ----------------- | -------------------- |
|
|
163
|
+
| `-h`, `--help` | Show help text |
|
|
164
|
+
| `-v`, `--version` | Show the CLI version |
|
|
165
|
+
|
|
166
|
+
Exit codes are consistent across commands unless noted:
|
|
167
|
+
|
|
168
|
+
| Code | Meaning |
|
|
169
|
+
| ---- | ------------- |
|
|
170
|
+
| `0` | success |
|
|
171
|
+
| `1` | runtime error |
|
|
172
|
+
| `2` | usage error |
|
|
173
|
+
|
|
174
|
+
### `keiko models list`
|
|
175
|
+
|
|
176
|
+
List all registered model capabilities as a table. No credentials required.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
keiko models list
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Takes no options. Prints one row per model: id, kind, cost class, latency class, tool-calling, structured-output, and use cases.
|
|
183
|
+
|
|
184
|
+
### `keiko models validate`
|
|
185
|
+
|
|
186
|
+
Validate the gateway configuration from `--config` or `KEIKO_CONFIG_FILE`. Reports structural errors without printing any configured value. Exit `0` when valid, `1` when invalid or no source is given, `2` when `--config` has no path.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
keiko models validate --config ./keiko.config.json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
| Option | Description |
|
|
193
|
+
| --------------- | -------------------------------------------- |
|
|
194
|
+
| `--config PATH` | Gateway config file (or `KEIKO_CONFIG_FILE`) |
|
|
195
|
+
|
|
196
|
+
### `keiko run`
|
|
197
|
+
|
|
198
|
+
Run a bounded, dry-run task through the agent harness against deterministic fixtures (no provider call). The task type selects the harness pipeline. A redacted evidence manifest is written by default.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
keiko run explain-plan --file src/auth.ts --question "what does this do?"
|
|
202
|
+
keiko run generate-unit-tests --file src/add.ts --function add
|
|
203
|
+
keiko run investigate-bug --description "login 500 on empty password"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
| Option | Description |
|
|
207
|
+
| --------------------- | ------------------------------------------------------------------------- |
|
|
208
|
+
| `<task-type>` | `explain-plan`, `generate-unit-tests`, or `investigate-bug` |
|
|
209
|
+
| `--file PATH` | Target file (required for the first two task types) |
|
|
210
|
+
| `--question TEXT` | Question for `explain-plan` |
|
|
211
|
+
| `--function NAME` | Focus function for `generate-unit-tests` |
|
|
212
|
+
| `--description TEXT` | Bug description (required for `investigate-bug`) |
|
|
213
|
+
| `--no-evidence` | Do not write an evidence manifest |
|
|
214
|
+
| `--evidence-dir PATH` | Evidence directory (or `KEIKO_EVIDENCE_DIR`; default `./.keiko/evidence`) |
|
|
215
|
+
| `--include-reasoning` | Include redacted reasoning entries in the manifest |
|
|
216
|
+
| `--include-diff` | Include the redacted proposed diff in the manifest |
|
|
217
|
+
|
|
218
|
+
For real model-backed generation and investigation, use `keiko gen-tests` and `keiko investigate`.
|
|
219
|
+
|
|
220
|
+
### `keiko context`
|
|
221
|
+
|
|
222
|
+
Print a redacted workspace context summary. Dry-run by construction: no model is called and nothing is written.
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
keiko context --dir .
|
|
226
|
+
keiko context --dir . --task "add tests" --budget 65536
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
| Option | Description |
|
|
230
|
+
| ---------------- | ------------------------------------------- |
|
|
231
|
+
| `--dir PATH` | Workspace root (default: cwd) |
|
|
232
|
+
| `--task TEXT` | Build a context pack scoped to this task |
|
|
233
|
+
| `--budget BYTES` | Context-pack byte budget (positive integer) |
|
|
234
|
+
| `--json` | Emit the summary as JSON |
|
|
235
|
+
|
|
236
|
+
### `keiko verify`
|
|
237
|
+
|
|
238
|
+
Run the project's gates through the safe tool layer under per-command resource limits, and print a redacted summary. Exit `0` when every gate passes, `1` when a gate fails or a workspace error occurs.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
keiko verify --dir .
|
|
242
|
+
keiko verify --only typecheck,lint --changed src/a.ts
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
| Option | Description |
|
|
246
|
+
| ----------------------- | --------------------------------------------------------------------------- |
|
|
247
|
+
| `--dir PATH` | Workspace root (default: cwd) |
|
|
248
|
+
| `--only KIND[,KIND]` | Run only these gates: `test`, `targeted-test`, `typecheck`, `lint`, `build` |
|
|
249
|
+
| `--changed FILE[,FILE]` | Restrict targeted tests to these changed files |
|
|
250
|
+
| `--json` | Emit the verification report as JSON |
|
|
251
|
+
|
|
252
|
+
### `keiko gen-tests`
|
|
253
|
+
|
|
254
|
+
Generate a reviewable unit-test patch. Dry-run by default; `--apply` writes the tests and runs verification. The patch may only create or modify test files (a production-code guard rejects anything else). The model provider comes from config, never a flag. Exit `0` on a successful dry-run or apply, `1` on a rejected/cancelled/failed run or workspace error, `2` on a usage error.
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
keiko gen-tests --file src/add.ts --config ~/keiko/config.json
|
|
258
|
+
keiko gen-tests --file src/add.ts --function add --apply
|
|
259
|
+
keiko gen-tests --dir src/math --changed src/math/sum.ts
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
| Option | Description |
|
|
263
|
+
| ----------------------- | --------------------------------------------------------------------------- |
|
|
264
|
+
| `--file PATH` | Source file to test (exactly one of `--file` / `--dir`) |
|
|
265
|
+
| `--dir PATH` | Module directory to test (exactly one of `--file` / `--dir`) |
|
|
266
|
+
| `--function NAME` | Focus on one function (with `--file`) |
|
|
267
|
+
| `--changed FILE[,FILE]` | Authoritative changed-file target set |
|
|
268
|
+
| `--apply` | Write the patch and run verification (default: dry-run) |
|
|
269
|
+
| `--model ID` | Registered configured model id (default: cheapest capable configured model) |
|
|
270
|
+
| `--config PATH` | Gateway config file (or `KEIKO_CONFIG_FILE`) |
|
|
271
|
+
| `--json` | Emit the workflow report as JSON |
|
|
272
|
+
| `--dir-root PATH` | Workspace root (default: cwd) |
|
|
273
|
+
|
|
274
|
+
### `keiko investigate`
|
|
275
|
+
|
|
276
|
+
Investigate a bounded bug report, then propose a minimal fix and a regression test, separating verified facts from the model's unverified hypothesis. Dry-run by default; `--apply` writes the fix and runs verification. A scope guard rejects edits to sensitive paths (version-control internals, CI config, git hooks, lockfiles). At least one evidence source is required. Exit `0` on `fix-applied`/`fix-proposed`/`investigation-only`, `1` on a rejected/cancelled/failed run or read error, `2` on a usage error.
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
keiko investigate --description "login returns 500 on empty password" --config ~/keiko/config.json
|
|
280
|
+
keiko investigate --output-file ./fail.txt --file src/auth.ts --apply
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
| Option | Description |
|
|
284
|
+
| -------------------- | --------------------------------------------------------------------------- |
|
|
285
|
+
| `--description TEXT` | Free-text bug description |
|
|
286
|
+
| `--output TEXT` | Failing command/test output (inline) |
|
|
287
|
+
| `--output-file PATH` | Failing output read from a file |
|
|
288
|
+
| `--stack TEXT` | Stack trace (inline) |
|
|
289
|
+
| `--stack-file PATH` | Stack trace read from a file |
|
|
290
|
+
| `--file PATH[,PATH]` | Suspected target file(s) |
|
|
291
|
+
| `--apply` | Apply the fix and run verification (default: dry-run) |
|
|
292
|
+
| `--model ID` | Registered configured model id (default: cheapest capable configured model) |
|
|
293
|
+
| `--config PATH` | Gateway config file (or `KEIKO_CONFIG_FILE`) |
|
|
294
|
+
| `--json` | Emit the investigation report as JSON |
|
|
295
|
+
| `--dir-root PATH` | Workspace root (default: cwd) |
|
|
296
|
+
|
|
297
|
+
### `keiko evidence`
|
|
298
|
+
|
|
299
|
+
Inspect redacted evidence manifests written by `keiko run`, the local UI, and `keiko evaluate`. Reads only the evidence base directory. Exit `0` on success, `1` on a run id not found in the store or a read error, `2` on a usage error (including `show` with no run id).
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
keiko evidence list
|
|
303
|
+
keiko evidence show <runId>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
| Option | Description |
|
|
307
|
+
| --------------------- | ------------------------------------------------------------------------- |
|
|
308
|
+
| `list` | List stored manifests |
|
|
309
|
+
| `show <runId>` | Show one manifest by run id |
|
|
310
|
+
| `--evidence-dir PATH` | Evidence directory (or `KEIKO_EVIDENCE_DIR`; default `./.keiko/evidence`) |
|
|
311
|
+
| `--json` | Emit as JSON |
|
|
312
|
+
|
|
313
|
+
### `keiko evaluate`
|
|
314
|
+
|
|
315
|
+
Run the evaluation harness against the built-in fixtures. Offline (deterministic, no network) by default; `--live` evaluates against a configured model and fails closed when no credentials resolve. Exit `0` when every applicable dimension and surface-parity pass, `1` on a failure or runtime error, `2` on a usage error.
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
keiko evaluate
|
|
319
|
+
keiko evaluate --suite unit-tests --json
|
|
320
|
+
keiko evaluate --live --model gpt-oss-120b --config ~/keiko/config.json
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
| Option | Description |
|
|
324
|
+
| ---------------- | ----------------------------------------------------------- |
|
|
325
|
+
| `--suite NAME` | `unit-tests`, `bug-investigation`, or `all` (default `all`) |
|
|
326
|
+
| `--fixture NAME` | Run one fixture by name (mutually exclusive with `--suite`) |
|
|
327
|
+
| `--live` | Evaluate against a configured model (default: offline) |
|
|
328
|
+
| `--model ID` | Override the model id for all fixtures (live mode) |
|
|
329
|
+
| `--config PATH` | Gateway config file (or `KEIKO_CONFIG_FILE`) |
|
|
330
|
+
| `--json` | Emit the scorecard as JSON |
|
|
331
|
+
| `--output PATH` | Write the scorecard JSON to a file |
|
|
332
|
+
|
|
333
|
+
The offline suite checks workflow plumbing deterministically. It does not measure model quality. See [Evaluation and Go/No-Go](#evaluation-and-gono-go).
|
|
334
|
+
|
|
335
|
+
### `keiko ui`
|
|
336
|
+
|
|
337
|
+
Launch the local UI. The server binds to `127.0.0.1` (loopback only), prints its URL, and runs until interrupted (Ctrl+C). It serves prebuilt UI assets. The published npm package ships these assets, so `keiko ui` works immediately after install; from a source checkout, run `npm run build && npm run ui:ci && npm run build:ui` first.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
keiko ui
|
|
341
|
+
keiko ui --port 4319
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
| Option | Description |
|
|
345
|
+
| --------------------- | ------------------------------------------------------------------- |
|
|
346
|
+
| `--port PORT` | Port to bind (default: 4319) |
|
|
347
|
+
| `--host HOST` | Validate a loopback host value; the server always binds `127.0.0.1` |
|
|
348
|
+
| `--evidence-dir PATH` | Evidence directory for UI-run evidence |
|
|
349
|
+
| `--config PATH` | Gateway config file required for model-backed UI runs |
|
|
350
|
+
|
|
351
|
+
See [Local UI](#local-ui) and the [local UI runbook](https://github.com/oscharko-dev/Keiko/blob/dev/docs/ui-runbook.md).
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## SDK usage
|
|
356
|
+
|
|
357
|
+
Keiko ships ESM-only with full type definitions. The package entry point re-exports the public surface; import named values from `keiko`.
|
|
358
|
+
|
|
359
|
+
`detectWorkspace` and `loadConfigFromFile` are synchronous and take a path string. The workflow functions take a `workspaceRoot` path (not a workspace object) plus a `deps` object carrying the model port.
|
|
360
|
+
|
|
361
|
+
### Workspace summary
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
import { detectWorkspace, buildWorkspaceSummary } from "@oscharko-dev/keiko";
|
|
365
|
+
|
|
366
|
+
const workspace = detectWorkspace(process.cwd());
|
|
367
|
+
const summary = buildWorkspaceSummary(workspace);
|
|
368
|
+
console.log(summary.name, summary.counts);
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Generate unit tests
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
import {
|
|
375
|
+
generateUnitTests,
|
|
376
|
+
renderUnitTestReport,
|
|
377
|
+
Gateway,
|
|
378
|
+
GatewayModelPort,
|
|
379
|
+
loadConfigFromFile,
|
|
380
|
+
} from "@oscharko-dev/keiko";
|
|
381
|
+
|
|
382
|
+
const config = loadConfigFromFile("./keiko.config.json", process.env);
|
|
383
|
+
const model = new GatewayModelPort(new Gateway(config));
|
|
384
|
+
|
|
385
|
+
const report = await generateUnitTests(
|
|
386
|
+
{
|
|
387
|
+
workspaceRoot: ".",
|
|
388
|
+
target: { kind: "file", filePath: "src/add.ts" },
|
|
389
|
+
modelId: config.providers[0].modelId,
|
|
390
|
+
// apply defaults to false: a reviewable diff, no files written
|
|
391
|
+
},
|
|
392
|
+
{ model },
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
console.log(report.status, report.proposedDiff);
|
|
396
|
+
console.log(renderUnitTestReport(report));
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Investigate a bug
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
import {
|
|
403
|
+
investigateBug,
|
|
404
|
+
renderBugInvestigationReport,
|
|
405
|
+
Gateway,
|
|
406
|
+
GatewayModelPort,
|
|
407
|
+
loadConfigFromFile,
|
|
408
|
+
} from "@oscharko-dev/keiko";
|
|
409
|
+
|
|
410
|
+
const config = loadConfigFromFile("./keiko.config.json", process.env);
|
|
411
|
+
const model = new GatewayModelPort(new Gateway(config));
|
|
412
|
+
|
|
413
|
+
const report = await investigateBug(
|
|
414
|
+
{
|
|
415
|
+
workspaceRoot: ".",
|
|
416
|
+
report: { description: "login returns 500 on empty password" },
|
|
417
|
+
modelId: config.providers[0].modelId,
|
|
418
|
+
// apply defaults to false (dry-run)
|
|
419
|
+
},
|
|
420
|
+
{ model },
|
|
421
|
+
);
|
|
422
|
+
|
|
423
|
+
// The report separates established facts from the model's unverified hypothesis.
|
|
424
|
+
console.log(report.verified, report.hypothesis);
|
|
425
|
+
console.log(renderBugInvestigationReport(report));
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Run verification
|
|
429
|
+
|
|
430
|
+
`runVerification` takes a plan. Build it from the detected workspace and its script catalog.
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
import {
|
|
434
|
+
detectWorkspace,
|
|
435
|
+
detectScripts,
|
|
436
|
+
buildVerificationPlan,
|
|
437
|
+
runVerification,
|
|
438
|
+
buildVerificationSummary,
|
|
439
|
+
} from "@oscharko-dev/keiko";
|
|
440
|
+
|
|
441
|
+
const workspace = detectWorkspace(process.cwd());
|
|
442
|
+
const catalog = detectScripts(workspace);
|
|
443
|
+
const plan = buildVerificationPlan(workspace, catalog, {});
|
|
444
|
+
|
|
445
|
+
const report = await runVerification(plan, { workspace });
|
|
446
|
+
console.log(buildVerificationSummary(report));
|
|
447
|
+
console.log(report.overallStatus); // "passed" when every gate passed
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Inspect evidence
|
|
451
|
+
|
|
452
|
+
`listEvidence` and `loadEvidence` are synchronous. The loaded data is redacted by construction.
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
import { createNodeEvidenceStore, listEvidence, loadEvidence } from "@oscharko-dev/keiko";
|
|
456
|
+
|
|
457
|
+
const store = createNodeEvidenceStore("./.keiko/evidence");
|
|
458
|
+
|
|
459
|
+
for (const entry of listEvidence(store)) {
|
|
460
|
+
console.log(entry.runId, entry.taskType, entry.outcome, entry.finishedAt);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const manifest = loadEvidence(store, "the-run-id");
|
|
464
|
+
if (manifest !== undefined) {
|
|
465
|
+
console.log(manifest.evidenceSchemaVersion);
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Drive a workflow with a scripted model
|
|
470
|
+
|
|
471
|
+
`createScriptedModelPort` builds a `ModelPort` that replays a fixed transcript, so you can exercise a workflow deterministically with no live model or credentials. It satisfies the same `deps.model` seam the workflows use.
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
import {
|
|
475
|
+
createScriptedModelPort,
|
|
476
|
+
generateUnitTests,
|
|
477
|
+
type NormalizedResponse,
|
|
478
|
+
} from "@oscharko-dev/keiko";
|
|
479
|
+
|
|
480
|
+
const response: NormalizedResponse = {
|
|
481
|
+
modelId: "scripted",
|
|
482
|
+
content: "--- a/src/add.test.ts\n+++ b/src/add.test.ts\n+// generated test\n",
|
|
483
|
+
finishReason: "stop",
|
|
484
|
+
toolCalls: [],
|
|
485
|
+
structuredOutput: null,
|
|
486
|
+
usage: {
|
|
487
|
+
requestId: "scripted",
|
|
488
|
+
promptTokens: 0,
|
|
489
|
+
completionTokens: 0,
|
|
490
|
+
latencyMs: 1,
|
|
491
|
+
costClass: "low",
|
|
492
|
+
},
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
const model = createScriptedModelPort([response]);
|
|
496
|
+
|
|
497
|
+
const report = await generateUnitTests(
|
|
498
|
+
{ workspaceRoot: ".", target: { kind: "file", filePath: "src/add.ts" }, modelId: "scripted" },
|
|
499
|
+
{ model },
|
|
500
|
+
);
|
|
501
|
+
console.log(report.status);
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
For the full offline scorecard, run `keiko evaluate` (see [Evaluation and Go/No-Go](#evaluation-and-gono-go)).
|
|
505
|
+
|
|
506
|
+
`SDK_VERSION` is exported for diagnostics. `--version` on the CLI reports the same value.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## Evidence output
|
|
511
|
+
|
|
512
|
+
`keiko run`, workflow runs launched from the local UI, and `keiko evaluate` (offline and live) persist an `EvidenceManifest`. `keiko gen-tests` and `keiko investigate` print a reviewable report but do not persist an evidence manifest; `keiko verify` and `keiko context` are read-only summaries that persist nothing. Manifests are **redacted at construction** — secret-shaped strings, environment values, and known literal credentials are removed before anything is written. There is no code path that writes an unredacted manifest.
|
|
513
|
+
|
|
514
|
+
Manifests are written with an exclusive-create (`O_EXCL`) open into a directory whose real path is verified to be inside the evidence root. The default location is `$KEIKO_EVIDENCE_DIR` or `.keiko/evidence` under the workspace.
|
|
515
|
+
|
|
516
|
+
Retention keeps the newest runs up to a maximum (`DEFAULT_RETENTION`, 50 runs). Every manifest carries a stable `EVIDENCE_SCHEMA_VERSION`; readers reject unknown versions rather than guessing.
|
|
517
|
+
|
|
518
|
+
Inspect manifests with `keiko evidence list` and `keiko evidence show <runId>`. See [ADR-0010](https://github.com/oscharko-dev/Keiko/blob/dev/docs/adr/README.md#adr-0010).
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## Local UI
|
|
523
|
+
|
|
524
|
+
`keiko ui` serves a single-user web surface for the workflows and evidence. It binds to `127.0.0.1` by default, checks `Host` and `Origin` headers to block DNS-rebinding, serves a strict Content-Security-Policy, and renders only redacted views. The apply action uses the same gated, dry-run-default path as the CLI.
|
|
525
|
+
|
|
526
|
+
The server runs until you interrupt it (Ctrl+C). For setup, surfaces, and troubleshooting, see the [local UI runbook](https://github.com/oscharko-dev/Keiko/blob/dev/docs/ui-runbook.md).
|
|
527
|
+
|
|
528
|
+
Multi-user access, authentication, and remote hosting are out of scope for Wave 1.
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Security and audit boundaries
|
|
533
|
+
|
|
534
|
+
Keiko's boundaries are explicit, and so are their limits. In summary:
|
|
535
|
+
|
|
536
|
+
- **Workspace access** is confined to the workspace root by a lexical and real-path check; secret-shaped files are always denied.
|
|
537
|
+
- **Command execution** runs an allowlist with no shell interpretation, an ephemeral HOME, and resource ceilings.
|
|
538
|
+
- **Patches** are dry-run by default and guarded by path scope; applying requires an explicit opt-in and is followed by verification.
|
|
539
|
+
- **The UI** is local-only with DNS-rebinding defense and a strict CSP.
|
|
540
|
+
- **No unattended merge.** A human reviews every change. This is a hard invariant of the pilot.
|
|
541
|
+
|
|
542
|
+
Wave 1 is **not** OS-level isolation. Allowlisted project scripts (for example `npm test`) can run repository-authored code; the boundary protects the host outside the workspace, not the workspace from itself. For the full picture and the explicit limitations, read [Security and audit boundaries](https://github.com/oscharko-dev/Keiko/blob/dev/docs/security-and-audit-boundaries.md).
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## Evaluation and Go/No-Go
|
|
547
|
+
|
|
548
|
+
`keiko evaluate` produces a scorecard, not a verdict. The Wave 1 pilot decision is made by people, using the scorecard plus run evidence.
|
|
549
|
+
|
|
550
|
+
- Offline (`keiko evaluate`) checks workflow plumbing deterministically against scripted responses. It does not measure model quality.
|
|
551
|
+
- Live (`keiko evaluate --live`) runs the same suite against a configured model endpoint.
|
|
552
|
+
|
|
553
|
+
See [Go/No-Go criteria](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/go-no-go.md) and the [model capability guide](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/model-capability-guide.md).
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
## Packaging
|
|
558
|
+
|
|
559
|
+
The published tarball ships `dist/`, `README.md`, `LICENSE`, `NOTICE`, and `TRADEMARKS.md`. A surface check enforces that package boundary and rejects source, docs, source maps, and secret files. Runtime dependencies are intentionally minimal; the root package currently uses `ws` for the browser CDP transport. Supply-chain review is covered by CI dependency review, CodeQL, audit steps, and SBOM builds. Inspect the surface with:
|
|
560
|
+
|
|
561
|
+
```bash
|
|
562
|
+
npm pack --dry-run
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
Publishing the package is out of scope for Wave 1. See [npm packaging](https://github.com/oscharko-dev/Keiko/blob/dev/docs/npm-packaging.md) for the exact prepack chain and surface check.
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
## Future architecture path
|
|
570
|
+
|
|
571
|
+
Wave 1 is npm-first and TypeScript-first: a CLI, an SDK, and a local UI that run on a developer machine or a CI runner with no managed control plane. This keeps the pilot's footprint small and its trust boundary local.
|
|
572
|
+
|
|
573
|
+
A later phase may add a cloud-native backend for teams that want shared evaluation, central evidence, or larger workloads. If it does, the CLI and UI stay lightweight local clients; the local-first path remains supported. Multi-user access, authentication, and a hosted UI are explicitly out of scope for Wave 1.
|
|
574
|
+
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
## Documentation index
|
|
578
|
+
|
|
579
|
+
Repository documentation (not shipped in the package):
|
|
580
|
+
|
|
581
|
+
| Document | Audience |
|
|
582
|
+
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
583
|
+
| [Customer pilot runbook](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/runbook.md) | Pilot teams, evaluators, reviewers |
|
|
584
|
+
| [Go/No-Go criteria](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/go-no-go.md) | Pilot sponsors, leads, review board |
|
|
585
|
+
| [Model capability guide](https://github.com/oscharko-dev/Keiko/blob/dev/docs/pilot/model-capability-guide.md) | Pilot evaluators, operators |
|
|
586
|
+
| [Security and audit boundaries](https://github.com/oscharko-dev/Keiko/blob/dev/docs/security-and-audit-boundaries.md) | Security and regulated reviewers |
|
|
587
|
+
| [Local UI runbook](https://github.com/oscharko-dev/Keiko/blob/dev/docs/ui-runbook.md) | UI operators and reviewers |
|
|
588
|
+
| [npm packaging](https://github.com/oscharko-dev/Keiko/blob/dev/docs/npm-packaging.md) | Release engineers |
|
|
589
|
+
|
|
590
|
+
Architecture Decision Records live in [`docs/adr/`](https://github.com/oscharko-dev/Keiko/tree/dev/docs/adr).
|
|
591
|
+
|
|
592
|
+
---
|
|
593
|
+
|
|
594
|
+
## Development
|
|
595
|
+
|
|
596
|
+
```bash
|
|
597
|
+
npm install
|
|
598
|
+
npm run build
|
|
599
|
+
npm test
|
|
600
|
+
npm run lint
|
|
601
|
+
npm run typecheck
|
|
602
|
+
npm run format
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
Contributions follow the delivery standard in [`CONTRIBUTING.md`](CONTRIBUTING.md): strict TypeScript, tested behavior, conventional commits with an issue number, and reviewable, evidence-backed changes.
|
|
606
|
+
|
|
607
|
+
---
|
|
608
|
+
|
|
609
|
+
## License and attribution
|
|
610
|
+
|
|
611
|
+
Keiko is licensed under Apache-2.0. See [`LICENSE`](LICENSE).
|
|
612
|
+
|
|
613
|
+
The `NOTICE` file carries the package attribution for Keiko and oscharko-dev and
|
|
614
|
+
ships with the npm package. Redistributors must preserve applicable copyright,
|
|
615
|
+
license, and NOTICE attribution as required by Apache-2.0.
|
|
616
|
+
|
|
617
|
+
The Keiko name, logo, visual identity, and oscharko-dev origin identifiers are
|
|
618
|
+
covered by the repository's trademark and brand policy. Truthful attribution and
|
|
619
|
+
compatibility references are permitted, but forks and derivative distributions
|
|
620
|
+
must not imply that they are the official Keiko project or endorsed by
|
|
621
|
+
oscharko-dev. See [`TRADEMARKS.md`](TRADEMARKS.md).
|
package/TRADEMARKS.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Keiko trademark and brand policy
|
|
2
|
+
|
|
3
|
+
This policy covers the Keiko name, Keiko logo, Keiko visual identity, and
|
|
4
|
+
oscharko-dev origin identifiers. It does not modify the Apache License 2.0
|
|
5
|
+
terms that apply to the code.
|
|
6
|
+
|
|
7
|
+
## Permitted uses
|
|
8
|
+
|
|
9
|
+
You may use the Keiko name and oscharko-dev attribution to make truthful,
|
|
10
|
+
factual statements, including:
|
|
11
|
+
|
|
12
|
+
- Identifying this repository or package as the upstream source.
|
|
13
|
+
- Stating that your work is based on, derived from, compatible with, or forked
|
|
14
|
+
from Keiko.
|
|
15
|
+
- Preserving copyright, license, and NOTICE attribution required by the Apache
|
|
16
|
+
License 2.0.
|
|
17
|
+
|
|
18
|
+
## Restricted uses
|
|
19
|
+
|
|
20
|
+
Without prior written permission from oscharko-dev, you may not use the Keiko
|
|
21
|
+
name, logo, visual identity, or oscharko-dev identifiers in a way that is likely
|
|
22
|
+
to confuse users about source, sponsorship, approval, or official status.
|
|
23
|
+
|
|
24
|
+
Restricted uses include:
|
|
25
|
+
|
|
26
|
+
- Presenting a fork, derivative distribution, hosted service, or modified build
|
|
27
|
+
as the official Keiko project.
|
|
28
|
+
- Using the Keiko name or logo as the primary brand for a derivative product or
|
|
29
|
+
service.
|
|
30
|
+
- Removing or obscuring attribution to Keiko and oscharko-dev when making a
|
|
31
|
+
public derivative distribution.
|
|
32
|
+
- Registering names, domains, package names, accounts, or marks that are
|
|
33
|
+
confusingly similar to Keiko or oscharko-dev.
|
|
34
|
+
|
|
35
|
+
## Forks and derivative distributions
|
|
36
|
+
|
|
37
|
+
Public forks and derivative distributions should identify that they are derived
|
|
38
|
+
from Keiko and should make any material modifications clear to users. A fork or
|
|
39
|
+
derivative distribution must not imply that it is maintained, reviewed,
|
|
40
|
+
approved, or endorsed by oscharko-dev unless oscharko-dev has granted that
|
|
41
|
+
permission in writing.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CostClass } from "../gateway/types.js";
|
|
2
|
+
import type { HarnessEvent } from "../harness/types.js";
|
|
3
|
+
import type { EvidenceUsageTotals } from "./types.js";
|
|
4
|
+
export declare function aggregateUsage(events: readonly HarnessEvent[]): EvidenceUsageTotals;
|
|
5
|
+
export declare function resolveCostClass(modelId: string): CostClass | "unknown";
|