feat: chat uploads, vision turn isolation, and MindSpace agent improvements

Add chat file/image upload UX, attachment proxying, vision thumbnails, and per-turn image scoping so agents only use the current upload. Extend MindSpace asset context, billing token state, OA/scenario verify scripts, and related runtime config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-11 00:23:01 +08:00
parent e3063ea806
commit 32fb2cdeaf
51 changed files with 4588 additions and 186 deletions
+10 -1
View File
@@ -5,6 +5,7 @@ import { Agent, fetch as undiciFetch } from 'undici';
import { jsonrepair } from 'jsonrepair';
import { reconcileAgentSession } from './session-reconcile.mjs';
import { resolveSessionAccess } from './session-broker.mjs';
import { resolveBillingTokenState } from './billing-token-state.mjs';
const insecureDispatcher = new Agent({
connect: { rejectUnauthorized: false },
@@ -395,7 +396,15 @@ export function createMindSpaceAgentRunner({
const parsed = normalizeStructuredResult(extractJsonObject(reply.text));
if (reply.tokenState) {
await userAuth.billSessionUsage(claim.userId, sessionId, reply.tokenState, requestId);
const tokenState = await resolveBillingTokenState(reply.tokenState, {
sessionId,
fetchSession: async (sid) => {
const response = await apiFetch(`/sessions/${encodeURIComponent(sid)}`);
if (!response?.ok) return null;
return readJsonResponse(response);
},
});
await userAuth.billSessionUsage(claim.userId, sessionId, tokenState, requestId);
}
const completed = await agentJobService.completeJob(jobId, claim.jobToken, {