Ship the batch: undo, parallel subagents, lazy MCP, hot-reloaded skills; docs and CI/CD
Loop and ergonomics batch across Now/Next and Maintenance:
- /undo and /redo via pre-prompt file snapshots (snapshot.ts)
- task takes a tasks[] array and runs investigations concurrently (subagent.ts)
- lazy MCP tools: mcp_list/mcp_inspect/mcp_call meta-tools, eager opt-in (mcp.ts, config.ts)
- skill tool reads its list live so a mid-session install is callable next turn (skills.ts)
- tool-name lists (tool-kinds.ts) derived from a mutating() marker; gates previously ungated writes
- prune/session recovery path summarized, and step-back doom-loop primitive (step-back.ts)
- @file completion re-walks on a slow cooldown; estimateTokens and pricing labeled as estimates
Docs: README, CHANGELOG, docs/{mcp,architecture,development} updated to match.
CI/CD: bun install-store cache and concurrency gates on both workflows; release.yml now
composes file-based release notes via scripts/make-release-notes.ts and verifies every binary.
This commit is contained in:
+47
-1
@@ -1,4 +1,10 @@
|
||||
import type { LanguageModelV4Usage } from '@ai-sdk/provider';
|
||||
import { simulateReadableStream } from 'ai/test';
|
||||
import type {
|
||||
LanguageModelV4GenerateResult,
|
||||
LanguageModelV4StreamPart,
|
||||
LanguageModelV4StreamResult,
|
||||
LanguageModelV4Usage,
|
||||
} from '@ai-sdk/provider';
|
||||
import type { AppHooks } from '../src/ui/App';
|
||||
|
||||
/**
|
||||
@@ -15,6 +21,46 @@ export function usageOf(input: number, output = 1): LanguageModelV4Usage {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A `doStream` return value built from `simulateReadableStream` chunks.
|
||||
*
|
||||
* Written out as `{ stream: simulateReadableStream(...) } as any` in most UI test
|
||||
* files, because the SDK's `ReadableStream` and `simulateReadableStream`'s type do
|
||||
* not unify. This is the one place that difference is absorbed.
|
||||
*/
|
||||
export function streamOf(chunks: LanguageModelV4StreamPart[]): LanguageModelV4StreamResult {
|
||||
return {
|
||||
stream: simulateReadableStream({
|
||||
chunks,
|
||||
chunkDelayInMs: null,
|
||||
initialDelayInMs: null,
|
||||
}),
|
||||
} as unknown as LanguageModelV4StreamResult;
|
||||
}
|
||||
|
||||
/** The text and finish chunks that make a stream say one thing and stop. */
|
||||
export function textChunks(body: string, usage: LanguageModelV4Usage = usageOf(1)): LanguageModelV4StreamPart[] {
|
||||
return [
|
||||
{ type: 'text-start', id: '0' },
|
||||
{ type: 'text-delta', id: '0', delta: body },
|
||||
{ type: 'text-end', id: '0' },
|
||||
{ type: 'finish', finishReason: { unified: 'stop', raw: 'stop' }, usage },
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* A `doGenerate` return value. `warnings` is required by the SDK type but empty in
|
||||
* every test, so it is filled here rather than repeated at each call site.
|
||||
*/
|
||||
export function generateResult(body: string, usage: LanguageModelV4Usage = usageOf(1)): LanguageModelV4GenerateResult {
|
||||
return {
|
||||
content: [{ type: 'text', text: body }],
|
||||
finishReason: { unified: 'stop', raw: 'stop' },
|
||||
usage,
|
||||
warnings: [],
|
||||
};
|
||||
}
|
||||
|
||||
/** Default AppHooks for UI tests; override only what a test cares about. */
|
||||
export function testHooks(over: Partial<AppHooks> = {}): AppHooks {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user