feat(runtime): default to passthrough and persist execution permissions
This commit is contained in:
@@ -13,8 +13,8 @@ export const HOST_ENVIRONMENT = Object.freeze(['AGENT_WORKBENCH_DEEPSEEK_ROOT',
|
||||
|
||||
async function jsonResponse(response) {
|
||||
if (!response.ok) throw hostError('本机宿主接口拒绝操作(HTTP ' + response.status + ')。', 'HOST_API_REJECTED', response.status);
|
||||
const chunks = []; let length = 0;
|
||||
for await (const chunk of response.body) { length += chunk.length; if (length > 4 * 1024 * 1024) throw hostError('本机宿主响应过大。'); chunks.push(chunk); }
|
||||
const chunks = [];
|
||||
for await (const chunk of response.body) chunks.push(chunk);
|
||||
try { return JSON.parse(Buffer.concat(chunks).toString('utf8')); } catch { throw hostError('端口未返回有效的宿主协议。'); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user