mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-13 11:57:19 +01:00
* feat(benchmark): particle-1 and DeepSeek V4.1 Flash awareness, gateway provider, preregistered model panel (GSTA-173) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(evals): particle-1 model panel results, run 2026-10-30-0105 (GSTA-173) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(model-panel): name the task field id (credential scanner false positive on key) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: gateway reports a missing OpenRouter key first; register the model panel in the paid count and test-of-test baseline Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: run the fake claude through bun so the gateway provider test passes on Windows Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: gateway benchmark runs load no Claude Code settings A settings.json env block's ANTHROPIC_API_KEY was sent to the OpenRouter base URL as x-api-key; --setting-sources '' loads no settings source. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: name particle-1 and DeepSeek V4.1 Flash in the /benchmark-models row Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: changelog fragment and TODOS for the particle-1 model panel Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: name particle-1 and DeepSeek V4.1 Flash in the AGENTS.md /benchmark-models row Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
29 lines
899 B
JavaScript
29 lines
899 B
JavaScript
let nextId = 1;
|
|
const notes = new Map();
|
|
|
|
function handleRequest(method, path, body) {
|
|
if (method === 'GET' && path === '/notes') {
|
|
return { status: 200, body: [...notes.values()] };
|
|
}
|
|
if (method === 'POST' && path === '/notes') {
|
|
if (!body || typeof body.text !== 'string' || !body.text.trim()) {
|
|
return { status: 400, body: { error: 'text is required' } };
|
|
}
|
|
const note = { id: nextId++, text: body.text.trim() };
|
|
notes.set(note.id, note);
|
|
return { status: 201, body: note };
|
|
}
|
|
const match = method === 'DELETE' && /^\/notes\/(\d+)$/.exec(path);
|
|
if (match) {
|
|
return notes.delete(Number(match[1])) ? { status: 204, body: null } : { status: 404, body: { error: 'not found' } };
|
|
}
|
|
return { status: 404, body: { error: 'not found' } };
|
|
}
|
|
|
|
function resetForTests() {
|
|
nextId = 1;
|
|
notes.clear();
|
|
}
|
|
|
|
module.exports = { handleRequest, resetForTests };
|