Some checks are pending
Auto-update PR branches / Update open PR branches (push) Waiting to run
CI / Frontend Static Quality Checks (push) Waiting to run
CI / Frontend Tests & Coverage (push) Waiting to run
CI / Rust Tests & Quality Checks (push) Waiting to run
CI / Linux build verification (push) Waiting to run
Deploy docs / Build VitePress site (push) Waiting to run
Deploy docs / Deploy to GitHub Pages (push) Blocked by required conditions
Release (Alpha) / Compute alpha version (push) Waiting to run
Release (Alpha) / Build release artifacts (push) Blocked by required conditions
Release (Alpha) / GitHub Release (alpha) (push) Blocked by required conditions
Release (Alpha) / Update docs and release pages (push) Blocked by required conditions
Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
24 lines
621 B
JavaScript
24 lines
621 B
JavaScript
import { readFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
import { vaultContext } from './vault.js'
|
|
|
|
export async function readAgentInstructions(vaultPath) {
|
|
const instructionsPath = path.join(vaultPath, 'AGENTS.md')
|
|
try {
|
|
return {
|
|
path: instructionsPath,
|
|
content: await readFile(instructionsPath, 'utf8'),
|
|
}
|
|
} catch (error) {
|
|
if (error?.code === 'ENOENT') return null
|
|
throw error
|
|
}
|
|
}
|
|
|
|
export async function vaultContextWithInstructions(vaultPath) {
|
|
return {
|
|
...(await vaultContext(vaultPath)),
|
|
agentInstructions: await readAgentInstructions(vaultPath),
|
|
}
|
|
}
|