@@ -30,23 +30,69 @@ export declare const OPENCODE_VERSION: string
3030
3131/**
3232 * List of expected agent names (without .md extension).
33- * This is the single source of truth for agent filenames.
34- * Frozen to prevent accidental mutation.
33+ *
34+ * This is the single source of truth for agent filenames used during
35+ * installation and uninstallation. Each name maps directly to a `.md`
36+ * file in the `agents/` directory.
37+ *
38+ * **Agent roles:**
39+ * - `opencoder` - Main orchestrator that coordinates the Plan-Build-Commit loop
40+ * - `opencoder-planner` - Analysis subagent that examines codebases and creates prioritized task lists
41+ * - `opencoder-builder` - Execution subagent that implements individual tasks and verifies changes
42+ *
43+ * The array is frozen via `Object.freeze()` to prevent accidental mutation,
44+ * ensuring consistency across the codebase.
45+ *
46+ * @example
47+ * import { AGENT_NAMES } from "./paths.mjs"
48+ *
49+ * // Iterate over agent names to process files
50+ * for (const name of AGENT_NAMES) {
51+ * const filename = `${name}.md`
52+ * console.log(`Processing ${filename}`)
53+ * }
54+ *
55+ * @example
56+ * // Check if a name is a valid agent
57+ * const isValidAgent = AGENT_NAMES.includes("opencoder") // true
58+ * const isInvalid = AGENT_NAMES.includes("unknown") // false
3559 */
3660export declare const AGENT_NAMES : readonly [ "opencoder" , "opencoder-planner" , "opencoder-builder" ]
3761
3862/** Minimum character count for valid agent files */
3963export declare const MIN_CONTENT_LENGTH : number
4064
4165/**
42- * Keywords that should appear in valid agent files (case-insensitive).
66+ * Keywords that must appear in valid agent files for content validation.
67+ *
68+ * Used by {@link validateAgentContent} to verify that a file actually contains
69+ * agent-related content rather than arbitrary text. The validation is
70+ * case-insensitive, so "Agent", "TASK", or "task" all match.
71+ *
72+ * **Keyword purposes:**
73+ * - `"agent"` - Identifies the file as defining or describing an agent persona
74+ * - `"task"` - Indicates the file contains task execution logic or instructions
75+ *
76+ * At least one of these keywords must be present for validation to pass.
77+ * This acts as a sanity check to catch corrupted or incorrectly-named files.
4378 *
44- * These specific keywords were chosen because they indicate the file contains
45- * agent-related content:
46- * - "agent": Identifies the file as defining or describing an agent
47- * - "task": Indicates the file contains task execution logic or instructions
79+ * @example
80+ * import { REQUIRED_KEYWORDS } from "./paths.mjs"
81+ *
82+ * // Manual keyword check (validateAgentContent does this internally)
83+ * const content = "# My Agent\nThis agent handles tasks..."
84+ * const lowerContent = content.toLowerCase()
85+ * const hasKeyword = REQUIRED_KEYWORDS.some(kw => lowerContent.includes(kw))
86+ * console.log(hasKeyword) // true (contains "agent" and "tasks")
87+ *
88+ * @example
89+ * // Invalid content missing keywords
90+ * const badContent = "# Random File\nThis is just some notes."
91+ * const lowerBad = badContent.toLowerCase()
92+ * const isValid = REQUIRED_KEYWORDS.some(kw => lowerBad.includes(kw))
93+ * console.log(isValid) // false (no "agent" or "task")
4894 *
49- * At least one of these keywords must be present for content validation to pass.
95+ * @see { @link validateAgentContent } - The function that uses these keywords
5096 */
5197export declare const REQUIRED_KEYWORDS : readonly [ "agent" , "task" ]
5298
0 commit comments