feat(ui): show actual model route and inspect live stream evidence

This commit is contained in:
Agent Workbench Dev
2026-10-31 22:42:47 +08:00
parent eeb11d6a76
commit 31ed219477
22 changed files with 276 additions and 38 deletions
+10 -4
View File
@@ -183,13 +183,19 @@ return async (request, response) => {
if (method === 'GET' && route === '/api/operations') {
return json(response, inspectOperations({ store, provider, runtime, server, appDirectory, version: APP_VERSION, parameters: url.searchParams }));
}
if (method === 'GET' && route === '/api/bootstrap') return json(response, {
if (method === 'GET' && route === '/api/bootstrap') {
const hub = provider.modelHub(store), selected = hub.state.selected;
const name = selected.type === 'pool' ? hub.state.pools.find(value => value.id === selected.id)?.name
: hub.connections().find(value => value.id === selected.id)?.name;
return json(response, {
token, version: APP_VERSION, config: { ...store.config, hasKey: provider.hasKey() },
modelSelection: { ...selected, name: name ?? '原模型连接' },
eventCursor: store.eventCursor, storage: store.storageInfo(), runtimeRoot: appDirectory,
environment: executionEnvironment(),
projects: store.projects, sessions: store.listSessions(), exampleProjectId: exampleProject?.id ?? null,
capabilities: { workspaces: 'owned-git-worktree-and-explicit-recovery', gitReview: 'durable-confirmation-boundary', requestContext: 'bounded-whole-request-and-history-artifacts', latestToolFeedback: 'sealed-original-result-fields', changeSets: 'reviewed-recoverable-batches', fileChanges: 'review', exactPatches: 'sha256-unique-anchors', codeIndex: 'bounded-ast-and-candidates', commands: 'per-call-approval', recovery: 'durable-tool-results', model: 'chat-completions-compatible', execution: 'task-run-step', events: 'persistent-cursor', artifacts: 'sha256-verified', checks: 'npm-and-python-counted-jobs', pythonChecks: 'bound-interpreter-and-structured-results', browserChecks: 'sealed-static-build-and-real-edge-assertions', projectInspection: 'bounded-source-and-git', projectMemory: 'project-scoped-source-fingerprint-and-expiry', gitDelivery: 'reviewed-local-snapshot', deliveryReports: 'evidence-json-markdown' },
});
});
}
if (method === 'GET' && route === '/api/diagnostics') {
const selected = url.searchParams.get('session');
const session = selected ? store.session(selected) : null;
@@ -223,13 +229,13 @@ return async (request, response) => {
const artifactMatch = route.match(/^\/api\/artifacts\/([a-f0-9-]+)$/);
if (method === 'GET' && artifactMatch) {
const artifact = store.owned('artifact', artifactMatch[1], url.searchParams.get('session'));
const text = store.artifactStore.read(artifact), offset = cursorNumber(url.searchParams.get('offset'));
if (url.searchParams.get('download') === '1') {
const extension = artifact.mediaType === 'application/json' ? '.json' : artifact.mediaType === 'text/markdown' ? '.md' : '.txt';
response.writeHead(200, { 'Content-Type': artifact.mediaType + '; charset=utf-8', 'Cache-Control': 'no-store',
'X-Content-Type-Options': 'nosniff', 'Content-Disposition': 'attachment; filename="agent-workbench-' + artifact.kind + '-' + artifact.id + extension + '"' });
response.end(text); return;
response.end(store.artifactStore.readBytes(artifact)); return;
}
const text = store.artifactStore.read(artifact), offset = cursorNumber(url.searchParams.get('offset'));
const limit = Math.min(64000, url.searchParams.has('limit') ? cursorNumber(url.searchParams.get('limit')) : 16000);
return json(response, { ...artifact, content: text.slice(offset, offset + limit), offset, totalCharacters: text.length, truncated: offset + limit < text.length });
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { randomUUID, createHash } from 'node:crypto';
export const APP_VERSION = '1.16.0';
export const APP_VERSION = '1.17.0';
export function executionEnvironment() {
const windows = process.platform === 'win32';