/** * @traqr/core — Configuration Schema * * Types, defaults, and starter packs for the Traqr platform. * Stored at .traqr/config.json in each project. * Generated by /traqr-init, read by all commands. */ /** * Daemon orchestration configuration. * Controls polling intervals, timeouts, concurrency, retry strategies, * and file paths for the daemon process. * * All timing values are in milliseconds. */ export interface DaemonConfig { /** API base URL for daemon coordination endpoints */ apiBase: string; /** Temporary file paths used by daemon for state persistence */ paths: { /** Processed Slack messages tracking */ processed: string; /** Processed Linear issues tracking */ processedIssues: string; /** Plan approval state */ plans: string; /** Claude question queue */ questionQueue: string; /** Answered questions log */ answeredQuestions: string; /** Processed analytics events */ processedAnalytics: string; /** Automation metrics */ metrics: string; /** Guardian temporary working directory (relative to worktrees base) */ guardianTemp: string; }; /** Polling intervals (ms) */ intervals: { /** Main loop poll interval (default: 10s) */ poll: number; /** Supabase task queue poll interval (default: 30s) */ taskPoll: number; /** Guardian merge loop interval (default: 60s) */ guardian: number; /** Slack question check interval (default: 60s) */ question: number; /** Analytics processing interval (default: 60s) */ analytics: number; /** Plan approval check interval (default: 30s) */ approvalCheck: number; /** Traffic monitoring interval (default: 15min) */ trafficCheck: number; /** Health check interval when idle (default: 30min) */ healthCheck: number; /** Slot sync check interval (default: 5min) */ syncCheck: number; /** Agent heartbeat interval (default: 60s) */ heartbeat: number; }; /** Timeout values (ms) */ timeouts: { /** Default fetch timeout (default: 30s) */ defaultFetch: number; /** Quick fetch timeout for non-critical requests (default: 3s) */ quickFetch: number; /** Git operation timeout (default: 30s) */ git: number; /** Quick git operations like status/branch (default: 5s) */ gitQuick: number; /** Git worktree removal timeout (default: 15s) */ gitRemove: number; /** Plan approval wait timeout (default: 5min) */ planApproval: number; /** Maximum implementation time (default: 30min) */ implementation: number; /** Stall detection for tool calls (default: 5min) */ toolCallStall: number; /** npm build timeout (default: 2min) */ npmBuild: number; /** Plan approval TTL before auto-expiry (default: 24h) */ planApprovalTTL: number; /** Pause/hold expiration time (default: 2h) */ pauseExpiration: number; /** Window for detecting rework cycles (default: 30min) */ reworkDetection: number; /** Adaptive timeout per changed file (default: 3min) */ perFileAdaptive: number; /** Maximum adaptive timeout cap (default: 30min) */ maxAdaptive: number; /** Divergence check cache TTL (default: 25s) */ divergenceCache: number; /** Minimum wait before checking approval (default: 30s) */ minApprovalWait: number; }; /** Concurrency and failure limits */ concurrency: { /** Maximum concurrent tasks (Walk=2, Run=all slots) */ maxTasks: number; /** Max failures per ticket before giving up */ maxTicketFailures: number; /** Max retries for in-function operations */ maxRetries: number; }; /** Per-reaction-type retry strategies for Guardian */ retryStrategies: { ciFailed: { retries: number; escalateAfterMs: number; }; mergeConflicts: { retries: number; escalateAfterMs: number; }; stale: { retries: number; escalateAfterMs: number; }; feedbackPending: { retries: number; escalateAfterMs: number; }; }; /** Query and result limits */ queryLimits: { /** Max PRs to list from GitHub (default: 50) */ prList: number; /** Max Slack channels to list (default: 200) */ slackChannelList: number; /** Max Slack messages to fetch (default: 50) */ slackFetchMessages: number; /** Memory search result limit (default: 10) */ memorySearch: number; /** Gotcha search result limit (default: 5) */ gotchaSearch: number; /** Max Slack thread scan iterations (default: 3) */ maxThreadScans: number; /** Recent activity cap for metrics (default: 100) */ recentActivityCap: number; /** Error message substring limit for logging (default: 200) */ errorSubstringLimit: number; }; } /** * Guardian merge lifecycle configuration (CLI-level). * Controls the automated PR merge pipeline behavior. * Stored in .traqr/config.json under the `guardian` key. */ export interface GuardianConfig { /** Whether Guardian is enabled (env: GUARDIAN_ENABLED) */ enabled: boolean; /** Dry-run mode — actions logged but not executed (env: GUARDIAN_DRY_RUN) */ dryRun: boolean; /** GitHub label that identifies PRs for Guardian to manage */ prLabel: string; /** Phase timeout durations (ms) — auto-reset if stuck */ phaseTimeouts: { /** Rebase phase timeout (default: 5min) */ rebasing: number; /** Merge phase timeout (default: 30min) */ merging: number; /** Conflict resolution phase timeout (default: 30min) */ resolving: number; }; /** Linear label configuration for ticket lifecycle */ labels: { /** Label for tickets ready for agent pickup */ agentReady: string; /** Label applied when agent claims a ticket */ agentClaimed: { name: string; color: string; }; /** Label indicating ticket has an implementation plan */ hasPlan: string; }; } /** * Default daemon configuration. * All timing values tuned from production experience. */ export declare function getDefaultDaemonConfig(projectName: string): DaemonConfig; /** * Default guardian configuration. * Safe defaults: disabled, dry-run on, conservative timeouts. */ export declare const DEFAULT_GUARDIAN_CONFIG: GuardianConfig; export interface DesignPalette { primary: string; secondary: string; accent: string; background: string; foreground: string; card: string; border: string; muted: string; } export interface DesignConfig { /** Design flavor preset */ flavor: 'terminal' | 'playful' | 'minimal' | 'bold' | 'custom'; /** Light mode color palette */ palette: DesignPalette; /** Dark mode overrides (bg, fg, card, border, muted) */ darkPalette?: { background: string; foreground: string; card: string; border: string; muted: string; }; /** Font configuration */ fonts: { sans: string; mono: string; /** Google Fonts import names, e.g. ['Inter', 'JetBrains_Mono'] */ googleFonts: string[]; }; /** Border radius level */ borderRadius: 'sharp' | 'medium' | 'rounded' | 'pill'; /** Animation intensity */ animations: 'none' | 'subtle' | 'smooth' | 'bouncy'; /** Shadow intensity */ shadows: 'none' | 'soft' | 'medium' | 'dramatic'; /** Whether to include framer-motion dependency */ useFramerMotion: boolean; /** Enable dark mode toggle support */ darkMode: boolean; /** App display name shown in shell/sidebar */ appDisplayName?: string; } /** * Border radius mapping per level. * Maps borderRadius setting to Tailwind classes at 4 sizes. */ export declare const BORDER_RADIUS_MAP: Record; /** * Animation parameter mapping per intensity level. */ export declare const ANIMATION_PARAMS: Record; /** * Design flavor defaults — full presets for each visual style. */ export declare const DESIGN_FLAVOR_DEFAULTS: Record<'terminal' | 'playful' | 'minimal' | 'bold', DesignConfig>; /** * Services that are always-on and non-skippable for Traqr projects. * During provisioning, these are processed in PASS 1. */ export declare const REQUIRED_SERVICES: readonly ["github", "supabase", "posthog", "vercel", "slack"]; export type RequiredService = (typeof REQUIRED_SERVICES)[number]; export interface TraqrConfig { /** Schema version — '2.0.0' adds per-system tracking via `systems` map */ version: '1.0.0' | '2.0.0'; project: { /** Lowercase slug, e.g. "myapp" */ name: string; /** Display name, e.g. "My App" */ displayName: string; /** Short description */ description: string; /** Absolute path to main repo */ repoPath: string; /** Absolute path to worktrees directory */ worktreesPath: string; /** GitHub org/repo, e.g. "your-org/myapp" */ ghOrgRepo: string; /** Framework detected (nextjs, node, python, rust, go, unknown) */ framework?: string; /** Package manager (npm, yarn, pnpm, bun, pip, cargo) */ packageManager?: string; /** Build command override */ buildCommand?: string; /** Type-check command override */ typecheckCommand?: string; /** Deployment platform (vercel, netlify, fly, railway, none) */ deployPlatform?: string; /** Project type — determines which command steps apply (default: 'code') */ type?: 'code' | 'life' | 'research'; }; /** Automation tier (0-4), derived from starterPack + customizations */ tier: 0 | 1 | 2 | 3 | 4; /** Starter pack selection (entry point for wizard) */ starterPack?: 'solo' | 'smart' | 'production' | 'full' | 'custom'; /** Automation score (0-100), calculated from enabled features */ automationScore?: number; /** Whether initialized in demo mode (no real API keys) */ demo?: boolean; slots: { /** Number of marketing slots (default 1) */ marketing?: number; /** Number of feature slots (default 5) */ feature: number; /** Number of bugfix slots (default 5) */ bugfix: number; /** Number of devops slots (default 5) */ devops: number; /** Whether to include guardian/grunt slot (default true) */ guardian?: boolean; /** Whether to include analysis slot (default false) */ analysis: boolean; }; ports: { /** Main repo port (default 3000) */ main: number; /** First marketing port (default 3041) */ marketingStart?: number; /** First feature port, increments by 1 (default 3001) */ featureStart: number; /** First bugfix port, increments by 1 (default 3011) */ bugfixStart: number; /** First devops port, increments by 1 (default 3021) */ devopsStart: number; /** Guardian/grunt slot port (default 3031) */ guardian?: number; /** Analysis slot port (default 3099) */ analysis: number; }; /** Short prefix for shell commands, e.g. "myapp" -> myapp-slots */ prefix: string; /** 2-char alias prefix for multi-project shell aliases, e.g. "nk" -> nk1, nkc1 */ aliasPrefix?: string; /** KV key namespace prefix for multi-project isolation, e.g. "myapp" */ kvPrefix?: string; /** Env var for authorized push, e.g. "MYAPP_SHIP_AUTHORIZED" */ shipEnvVar: string; /** Session marker prefix, e.g. "myapp" -> /tmp/myapp-session-*.json */ sessionPrefix: string; /** Co-author line for commits, e.g. "Claude Opus 4.6" */ coAuthor: string; /** Memory configuration */ memory?: { /** Memory provider: 'supabase' (full pgvector), 'local' (CLAUDE.md only), 'none' */ provider: 'supabase' | 'local' | 'none'; /** Memory API base URL, e.g. "https://myapp.com/api" */ apiBase?: string; /** Project slug in memory system */ projectSlug?: string; /** Enable voice profile extraction */ voiceProfiles?: boolean; /** Enable cross-project learning */ crossProject?: boolean; }; /** Obsidian vault configuration */ vault?: { /** Absolute path to Obsidian vault root (e.g., '/Users/you/Documents/Obsidian Vault') */ path: string; /** Folder names for PARA-style promotion workflow (defaults shown) */ inboxFolder?: string; wikiFolder?: string; referenceFolder?: string; canvasFolder?: string; basesFolder?: string; }; /** Daily brief configuration — config-driven data source synthesis */ dailyBrief?: { /** Data sources to query for the brief */ sources: Array<{ /** Source type identifier (linear, posthog, github, slack, calendar, memory, vault-inbox, vercel, salesforce, outlook, gitlab) */ type: string; /** Whether this source is active */ enabled: boolean; /** If true, brief fails when this source is unavailable (default: false = skip with note) */ required?: boolean; /** Source-specific configuration (teams, projects, filters, etc.) */ config?: Record; }>; /** Output destinations */ output?: { /** Slack DM delivery */ slack?: { target: string; format: 'summary' | 'full'; }; /** Obsidian vault report */ obsidian?: { folder: string; format: 'full-report' | 'summary'; }; }; /** Cron schedule expression (e.g., '0 7 * * *' for 7am daily) */ schedule?: string; /** Pipeline mode — sequential enables cross-source entity linking in final step */ pipeline?: 'sequential' | 'parallel'; /** Maximum word count for the brief (default: 400) */ maxWords?: number; }; /** Heartbeat agent configuration — proactive monitoring via HEARTBEAT.md */ heartbeat?: { /** Enable the heartbeat agent */ enabled: boolean; /** Check interval (e.g., '30m', '1h', '6h') */ interval?: string; /** Restrict monitoring to specific hours */ activeHours?: { start: string; end: string; timezone: string; }; /** Response char threshold — below this, daemon swallows as HEARTBEAT_OK (default: 300) */ suppressionThreshold?: number; /** Run heartbeat tasks in isolated sessions (reduces token cost ~95%) */ isolatedSession?: boolean; /** Strip non-essential context from heartbeat sessions */ lightContext?: boolean; }; /** Issue tracking configuration */ issues?: { /** Issue tracker provider */ provider: 'linear' | 'github' | 'gitlab' | 'none'; /** Linear team ID (required if provider is linear) */ linearTeamId?: string; /** Linear workspace slug for URLs, e.g. "traqr-enterprises" → linear.app/traqr-enterprises/... */ linearWorkspaceSlug?: string; /** Map of team key → team UUID for multi-team workspaces, e.g. { NTQ: "uuid1", TRQ: "uuid2" } */ linearTeamMap?: Record; /** Map of team key → Slack channel prefix, e.g. { NTQ: "nk", TRQ: "trq" } */ channelPrefixMap?: Record; /** Project ticket prefix for PR body parsing, e.g. "MYA" for My App */ ticketPrefix?: string; /** Enable plan-dispatch workflow */ planDispatch?: boolean; /** Auto-create labels (agent-ready, has-plan, stale-*) */ autoLabels?: boolean; }; /** VCS (Version Control System) provider configuration */ vcs?: { /** VCS provider: github or gitlab. Drives template conditionals and CLI tool selection. */ provider: 'github' | 'gitlab'; /** GitLab numeric project ID (required for GitLab API calls) */ projectId?: string; /** Base URL for self-hosted instances (e.g., 'https://gitlab.example.com'). Defaults to github.com/gitlab.com */ baseUrl?: string; /** Merge strategy: squash, fast-forward, or merge commit */ mergeStrategy?: 'squash' | 'fast-forward' | 'merge'; /** Enable auto-merge (GitHub: gh pr merge --auto, GitLab: merge_when_pipeline_succeeds) */ autoMerge?: boolean; /** Enable primed-session pattern: GET before POST for corporate auth cookie establishment */ primedSession?: boolean; /** Delete source branch after merge (GitLab setting) */ removeSourceBranch?: boolean; }; /** Notification configuration */ notifications?: { /** Slack integration level */ slackLevel: 'none' | 'basic' | 'standard' | 'full'; /** Channel prefix for per-project channels (e.g., 'ma' for My App) */ slackChannelPrefix?: string; /** Slack channel for PR notifications / merge buttons */ slackDeployChannel?: string; /** Slack channel for triage/errors/Dev Inbox */ slackTriageChannel?: string; /** Slack channel for analytics/signups */ slackAnalyticsChannel?: string; /** Slack channel for user feedback log */ slackFeedbackChannel?: string; /** Slack channel for marketing/newsletters */ slackMarketingChannel?: string; /** Slack channel for archived threads */ slackArchiveChannel?: string; /** Slack channel for ideas sounding board */ slackIdeasChannel?: string; /** Slack channel for memory/learning notifications */ slackMemoryChannel?: string; /** Slack channel for signup notifications */ slackSignupsChannel?: string; /** Slack channel for control center status */ slackControlCenterChannel?: string; /** Slack channel for cross-project dashboard aggregation */ slackDashboardChannel?: string; /** Enable Dev Inbox (natural language ticket creation in Slack) */ devInbox?: boolean; /** Enable Vibe Chat (brainstorming sessions in Slack threads) */ vibeChat?: boolean; }; /** Monitoring configuration */ monitoring?: { /** Error tracking: sentry, axiom, or none */ errorTracking: 'sentry' | 'axiom' | 'none'; /** Analytics: posthog or none */ analytics: 'posthog' | 'none'; /** Uptime monitoring: checkly, betterstack, both, or none */ uptime: 'checkly' | 'betterstack' | 'both' | 'none'; /** Built-in user feedback widget */ feedbackWidget: boolean; /** Observability: axiom or none */ observability?: 'axiom' | 'none'; }; /** Auth provider configuration (per-project) */ auth?: { /** Authentication provider */ provider: 'firebase' | 'supabase' | 'clerk' | 'custom' | 'none'; }; /** Edge compute / KV configuration */ edge?: { /** Edge provider */ provider: 'cloudflare' | 'none'; /** Cloudflare KV namespace ID (if provisioned) */ kvNamespaceId?: string; }; /** Email/marketing configuration */ email?: { /** Email provider: resend or none */ provider: 'resend' | 'none'; /** Enabled email templates */ templates: Array<'bug-fix' | 'feature-shipped' | 'welcome' | 'feedback-request' | 'weekly-recap' | 'marketing'>; /** Enable the full user feedback loop (bug -> fix -> email user) */ feedbackLoop: boolean; }; /** Cron job configuration — grouped by category */ crons?: { /** Development health crons (slot status, stale branch cleanup, etc.) */ devHealth: boolean; /** Analytics crons (engagement reports, traffic monitor, funnel analysis) */ analytics: boolean; /** Issue tracking crons (ticket aging, backlog digest, SLA alerts) */ issueTracking: boolean; /** Monitoring crons (proactive alerts, error digests) */ monitoring: boolean; /** Memory system crons (learning synthesis, contradiction check) */ memory: boolean; /** Marketing crons (newsletter schedule, unsubscribe cleanup) */ marketing: boolean; /** Agent system crons (daemon health, session analysis) */ agentSystem: boolean; /** Digest & report crons (daily/weekly summaries) */ digests: boolean; }; /** Daemon orchestration configuration (intervals, timeouts, concurrency) */ daemon?: Partial; /** Guardian merge lifecycle configuration */ guardian?: Partial; /** Design DNA configuration (visual flavor, palette, fonts, animations) */ design?: DesignConfig; /** Monorepo sub-app configuration */ monorepo?: { /** Whether this project is a monorepo with multiple apps */ enabled: boolean; /** Directories containing apps (e.g. ['apps/myapp', 'apps/platform']) */ appDirs: string[]; /** Per-app configuration overrides */ apps: Record; }>; }; /** Template source configuration (for cross-project init) */ templateSource?: { /** Where to load templates from */ mode: 'local' | 'api'; /** API URL for remote template loading (required if mode is 'api') */ apiUrl?: string; }; /** Service provisioning state — tracks how each service was set up */ provisioning?: Record; /** Per-system skill tracking (v2) — records version, last applied, and audit state per sub-skill */ systems?: Record; /** Podcast synthesizer (/podcast) — machine-readable feed list the skill + life-os cron iterate over. * Seeded from podcast.md's prose table; was `null` (skill read only prose) until 2026-07-04. */ podcast?: { /** Master switch for the /podcast surface */ enabled: boolean; /** Phase-1 policy: try free transcript sources before paid transcription (podcast.md Phase 1) */ transcriptFirst?: boolean; /** Curated feed list — one entry per subscribed show */ feeds: Array<{ /** /podcast arg slug, e.g. 'acquired' | 'pmt' | 'trapdraw' | 'dwarkesh' */ slug: string; /** Display name */ name: string; /** Verified RSS URL (null = placeholder awaiting a concrete pick) */ rss: string | null; /** Publish cadence, e.g. 'weekly' | 'monthly' | 'weekdays' | 'biweekly' */ cadence?: string; /** Content domain */ domain?: string; /** Whether this feed is active for --latest sweeps */ enabled: boolean; /** Optional note (e.g. why a placeholder feed is disabled) */ note?: string; }>; }; } /** * Provisioning dependency tiers — services must be provisioned in this order. * Tier 1 services are provisioned first (others may depend on them). * All 11 services are represented across 4 tiers. */ export declare const PROVISIONING_TIERS: Array<{ tier: number; services: string[]; }>; /** * Return services that need provisioning for a given config, in dependency order. * Returns two lists: required (always-on) and selected (user choices), both in tier order. */ export declare function getProvisioningOrder(config: TraqrConfig): string[]; /** * Starter pack defaults — used by the wizard to pre-fill selections. */ export declare const STARTER_PACK_DEFAULTS: Record<'solo' | 'smart' | 'production' | 'full', Partial>; /** * Golden Path presets — opinionated VCS + issues + notifications bundles. * Each path extends a starter pack with VCS-specific defaults. * Used by `traqr init` to suggest the right config based on environment detection. */ export declare const GOLDEN_PATH_DEFAULTS: Record<'github-pro' | 'gitlab-team' | 'gitlab-minimal', { starterPack: 'solo' | 'smart' | 'production' | 'full'; vcsOverrides: Partial; }>; /** * Calculate automation score (0-100) from config. */ export declare function calculateAutomationScore(config: TraqrConfig): number; //# sourceMappingURL=config-schema.d.ts.map