nightralph 0.0.53 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -9
- package/dist/index.js +1947 -230
- package/dist/index.js.map +4 -4
- package/dist/learnings.js +356 -0
- package/dist/learnings.js.map +7 -0
- package/dist/meta.json +232 -12
- package/dist/orchestrator.js +442 -109
- package/dist/orchestrator.js.map +3 -3
- package/dist/preflight.js +34 -0
- package/dist/preflight.js.map +7 -0
- package/dist/progress.js +5 -4
- package/dist/progress.js.map +2 -2
- package/dist/retry.js +83 -0
- package/dist/retry.js.map +7 -0
- package/dist/review.js +662 -0
- package/dist/review.js.map +7 -0
- package/dist/rules.js +54 -0
- package/dist/rules.js.map +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/learnings.d.ts +68 -0
- package/dist/src/learnings.d.ts.map +1 -0
- package/dist/src/orchestrator.d.ts +14 -11
- package/dist/src/orchestrator.d.ts.map +1 -1
- package/dist/src/preflight.d.ts +6 -0
- package/dist/src/preflight.d.ts.map +1 -0
- package/dist/src/progress.d.ts +1 -1
- package/dist/src/progress.d.ts.map +1 -1
- package/dist/src/retry.d.ts +26 -0
- package/dist/src/retry.d.ts.map +1 -0
- package/dist/src/review.d.ts +127 -0
- package/dist/src/review.d.ts.map +1 -0
- package/dist/src/rules.d.ts +10 -0
- package/dist/src/rules.d.ts.map +1 -0
- package/dist/src/testcmd.d.ts +1 -0
- package/dist/src/testcmd.d.ts.map +1 -1
- package/dist/src/worktree.d.ts +30 -1
- package/dist/src/worktree.d.ts.map +1 -1
- package/dist/testcmd.js +13 -0
- package/dist/testcmd.js.map +2 -2
- package/dist/worktree.js +236 -32
- package/dist/worktree.js.map +2 -2
- package/package.json +4 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/review.ts"],
|
|
4
|
+
"sourcesContent": ["import { existsSync, readFileSync, writeFileSync } from 'node:fs'\nimport { basename, dirname, join, relative } from 'node:path'\nimport {\n NOTES_PATH,\n formatDate,\n collectNotes,\n ensureNotesIgnored,\n appendEntry,\n} from './learnings.js'\nimport { runTestCmd } from './testcmd.js'\nimport { commitProgress } from './progress.js'\nimport { runWithRetries, type EffortLevel } from './retry.js'\nimport {\n createNamedWorktree,\n deleteBranch,\n removeWorktree,\n commitDirty,\n hasNewCommits,\n isDirty,\n hasChangesOutside,\n headCommit,\n isAncestor,\n mergeBase,\n} from './worktree.js'\nimport { mergeBranch } from './merge.js'\nimport type { AgentResult } from './orchestrator.js'\nimport {\n readDocsRule,\n installRule,\n testGateRule,\n LINT_RULE,\n integrityRule,\n CONFINEMENT_RULES,\n commitRule,\n notesRule,\n agentsMdRule,\n} from './rules.js'\n\nexport const FINDINGS_FILE = 'findings.md'\nexport const FINDINGS_PATH = `${dirname(NOTES_PATH)}/${FINDINGS_FILE}`\nexport const NO_FINDINGS = 'No findings.'\n// Bookkeeping lives here (tickets, progress, learnings, the\n// review log), so the review never looks at it.\nexport const REVIEW_EXCLUDE = '.scratch'\n\nexport const REVIEW_MARKER = '---- REVIEW INSTRUCTIONS ----'\nexport const FIX_MARKER = '---- REVIEW FINDINGS ----'\n\n// The bookkeeping directory for a review log: the nearest ancestor\n// of reviewPath named .scratch, relative to the repo root, so a run\n// launched from a subdirectory excludes the right path. Falls back\n// to REVIEW_EXCLUDE when reviewPath is not under a .scratch.\nexport function reviewExcludeFor (\n repoRoot:string,\n reviewPath:string\n):string {\n let dir = dirname(reviewPath)\n while (dirname(dir) !== dir) {\n if (basename(dir) === '.scratch') {\n const rel = relative(repoRoot, dir)\n if (rel && !rel.startsWith('..')) return rel\n break\n }\n dir = dirname(dir)\n }\n return REVIEW_EXCLUDE\n}\n\nexport function reviewDiffCommand (\n from:string,\n to:string,\n exclude:string = REVIEW_EXCLUDE\n):string {\n return `git diff ${from}..${to} -- . ':(exclude)${exclude}'`\n}\n\nexport function renderReviewPrompt (opts:{\n specBody:string\n from:string\n to:string\n exclude?:string\n}):string {\n return [\n '---- SPEC CONTEXT ----',\n opts.specBody,\n '',\n REVIEW_MARKER,\n 'You are reviewing work that autonomous agents merged ' +\n 'into this branch, one ticket at a time. Review the ' +\n 'combined change as a whole.',\n '',\n 'The change to review:',\n '',\n ` ${reviewDiffCommand(opts.from, opts.to, opts.exclude)}`,\n '',\n 'Follow these rules:',\n '- Read any AGENTS.md in or above the directories the ' +\n 'change touches, plus CONTEXT.md and the relevant ' +\n 'docs/adr/ entries if they exist. Treat their ' +\n 'contracts and the spec above as the standard the ' +\n 'code must meet.',\n '- Look for correctness bugs, missing or weak tests, ' +\n 'and code that breaks a documented contract. Ignore ' +\n 'style preferences.',\n '- You may run the tests or the type checker to confirm ' +\n 'a suspicion.',\n '- Do NOT edit, stage, or commit code. Anything you ' +\n 'change here is discarded.',\n ...CONFINEMENT_RULES,\n '',\n `Write your findings to \\`${FINDINGS_PATH}\\` (create the ` +\n 'directory), most severe first, in exactly this form:',\n '',\n '- [ ] <one-line summary of the finding>',\n ' <file:line, and a concrete input or state that goes ' +\n 'wrong>',\n '',\n 'If you find nothing worth fixing, write the single line: ' +\n NO_FINDINGS,\n 'Never git add or commit that file; the orchestrator ' +\n 'collects it.',\n '',\n ].join('\\n')\n}\n\nexport type FixFailure =\n 'install'|'exit'|'no-commits'|'tests'|'merge'\n\nexport const FIX_FAILURE_TEXT:Record<FixFailure, string> = {\n install:'dependency install failed',\n exit:'the agent exited with an error',\n 'no-commits':'the agent made no commits',\n tests:'the test command failed after the agent finished',\n merge:'the fix branch did not merge cleanly',\n}\n\nfunction findingLines (findings:ReadonlyArray<Finding>):string[] {\n return findings.flatMap(f => [\n `- [ ] ${f.summary}`,\n ...(f.detail ?\n f.detail.split('\\n').map(l => ` ${l}`) :\n []),\n ])\n}\n\nfunction previousBlock (\n previous?:{ reason:FixFailure; notes:string|null }\n):string[] {\n if (!previous) return []\n return [\n '---- PREVIOUS FIX ATTEMPT ----',\n `It failed: ${FIX_FAILURE_TEXT[previous.reason]}.`,\n previous.notes ?? 'It left no notes.',\n '',\n ]\n}\n\nexport function renderFixPrompt (opts:{\n specBody:string\n findings:ReadonlyArray<Finding>\n testCmd:string\n installCmd?:string\n previous?:{ reason:FixFailure; notes:string|null }\n}):string {\n return [\n '---- SPEC CONTEXT ----',\n opts.specBody,\n '',\n FIX_MARKER,\n ...findingLines(opts.findings),\n '',\n ...previousBlock(opts.previous),\n '---- AGENT INSTRUCTIONS ----',\n 'You are an autonomous coding agent. Fix the review ' +\n 'findings above using /tdd.',\n '',\n 'Follow these rules:',\n readDocsRule('findings'),\n '- Fix ONLY the listed findings. Do not fix unrelated ' +\n 'problems you notice.',\n ...installRule(opts.installCmd),\n '- Use /tdd for every finding: write a failing test that ' +\n 'shows the problem, then write only enough code to ' +\n 'make it pass, then refactor.',\n testGateRule(opts.testCmd, 'fix'),\n LINT_RULE,\n integrityRule('finding'),\n ...CONFINEMENT_RULES,\n commitRule('finding'),\n notesRule('finding', 'fix'),\n '- After fixing each finding, print a line: ' +\n '[x] <finding summary> (matching the summary ' +\n 'text exactly).',\n '- If a finding is wrong or cannot be fixed honestly, ' +\n 'leave it unchecked and explain why in your notes ' +\n 'file.',\n agentsMdRule('fix'),\n '',\n ].join('\\n')\n}\n\nconst SENTINEL_PREFIX = '<!-- nightralph:review'\nconst SENTINEL_RE = /^<!-- nightralph:review (.*) -->$/\nconst SHA_RE = /^[0-9a-f]{4,64}$/\nconst FIX_HEADING = '### Fix'\nconst FINDING_RE = /^ ?[-*+]\\s+\\[([ xX])\\]\\s+(.+)$/\n\nexport const REVIEW_STATUSES = [\n 'clean', 'fixed', 'unresolved', 'review-failed',\n] as const\n\nexport type ReviewStatus = typeof REVIEW_STATUSES[number]\n\nexport type Finding = {\n summary:string\n detail:string\n checked:boolean\n}\n\nexport type FixRecord = {\n attempts:number\n maxAttempts:number\n effort?:string\n exitCode:number|null\n result:string\n notes:string|null\n}\n\nexport type ReviewEntryInput = {\n from:string\n to:string\n status:ReviewStatus\n now:Date\n findings:Finding[]\n fix?:FixRecord\n}\n\nexport type ReviewEntry = {\n from:string\n to:string\n status:ReviewStatus\n findings:Finding[]\n body:string\n}\n\nexport type ReviewOutcome = {\n status:ReviewStatus|'skipped'\n findings:number\n fixed:number\n}\n\nfunction isReviewStatus (value:string):value is ReviewStatus {\n return (REVIEW_STATUSES as readonly string[]).includes(value)\n}\n\nfunction collapse (s:string):string {\n return s.replace(/\\s+/g, ' ').trim()\n}\n\nfunction normalize (s:string):string {\n return collapse(s).toLowerCase()\n}\n\nfunction sanitize (text:string):string {\n return text.replace(\n new RegExp(SENTINEL_PREFIX, 'g'),\n '<!-- nightralph-review'\n )\n}\n\nfunction splitLines (text:string):string[] {\n return text.split('\\n').map(line => {\n return line.endsWith('\\r') ? line.slice(0, -1) : line\n })\n}\n\n// The reviewer's checklist: `- [ ] summary` lines, each followed\n// by its detail lines. [] for an explicit \"No findings.\", null\n// when the text is neither, which fails the review attempt.\nexport function parseFindings (text:string):Finding[]|null {\n const findings:Finding[] = []\n const details:string[][] = []\n for (const line of splitLines(text)) {\n const m = line.match(FINDING_RE)\n if (m) {\n findings.push({\n summary:collapse(m[2]),\n detail:'',\n checked:m[1] !== ' ',\n })\n details.push([])\n } else if (findings.length > 0 && line.trim()) {\n details[details.length - 1].push(line.trim())\n }\n }\n if (findings.length > 0) {\n return findings.map((f, i) => {\n return { ...f, detail:details[i].join('\\n') }\n })\n }\n const clean = splitLines(text).some(line => {\n return normalize(line) === NO_FINDINGS.toLowerCase()\n })\n return clean ? [] : null\n}\n\n// Checks off the findings the fixer echoed as `[x] <summary>`,\n// compared loosely like ticket checklist items.\nexport function markFixed (\n findings:ReadonlyArray<Finding>,\n completedItems:ReadonlyArray<string>\n):Finding[] {\n const done = new Set(completedItems.map(normalize))\n return findings.map(f => {\n return { ...f, checked:done.has(normalize(f.summary)) }\n })\n}\n\nfunction headline (input:ReviewEntryInput):string {\n const n = input.findings.length\n const fixed = input.findings.filter(f => f.checked).length\n switch (input.status) {\n case 'clean': return 'no findings'\n case 'fixed': return `${fixed} of ${n} fixed`\n case 'unresolved':\n return `${n} finding${n === 1 ? '' : 's'}, fix failed`\n case 'review-failed': return 'review failed'\n default: {\n const _exhaustive:never = input.status\n return _exhaustive\n }\n }\n}\n\nfunction renderFindings (input:ReviewEntryInput):string[] {\n if (input.status === 'review-failed') {\n return ['The reviewer left no usable findings file.']\n }\n if (input.findings.length === 0) return [NO_FINDINGS]\n return input.findings.flatMap(f => {\n const box = f.checked ? '[x]' : '[ ]'\n const detail = f.detail ?\n f.detail.split('\\n').map(l => ` ${sanitize(l)}`) :\n []\n return [`- ${box} ${sanitize(collapse(f.summary))}`, ...detail]\n })\n}\n\nfunction renderFix (fix?:FixRecord):string[] {\n if (!fix) return []\n return [\n '',\n FIX_HEADING,\n `- attempts: ${fix.attempts} of ${fix.maxAttempts}`,\n ...(fix.effort ? [`- effort: ${fix.effort}`] : []),\n `- agent exit code: ${fix.exitCode ?? 'none'}`,\n `- result: ${sanitize(fix.result)}`,\n '',\n fix.notes ? sanitize(fix.notes) : 'The fixer left no notes.',\n ]\n}\n\nexport function renderReviewEntry (input:ReviewEntryInput):string {\n return [\n `${SENTINEL_PREFIX} from=${input.from} to=${input.to} ` +\n `status=${input.status} -->`,\n `## ${formatDate(input.now)} -- review ` +\n `${input.from.slice(0, 7)}..${input.to.slice(0, 7)} ` +\n `-- ${headline(input)}`,\n ...renderFindings(input),\n ...renderFix(input.fix),\n '---',\n '',\n ].join('\\n')\n}\n\nfunction parseEntry (\n sentinel:string,\n bodyLines:string[]\n):ReviewEntry|null {\n const attrs:Record<string, string> = {}\n for (const part of sentinel.split(/\\s+/).filter(Boolean)) {\n const idx = part.indexOf('=')\n if (idx > 0) attrs[part.slice(0, idx)] = part.slice(idx + 1)\n }\n const { from, to, status } = attrs\n if (!from || !SHA_RE.test(from)) return null\n if (!to || !SHA_RE.test(to)) return null\n if (!status || !isReviewStatus(status)) return null\n\n const lines = [...bodyLines]\n while (lines.length > 0 && !lines[lines.length - 1].trim()) {\n lines.pop()\n }\n if (lines[lines.length - 1] === '---') lines.pop()\n const fixAt = lines.indexOf(FIX_HEADING)\n const findingLines = fixAt === -1 ? lines : lines.slice(0, fixAt)\n return {\n from,\n to,\n status,\n findings:parseFindings(findingLines.join('\\n')) ?? [],\n body:lines.join('\\n').trim(),\n }\n}\n\n// Malformed entries are dropped, not thrown; text before the\n// first sentinel is ignored.\nexport function parseReviewEntries (text:string):ReviewEntry[] {\n const entries:ReviewEntry[] = []\n let sentinel:string|null = null\n let body:string[] = []\n const flush = ():void => {\n if (sentinel === null) return\n const entry = parseEntry(sentinel, body)\n if (entry) entries.push(entry)\n }\n for (const line of splitLines(text)) {\n const m = line.match(SENTINEL_RE)\n if (m) {\n flush()\n sentinel = m[1]\n body = []\n } else if (sentinel !== null) {\n body.push(line)\n }\n }\n flush()\n return entries\n}\n\n// Where the review range starts: the last reviewed commit while\n// it is still on this branch, else the fork point from the\n// default branch, else the commit the run started from.\nexport function selectReviewBase (\n entries:ReadonlyArray<ReviewEntry>,\n opts:{\n isAncestor:(sha:string) => boolean\n forkPoint:string|null\n launchCommit:string\n }\n):string {\n const last = [...entries].reverse().find(e => {\n return e.status !== 'review-failed'\n })\n if (last && opts.isAncestor(last.to)) return last.to\n return opts.forkPoint ?? opts.launchCommit\n}\n\n// One line for the finish summary; null when no review ran.\nexport function renderReviewSummary (\n outcome:ReviewOutcome,\n reviewPath:string\n):string|null {\n const see = ` -- see ${reviewPath}`\n const plural = outcome.findings === 1 ? '' : 's'\n switch (outcome.status) {\n case 'skipped': return null\n case 'clean': return `Review: no findings${see}`\n case 'fixed':\n return `Review: ${outcome.findings} finding${plural}, ` +\n `${outcome.fixed} fixed${see}`\n case 'unresolved':\n return `Review: ${outcome.findings} finding${plural}, ` +\n `fix failed${see}`\n case 'review-failed':\n return `Review: the reviewer failed${see}`\n default: {\n const _exhaustive:never = outcome.status\n return _exhaustive\n }\n }\n}\n\nexport type SpawnAgentFn = (opts:{\n prompt:string\n agentCmd:string\n model:string|null\n timeout:number\n logPath:string\n cwd?:string\n label?:string\n maxTurns?:number\n effort?:EffortLevel\n onLine?:(line:string) => void\n}) => Promise<AgentResult>\n\nexport type ReviewDeps = {\n spawnAgent:SpawnAgentFn\n // running child pids, so SIGINT also kills installs and tests\n registry?:Set<number>\n}\n\nexport type ReviewPassOpts = {\n repoRoot:string\n repoName:string\n // the branch the run merged into; the fix merges here too\n baseBranch:string\n reviewPath:string\n // the default branch, when baseBranch is an integration branch\n forkedFrom?:string\n launchCommit:string\n specBody:string\n agentCmd:string\n model:string|null\n timeout:number\n logsDir:string\n testCmd:string\n installCmd?:string\n maxTurns?:number\n effort?:EffortLevel\n retries:number\n retryDelay:number\n log:(msg:string) => void\n now?:() => Date\n}\n\n// Same naming as ticket logs: the first attempt keeps the plain\n// name, later attempts get their own file.\nfunction logPath (\n logsDir:string,\n stem:string,\n attempt:number,\n ext:string\n):string {\n const suffix = attempt > 1 ? `.attempt${attempt}` : ''\n return join(logsDir, `${stem}${suffix}${ext}`)\n}\n\n// Runs a shell step (install or tests) in a worktree, writing its\n// output to `path`; true only on exit 0.\nasync function runStep (\n opts:ReviewPassOpts,\n deps:ReviewDeps,\n cmd:string,\n cwd:string,\n path:string\n):Promise<boolean> {\n const result = await runTestCmd({\n cmd,\n cwd,\n timeout:opts.timeout,\n registry:deps.registry,\n })\n writeFileSync(path, result.output)\n return result.exitCode === 0\n}\n\nasync function discardWorktree (\n opts:ReviewPassOpts,\n wt:{ worktreePath:string; branchName:string }\n):Promise<void> {\n try {\n await removeWorktree(wt.worktreePath, { force:true })\n await deleteBranch(opts.repoRoot, wt.branchName)\n } catch (err) {\n opts.log(\n ` Failed to remove ${wt.worktreePath}: ` +\n (err instanceof Error ? err.message : String(err))\n )\n }\n}\n\n// Asks an agent to review from..to and returns its findings:\n// [] when clean, null when no attempt produced a usable findings\n// file. The worktree and anything the reviewer changed in it are\n// always discarded.\nexport async function runReviewer (\n opts:ReviewPassOpts,\n deps:ReviewDeps,\n range:{ from:string; to:string }\n):Promise<Finding[]|null> {\n return runWithRetries({\n maxAttempts:opts.retries + 1,\n retryDelay:opts.retryDelay,\n agentCmd:opts.agentCmd,\n effort:opts.effort,\n label:'review',\n log:opts.log,\n }, async (attempt, effort) => {\n const wt = await createNamedWorktree({\n repoRoot:opts.repoRoot,\n repoName:opts.repoName,\n baseBranch:opts.baseBranch,\n name:'review',\n })\n try {\n if (opts.installCmd && !(await runStep(\n opts, deps, opts.installCmd, wt.worktreePath,\n logPath(opts.logsDir, 'review', attempt, '.install.log')\n ))) {\n opts.log(' review: install failed')\n return { result:null, stop:false }\n }\n ensureNotesIgnored(wt.worktreePath)\n await deps.spawnAgent({\n prompt:renderReviewPrompt({\n specBody:opts.specBody,\n ...range,\n exclude:reviewExcludeFor(\n opts.repoRoot, opts.reviewPath\n ),\n }),\n agentCmd:opts.agentCmd,\n model:opts.model,\n timeout:opts.timeout,\n logPath:logPath(opts.logsDir, 'review', attempt, '.log'),\n cwd:wt.worktreePath,\n label:'review',\n maxTurns:opts.maxTurns,\n effort,\n onLine:opts.log,\n })\n const text = collectNotes(wt.worktreePath, FINDINGS_FILE)\n const findings = text === null ? null : parseFindings(text)\n if (findings === null) {\n opts.log(' review: no usable findings file')\n }\n return { result:findings, stop:findings !== null }\n } finally {\n await discardWorktree(opts, wt)\n }\n })\n}\n\nexport type FixResult = {\n merged:boolean\n // checked per the fixer's [x] lines when merged; all\n // unchecked otherwise\n findings:Finding[]\n attempts:number\n effort?:EffortLevel\n exitCode:number|null\n result:string\n notes:string|null\n}\n\n// Asks an agent to fix the findings in a fresh worktree off the\n// branch tip. Its work merges only after a green test gate;\n// every failure is retried like a ticket.\nexport async function runFixer (\n opts:ReviewPassOpts,\n deps:ReviewDeps,\n findings:ReadonlyArray<Finding>\n):Promise<FixResult> {\n const unchecked = findings.map(f => ({ ...f, checked:false }))\n let previous:{ reason:FixFailure; notes:string|null }|undefined\n\n return runWithRetries<FixResult>({\n maxAttempts:opts.retries + 1,\n retryDelay:opts.retryDelay,\n agentCmd:opts.agentCmd,\n effort:opts.effort,\n label:'review fix',\n log:opts.log,\n }, async (attempt, effort) => {\n const fail = (\n reason:FixFailure,\n exitCode:number|null,\n notes:string|null\n ) => {\n previous = { reason, notes }\n opts.log(` review fix: ${FIX_FAILURE_TEXT[reason]}`)\n return {\n result:{\n merged:false,\n findings:unchecked,\n attempts:attempt,\n effort,\n exitCode,\n result:FIX_FAILURE_TEXT[reason],\n notes,\n },\n stop:false,\n }\n }\n\n const wt = await createNamedWorktree({\n repoRoot:opts.repoRoot,\n repoName:opts.repoName,\n baseBranch:opts.baseBranch,\n name:'review-fix',\n })\n try {\n if (opts.installCmd && !(await runStep(\n opts, deps, opts.installCmd, wt.worktreePath,\n logPath(\n opts.logsDir, 'review-fix', attempt,\n '.install.log'\n )\n ))) {\n return fail('install', null, null)\n }\n ensureNotesIgnored(wt.worktreePath)\n const agent = await deps.spawnAgent({\n prompt:renderFixPrompt({\n specBody:opts.specBody,\n findings,\n testCmd:opts.testCmd,\n installCmd:opts.installCmd,\n previous,\n }),\n agentCmd:opts.agentCmd,\n model:opts.model,\n timeout:opts.timeout,\n logPath:logPath(\n opts.logsDir, 'review-fix', attempt, '.log'\n ),\n cwd:wt.worktreePath,\n label:'review-fix',\n maxTurns:opts.maxTurns,\n effort,\n onLine:opts.log,\n })\n // Before any auto-commit, so notes never get committed\n const notes = collectNotes(wt.worktreePath)\n\n if (!agent.timedOut && agent.exitCode !== 0) {\n return fail('exit', agent.exitCode, notes)\n }\n if (isDirty(wt.worktreePath)) {\n await commitDirty(\n wt.worktreePath,\n 'nightralph: auto-commit review fix ' +\n 'remaining changes'\n )\n }\n if (!hasNewCommits(\n opts.repoRoot, opts.baseBranch, wt.branchName\n )) {\n return fail('no-commits', agent.exitCode, notes)\n }\n if (opts.testCmd === '') {\n opts.log(' review fix: no test gate')\n } else if (!(await runStep(\n opts, deps, opts.testCmd, wt.worktreePath,\n logPath(\n opts.logsDir, 'review-fix', attempt, '.test.log'\n )\n ))) {\n return fail('tests', agent.exitCode, notes)\n }\n const merged = await mergeBranch(\n opts.repoRoot, wt.branchName\n )\n if (!merged.success) {\n return fail(\n 'merge',\n agent.exitCode,\n [notes, merged.stderr].filter(Boolean)\n .join('\\n\\n') || null\n )\n }\n opts.log(' review fix: merged')\n return {\n result:{\n merged:true,\n findings:markFixed(findings, agent.completedItems),\n attempts:attempt,\n effort,\n exitCode:agent.exitCode,\n result:'merged',\n notes,\n },\n stop:true,\n }\n } finally {\n await discardWorktree(opts, wt)\n }\n })\n}\n\nexport function readReviewEntries (path:string):ReviewEntry[] {\n if (!existsSync(path)) return []\n return parseReviewEntries(readFileSync(path, 'utf8'))\n}\n\n// Reviews everything since the last reviewed commit, runs one fix\n// pass when there are findings, and appends and commits one entry\n// to the review log. Skips entirely when the range only touches\n// bookkeeping under REVIEW_EXCLUDE.\nexport async function runReviewPass (\n opts:ReviewPassOpts,\n deps:ReviewDeps\n):Promise<ReviewOutcome> {\n const now = opts.now ?? (() => new Date())\n const to = headCommit(opts.repoRoot)\n const forkPoint = opts.forkedFrom ?\n mergeBase(opts.repoRoot, opts.forkedFrom, to) :\n null\n const from = selectReviewBase(readReviewEntries(opts.reviewPath), {\n isAncestor:sha => isAncestor(opts.repoRoot, sha, to),\n forkPoint,\n launchCommit:opts.launchCommit,\n })\n const exclude = reviewExcludeFor(opts.repoRoot, opts.reviewPath)\n if (!hasChangesOutside(opts.repoRoot, from, to, exclude)) {\n opts.log('\\nReview: nothing new to review')\n return { status:'skipped', findings:0, fixed:0 }\n }\n\n opts.log(`\\nReviewing ${from.slice(0, 7)}..${to.slice(0, 7)}`)\n const findings = await runReviewer(opts, deps, { from, to })\n\n let entry:ReviewEntryInput\n if (findings === null) {\n entry = {\n from,\n to,\n status:'review-failed',\n now:now(),\n findings:[]\n }\n } else if (findings.length === 0) {\n entry = { from, to, status:'clean', now:now(), findings:[] }\n } else {\n opts.log(\n `Review: ${findings.length} finding` +\n `${findings.length === 1 ? '' : 's'}`\n )\n const fix = await runFixer(opts, deps, findings)\n entry = {\n from,\n // A merged fix counts as reviewed\n to:fix.merged ? headCommit(opts.repoRoot) : to,\n status:fix.merged ? 'fixed' : 'unresolved',\n now:now(),\n findings:fix.findings,\n fix:{\n attempts:fix.attempts,\n maxAttempts:opts.retries + 1,\n effort:fix.effort,\n exitCode:fix.exitCode,\n result:fix.result,\n notes:fix.notes,\n },\n }\n }\n\n appendEntry(opts.reviewPath, renderReviewEntry(entry))\n await commitProgress(\n opts.repoRoot, opts.reviewPath, 'nightralph: record review'\n )\n return {\n status:entry.status,\n findings:entry.findings.length,\n fixed:entry.findings.filter(f => f.checked).length,\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA,SAAS,YAAY,cAAc,qBAAqB;AACxD,SAAS,UAAU,SAAS,MAAM,gBAAgB;AAClD;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,sBAAwC;AACjD;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,mBAAmB;AAE5B;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEA,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,GAAG,QAAQ,UAAU,CAAC,IAAI,aAAa;AAC7D,MAAM,cAAc;AAGpB,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AAMnB,SAAS,iBACZ,UACA,YACK;AACL,MAAI,MAAM,QAAQ,UAAU;AAC5B,SAAO,QAAQ,GAAG,MAAM,KAAK;AACzB,QAAI,SAAS,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WAAW,KAAK,QAAQ,IAAI;AAAA,MAC5C,QAAO,IAAI,SAAS,UAAU;AAAA,MAC9B,KAAI,IAAI;AAAA,MACR,UAAS,IAAI;AAAA,MACb,KAAI;AAAA,QACA,UAAS,IAAI;AAAA,QACb,aAAY,KAAK,UAAU;AAAA,QAC3B,QAAO,IAAI;AAAA,QACX,UAAS,IAAI;AAAA,QACb,QAAO,IAAI;AAAA,QACX,OAAM,IAAI;AAAA,MACd;AAAA,IACJ;AAAA,EACJ;AAEA,cAAY,KAAK,YAAY,kBAAkB,KAAK,CAAC;AACrD,QAAM;AAAA,IACF,KAAK;AAAA,IAAU,KAAK;AAAA,IAAY;AAAA,EACpC;AACA,SAAO;AAAA,IACH,QAAO,MAAM;AAAA,IACb,UAAS,MAAM,SAAS;AAAA,IACxB,OAAM,MAAM,SAAS,OAAO,OAAK,EAAE,OAAO,EAAE;AAAA,EAChD;AACJ;AAnEsB;",
|
|
6
|
+
"names": ["findingLines"]
|
|
7
|
+
}
|
package/dist/rules.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { NOTES_PATH } from "./learnings.js";
|
|
4
|
+
function readDocsRule(subject) {
|
|
5
|
+
return `- Read the files directly relevant to the ${subject} before writing code. Also read any AGENTS.md in or above the directories you will touch, plus CONTEXT.md and the relevant docs/adr/ entries if they exist. If they do not exist, proceed silently.`;
|
|
6
|
+
}
|
|
7
|
+
__name(readDocsRule, "readDocsRule");
|
|
8
|
+
function installRule(installCmd) {
|
|
9
|
+
if (!installCmd) return [];
|
|
10
|
+
return [
|
|
11
|
+
`- Dependencies are already installed with \`${installCmd}\`. Do NOT reinstall them with any other command; to reinstall, run that same command. To add a dependency, use the package manager that command uses, so its lockfile stays in sync.`
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
__name(installRule, "installRule");
|
|
15
|
+
function testGateRule(testCmd, subject) {
|
|
16
|
+
if (testCmd === "") {
|
|
17
|
+
return `- Before each commit, run the tests relevant to what you changed. Do not commit with failing tests. The orchestrator runs no test command for this ${subject}.`;
|
|
18
|
+
}
|
|
19
|
+
return `- While iterating, run only the tests relevant to what you changed. Run \`${testCmd}\` in full once, as the final gate before your last commit. Do not commit with failing tests. The orchestrator runs the same command after you exit and rejects the ${subject} if it fails.`;
|
|
20
|
+
}
|
|
21
|
+
__name(testGateRule, "testGateRule");
|
|
22
|
+
const LINT_RULE = "- If the project has a lint script, run it and fix what it reports.";
|
|
23
|
+
function integrityRule(unit) {
|
|
24
|
+
return `- INTEGRITY: never delete, skip, weaken, or write tautological tests to force a green result. Only report a ${unit} done when its real tests genuinely pass. If an item cannot be completed honestly, leave it unchecked and record what blocked you in your notes file.`;
|
|
25
|
+
}
|
|
26
|
+
__name(integrityRule, "integrityRule");
|
|
27
|
+
const CONFINEMENT_RULES = [
|
|
28
|
+
"- Do NOT read or modify files outside your current directory (the worktree).",
|
|
29
|
+
"- Do NOT run git push."
|
|
30
|
+
];
|
|
31
|
+
function commitRule(unit) {
|
|
32
|
+
return `- Commit after each ${unit}, and make sure everything is committed when finished, except your notes file.`;
|
|
33
|
+
}
|
|
34
|
+
__name(commitRule, "commitRule");
|
|
35
|
+
function notesRule(unit, subject) {
|
|
36
|
+
return `- Keep notes for this attempt in \`${NOTES_PATH}\` (create the directory). Update it after each ${unit} and as soon as you hit a blocker, not only at the end. Record what you implemented, files changed, how you read any vague acceptance criteria, what blocked you, and anything the next attempt at this ${subject} should know. Never commit, git add, or delete this file; the orchestrator collects it.`;
|
|
37
|
+
}
|
|
38
|
+
__name(notesRule, "notesRule");
|
|
39
|
+
function agentsMdRule(subject) {
|
|
40
|
+
return `- Before your final commit, record reusable learnings in the nearest AGENTS.md (in or above the directories you modified; prefer that over the repo root). Good additions: module conventions, gotchas, files that must change together, how to test that area, environment requirements. Do NOT add ${subject}-specific details or temporary debugging notes. Only write when you have knowledge that would help future work in that directory. Reusable patterns go in AGENTS.md; anything specific to this ${subject} goes in your notes file.`;
|
|
41
|
+
}
|
|
42
|
+
__name(agentsMdRule, "agentsMdRule");
|
|
43
|
+
export {
|
|
44
|
+
CONFINEMENT_RULES,
|
|
45
|
+
LINT_RULE,
|
|
46
|
+
agentsMdRule,
|
|
47
|
+
commitRule,
|
|
48
|
+
installRule,
|
|
49
|
+
integrityRule,
|
|
50
|
+
notesRule,
|
|
51
|
+
readDocsRule,
|
|
52
|
+
testGateRule
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/rules.ts"],
|
|
4
|
+
"sourcesContent": ["import { NOTES_PATH } from './learnings.js'\n\n// Rule lines shared by the agent prompts. `unit` is what the agent\n// commits one at a time (\"checklist item\", \"finding\"); `subject` is\n// what the orchestrator accepts or rejects (\"ticket\", \"fix\").\n\nexport function readDocsRule (subject:string):string {\n return '- Read the files directly relevant to the ' +\n `${subject} before writing code. Also read any ` +\n 'AGENTS.md in or above the directories you ' +\n 'will touch, plus CONTEXT.md and the ' +\n 'relevant docs/adr/ entries if they exist. ' +\n 'If they do not exist, proceed silently.'\n}\n\n// The rule for agents in a worktree the orchestrator has\n// already installed dependencies into. Empty without one.\nexport function installRule (installCmd?:string):string[] {\n if (!installCmd) return []\n return [\n '- Dependencies are already installed with ' +\n `\\`${installCmd}\\`. Do NOT reinstall them ` +\n 'with any other command; to reinstall, run ' +\n 'that same command. To add a dependency, use ' +\n 'the package manager that command uses, so ' +\n 'its lockfile stays in sync.',\n ]\n}\n\nexport function testGateRule (testCmd:string, subject:string):string {\n if (testCmd === '') {\n return '- Before each commit, run the tests relevant ' +\n 'to what you changed. Do not commit with failing ' +\n 'tests. The orchestrator runs no test command ' +\n `for this ${subject}.`\n }\n return '- While iterating, run only the tests ' +\n 'relevant to what you changed. Run ' +\n `\\`${testCmd}\\` in full once, as the ` +\n 'final gate before your last commit. Do ' +\n 'not commit with failing tests. The ' +\n 'orchestrator runs the same command after ' +\n `you exit and rejects the ${subject} if it ` +\n 'fails.'\n}\n\nexport const LINT_RULE = '- If the project has a lint script, run it ' +\n 'and fix what it reports.'\n\nexport function integrityRule (unit:string):string {\n return '- INTEGRITY: never delete, skip, weaken, or ' +\n 'write tautological tests to force a green ' +\n `result. Only report a ${unit} done ` +\n 'when its real tests genuinely pass. If an ' +\n 'item cannot be completed honestly, leave ' +\n 'it unchecked and record what blocked you ' +\n 'in your notes file.'\n}\n\nexport const CONFINEMENT_RULES:string[] = [\n '- Do NOT read or modify files outside ' +\n 'your current directory (the worktree).',\n '- Do NOT run git push.',\n]\n\nexport function commitRule (unit:string):string {\n return `- Commit after each ${unit}, and make ` +\n 'sure everything is committed when finished, ' +\n 'except your notes file.'\n}\n\nexport function notesRule (unit:string, subject:string):string {\n return `- Keep notes for this attempt in \\`${NOTES_PATH}\\` ` +\n '(create the directory). Update it after each ' +\n `${unit} and as soon as you hit a ` +\n 'blocker, not only at the end. Record what you ' +\n 'implemented, files changed, how you read any ' +\n 'vague acceptance criteria, what blocked you, and ' +\n `anything the next attempt at this ${subject} should ` +\n 'know. Never commit, git add, or delete this ' +\n 'file; the orchestrator collects it.'\n}\n\nexport function agentsMdRule (subject:string):string {\n return '- Before your final commit, record reusable ' +\n 'learnings in the nearest AGENTS.md (in or ' +\n 'above the directories you modified; ' +\n 'prefer that over the repo root). Good ' +\n 'additions: module conventions, gotchas, ' +\n 'files that must change together, how to ' +\n 'test that area, environment requirements. ' +\n `Do NOT add ${subject}-specific details or ` +\n 'temporary debugging notes. Only write ' +\n 'when you have knowledge that would help ' +\n 'future work in that directory. Reusable ' +\n 'patterns go in AGENTS.md; anything ' +\n `specific to this ${subject} goes in your ` +\n 'notes file.'\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA,SAAS,kBAAkB;AAMpB,SAAS,aAAc,SAAuB;AACjD,SAAO,6CACA,OAAO;AAKlB;AAPgB;AAWT,SAAS,YAAa,YAA6B;AACtD,MAAI,CAAC,WAAY,QAAO,CAAC;AACzB,SAAO;AAAA,IACH,+CACS,UAAU;AAAA,EAKvB;AACJ;AAVgB;AAYT,SAAS,aAAc,SAAgB,SAAuB;AACjE,MAAI,YAAY,IAAI;AAChB,WAAO,sJAGS,OAAO;AAAA,EAC3B;AACA,SAAO,6EAEE,OAAO,uKAIgB,OAAO;AAE3C;AAfgB;AAiBT,MAAM,YAAY;AAGlB,SAAS,cAAe,MAAoB;AAC/C,SAAO,+GAEsB,IAAI;AAKrC;AARgB;AAUT,MAAM,oBAA6B;AAAA,EACtC;AAAA,EAEA;AACJ;AAEO,SAAS,WAAY,MAAoB;AAC5C,SAAO,uBAAuB,IAAI;AAGtC;AAJgB;AAMT,SAAS,UAAW,MAAa,SAAuB;AAC3D,SAAO,sCAAsC,UAAU,mDAEhD,IAAI,2MAI8B,OAAO;AAGpD;AAVgB;AAYT,SAAS,aAAc,SAAuB;AACjD,SAAO,wSAOW,OAAO,kMAKD,OAAO;AAEnC;AAfgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AA4BA,OAAO,EACH,eAAe,EACf,gBAAgB,EAGnB,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const MAX_OWN_ENTRIES = 4;
|
|
2
|
+
export declare const MAX_ENTRY_CHARS = 4000;
|
|
3
|
+
export declare const LOG_TAIL_LINES = 40;
|
|
4
|
+
export declare const NOTES_PATH = ".nightralph/notes.md";
|
|
5
|
+
export declare const TRUNCATED_MARKER = "[truncated]";
|
|
6
|
+
export declare const LEARNING_OUTCOMES: readonly ["done", "exit", "tests", "install", "no-commits", "error", "merge"];
|
|
7
|
+
export type LearningOutcome = typeof LEARNING_OUTCOMES[number];
|
|
8
|
+
export type LearningEntry = {
|
|
9
|
+
key: string;
|
|
10
|
+
attempt: number;
|
|
11
|
+
outcome: LearningOutcome;
|
|
12
|
+
timedOut: boolean;
|
|
13
|
+
body: string;
|
|
14
|
+
};
|
|
15
|
+
type EntryBase = {
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
attempt: number;
|
|
19
|
+
now: Date;
|
|
20
|
+
};
|
|
21
|
+
export type AgentRunRecord = {
|
|
22
|
+
exitCode: number;
|
|
23
|
+
completedItems: string[];
|
|
24
|
+
timedOut: boolean;
|
|
25
|
+
notes: string | null;
|
|
26
|
+
};
|
|
27
|
+
type AgentFields = {
|
|
28
|
+
run: AgentRunRecord;
|
|
29
|
+
effort?: string;
|
|
30
|
+
};
|
|
31
|
+
type LogTail = {
|
|
32
|
+
logName: string;
|
|
33
|
+
logTail: string;
|
|
34
|
+
};
|
|
35
|
+
export type EntryInput = EntryBase & ((AgentFields & {
|
|
36
|
+
outcome: 'done' | 'exit' | 'no-commits';
|
|
37
|
+
}) | (AgentFields & LogTail & {
|
|
38
|
+
outcome: 'tests';
|
|
39
|
+
}) | (LogTail & {
|
|
40
|
+
outcome: 'install';
|
|
41
|
+
}) | {
|
|
42
|
+
outcome: 'error';
|
|
43
|
+
error: string;
|
|
44
|
+
} | {
|
|
45
|
+
outcome: 'merge';
|
|
46
|
+
stderr: string;
|
|
47
|
+
});
|
|
48
|
+
export type HistorySelection = {
|
|
49
|
+
own: LearningEntry[];
|
|
50
|
+
blockers: LearningEntry[];
|
|
51
|
+
};
|
|
52
|
+
export declare function formatDate(date: Date): string;
|
|
53
|
+
export declare function isLearningOutcome(value: string): value is LearningOutcome;
|
|
54
|
+
export declare function renderEntry(input: EntryInput): string;
|
|
55
|
+
export declare function parseEntries(text: string): LearningEntry[];
|
|
56
|
+
export declare function selectHistory(entries: LearningEntry[], opts: {
|
|
57
|
+
key: string;
|
|
58
|
+
blockerKeys: string[];
|
|
59
|
+
}): HistorySelection;
|
|
60
|
+
export declare function renderHistory(selection: HistorySelection): string;
|
|
61
|
+
export declare function tailLines(text: string, n: number): string;
|
|
62
|
+
export declare function learningsPathFor(progressPath: string): string;
|
|
63
|
+
export declare function readEntries(path: string): LearningEntry[];
|
|
64
|
+
export declare function appendEntry(path: string, text: string): void;
|
|
65
|
+
export declare function collectNotes(worktreePath: string, file?: string): string | null;
|
|
66
|
+
export declare function ensureNotesIgnored(worktreePath: string): void;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=learnings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learnings.d.ts","sourceRoot":"","sources":["../../src/learnings.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,eAAO,MAAM,eAAe,OAAO,CAAA;AACnC,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,UAAU,yBAAyB,CAAA;AAGhD,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C,eAAO,MAAM,iBAAiB,+EAQpB,CAAA;AACV,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAA;AAE9D,MAAM,MAAM,aAAa,GAAG;IACxB,GAAG,EAAC,MAAM,CAAA;IACV,OAAO,EAAC,MAAM,CAAA;IACd,OAAO,EAAC,eAAe,CAAA;IACvB,QAAQ,EAAC,OAAO,CAAA;IAGhB,IAAI,EAAC,MAAM,CAAA;CACd,CAAA;AAED,KAAK,SAAS,GAAG;IACb,GAAG,EAAC,MAAM,CAAA;IACV,KAAK,EAAC,MAAM,CAAA;IACZ,OAAO,EAAC,MAAM,CAAA;IACd,GAAG,EAAC,IAAI,CAAA;CACX,CAAA;AAID,MAAM,MAAM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,aAAa,EAAE,EACvB,IAAI,EAAC;IAAE,GAAG,EAAC,MAAM,CAAC;IAAC,WAAW,EAAC,MAAM,EAAE,CAAA;CAAE,GAC3C,gBAAgB,CAcjB;AAED,wBAAgB,aAAa,CAAE,SAAS,EAAC,gBAAgB,GAAE,MAAM,CAyBhE;AAUD,wBAAgB,SAAS,CAAE,IAAI,EAAC,MAAM,EAAE,CAAC,EAAC,MAAM,GAAE,MAAM,CAcvD;AAED,wBAAgB,gBAAgB,CAAE,YAAY,EAAC,MAAM,GAAE,MAAM,CAE5D;AAMD,wBAAgB,WAAW,CAAE,IAAI,EAAC,MAAM,GAAE,aAAa,EAAE,CAGxD;AAID,wBAAgB,WAAW,CAAE,IAAI,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,GAAE,IAAI,CAG1D;AAMD,wBAAgB,YAAY,CACxB,YAAY,EAAC,MAAM,EACnB,IAAI,GAAC,MAA6B,GACpC,MAAM,GAAC,IAAI,CAQZ;AAMD,wBAAgB,kBAAkB,CAAE,YAAY,EAAC,MAAM,GAAE,IAAI,CAI5D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type MergeConflictStrategy } from './merge.js';
|
|
2
2
|
import { type Display } from './display.js';
|
|
3
|
+
import { type EffortLevel } from './retry.js';
|
|
4
|
+
export { EFFORT_LADDERS, ALL_EFFORT_LEVELS, escalateEffort, retryDelayFor, type EffortLevel, type ProviderName, } from './retry.js';
|
|
3
5
|
export type Ticket = {
|
|
4
6
|
num: number;
|
|
5
7
|
slug: string;
|
|
@@ -39,18 +41,13 @@ export declare function stripSpecSection(specBody: string, heading: string): str
|
|
|
39
41
|
export declare function lookupSpec(specBodies: Map<string, string> | undefined, fallback: string, feature: string): string;
|
|
40
42
|
export declare function renderPrompt(specBody: string, ticket: Ticket, opts: {
|
|
41
43
|
testCmd: string;
|
|
44
|
+
installCmd?: string;
|
|
45
|
+
history?: string;
|
|
46
|
+
}): string;
|
|
47
|
+
export declare function renderMergePrompt(specBody: string, ticket: Ticket, opts?: {
|
|
48
|
+
installCmd?: string;
|
|
42
49
|
}): string;
|
|
43
|
-
export declare function renderMergePrompt(specBody: string, ticket: Ticket): string;
|
|
44
50
|
export declare function getProviderArgs(cmd: string): string[];
|
|
45
|
-
export declare const EFFORT_LADDERS: {
|
|
46
|
-
readonly pi: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
47
|
-
readonly claude: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
48
|
-
readonly codex: readonly ["low", "medium", "high"];
|
|
49
|
-
};
|
|
50
|
-
export type ProviderName = keyof typeof EFFORT_LADDERS;
|
|
51
|
-
export type EffortLevel = typeof EFFORT_LADDERS[ProviderName][number];
|
|
52
|
-
export declare const ALL_EFFORT_LEVELS: EffortLevel[];
|
|
53
|
-
export declare function escalateEffort(provider: ProviderName, level?: EffortLevel): EffortLevel;
|
|
54
51
|
export declare function formatStreamLine(line: string): string | null;
|
|
55
52
|
export type PiStreamFormatter = {
|
|
56
53
|
process: (line: string) => string[];
|
|
@@ -84,6 +81,7 @@ export declare function dryRunIsolated(opts: {
|
|
|
84
81
|
conflictStrategy: MergeConflictStrategy;
|
|
85
82
|
progressPath: string;
|
|
86
83
|
testCmd: string;
|
|
84
|
+
installCmd?: string;
|
|
87
85
|
effort?: EffortLevel;
|
|
88
86
|
retries?: number;
|
|
89
87
|
retryDelay?: number;
|
|
@@ -93,7 +91,6 @@ export declare const DEFAULT_RETRIES = 3;
|
|
|
93
91
|
export declare const DEFAULT_RETRY_DELAY = 30;
|
|
94
92
|
export declare const DEFAULT_CONCURRENCY = 5;
|
|
95
93
|
export declare function runPool<T, R>(items: T[], limit: number, fn: (item: T) => Promise<R>): Promise<PromiseSettledResult<R>[]>;
|
|
96
|
-
export declare function retryDelayFor(base: number, attempt: number): number;
|
|
97
94
|
export declare const HUMAN_STATUS = "ready-for-human";
|
|
98
95
|
/**
|
|
99
96
|
* The text logged when a run ends. The first line is the
|
|
@@ -118,13 +115,19 @@ export declare function runWavesIsolated(opts: {
|
|
|
118
115
|
conflictStrategy: MergeConflictStrategy;
|
|
119
116
|
display?: Display;
|
|
120
117
|
testCmd: string;
|
|
118
|
+
installCmd?: string;
|
|
121
119
|
maxTurns?: number;
|
|
122
120
|
effort?: EffortLevel;
|
|
123
121
|
retries?: number;
|
|
124
122
|
retryDelay?: number;
|
|
125
123
|
concurrency?: number;
|
|
126
124
|
progressPaths?: Map<string, string>;
|
|
125
|
+
review?: {
|
|
126
|
+
reviewPath: string;
|
|
127
|
+
forkedFrom?: string;
|
|
128
|
+
};
|
|
127
129
|
}): Promise<{
|
|
128
130
|
allDone: boolean;
|
|
131
|
+
branch: string;
|
|
129
132
|
}>;
|
|
130
133
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator.ts"],"names":[],"mappings":"AAwCA,OAAO,EAIH,KAAK,qBAAqB,EAC7B,MAAM,YAAY,CAAA;AACnB,OAAO,EAIH,KAAK,OAAO,EAEf,MAAM,cAAc,CAAA;AAcrB,OAAO,EAMH,KAAK,WAAW,EAEnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,GACpB,MAAM,YAAY,CAAA;AAgBnB,MAAM,MAAM,MAAM,GAAG;IACjB,GAAG,EAAC,MAAM,CAAA;IACV,IAAI,EAAC,MAAM,CAAA;IACX,QAAQ,EAAC,MAAM,CAAA;IACf,QAAQ,EAAC,MAAM,CAAA;IACf,IAAI,EAAC,MAAM,CAAA;IACX,MAAM,EAAC,MAAM,CAAA;IACb,QAAQ,EAAC,MAAM,EAAE,CAAA;IACjB,OAAO,EAAC,MAAM,CAA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,MAAM,CAAA;IAEf,UAAU,CAAC,EAAC,MAAM,CAAA;IAElB,WAAW,CAAC,EAAC,MAAM,CAAA;IAEnB,aAAa,CAAC,EAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAGlC,MAAM,CAAC,EAAC;QACJ,UAAU,EAAC,MAAM,CAAA;QAGjB,UAAU,CAAC,EAAC,MAAM,CAAA;KACrB,CAAA;CACJ,GAAE,OAAO,CAAC;IAAE,OAAO,EAAC,OAAO,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAE,CAAC,CAolB7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/preflight.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,qBAAqB,GAAG;IAEhC,IAAI,CAAC,EAAC,MAAM,CAAA;IAGZ,GAAG,CAAC,EAAC,MAAM,CAAA;CACd,CAAA;AAeD,wBAAgB,iBAAiB,CAC7B,GAAG,EAAC,MAAM,EACV,IAAI,GAAC,qBAA0B,GACjC,MAAM,GAAC,IAAI,CAcZ"}
|
package/dist/src/progress.d.ts
CHANGED
|
@@ -35,5 +35,5 @@ export declare function checkTicket(data: ProgressData, ticketNum: number, resul
|
|
|
35
35
|
done?: boolean;
|
|
36
36
|
}): void;
|
|
37
37
|
export declare function writeProgress(progressPath: string, data: ProgressData): void;
|
|
38
|
-
export declare function commitProgress(repoRoot: string,
|
|
38
|
+
export declare function commitProgress(repoRoot: string, paths: string | string[], message: string): Promise<boolean>;
|
|
39
39
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/progress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAM/C,MAAM,MAAM,cAAc,GAAG;IACzB,GAAG,EAAC,MAAM,CAAA;IACV,IAAI,EAAC,MAA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];
|
|
3
|
+
readonly claude: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
4
|
+
readonly codex: readonly ["low", "medium", "high"];
|
|
5
|
+
};
|
|
6
|
+
export type ProviderName = keyof typeof EFFORT_LADDERS;
|
|
7
|
+
export type EffortLevel = typeof EFFORT_LADDERS[ProviderName][number];
|
|
8
|
+
export declare const ALL_EFFORT_LEVELS: EffortLevel[];
|
|
9
|
+
export declare function escalateEffort(provider: ProviderName, level?: EffortLevel): EffortLevel;
|
|
10
|
+
export declare function retryDelayFor(base: number, attempt: number): number;
|
|
11
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
12
|
+
export type AttemptStep<T> = {
|
|
13
|
+
result: T;
|
|
14
|
+
stop: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type RetryOpts = {
|
|
17
|
+
maxAttempts: number;
|
|
18
|
+
retryDelay: number;
|
|
19
|
+
agentCmd: string;
|
|
20
|
+
effort?: EffortLevel;
|
|
21
|
+
label: string;
|
|
22
|
+
log: (msg: string) => void;
|
|
23
|
+
wait?: (ms: number) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export declare function runWithRetries<T>(opts: RetryOpts, run: (attempt: number, effort: EffortLevel | undefined) => Promise<AttemptStep<T>>): Promise<T>;
|
|
26
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/retry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;CAMjB,CAAA;AAEV,MAAM,MAAM,YAAY,GACpB,MAAM,OAAO,cAAc,CAAA;AAE/B,MAAM,MAAM,WAAW,GACnB,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/C,eAAO,MAAM,iBAAiB,EAAC,WAAW,EAGzC,CAAA;AAKD,wBAAgB,cAAc,CAC1B,QAAQ,EAAC,YAAY,EACrB,KAAK,CAAC,EAAC,WAAW,GACpB,WAAW,CASZ;AAED,wBAAgB,aAAa,CAAE,IAAI,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,GAAE,MAAM,CAEjE;AAED,wBAAgB,KAAK,CAAE,EAAE,EAAC,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,CAE9C;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAAE,MAAM,EAAC,CAAC,CAAC;IAAC,IAAI,EAAC,OAAO,CAAA;CAAE,CAAA;AAEvD,MAAM,MAAM,SAAS,GAAG;IACpB,WAAW,EAAC,MAAM,CAAA;IAElB,UAAU,EAAC,MAAM,CAAA;IACjB,QAAQ,EAAC,MAAM,CAAA;IAEf,MAAM,CAAC,EAAC,WAAW,CAAA;IAEnB,KAAK,EAAC,MAAM,CAAA;IACZ,GAAG,EAAC,CAAC,GAAG,EAAC,MAAM,KAAK,IAAI,CAAA;IAExB,IAAI,CAAC,EAAC,CAAC,EAAE,EAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACrC,CAAA;AAKD,wBAAsB,cAAc,CAAC,CAAC,EAClC,IAAI,EAAC,SAAS,EACd,GAAG,EAAC,CACA,OAAO,EAAC,MAAM,EACd,MAAM,EAAC,WAAW,GAAC,SAAS,KAC3B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,CAAC,CAAC,CAgCX"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type EffortLevel } from './retry.js';
|
|
2
|
+
import type { AgentResult } from './orchestrator.js';
|
|
3
|
+
export declare const FINDINGS_FILE = "findings.md";
|
|
4
|
+
export declare const FINDINGS_PATH: string;
|
|
5
|
+
export declare const NO_FINDINGS = "No findings.";
|
|
6
|
+
export declare const REVIEW_EXCLUDE = ".scratch";
|
|
7
|
+
export declare const REVIEW_MARKER = "---- REVIEW INSTRUCTIONS ----";
|
|
8
|
+
export declare const FIX_MARKER = "---- REVIEW FINDINGS ----";
|
|
9
|
+
export declare function reviewExcludeFor(repoRoot: string, reviewPath: string): string;
|
|
10
|
+
export declare function reviewDiffCommand(from: string, to: string, exclude?: string): string;
|
|
11
|
+
export declare function renderReviewPrompt(opts: {
|
|
12
|
+
specBody: string;
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
exclude?: string;
|
|
16
|
+
}): string;
|
|
17
|
+
export type FixFailure = 'install' | 'exit' | 'no-commits' | 'tests' | 'merge';
|
|
18
|
+
export declare const FIX_FAILURE_TEXT: Record<FixFailure, string>;
|
|
19
|
+
export declare function renderFixPrompt(opts: {
|
|
20
|
+
specBody: string;
|
|
21
|
+
findings: ReadonlyArray<Finding>;
|
|
22
|
+
testCmd: string;
|
|
23
|
+
installCmd?: string;
|
|
24
|
+
previous?: {
|
|
25
|
+
reason: FixFailure;
|
|
26
|
+
notes: string | null;
|
|
27
|
+
};
|
|
28
|
+
}): string;
|
|
29
|
+
export declare const REVIEW_STATUSES: readonly ["clean", "fixed", "unresolved", "review-failed"];
|
|
30
|
+
export type ReviewStatus = typeof REVIEW_STATUSES[number];
|
|
31
|
+
export type Finding = {
|
|
32
|
+
summary: string;
|
|
33
|
+
detail: string;
|
|
34
|
+
checked: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type FixRecord = {
|
|
37
|
+
attempts: number;
|
|
38
|
+
maxAttempts: number;
|
|
39
|
+
effort?: string;
|
|
40
|
+
exitCode: number | null;
|
|
41
|
+
result: string;
|
|
42
|
+
notes: string | null;
|
|
43
|
+
};
|
|
44
|
+
export type ReviewEntryInput = {
|
|
45
|
+
from: string;
|
|
46
|
+
to: string;
|
|
47
|
+
status: ReviewStatus;
|
|
48
|
+
now: Date;
|
|
49
|
+
findings: Finding[];
|
|
50
|
+
fix?: FixRecord;
|
|
51
|
+
};
|
|
52
|
+
export type ReviewEntry = {
|
|
53
|
+
from: string;
|
|
54
|
+
to: string;
|
|
55
|
+
status: ReviewStatus;
|
|
56
|
+
findings: Finding[];
|
|
57
|
+
body: string;
|
|
58
|
+
};
|
|
59
|
+
export type ReviewOutcome = {
|
|
60
|
+
status: ReviewStatus | 'skipped';
|
|
61
|
+
findings: number;
|
|
62
|
+
fixed: number;
|
|
63
|
+
};
|
|
64
|
+
export declare function parseFindings(text: string): Finding[] | null;
|
|
65
|
+
export declare function markFixed(findings: ReadonlyArray<Finding>, completedItems: ReadonlyArray<string>): Finding[];
|
|
66
|
+
export declare function renderReviewEntry(input: ReviewEntryInput): string;
|
|
67
|
+
export declare function parseReviewEntries(text: string): ReviewEntry[];
|
|
68
|
+
export declare function selectReviewBase(entries: ReadonlyArray<ReviewEntry>, opts: {
|
|
69
|
+
isAncestor: (sha: string) => boolean;
|
|
70
|
+
forkPoint: string | null;
|
|
71
|
+
launchCommit: string;
|
|
72
|
+
}): string;
|
|
73
|
+
export declare function renderReviewSummary(outcome: ReviewOutcome, reviewPath: string): string | null;
|
|
74
|
+
export type SpawnAgentFn = (opts: {
|
|
75
|
+
prompt: string;
|
|
76
|
+
agentCmd: string;
|
|
77
|
+
model: string | null;
|
|
78
|
+
timeout: number;
|
|
79
|
+
logPath: string;
|
|
80
|
+
cwd?: string;
|
|
81
|
+
label?: string;
|
|
82
|
+
maxTurns?: number;
|
|
83
|
+
effort?: EffortLevel;
|
|
84
|
+
onLine?: (line: string) => void;
|
|
85
|
+
}) => Promise<AgentResult>;
|
|
86
|
+
export type ReviewDeps = {
|
|
87
|
+
spawnAgent: SpawnAgentFn;
|
|
88
|
+
registry?: Set<number>;
|
|
89
|
+
};
|
|
90
|
+
export type ReviewPassOpts = {
|
|
91
|
+
repoRoot: string;
|
|
92
|
+
repoName: string;
|
|
93
|
+
baseBranch: string;
|
|
94
|
+
reviewPath: string;
|
|
95
|
+
forkedFrom?: string;
|
|
96
|
+
launchCommit: string;
|
|
97
|
+
specBody: string;
|
|
98
|
+
agentCmd: string;
|
|
99
|
+
model: string | null;
|
|
100
|
+
timeout: number;
|
|
101
|
+
logsDir: string;
|
|
102
|
+
testCmd: string;
|
|
103
|
+
installCmd?: string;
|
|
104
|
+
maxTurns?: number;
|
|
105
|
+
effort?: EffortLevel;
|
|
106
|
+
retries: number;
|
|
107
|
+
retryDelay: number;
|
|
108
|
+
log: (msg: string) => void;
|
|
109
|
+
now?: () => Date;
|
|
110
|
+
};
|
|
111
|
+
export declare function runReviewer(opts: ReviewPassOpts, deps: ReviewDeps, range: {
|
|
112
|
+
from: string;
|
|
113
|
+
to: string;
|
|
114
|
+
}): Promise<Finding[] | null>;
|
|
115
|
+
export type FixResult = {
|
|
116
|
+
merged: boolean;
|
|
117
|
+
findings: Finding[];
|
|
118
|
+
attempts: number;
|
|
119
|
+
effort?: EffortLevel;
|
|
120
|
+
exitCode: number | null;
|
|
121
|
+
result: string;
|
|
122
|
+
notes: string | null;
|
|
123
|
+
};
|
|
124
|
+
export declare function runFixer(opts: ReviewPassOpts, deps: ReviewDeps, findings: ReadonlyArray<Finding>): Promise<FixResult>;
|
|
125
|
+
export declare function readReviewEntries(path: string): ReviewEntry[];
|
|
126
|
+
export declare function runReviewPass(opts: ReviewPassOpts, deps: ReviewDeps): Promise<ReviewOutcome>;
|
|
127
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/review.ts"],"names":[],"mappings":"AAWA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAc7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAapD,eAAO,MAAM,aAAa,gBAAgB,CAAA;AAC1C,eAAO,MAAM,aAAa,QAA4C,CAAA;AACtE,eAAO,MAAM,WAAW,iBAAiB,CAAA;AAGzC,eAAO,MAAM,cAAc,aAAa,CAAA;AAExC,eAAO,MAAM,aAAa,kCAAkC,CAAA;AAC5D,eAAO,MAAM,UAAU,8BAA8B,CAAA;AAMrD,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAC,MAAM,EACf,UAAU,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C,MAAM,CAAA;IACd,UAAU,EAAC,MAAM,CAAA;IACjB,GAAG,EAAC,CAAC,GAAG,EAAC,MAAM,KAAK,IAAI,CAAA;IACxB,GAAG,CAAC,EAAC,MAAM,IAAI,CAAA;CAClB,CAAA;AAoDD,wBAAsB,WAAW,CAC7B,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,UAAU,EACf,KAAK,EAAC;IAAE,IAAI,EAAC,MAAM,CAAC;IAAC,EAAE,EAAC,MAAM,CAAA;CAAE,GAClC,OAAO,CAAC,OAAO,EAAE,GAAC,IAAI,CAAC,CAoDxB;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAC,OAAO,CAAA;IAGd,QAAQ,EAAC,OAAO,EAAE,CAAA;IAClB,QAAQ,EAAC,MAAM,CAAA;IACf,MAAM,CAAC,EAAC,WAAW,CAAA;IACnB,QAAQ,EAAC,MAAM,GAAC,IAAI,CAAA;IACpB,MAAM,EAAC,MAAM,CAAA;IACb,KAAK,EAAC,MAAM,GAAC,IAAI,CAAA;CACpB,CAAA;AAKD,wBAAsB,QAAQ,CAC1B,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,UAAU,EACf,QAAQ,EAAC,aAAa,CAAC,OAAO,CAAC,GACjC,OAAO,CAAC,SAAS,CAAC,CA8HnB;AAED,wBAAgB,iBAAiB,CAAE,IAAI,EAAC,MAAM,GAAE,WAAW,EAAE,CAG5D;AAMD,wBAAsB,aAAa,CAC/B,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,UAAU,GACjB,OAAO,CAAC,aAAa,CAAC,CAgEvB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function readDocsRule(subject: string): string;
|
|
2
|
+
export declare function installRule(installCmd?: string): string[];
|
|
3
|
+
export declare function testGateRule(testCmd: string, subject: string): string;
|
|
4
|
+
export declare const LINT_RULE: string;
|
|
5
|
+
export declare function integrityRule(unit: string): string;
|
|
6
|
+
export declare const CONFINEMENT_RULES: string[];
|
|
7
|
+
export declare function commitRule(unit: string): string;
|
|
8
|
+
export declare function notesRule(unit: string, subject: string): string;
|
|
9
|
+
export declare function agentsMdRule(subject: string): string;
|
|
10
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAE,OAAO,EAAC,MAAM,GAAE,MAAM,CAOnD;AAID,wBAAgB,WAAW,CAAE,UAAU,CAAC,EAAC,MAAM,GAAE,MAAM,EAAE,CAUxD;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,GAAE,MAAM,CAenE;AAED,eAAO,MAAM,SAAS,QACQ,CAAA;AAE9B,wBAAgB,aAAa,CAAE,IAAI,EAAC,MAAM,GAAE,MAAM,CAQjD;AAED,eAAO,MAAM,iBAAiB,EAAC,MAAM,EAIpC,CAAA;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAC,MAAM,GAAE,MAAM,CAI9C;AAED,wBAAgB,SAAS,CAAE,IAAI,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,GAAE,MAAM,CAU7D;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAC,MAAM,GAAE,MAAM,CAenD"}
|
package/dist/src/testcmd.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type TestResult = {
|
|
|
3
3
|
output: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function detectTestCmd(projectDir: string): string | null;
|
|
6
|
+
export declare function detectInstallCmd(projectDir: string): string | null;
|
|
6
7
|
export declare function runTestCmd(opts: {
|
|
7
8
|
cmd: string;
|
|
8
9
|
cwd: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testcmd.d.ts","sourceRoot":"","sources":["../../src/testcmd.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,EAAC,MAAM,CAAA;IACf,MAAM,EAAC,MAAM,CAAA;CAChB,CAAA;AAID,wBAAgB,aAAa,CAAE,UAAU,EAAC,MAAM,GAAE,MAAM,GAAC,IAAI,CAa5D;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAC;IAC7B,GAAG,EAAC,MAAM,CAAA;IACV,GAAG,EAAC,MAAM,CAAA;IACV,OAAO,EAAC,MAAM,CAAA;IACd,QAAQ,CAAC,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,GAAE,OAAO,CAAC,UAAU,CAAC,CAwDrB"}
|
|
1
|
+
{"version":3,"file":"testcmd.d.ts","sourceRoot":"","sources":["../../src/testcmd.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,EAAC,MAAM,CAAA;IACf,MAAM,EAAC,MAAM,CAAA;CAChB,CAAA;AAID,wBAAgB,aAAa,CAAE,UAAU,EAAC,MAAM,GAAE,MAAM,GAAC,IAAI,CAa5D;AAOD,wBAAgB,gBAAgB,CAAE,UAAU,EAAC,MAAM,GAAE,MAAM,GAAC,IAAI,CAW/D;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAC;IAC7B,GAAG,EAAC,MAAM,CAAA;IACV,GAAG,EAAC,MAAM,CAAA;IACV,OAAO,EAAC,MAAM,CAAA;IACd,QAAQ,CAAC,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB,GAAE,OAAO,CAAC,UAAU,CAAC,CAwDrB"}
|