diff --git a/.gitignore b/.gitignore index 89b72ee7..5db4b3bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__/ .context/ +node_modules/ diff --git a/plugins/altimate-code/README.md b/plugins/altimate-code/README.md index e2594739..9f01411a 100644 --- a/plugins/altimate-code/README.md +++ b/plugins/altimate-code/README.md @@ -136,7 +136,7 @@ Rule drafting uses altimate-code's own model (sign in to the Altimate LLM Gatewa ## Settings -The plugin has five settings, shown when you enable it (`userConfig` in `.claude-plugin/plugin.json`). None is used yet: the features that read them are not in this version, so changing one changes nothing. The table says what each will control. +The plugin has six settings, shown when you enable it (`userConfig` in `.claude-plugin/plugin.json`). `dbt_mods` is used, and so are `healthBlocksPush` and `healthConfigPath`, by the project health check. `maxScanBytes` and the comments settings are not used yet: the features that read them are not in this version, so changing one changes nothing. The table says what each controls or will control. | Setting | Default | What it controls | | --- | --- | --- | diff --git a/plugins/altimate-code/hooks/dbt-mods.tsx b/plugins/altimate-code/hooks/dbt-mods.tsx new file mode 100644 index 00000000..7a339125 --- /dev/null +++ b/plugins/altimate-code/hooks/dbt-mods.tsx @@ -0,0 +1,34 @@ +// The dbt helpers (compile and validate, Explain and Fix, the Query results pane, model context, the doctor). +// +// features/index.ts calls each function below at its moment, in the same phases and band as the other +// features; one with nothing to do stays a no-op. The helpers themselves are filled in by their own change. +import type { Args, EngineInterface, On, PluginOptions, RenderElement, ToolCallResult } from 'claude-code' + +/** How long the edit phase may hold an edit's result for a slow check, in milliseconds. */ +export const CHECK_HOLD_MS = 30_000 + +export async function dbtModsCallStart($: EngineInterface, e: { tool: string; agentId?: string }): Promise {} + +export async function dbtModsBashAfter($: EngineInterface, e: { tool: string; command: string; agentId?: string }, result: ToolCallResult): Promise { + return [] +} + +export async function dbtModsEditAfter($: EngineInterface, e: { tool: string; agentId?: string }, result: ToolCallResult, file: { path: string }): Promise { + return [] +} + +export async function dbtModsReadOrEditAfter($: EngineInterface, e: { tool: string; agentId?: string }, result: ToolCallResult, file: { path: string }): Promise { + return [] +} + +export async function endDbtMods($: EngineInterface) {} + +export function newTurnDbtMods(e: { agentId?: string }) {} + +export async function sessionStartDbtMods($: EngineInterface, e: Args<'session.start'>) {} + +export async function bandDbtMods($: EngineInterface, ui: { Box: any; Button: any; Text: any }): Promise { + return null +} + +export function registerDbtMods(on: On, context: { options: PluginOptions }) {} diff --git a/plugins/altimate-code/hooks/features/docs.test.tsx b/plugins/altimate-code/hooks/features/docs.test.tsx index 5c73f569..f6409036 100644 --- a/plugins/altimate-code/hooks/features/docs.test.tsx +++ b/plugins/altimate-code/hooks/features/docs.test.tsx @@ -1,7 +1,12 @@ -import { expect, mock, test } from 'claude-code/testing' +import { expect, mock, test as kitTest } from 'claude-code/testing' + +// These tests are about the docs feature: the dbt helpers, which run the project's own dbt, are off here +// and tested in dbt-mods.test.tsx. +const test = (name: string, body: Parameters[1]) => kitTest(name, { options: { dbt_mods: false } }, body as any) import { PHASE_TIMEOUT_MS } from '../tool-chain' import { ROUND_MS, applyPrompt, candidatesFrom, changedDescriptions, columnDescriptions, modelPaths, sentGroups } from './docs' +import { nothingToReport } from '../inert-features' const ROOT = '/repo' const MANIFEST_PATH = `${ROOT}/target/manifest.json` @@ -256,7 +261,9 @@ async function start($: any, on: any, options: Options = {}) { }) on('process.run', (_: unknown, e: { argv: readonly string[] }) => { const [, command, , tool] = e.argv - if (command !== 'tool') return { value: { exitCode: 1, stdout: '', stderr: 'not this test' } } + if (command !== 'tool' || tool === 'docs_share_comments') return { value: { exitCode: 1, stdout: '', stderr: 'not this test' } } + // The project health check asks for its own tool at session start: not a call this feature makes. + if (tool === 'dbt_health') return { value: nothingToReport(e.argv)! } calls.push(`cli:${tool}`) toolArgs.push(String(e.argv[5])) if (tool === 'dbt_docs_coverage') { diff --git a/plugins/altimate-code/hooks/features/index.test.ts b/plugins/altimate-code/hooks/features/index.test.ts index 613b6842..94c6e7e8 100644 --- a/plugins/altimate-code/hooks/features/index.test.ts +++ b/plugins/altimate-code/hooks/features/index.test.ts @@ -2,6 +2,7 @@ import { expect, test } from 'claude-code/testing' import { nothingToReport } from '../inert-features' import { + registerFeatures, attempt, featureBandLines, featuresBashAfter, @@ -86,8 +87,22 @@ test('each phase runs through the features, which find nothing to report and log expect(await featuresBashRewrite($, bash)).toBe('dbt run -s a') expect(await featuresBashGate($, bash)).toBeNull() // A dbt command may get a note from a feature that watches dbt (what a run would scan); a call no feature watches gets none. - expect(await featuresBashAfter($, { tool: 'Bash', command: 'ls models' } as any, {} as any)).toEqual([]) + expect(await featuresBashAfter($, { tool: 'Bash', command: 'ls models', tool_use_id: 'ls' } as any, {} as any)).toEqual([]) expect(await featuresEditAfter($, file, {} as any, { path: '/repo/models/a.sql', before: null })).toEqual([]) expect(await featuresReadOrEditAfter($, file, {} as any, { path: '/repo/models/a.sql' })).toEqual([]) - expect(logs).toEqual([]) + // The runs feature is real here and needs a fuller engine than this stub; every other feature must log nothing. + expect(logs.filter(line => !line.startsWith('runs · '))).toEqual([]) +}) + +test('a feature whose register throws never reaches the caller, so the tool hook after the features still installs', () => { + let calls = 0 + const on = new Proxy(() => {}, { + get: () => on, + apply: () => { + calls++ + throw new Error('refused matcher') + }, + }) as any + expect(() => registerFeatures(on, { options: {} } as any)).not.toThrow() + expect(calls).toBeGreaterThan(0) }) diff --git a/plugins/altimate-code/hooks/features/index.ts b/plugins/altimate-code/hooks/features/index.ts index f8a6a590..358f5f2a 100644 --- a/plugins/altimate-code/hooks/features/index.ts +++ b/plugins/altimate-code/hooks/features/index.ts @@ -1,13 +1,27 @@ // The dbt Power User features, each in its own file here, and the one place that calls them, in a -// fixed order: runs, defer, toModel, comments, cost, health, sqlGraph, docs, cteProfile. +// fixed order: runs, defer, toModel, comments, cost, health, sqlGraph, docs, cteProfile. The dbt helpers +// (hooks/dbt-mods.tsx: compile and validate, Explain and Fix, the Query results pane, model context, the +// doctor) are called last, in the same phases and band; they have no status-line part. // // A plugin hooks each shared event once (a second hook on an event without a matcher is refused), and // the engine refuses `$` handed to anything but a function it can name, so this file calls every // feature's functions by name instead of looping over a list. A feature fills in its own file only. -// A function that throws, at once or as a rejection, is logged and skipped: one feature's failure never stops another or the call. -import type { Args, EngineInterface, EventResult, On, PluginOptions, RenderElement, ToolCallResult } from 'claude-code' +// A function that throws, at once or as a rejection, is logged and skipped: one feature's failure never stops another or the call. A `register` failure is silent (`$` is not available at load). +import type { Args, EngineInterface, EventResult, On, PluginOptions, RenderElement, ToolCallInput, ToolCallResult } from 'claude-code' import type { BashCall, EditedFile, FileCall } from '../tool-chain' +import { + CHECK_HOLD_MS as dbtModsCheckHoldMs, + bandDbtMods, + dbtModsBashAfter, + dbtModsCallStart, + dbtModsEditAfter, + dbtModsReadOrEditAfter, + endDbtMods, + newTurnDbtMods, + registerDbtMods, + sessionStartDbtMods, +} from '../dbt-mods' import { register as runsRegister, sessionStart as runsSessionStart, @@ -18,6 +32,7 @@ import { bashRewrite as runsBashRewrite, bashGate as runsBashGate, bashAfter as runsBashAfter, + bashDropped as runsBashDropped, editAfter as runsEditAfter, readOrEditAfter as runsReadOrEditAfter, editReadsBefore as runsEditReadsBefore, @@ -195,6 +210,9 @@ export function registerFeatures(on: On, context: FeatureContext) { try { cteProfileRegister(on, context) } catch {} + try { + registerDbtMods(on, context) + } catch {} } export async function featuresSessionStart($: EngineInterface, e: Args<'session.start'>) { @@ -207,6 +225,7 @@ export async function featuresSessionStart($: EngineInterface, e: Args<'session. await attempt($, 'sqlGraph', 'sessionStart', () => sqlGraphSessionStart($, e)) await attempt($, 'docs', 'sessionStart', () => docsSessionStart($, e)) await attempt($, 'cteProfile', 'sessionStart', () => cteProfileSessionStart($, e)) + await attempt($, 'dbtMods', 'sessionStart', () => sessionStartDbtMods($, e)) } export async function featuresTurnStart($: EngineInterface, e: Args<'turn.start'>) { @@ -219,6 +238,7 @@ export async function featuresTurnStart($: EngineInterface, e: Args<'turn.start' await attempt($, 'sqlGraph', 'turnStart', () => sqlGraphTurnStart($, e)) await attempt($, 'docs', 'turnStart', () => docsTurnStart($, e)) await attempt($, 'cteProfile', 'turnStart', () => cteProfileTurnStart($, e)) + await attempt($, 'dbtMods', 'turnStart', () => newTurnDbtMods(e)) } export async function featuresTurnComplete($: EngineInterface, e: Args<'turn.complete'>, out: EventResult<'turn.complete'>) { @@ -243,6 +263,7 @@ export async function featuresSessionEnd($: EngineInterface, e: Args<'session.en await attempt($, 'sqlGraph', 'sessionEnd', () => sqlGraphSessionEnd($, e)) await attempt($, 'docs', 'sessionEnd', () => docsSessionEnd($, e)) await attempt($, 'cteProfile', 'sessionEnd', () => cteProfileSessionEnd($, e)) + await attempt($, 'dbtMods', 'sessionEnd', () => endDbtMods($)) } /** Each feature's band line, in order, with its id; a feature with nothing to say is left out. */ @@ -260,6 +281,7 @@ export async function featureBandLines($: EngineInterface, ui: BandUi): Promise< add('sqlGraph', await attempt($, 'sqlGraph', 'bandLine', () => sqlGraphBandLine($, ui))) add('docs', await attempt($, 'docs', 'bandLine', () => docsBandLine($, ui))) add('cteProfile', await attempt($, 'cteProfile', 'bandLine', () => cteProfileBandLine($, ui))) + add('dbtMods', await attempt($, 'dbtMods', 'bandLine', () => bandDbtMods($, ui))) return lines } @@ -299,6 +321,19 @@ export async function featuresBashGate($: EngineInterface, e: BashCall): Promise return gate } +/** A Bash call that a gate refused, or whose result is a refusal, never reaches bashAfter: the features that kept it let go. */ +export async function featuresBashDropped($: EngineInterface, e: BashCall): Promise { + await attempt($, 'runs', 'bashDropped', () => runsBashDropped($, e)) +} + +/** + * Before a call runs, after the rewrites and the gate: what a feature needs to know of the call as it was + * then (the conversation it is in, the folder a command starts in). It cannot refuse or change the call. + */ +export async function featuresCallStart($: EngineInterface, e: ToolCallInput): Promise { + await attempt($, 'dbtMods', 'callStart', () => dbtModsCallStart($, e)) +} + /** The context lines every feature adds after a Bash call ran. */ export async function featuresBashAfter($: EngineInterface, e: BashCall, result: ToolCallResult): Promise { const lines: string[] = [] @@ -311,9 +346,16 @@ export async function featuresBashAfter($: EngineInterface, e: BashCall, result: addLines(lines, await attempt($, 'sqlGraph', 'bashAfter', () => sqlGraphBashAfter($, e, result))) addLines(lines, await attempt($, 'docs', 'bashAfter', () => docsBashAfter($, e, result))) addLines(lines, await attempt($, 'cteProfile', 'bashAfter', () => cteProfileBashAfter($, e, result))) + addLines(lines, await attempt($, 'dbtMods', 'bashAfter', () => dbtModsBashAfter($, e, result))) return lines } +/** + * How long the edit phase may take: the dbt helpers hold an edit's result for up to their check's wait + * (dbt-mods.tsx), so the phase's deadline allows that and a little more. + */ +export const EDIT_AFTER_TIMEOUT_MS = dbtModsCheckHoldMs + 5_000 + /** Whether any feature's `editAfter` needs the file's text from before the edit. */ export const EDIT_READS_BEFORE: boolean = runsEditReadsBefore || deferEditReadsBefore || toModelEditReadsBefore || commentsEditReadsBefore || costEditReadsBefore || healthEditReadsBefore || sqlGraphEditReadsBefore || docsEditReadsBefore || cteProfileEditReadsBefore @@ -329,6 +371,7 @@ export async function featuresEditAfter($: EngineInterface, e: FileCall, result: addLines(lines, await attempt($, 'sqlGraph', 'editAfter', () => sqlGraphEditAfter($, e, result, sqlGraphEditReadsBefore ? file : { path: file.path, before: null }))) addLines(lines, await attempt($, 'docs', 'editAfter', () => docsEditAfter($, e, result, docsEditReadsBefore ? file : { path: file.path, before: null }))) addLines(lines, await attempt($, 'cteProfile', 'editAfter', () => cteProfileEditAfter($, e, result, cteProfileEditReadsBefore ? file : { path: file.path, before: null }))) + addLines(lines, await attempt($, 'dbtMods', 'editAfter', () => dbtModsEditAfter($, e, result, file))) return lines } @@ -344,6 +387,7 @@ export async function featuresReadOrEditAfter($: EngineInterface, e: FileCall, r addLines(lines, await attempt($, 'sqlGraph', 'readOrEditAfter', () => sqlGraphReadOrEditAfter($, e, result, file))) addLines(lines, await attempt($, 'docs', 'readOrEditAfter', () => docsReadOrEditAfter($, e, result, file))) addLines(lines, await attempt($, 'cteProfile', 'readOrEditAfter', () => cteProfileReadOrEditAfter($, e, result, file))) + addLines(lines, await attempt($, 'dbtMods', 'readOrEditAfter', () => dbtModsReadOrEditAfter($, e, result, file))) return lines } diff --git a/plugins/altimate-code/hooks/features/runs.tsx b/plugins/altimate-code/hooks/features/runs.tsx index 40ad8ff0..5dd088f0 100644 --- a/plugins/altimate-code/hooks/features/runs.tsx +++ b/plugins/altimate-code/hooks/features/runs.tsx @@ -44,6 +44,9 @@ export async function bashGate($: EngineInterface, e: BashCall): Promise<{ deny: export async function bashAfter($: EngineInterface, e: BashCall, result: ToolCallResult): Promise {} +/** A Bash call that a gate refused, or whose result is a refusal, never reaches `bashAfter`: the place to let go of what this feature kept for it. */ +export async function bashDropped($: EngineInterface, e: BashCall): Promise {} + /** `file.before` holds the text from before the edit only when `editReadsBefore` is true. */ export async function editAfter($: EngineInterface, e: FileCall, result: ToolCallResult, file: EditedFile): Promise {} diff --git a/plugins/altimate-code/hooks/tool-chain.test.ts b/plugins/altimate-code/hooks/tool-chain.test.ts index 940fd6ad..61b8ae63 100644 --- a/plugins/altimate-code/hooks/tool-chain.test.ts +++ b/plugins/altimate-code/hooks/tool-chain.test.ts @@ -159,11 +159,27 @@ test('a phase that never settles is given up on: the call passes through unchang expect(await afterCall(edit, ok, null, steps)).toBe(ok) expect(seen).toEqual( ['bashRewrite', 'bashGate', 'bashAfter', 'readBefore', 'editAfter', 'readOrEditAfter'].map( - phase => `log:tool chain · ${phase} did not finish within 5000 ms or failed: the call goes on unchanged`, + phase => `log:tool chain · ${phase} did not finish within ${phase === 'editAfter' ? 35000 : 5000} ms or failed: the call goes on unchanged`, ), ) }) +test('the edit phase may hold an edit longer than the others: a slow check still rides on its result', async () => { + const deadlines: number[] = [] + const { steps } = recording({ + editAfter: async () => ['held note'], + limit: (async (work: Promise, ms: number) => { + deadlines.push(ms) + return work + }) as any, + }) + const edit = { tool: 'Edit', file_path: '/repo/models/a.sql' } as any + const result = await afterCall(edit, ok, null, steps) + expect((result as any).context).toContain('held note') + // editAfter, then readOrEditAfter. + expect(deadlines).toEqual([35000, 5000]) +}) + test('a phase that throws at once is treated like one that timed out', async () => { const { steps } = recording({ bashRewrite: (() => { @@ -191,3 +207,18 @@ test('a deadline or a logger that throws drops only that phase: the gate after i expect(pre.deny).toEqual({ deny: 'refused' }) expect(seen).toEqual(['bashRewrite:dbt run', 'bashGate:dbt run']) }) + +test('a call a gate refuses is reported as dropped, and so is one whose result is a refusal; a call that runs is not', async () => { + const dropped: string[] = [] + const bashDropped = async (e: { command: string }) => void dropped.push(e.command) + const refused = recording({ bashGate: async () => ({ deny: 'held' }), bashDropped }) + expect((await beforeCall({ tool: 'Bash', command: 'dbt build -s a' } as any, refused.steps)).deny).toEqual({ deny: 'held' }) + expect(dropped).toEqual(['dbt build -s a']) + + const open = recording({ bashDropped }) + const call = { tool: 'Bash', command: 'dbt build -s b' } as any + await afterCall(call, { deny: 'later' } as any, null, open.steps) + expect(dropped).toEqual(['dbt build -s a', 'dbt build -s b']) + await afterCall(call, ok, null, open.steps) + expect(dropped).toHaveLength(2) +}) diff --git a/plugins/altimate-code/hooks/tool-chain.ts b/plugins/altimate-code/hooks/tool-chain.ts index 0f2e9010..b941ef34 100644 --- a/plugins/altimate-code/hooks/tool-chain.ts +++ b/plugins/altimate-code/hooks/tool-chain.ts @@ -1,21 +1,27 @@ // The one `tool.call` hook the features share. Bash and file-edit handling runs in fixed phases, so // a rewrite is seen by the gate and by what runs after: // -// bashRewrite → bashGate → next(e) → bashAfter → editAfter → readOrEditAfter +// bashRewrite → bashGate → callStart → next(e) → bashAfter → editAfter → readOrEditAfter +// +// `callStart` is not a phase that decides anything: it lets a feature note what it needs of the call as it +// was before it ran (the conversation it is in), and it cannot refuse or change the call. // // Within a phase the features run in the order features/index.ts calls them. A feature that throws is // logged and skipped: its failure never stops or alters the call on its own. After-phases are awaited, // so they stay quick and leave slow work to `later`. Context lines they return are appended to the -// call's result, after any the call already carries. Each phase has a deadline (PHASE_TIMEOUT_MS): one +// call's result, after any the call already carries. Each phase has a deadline (PHASE_TIMEOUT_MS, longer for editAfter: PHASE_DEADLINES): one // that does not answer in time is logged and the call goes on as if no feature had spoken in it. import type { On, ToolCallInput, ToolCallResult } from 'claude-code' import { within } from './altimate-cli' import { + EDIT_AFTER_TIMEOUT_MS, EDIT_READS_BEFORE, featuresBashAfter, + featuresBashDropped, featuresBashGate, featuresBashRewrite, + featuresCallStart, featuresEditAfter, featuresReadOrEditAfter, } from './features' @@ -46,6 +52,9 @@ export const PHASES: readonly Phase[] = ['bashRewrite', 'bashGate', 'bashAfter', */ export const PHASE_TIMEOUT_MS = 5_000 +/** A phase's own deadline when it is not PHASE_TIMEOUT_MS: the edit phase holds an edit's result for a slow check. */ +const PHASE_DEADLINES: Partial> = { editAfter: EDIT_AFTER_TIMEOUT_MS } + const EDIT_TOOLS = new Set(['Edit', 'Write', 'MultiEdit']) /** The Bash call in `e`, or null when it is no Bash call with a command. */ @@ -69,29 +78,34 @@ export function withContext(result: ToolCallResult, lines: readonly string[]): T export type ChainSteps = { bashRewrite: (e: BashCall) => Promise bashGate: (e: BashCall) => Promise<{ deny: string } | null> + /** Before the call runs, after the rewrites and the gate: what a feature notes of the call as it was. Never refuses or changes it. */ + callStart?: (e: ToolCallInput) => Promise bashAfter: (e: BashCall, result: ToolCallResult) => Promise + /** Told when a Bash call will not reach bashAfter because a gate refused it or its result is a refusal. */ + bashDropped?: (e: BashCall) => Promise editAfter: (e: FileCall, result: ToolCallResult, file: EditedFile) => Promise readOrEditAfter: (e: FileCall, result: ToolCallResult, file: { path: string }) => Promise /** The file's text before an edit; called only when `readsBefore` is set. */ readBefore: (path: string) => Promise readsBefore: boolean /** Runs one phase's work under its deadline: null when the work did not finish in time or failed. */ - limit: (work: Promise) => Promise + limit: (work: Promise, ms: number) => Promise /** Where a phase that timed out is logged. */ log: (text: string) => void } /** The phase's value, or `fallback` (logged) when it ran out of time, failed or threw. */ -async function bounded(steps: ChainSteps, phase: Phase | 'readBefore', fallback: T, run: () => Promise): Promise { +async function bounded(steps: ChainSteps, phase: Phase | 'readBefore' | 'bashDropped' | 'callStart', fallback: T, run: () => Promise): Promise { try { // Wrapped, so a legitimate null value is told apart from the deadline's null. - const done = await steps.limit(Promise.resolve().then(run).then(value => ({ value }))) + const ms = PHASE_DEADLINES[phase] ?? PHASE_TIMEOUT_MS + const done = await steps.limit(Promise.resolve().then(run).then(value => ({ value })), ms) if (done) return done.value } catch { // The deadline itself failed: only this phase is dropped, the later ones (the gate) still run. } try { - steps.log(`tool chain · ${phase} did not finish within ${PHASE_TIMEOUT_MS} ms or failed: the call goes on unchanged`) + steps.log(`tool chain · ${phase} did not finish within ${PHASE_DEADLINES[phase] ?? PHASE_TIMEOUT_MS} ms or failed: the call goes on unchanged`) } catch { // A logger that throws does not drop the phases after this one. } @@ -106,8 +120,12 @@ export async function beforeCall(input: ToolCallInput, steps: ChainSteps): Promi const command = await bounded(steps, 'bashRewrite', bash.command, () => steps.bashRewrite(bash)) if (command !== bash.command) e = { ...e, command } as ToolCallInput const deny = await bounded(steps, 'bashGate', null, () => steps.bashGate({ ...bash, command })) - if (deny) return { e, deny, before: null } + if (deny) { + await bounded(steps, 'bashDropped', undefined, async () => steps.bashDropped?.({ ...bash, command })) + return { e, deny, before: null } + } } + if (steps.callStart) await bounded(steps, 'callStart', undefined, () => steps.callStart!(e)) const path = filePathOf(e) const before = path && EDIT_TOOLS.has(e.tool) && steps.readsBefore ? await bounded(steps, 'readBefore', null, () => steps.readBefore(path)) : null return { e, deny: null, before } @@ -115,7 +133,11 @@ export async function beforeCall(input: ToolCallInput, steps: ChainSteps): Promi /** The phases after the call ran: bashAfter, editAfter, readOrEditAfter; their lines go to `context`. */ export async function afterCall(e: ToolCallInput, result: ToolCallResult, before: string | null, steps: ChainSteps): Promise { - if (result.deny !== undefined) return result + if (result.deny !== undefined) { + const dropped = bashCallOf(e) + if (dropped) await bounded(steps, 'bashDropped', undefined, async () => steps.bashDropped?.(dropped)) + return result + } const lines: string[] = [] const bash = bashCallOf(e) if (bash) lines.push(...(await bounded(steps, 'bashAfter', [], () => steps.bashAfter(bash, result)))) @@ -136,12 +158,14 @@ export function installToolChain(on: On) { const steps: ChainSteps = { bashRewrite: e => featuresBashRewrite($, e), bashGate: e => featuresBashGate($, e), + callStart: e => featuresCallStart($, e), bashAfter: (e, result) => featuresBashAfter($, e, result), + bashDropped: e => featuresBashDropped($, e), editAfter: (e, result, file) => featuresEditAfter($, e, result, file), readOrEditAfter: (e, result, file) => featuresReadOrEditAfter($, e, result, file), readBefore: path => $.fs.read(path), readsBefore: EDIT_READS_BEFORE, - limit: work => within($, PHASE_TIMEOUT_MS, work), + limit: (work, ms) => within($, ms, work), log: text => $.ui.log(text, { to: 'debug' }), } // The chain failing never stops the call: it then runs as it came, and its result goes back as is.