{ "name": "@kody/kody-factory", "private": true, "type": "module", "license": "MIT", "description": "Forkable multi-project software factory with signal intake, priority queue, and swappable adapters.", "exports": { ".": "./src/index.ts", "./list": "./src/exports/list.ts", "./next": "./src/exports/next.ts", "./create": "./src/exports/create.ts", "./advance": "./src/exports/advance.ts", "./record-outcome": "./src/exports/record-outcome.ts", "./cards/report": "./src/exports/cards-report.ts", "./reports/post": "./src/exports/reports/post.ts", "./reports/list": "./src/exports/reports/list.ts", "./reports/get": "./src/exports/reports/get.ts", "./reports/remove": "./src/exports/reports/remove.ts", "./link-pr": "./src/exports/link-pr.ts", "./refresh-pr": "./src/exports/refresh-pr.ts", "./github-preflight": "./src/exports/github-preflight.ts", "./ingest": "./src/exports/ingest.ts", "./sync": "./src/exports/sync.ts", "./github-release": "./src/exports/github-release.ts", "./webhooks/github-release": "./src/webhooks/github-release.ts", "./status": "./src/exports/status.ts", "./status/now": "./src/exports/status-now.ts", "./setup-status": "./src/exports/setup-status.ts", "./list-projects": "./src/exports/list-projects.ts", "./upsert-project": "./src/exports/upsert-project.ts", "./enable-project": "./src/exports/enable-project.ts", "./disable-project": "./src/exports/disable-project.ts", "./delete-project": "./src/exports/delete-project.ts", "./configure-settings": "./src/exports/configure-settings.ts", "./seed-projects": "./src/exports/seed-projects.ts", "./plans/list": "./src/exports/plans/list.ts", "./plans/get": "./src/exports/plans/get.ts", "./plans/upsert": "./src/exports/plans/upsert.ts", "./plans/add-progress-note": "./src/exports/plans/add-progress-note.ts", "./plans/import": "./src/exports/plans/import.ts", "./board": "./src/exports/board.ts", "./stalled": "./src/exports/stalled.ts", "./move-card": "./src/exports/move-card.ts", "./claim": "./src/exports/claim.ts", "./release": "./src/exports/release.ts", "./nudge": "./src/exports/nudge.ts", "./record-ship-pr": "./src/exports/record-ship-pr.ts", "./project-overview": "./src/exports/project-overview.ts", "./ship-pr/tick": "./src/exports/ship-pr-tick.ts", "./ship-pr/merge": "./src/exports/ship-pr-merge.ts", "./ship-pr/decide": "./src/exports/ship-pr-decide.ts", "./ship-pr/reply-review": "./src/exports/ship-pr-reply-review.ts", "./ship-pr/reply-comment": "./src/exports/ship-pr-reply-comment.ts", "./ship-pr/review-sort": "./src/exports/ship-pr-review-sort.ts", "./notifications": "./src/exports/notifications.ts", "./confirm-category": "./src/exports/confirm-category.ts", "./friction/file": "./src/exports/friction-file.ts", "./friction/push-branch": "./src/exports/friction-push-branch.ts", "./cleanup/legacy-reaper": "./src/jobs/cleanup-legacy-reaper.ts", "./cleanup/docs-freshness": "./src/jobs/cleanup-docs-freshness.ts", "./cleanup/keep-tests-tight": "./src/jobs/cleanup-keep-tests-tight.ts", "./cleanup/general-audit": "./src/jobs/cleanup-general-audit.ts", "./cleanup/config": "./src/cleanup/config.ts", "./ci-review/run": "./src/exports/ci-review/run.ts", "./ci-review/weekly-run": "./src/exports/ci-review/weekly-run.ts", "./ci-review/status": "./src/exports/ci-review/status.ts", "./ci-review/pause": "./src/exports/ci-review/pause.ts", "./ci-review/resume": "./src/exports/ci-review/resume.ts", "./jobs/sweep": "./src/jobs/sweep.ts", "./jobs/health-sweep": "./src/jobs/health-sweep.ts", "./health/on-run-error": "./src/health/on-run-error.ts", "./health/sweep": "./src/exports/health/sweep.ts", "./health/record-outcome": "./src/exports/health/record-outcome.ts", "./health/status": "./src/exports/health/status.ts", "./health/configure": "./src/exports/health/configure.ts", "./config/export": "./src/exports/config-export.ts", "./config/import": "./src/exports/config-import.ts", "./jobs/friction-cluster": "./src/jobs/friction-cluster.ts", "./signals/sources": "./src/exports/signals/sources.ts", "./signals/records": "./src/exports/signals/records.ts", "./signals/routing": "./src/exports/signals/routing.ts", "./signals/eval": "./src/exports/signals/eval.ts", "./webhooks/github-issues": "./src/webhooks/github-issues.ts", "./webhooks/github-ci": "./src/webhooks/github-ci.ts", "./webhooks/signals": "./src/webhooks/signals.ts", "./events/status": "./src/exports/events-status.ts", "./events/self-test": "./src/exports/events-self-test.ts", "./subscriptions/on-dr-problem-detected": "./src/subscriptions/on-dr-problem-detected.ts", "./subscriptions/on-outage-opened": "./src/subscriptions/on-outage-opened.ts", "./subscriptions/on-outage-cleared": "./src/subscriptions/on-outage-cleared.ts", "./github-events/report": "./src/github-events/report.ts", "./agent-events/report": "./src/agent-events/report.ts", "./runners/self-test": "./src/exports/runners-self-test.ts" }, "scripts": { "test": "node --test --experimental-strip-types --import ./src/test-support/kody-github-stub.ts src/**/*.test.ts src/**/**/*.test.ts" }, "kody": { "description": "Forkable multi-project software factory: signals, priority queue, project UI, sweep job. Agent runners and Sentry reach it by events.", "category": "productivity", "tags": [ "factory", "orchestrator", "priority-queue", "signals", "autopilot", "github", "planning", "dashboard", "multi-project", "events" ], "searchText": "kody factory software factory signal intake sentry @kody/sentry-events.issue.alerted github issues feedback discord x email friction ci-failure priority queue multi-project dashboard cole orchestrator single-agent adapter github projects gitlab kody-native autopilot readiness sweep job shadow mode record-outcome list-projects upsert-project enable-project disable-project seed-projects configure-settings agent runner events @kody/devin triage factory health run.error.recorded error fingerprints reconcile wake relay wake alert record-outcome health signals github events @kody/github.issue.opened ci.completed githubEventsMode shadow live bridge reports report post audit findings weekly ci review github actions speed cost redundant work flaky coverage trade safe wins cards needs you", "credentials": { "model": { "provider": "cloudflare", "description": "Optional Cloudflare API token for triage decisions (map to cloudflareApiToken)" }, "githubOwner": { "provider": "github", "description": "Owner's GitHub account, used only for branch pushes and PR creation (Git Data and pull request APIs on api.github.com). Map to an org GitHub OAuth connection or a fine-grained PAT for the owner, with provider github. ./friction/push-branch fails if this is unmapped and never falls back to the bot github slot." }, "webPush": { "provider": "web-push", "kind": "signing", "description": "VAPID ES256 signing key for web push (org signing credential factoryWebPushVapid, hosts fcm.googleapis.com, updates.push.services.mozilla.com, web.push.apple.com, *.notify.windows.com). Kody signs the VAPID JWT; the key never enters package code. The matching public key is the setting webPushVapidPublicKey." } }, "app": { "entry": "./src/app/entry.ts", "assets": "./public", "capabilities": [ "runList", "runGet", "runUpdate", "runUpdateBulk", "metaGetCurrentUser" ] }, "subscriptions": { "run.error.recorded": { "handler": "./src/health/on-run-error.ts", "description": "Factory health intake: record one fingerprint per failing run family. Storage only; never wakes an agent. Does nothing until health intake is switched on." }, "@kody/dr.problem.detected": { "handler": "./src/subscriptions/on-dr-problem-detected.ts", "description": "Disaster recovery problem from @kody/dr-backup-health becomes one deduped factory card (key dr-backup--); a new card wakes Cole through @kody/wake-relay. eventCardsMode shadow (default) only records what would be filed." }, "@kody/status-alerts.outage.opened": { "handler": "./src/subscriptions/on-outage-opened.ts", "description": "Status outage from @kody/status-alerts becomes one deduped P0 card per incident set; a new card wakes Cole through @kody/wake-relay. eventCardsMode shadow (default) only records what would be filed." }, "@kody/status-alerts.outage.cleared": { "handler": "./src/subscriptions/on-outage-cleared.ts", "description": "Records that an outage cleared and, in live mode, sends Cole one all-clear through @kody/wake-relay. Never closes or changes a card." }, "@kody/sentry-events.issue.alerted": { "handler": "./src/subscriptions/on-sentry-issue-alerted.ts", "description": "Sentry issue alert from @kody/sentry-events (settings.sentryEventsSource) becomes one deduped card per Sentry issue (key sentry-issue-) in the project sentryProjectMap or sentryIntakeProjectId names. The factory holds no Sentry credential." }, "@kody/wake-relay.wake.delivered": { "handler": "./src/subscriptions/on-wake-delivered.ts", "description": "Mark a pending wake as delivered by @kody/wake-relay. Turn on for exactly one person." }, "@kody/wake-relay.wake.failed": { "handler": "./src/subscriptions/on-wake-failed.ts", "description": "Raise a wake alert when @kody/wake-relay could not deliver a wake (health page, card label, Discord when on). Never posts to a bot. Turn on for exactly one person." }, "@kody/github.issue.opened": { "handler": "./src/subscriptions/on-github-issue-opened.ts", "description": "GitHub issue opened (from @kody/github) becomes a factory card for a mapped, in-scope repo. githubEventsMode shadow (default) only records the decision next to the github-issues webhook result; live does the work and the factory webhook just forwards." }, "@kody/github.issue.reopened": { "handler": "./src/subscriptions/on-github-issue-reopened.ts", "description": "GitHub issue reopened (from @kody/github) reopens its dropped card or files one. githubEventsMode shadow (default) only records the decision next to the github-issues webhook result; live does the work and the factory webhook just forwards." }, "@kody/github.issue.updated": { "handler": "./src/subscriptions/on-github-issue-updated.ts", "description": "GitHub issue edited or relabeled (from @kody/github) re-ingests, deduped by issue fingerprint. githubEventsMode shadow (default) only records the decision next to the github-issues webhook result; live does the work and the factory webhook just forwards." }, "@kody/github.issue.closed": { "handler": "./src/subscriptions/on-github-issue-closed.ts", "description": "GitHub issue closed or deleted (from @kody/github) drops queued work and never stops a running agent. githubEventsMode shadow (default) only records the decision next to the github-issues webhook result; live does the work and the factory webhook just forwards." }, "@kody/github.pr.merged": { "handler": "./src/subscriptions/on-github-pr-merged.ts", "description": "GitHub PR merged (from @kody/github): card references in the PR body close cards (Closes|Fixes|Resolves ships the card) or link the PR on the card (bare reference). githubEventsMode shadow (default) only records the decision; live applies it, and the sweep's own scan of merged PRs steps aside." }, "@kody/github.ci.completed": { "handler": "./src/subscriptions/on-github-ci-completed.ts", "description": "GitHub CI completed (from @kody/github); red runs on a mapped repo become CI failure cards. Shadow by default." }, "@kody/github.release.changed": { "handler": "./src/subscriptions/on-github-release-changed.ts", "description": "GitHub release change (from @kody/github) for projects with sources.githubRelease on; records releases only. Shadow by default." }, "@kody/devin.session.started": { "handler": "./src/subscriptions/on-devin-session-started.ts", "description": "A runner session started: stored, indexed by requestId, and adopted by the card whose run id is pending_." }, "@kody/devin.session.updated": { "handler": "./src/subscriptions/on-devin-session-updated.ts", "description": "A runner session changed state or PRs: stored as the run's latest status, which the sweep reads instead of calling the runner." }, "@kody/devin.session.finished": { "handler": "./src/subscriptions/on-devin-session-finished.ts", "description": "A runner session reached a terminal state: stored as the run's latest status, which the sweep reads to move the card." } }, "dependencies": { "@kody/github": "*", "@kody/cursor": "*", "@kody/discord": "*", "@kody/clef": "*", "@kody/bugbot": "*" }, "jobs": { "sweep": { "entry": "./src/jobs/sweep.ts", "schedule": { "type": "cron", "expression": "*/15 * * * *" }, "timezone": "America/Denver", "enabled": true, "description": "Sweep work-item ledger across projects (one stage per item per tick)." }, "health-sweep": { "entry": "./src/jobs/health-sweep.ts", "schedule": { "type": "cron", "expression": "7,37 * * * *" }, "timezone": "America/Denver", "enabled": true, "description": "Factory health sweep every 30 minutes: wake Patch for queued run-error fingerprints (one wake per fingerprint, under the hourly cap and lease), recover stale wakes, refresh health signals. Reconcile and wakes follow their own switches." }, "friction-daily": { "entry": "./src/jobs/friction-daily.ts", "schedule": { "type": "cron", "expression": "0 5 * * *" }, "timezone": "America/Denver", "enabled": true, "description": "Daily friction sweep (all-issues mode)." }, "cleanup-legacy-reaper": { "entry": "./src/jobs/cleanup-legacy-reaper.ts", "schedule": { "type": "cron", "expression": "0 2 * * 1" }, "timezone": "America/Denver", "enabled": false, "description": "Weekly legacy reaper cleanup. Disabled; the owner enables it after migration." }, "cleanup-docs-freshness": { "entry": "./src/jobs/cleanup-docs-freshness.ts", "schedule": { "type": "cron", "expression": "0 3 * * *" }, "timezone": "America/Denver", "enabled": true, "description": "Daily docs freshness pass scoped to docs changes since the last cleanup merge, Clef/Jev triage, at most 3 Devin sessions; Sunday full sweep (3:00 AM America/Denver)." }, "cleanup-keep-tests-tight": { "entry": "./src/jobs/cleanup-keep-tests-tight.ts", "schedule": { "type": "cron", "expression": "30 3 * * *" }, "timezone": "America/Denver", "enabled": false, "description": "Daily keep-tests-tight pass. Disabled; the owner enables it after migration." }, "cleanup-general-audit": { "entry": "./src/jobs/cleanup-general-audit.ts", "schedule": { "type": "cron", "expression": "0 4 * * 0" }, "timezone": "America/Denver", "enabled": false, "description": "Weekly general audit (Devin). Disabled; the owner enables it after migration." }, "ci-review-weekly": { "entry": "./src/jobs/ci-review-weekly.ts", "schedule": { "type": "cron", "expression": "0 4 * * 1" }, "timezone": "America/Denver", "enabled": true, "description": "Weekly CI review of kody-hq/kody (Mon 4:00 AM America/Denver): measure GitHub Actions speed, cost, and redundant work, then post one factory report; safe wins become work cards, coverage trades become Needs-you cards. Never posts to GitHub." }, "friction-cluster": { "entry": "./src/jobs/friction-cluster.ts", "schedule": { "type": "cron", "expression": "0 6 * * *" }, "timezone": "America/Denver", "enabled": true, "description": "Daily friction clustering: group new friction signals into clusters, one board card per cluster." } }, "webhooks": [ { "name": "github-issues", "export": "./webhooks/github-issues", "description": "GitHub issues and issue_comment events (opened/edited/labeled ingest; closed/deleted drop queued work but never stop a running agent; synthetic dispatch never writes). Maps repository.full_name to an enabled factory project and ingests into the ledger. Legacy path: GitHub now reaches the factory as @kody/github.* events. While a hook still points here, each delivery is forwarded to @kody/github (githubEventsBridge) and, with githubEventsMode live, this webhook only forwards. Do not change remote GitHub hooks without the owner.", "responseMode": "ack", "inputMode": "request", "rateLimitPerMinute": 120, "verification": { "type": "hmac-sha256", "header": "x-hub-signature-256", "encoding": "hex", "prefix": "sha256=" }, "replay": { "deliveryIdHeader": "X-GitHub-Delivery" } }, { "name": "github-release", "export": "./webhooks/github-release", "description": "Optional GitHub release observation (published/released/edited/deleted). Off unless a project sets sources.githubRelease.enabled; records releases only, never creates work or posts. Legacy path: GitHub now reaches the factory as @kody/github.* events. While a hook still points here, each delivery is forwarded to @kody/github (githubEventsBridge) and, with githubEventsMode live, this webhook only forwards. Do not change remote GitHub hooks without the owner.", "responseMode": "ack", "inputMode": "request", "rateLimitPerMinute": 60, "verification": { "type": "hmac-sha256", "header": "x-hub-signature-256", "encoding": "hex", "prefix": "sha256=" }, "replay": { "deliveryIdHeader": "X-GitHub-Delivery" } }, { "name": "github-ci", "export": "./webhooks/github-ci", "description": "GitHub check_run, check_suite, and workflow_run failures. Maps repository.full_name to an enabled project. Legacy path: GitHub now reaches the factory as @kody/github.* events. While a hook still points here, each delivery is forwarded to @kody/github (githubEventsBridge) and, with githubEventsMode live, this webhook only forwards. Do not change remote GitHub hooks without the owner.", "responseMode": "ack", "inputMode": "request", "rateLimitPerMinute": 120, "verification": { "type": "hmac-sha256", "header": "x-hub-signature-256", "encoding": "hex", "prefix": "sha256=" }, "replay": { "deliveryIdHeader": "X-GitHub-Delivery" } }, { "name": "signals", "export": "./webhooks/signals", "description": "Inbound signals. Generic senders set x-signal-source and sign with their source key (checked in the handler). Sentry does not post here: it posts to the sentry webhook of @kody/sentry-events, which sends @kody/sentry-events.issue.alerted events. Mint + Approve required.", "responseMode": "ack", "inputMode": "request", "rateLimitPerMinute": 60 } ], "capabilities": [ "runList", "runGet", "runUpdate", "runUpdateBulk" ], "emits": { "@kody/factory.health.fingerprint.queued": { "description": "A new run-error fingerprint was queued for triage. Emitted only while emitHealthEvents is on.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "fingerprint": { "type": "string" }, "org": { "type": "string" }, "count": { "type": "number" }, "runId": { "type": "string" } }, "required": [ "fingerprint" ], "additionalProperties": false } }, "@kody/factory.health.wake.stale": { "description": "A woken fingerprint recorded no outcome inside the stale window and was marked failed. Emitted only while emitHealthEvents is on.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "fingerprint": { "type": "string" }, "wokenAt": { "type": "string" } }, "required": [ "fingerprint" ], "additionalProperties": false } }, "@kody/factory.card.created": { "description": "A factory work item (card) was created. Emitted only while emitHealthEvents is on.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "itemId": { "type": "string" }, "projectId": { "type": "string" }, "title": { "type": "string" }, "priority": { "type": "number" }, "labels": { "type": "array", "items": { "type": "string" } }, "state": { "type": "string" }, "source": { "type": "string" } }, "required": [ "itemId", "projectId" ], "additionalProperties": false } }, "@kody/factory.wake.requested": { "description": "The factory wants an agent woken for a role. @kody/wake-relay maps role to bot to credential. In wakeTransport shadow: dryRun shadow twins of direct wakes. In wakeTransport event: real requests (dryRun false) for eventWakeBots, with direct fallback.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "requestId": { "type": "string" }, "role": { "type": "string", "enum": [ "package-triage", "platform", "outage", "dr", "notification" ] }, "bot": { "type": "string" }, "source": { "type": "string" }, "reason": { "type": "string" }, "ref": { "type": "string" }, "cardId": { "type": "string" }, "priority": { "type": "number" }, "prompt": { "type": "string", "maxLength": 49152 }, "dryRun": { "type": "boolean" }, "shadow": { "type": "boolean" }, "directOk": { "type": "boolean" } }, "required": [ "requestId", "role", "prompt", "dryRun", "shadow" ], "additionalProperties": false } }, "@kody/factory.agent.start.requested": { "description": "Ask a runner package (filter on runner) to start an agent session for a factory card, a cleanup automation, or a friction group. The runner answers with @kody/.session.started carrying requestId. mode is runner-specific (Devin: devin_mode); dryRun asks the runner to check the request and start nothing.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "runner": { "type": "string" }, "requestId": { "type": "string" }, "prompt": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "repos": { "type": "array", "items": { "type": "string" } }, "projectId": { "type": "string" }, "workItemId": { "type": "string" }, "mode": { "type": "string" }, "maxAcuLimit": { "type": "number" }, "dryRun": { "type": "boolean" } }, "required": [ "runner", "requestId", "prompt" ], "additionalProperties": false } }, "@kody/factory.agent.message.requested": { "description": "Ask a runner package to send a follow-up message to a running session.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "runner": { "type": "string" }, "runId": { "type": "string" }, "text": { "type": "string" }, "dryRun": { "type": "boolean" } }, "required": [ "runner", "runId", "text" ], "additionalProperties": false } }, "@kody/factory.agent.cancel.requested": { "description": "Ask a runner package to stop a session.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "runner": { "type": "string" }, "runId": { "type": "string" }, "dryRun": { "type": "boolean" } }, "required": [ "runner", "runId" ], "additionalProperties": false } }, "@kody/factory.report.posted": { "description": "A report was posted onto the factory (audit or review result, with the cards it filed or linked). Emitted only while emitHealthEvents is on.", "payloadSchema": { "type": "object", "properties": { "schemaVersion": { "type": "number" }, "occurredAt": { "type": "string" }, "reportId": { "type": "string" }, "source": { "type": "string" }, "title": { "type": "string" }, "projectId": { "type": "string" }, "noteworthy": { "type": "boolean" }, "cardIds": { "type": "array", "items": { "type": "string" } }, "url": { "type": "string" } }, "required": [ "reportId", "source" ], "additionalProperties": false } } } } }