Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 2x 2x 2x 2x 2x 100x 75x 75x 75x 100x 100x 2x 2x 1x | import {library} from '@feasibleone/blong';
import {extractInstructions, walk} from '../../engine.ts';
import type {KukumLibContext, OperationParams} from '../../operation.ts';
/**
* `kukum.instruction.find` — artifacts carrying coding-agent instructions.
*
* This is what a future built-in agent would read to know what still needs
* doing; today it lets an external agent find its own outstanding notes.
*/
export default library(
() =>
async function instructionFind(this: KukumLibContext, params: OperationParams) {
const host = this.platform;
const root = host.resolve(params.target ?? '.');
const all = await walk(host, root);
const found: Array<{path: string; instructions: string[]}> = [];
for (const file of all) {
if (!/\.tsx?$/.test(file)) continue;
const source = String(host.readFileSync(file, {encoding: 'utf-8'}));
const lines = extractInstructions(source);
if (lines.length)
found.push({path: host.relative(root, file), instructions: lines});
}
return {target: root, files: found};
},
);
|