Parses Qwen-format FIM prompts (prefix- or suffix-first, optional repo/file headers) back into prefix/suffix and rebuilds them in the trained layout; mode from the model string (ac:symbols / ac:simple); files located via workspaceRoots by path or content. extensions/zed/README.md documents the Zed settings; untested against real Zed traffic yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J39imRDT8L7xYbWzsVWd8A
This commit is contained in:
@@ -124,6 +124,10 @@ if (cfg.models?.['nextedit-plumbing']) {
|
||||
for (let i = 0; i < 120 && !(await api('GET', '/health')).body.ok; i++) await new Promise(r => setTimeout(r, 500))
|
||||
}
|
||||
|
||||
// ---------- OpenAI-compatible endpoint (Zed)
|
||||
const oai = (await api('POST', '/v1/completions', { model: 'ac:simple', prompt: "<|fim_prefix|>import { z } from 'zod'\n\nexport const configSchema = z.object({\n port: z.coerce.number().default(3000),\n})\n\nexport type Config = <|fim_suffix|>\n<|fim_middle|>", max_tokens: 64 })).body
|
||||
check('OpenAI-compatible /v1/completions (Zed shim)', oai.object === 'text_completion' && String(oai.choices?.[0]?.text).includes('z.infer'), JSON.stringify(oai.choices?.[0]?.text))
|
||||
|
||||
// ---------- edit recording endpoint
|
||||
const recorded = await api('POST', '/v1/edits', { events: [{ t: Date.now(), repo: 'smoke', path: 'src/a.ts', version: 2, changes: [{ offset: 0, length: 0, text: 'x' }], snapshot: 'x' }] })
|
||||
check('edit recordings are accepted', recorded.body.recorded === 1)
|
||||
@@ -132,7 +136,7 @@ check('edit recordings are accepted', recorded.body.recorded === 1)
|
||||
// Optional typing replay over held-out FIM samples from the (private) training workspace.
|
||||
const dataDir = path.resolve(process.env.SMOKE_DATA_DIR ?? '../../data')
|
||||
const testFim = path.join(dataDir, 'fim/test-repo.jsonl')
|
||||
if (fs.existsSync(testFim)) {
|
||||
if (fs.existsSync(testFim) && Number(args['typing-samples']) > 0) {
|
||||
const files = new Map(fs.readFileSync(path.join(dataDir, 'corpus/files.jsonl'), 'utf8').trim().split('\n').map(l => JSON.parse(l)).map(r => [r.id, r]))
|
||||
const rank = (id: string) => crypto.createHash('sha256').update(`smoke:${id}`).digest('hex')
|
||||
const samples = fs.readFileSync(testFim, 'utf8').trim().split('\n').map(l => JSON.parse(l))
|
||||
|
||||
Reference in New Issue
Block a user