Skip to content
← Public packages

@kentcdodds/kody-issue-triage

Loop-safe triage for Kody run errors and fleet package-runtime error-rate elevations. Wakes Cole (Grok Bot) to decide; Cursor agents only when Cole escalates.

src/index.ts

52 lines · 1.4 KB · TypeScript
import {
	SELF_KODY_ID,
	agentModelId,
	agentRepoSlug,
	discordChannelId,
	eventAnomalyThreshold,
	fingerprintAnomalyThreshold,
	kodyRepoSlug,
	maxAgentsPerHour,
} from './shared.ts'

/**
 * Kody issue-triage overview (fingerprints, caps, and export map).
 */
export default async function describeKodyIssueTriage() {
	return {
		name: '@kentcdodds/kody-issue-triage',
		kodyId: SELF_KODY_ID,
		model: agentModelId,
		triageRepository: agentRepoSlug,
		kodyRepository: kodyRepoSlug,
		discordChannel: discordChannelId,
		guardrails: {
			maxAgentsPerHour,
			fingerprintAnomalyThreshold,
			eventAnomalyThreshold,
			subscriptionIsEnqueueOnly: true,
			skip: [
				'self-package',
				'subscription-surface',
				'agent-execute',
				'smoke-test',
				'sibling-triage-export',
				'triage-validation',
			],
		},
		exports: {
			'.': 'overview',
			'./on-run-error': 'run.error.recorded enqueue',
			'./on-fleet-error-rate': 'fleet.package_error_rate.elevated enqueue',
			'./sweep': 'bounded spawn path',
			'./get-issue-state': 'agent loop guard',
			'./peer-context': 'matching Cloud agents, related PRs, owner activity',
			'./escalate-to-kody': 'spawn one grok-4.6 agent on kentcdodds/kody',
			'./record-outcome': 'agent final report',
			'./update-card': 'progressive Discord card links (started/pr/merged/deployed)',
			'./pause': 'kill switch on',
			'./resume': 'kill switch off + enable job',
			'./status': 'operator snapshot',
		},
	}
}