@spotpatch/runtime 1.15.2 → 1.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-ELCIEQGT.js +183 -0
- package/dist/chunk-ELCIEQGT.js.map +1 -0
- package/dist/contextual-ask-panel.cjs +100 -92
- package/dist/contextual-ask-panel.cjs.map +1 -1
- package/dist/contextual-ask-panel.js +74 -235
- package/dist/contextual-ask-panel.js.map +1 -1
- package/dist/data-flow-panel.cjs +28 -28
- package/dist/data-flow-panel.cjs.map +1 -1
- package/dist/data-flow-panel.js +28 -28
- package/dist/data-flow-panel.js.map +1 -1
- package/dist/external-handoff-panel.cjs +296 -109
- package/dist/external-handoff-panel.cjs.map +1 -1
- package/dist/external-handoff-panel.js +127 -109
- package/dist/external-handoff-panel.js.map +1 -1
- package/dist/index.cjs +284 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +284 -284
- package/dist/index.js.map +1 -1
- package/dist/motion.cjs +2 -2
- package/dist/motion.cjs.map +1 -1
- package/dist/motion.js +2 -2
- package/dist/motion.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -646,7 +646,7 @@ import { isSensitiveName, redactSensitiveText, sanitizeUrl } from "@spotpatch/sh
|
|
|
646
646
|
var MAX_ATTRIBUTE_CHARACTERS = 500;
|
|
647
647
|
var MAX_SVG_PATH_CHARACTERS = 256;
|
|
648
648
|
function truncate(value, maxCharacters) {
|
|
649
|
-
return value.length <= maxCharacters ? value : `${value.slice(0, Math.max(0, maxCharacters - 1))}
|
|
649
|
+
return value.length <= maxCharacters ? value : `${value.slice(0, Math.max(0, maxCharacters - 1))}…`;
|
|
650
650
|
}
|
|
651
651
|
function isSensitiveAttributeName(name) {
|
|
652
652
|
return isSensitiveName(name);
|
|
@@ -659,7 +659,7 @@ function sanitizeAttributeValue(name, value, baseUrl) {
|
|
|
659
659
|
return sanitizeUrl(value, baseUrl);
|
|
660
660
|
}
|
|
661
661
|
if (name === "d" && value.length > MAX_SVG_PATH_CHARACTERS) {
|
|
662
|
-
return `${value.slice(0, MAX_SVG_PATH_CHARACTERS)}
|
|
662
|
+
return `${value.slice(0, MAX_SVG_PATH_CHARACTERS)}…`;
|
|
663
663
|
}
|
|
664
664
|
return truncate(redactSensitiveText(value), MAX_ATTRIBUTE_CHARACTERS);
|
|
665
665
|
}
|
|
@@ -964,7 +964,7 @@ function serializeElement(element2, depth, state, lines) {
|
|
|
964
964
|
const text2 = normalizedText(child.textContent ?? "");
|
|
965
965
|
if (text2.length > 0) {
|
|
966
966
|
state.nodeCount += 1;
|
|
967
|
-
const truncated = text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}
|
|
967
|
+
const truncated = text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}…`;
|
|
968
968
|
lines.push(`${" ".repeat(depth + 1)}${escapeHtml(truncated)}`);
|
|
969
969
|
}
|
|
970
970
|
continue;
|
|
@@ -979,7 +979,7 @@ function serializeElement(element2, depth, state, lines) {
|
|
|
979
979
|
serializeElement(child, depth + 1, state, lines);
|
|
980
980
|
}
|
|
981
981
|
if (state.truncated && depth === 0) {
|
|
982
|
-
lines.push("
|
|
982
|
+
lines.push(" …");
|
|
983
983
|
}
|
|
984
984
|
lines.push(`${indent}</${tagName}>`);
|
|
985
985
|
}
|
|
@@ -996,7 +996,7 @@ function truncateContext(value, maxCharacters) {
|
|
|
996
996
|
if (value.length <= maxCharacters) {
|
|
997
997
|
return value;
|
|
998
998
|
}
|
|
999
|
-
return `${value.slice(0, Math.max(0, maxCharacters - 1)).trimEnd()}
|
|
999
|
+
return `${value.slice(0, Math.max(0, maxCharacters - 1)).trimEnd()}…`;
|
|
1000
1000
|
}
|
|
1001
1001
|
function escapeCssIdentifier(value) {
|
|
1002
1002
|
return Array.from(value).map(
|
|
@@ -1052,7 +1052,7 @@ function collectElementContext(options) {
|
|
|
1052
1052
|
selector: createSelector(options.element),
|
|
1053
1053
|
sanitizedHtml: truncateContext(lines.join("\n"), options.maxCharacters),
|
|
1054
1054
|
...text2.length === 0 ? {} : {
|
|
1055
|
-
textPreview: text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}
|
|
1055
|
+
textPreview: text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}…`
|
|
1056
1056
|
},
|
|
1057
1057
|
...role === null ? {} : { role },
|
|
1058
1058
|
rect: Object.freeze({
|
|
@@ -1205,36 +1205,36 @@ var PROMPT_MESSAGES = Object.freeze({
|
|
|
1205
1205
|
none: "None"
|
|
1206
1206
|
}),
|
|
1207
1207
|
"zh-CN": Object.freeze({
|
|
1208
|
-
adapter: "
|
|
1209
|
-
boundary: "
|
|
1210
|
-
code: "
|
|
1211
|
-
component: "
|
|
1212
|
-
computedStyles: "
|
|
1213
|
-
confidence: "
|
|
1214
|
-
devicePixelRatio: "
|
|
1215
|
-
element: "
|
|
1216
|
-
file: "
|
|
1217
|
-
modificationConstraint: "
|
|
1218
|
-
modificationRequirements: "
|
|
1219
|
-
origin: "
|
|
1220
|
-
pageEnvironment: "
|
|
1221
|
-
pathname: "
|
|
1222
|
-
reactContext: "React
|
|
1208
|
+
adapter: "适配器",
|
|
1209
|
+
boundary: "代码边界",
|
|
1210
|
+
code: "附近代码",
|
|
1211
|
+
component: "组件",
|
|
1212
|
+
computedStyles: "关键计算样式",
|
|
1213
|
+
confidence: "置信度",
|
|
1214
|
+
devicePixelRatio: "设备像素比",
|
|
1215
|
+
element: "选中元素",
|
|
1216
|
+
file: "文件",
|
|
1217
|
+
modificationConstraint: "请先判断根因,再把每个目标各自的修改说明作为一个原子任务,完成一致且最小范围的修改。不要合并、忽略或扩大目标说明,不要改动无关组件;如果上下文不足,请明确说明需要哪些信息。",
|
|
1218
|
+
modificationRequirements: "修改要求",
|
|
1219
|
+
origin: "定位来源",
|
|
1220
|
+
pageEnvironment: "页面环境",
|
|
1221
|
+
pathname: "路径",
|
|
1222
|
+
reactContext: "React 上下文",
|
|
1223
1223
|
reactVersion: "React",
|
|
1224
|
-
requestedChange: "
|
|
1225
|
-
selectedTargets: (count) =>
|
|
1226
|
-
source: "
|
|
1227
|
-
stack: "
|
|
1228
|
-
styles: "
|
|
1229
|
-
supported: "
|
|
1230
|
-
target: (index) =>
|
|
1231
|
-
title: "
|
|
1232
|
-
unavailable: "
|
|
1233
|
-
unsupported: "
|
|
1224
|
+
requestedChange: "修改说明",
|
|
1225
|
+
selectedTargets: (count) => `已选目标(${String(count)})`,
|
|
1226
|
+
source: "源码定位",
|
|
1227
|
+
stack: "组件栈",
|
|
1228
|
+
styles: "相关样式",
|
|
1229
|
+
supported: "支持",
|
|
1230
|
+
target: (index) => `目标 ${String(index)}`,
|
|
1231
|
+
title: "标题",
|
|
1232
|
+
unavailable: "不可用",
|
|
1233
|
+
unsupported: "不支持",
|
|
1234
1234
|
url: "URL",
|
|
1235
|
-
viewport: "
|
|
1236
|
-
warnings: "
|
|
1237
|
-
none: "
|
|
1235
|
+
viewport: "视口",
|
|
1236
|
+
warnings: "采集警告",
|
|
1237
|
+
none: "无"
|
|
1238
1238
|
})
|
|
1239
1239
|
});
|
|
1240
1240
|
function longestBacktickRun(value) {
|
|
@@ -1337,7 +1337,7 @@ function renderPrompt(annotation, draft) {
|
|
|
1337
1337
|
`- ${messages.url}: <${pageUrl}>
|
|
1338
1338
|
- ${messages.pathname}: ${redactSensitiveText(annotation.page.pathname)}
|
|
1339
1339
|
- ${messages.title}: ${draft.pageTitle.length === 0 ? messages.unavailable : draft.pageTitle}
|
|
1340
|
-
- ${messages.viewport}: ${String(annotation.page.viewportWidth)}
|
|
1340
|
+
- ${messages.viewport}: ${String(annotation.page.viewportWidth)} × ${String(annotation.page.viewportHeight)}
|
|
1341
1341
|
- ${messages.devicePixelRatio}: ${String(annotation.page.devicePixelRatio)}`,
|
|
1342
1342
|
`## ${messages.selectedTargets(annotation.targets.length)}`,
|
|
1343
1343
|
annotation.targets.map((target2, index) => {
|
|
@@ -1360,7 +1360,7 @@ function shrinkCode(target2, draft) {
|
|
|
1360
1360
|
if (line.length <= 120) {
|
|
1361
1361
|
draft.codeLines = [];
|
|
1362
1362
|
} else {
|
|
1363
|
-
draft.codeLines = [`${line.slice(0, 119)}
|
|
1363
|
+
draft.codeLines = [`${line.slice(0, 119)}…`];
|
|
1364
1364
|
}
|
|
1365
1365
|
return true;
|
|
1366
1366
|
}
|
|
@@ -1945,7 +1945,7 @@ var AGENT_PANEL_STYLES = `
|
|
|
1945
1945
|
}
|
|
1946
1946
|
.spotpatch-agent-activity { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
|
|
1947
1947
|
.spotpatch-agent-activity li { display: flex; gap: 8px; color: #929bab; font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
1948
|
-
.spotpatch-agent-activity li::before { color: #64748b; content: "
|
|
1948
|
+
.spotpatch-agent-activity li::before { color: #64748b; content: "•"; }
|
|
1949
1949
|
.spotpatch-agent-activity li[data-state="active"]::before { color: #fbbf24; }
|
|
1950
1950
|
.spotpatch-agent-activity li[data-state="success"]::before { color: #34d399; }
|
|
1951
1951
|
.spotpatch-agent-activity li[data-state="failure"]::before { color: #fb7185; }
|
|
@@ -2225,7 +2225,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2225
2225
|
}
|
|
2226
2226
|
const snapshot = latestSnapshot;
|
|
2227
2227
|
const result = latestResult;
|
|
2228
|
-
jobModel.textContent = `${snapshot.providerLabel}
|
|
2228
|
+
jobModel.textContent = `${snapshot.providerLabel} · ${snapshot.modelLabel}`;
|
|
2229
2229
|
jobStatus.textContent = messages.agent.status(snapshot.status);
|
|
2230
2230
|
phase.textContent = snapshot.phaseMessage;
|
|
2231
2231
|
const jobErrorCode = latestErrorCode ?? snapshot.errorCode;
|
|
@@ -2251,7 +2251,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2251
2251
|
for (const check of result?.checks ?? []) {
|
|
2252
2252
|
const details = createMarkedElement(document, "details");
|
|
2253
2253
|
const checkTitle = createMarkedElement(document, "summary");
|
|
2254
|
-
checkTitle.textContent = `${check.label}: ${check.status}
|
|
2254
|
+
checkTitle.textContent = `${check.label}: ${check.status} · ${String(check.durationMs)} ms`;
|
|
2255
2255
|
const output = createMarkedElement(document, "pre");
|
|
2256
2256
|
output.textContent = check.output.length === 0 ? messages.agent.noOutput : check.output;
|
|
2257
2257
|
details.append(checkTitle, output);
|
|
@@ -2290,7 +2290,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2290
2290
|
} else if (latestCapabilityState === "probing") {
|
|
2291
2291
|
capability.textContent = messages.agent.testingCapability;
|
|
2292
2292
|
} else if (latestCapabilityState === "ready") {
|
|
2293
|
-
capability.textContent = `${messages.agent.capabilityVerified}
|
|
2293
|
+
capability.textContent = `${messages.agent.capabilityVerified} · ${messages.agent.toolsReady}`;
|
|
2294
2294
|
} else if (latestCapabilityErrorCode !== void 0) {
|
|
2295
2295
|
capability.textContent = messages.errors[latestCapabilityErrorCode];
|
|
2296
2296
|
} else if (selectedProvider() === void 0) {
|
|
@@ -2341,7 +2341,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2341
2341
|
capabilityProbing = state === "probing";
|
|
2342
2342
|
capabilityReady = state === "ready" && capabilitySnapshot?.state === "agent-ready";
|
|
2343
2343
|
capability.dataset.state = state;
|
|
2344
|
-
capability.textContent = capabilitySnapshot?.state === "agent-ready" ? `${message}
|
|
2344
|
+
capability.textContent = capabilitySnapshot?.state === "agent-ready" ? `${message} · ${messages.agent.toolsReady}` : message;
|
|
2345
2345
|
refreshActions();
|
|
2346
2346
|
},
|
|
2347
2347
|
renderWorkspaceHealth(state, snapshot, errorCode) {
|
|
@@ -2452,19 +2452,19 @@ var STATUS_EN = Object.freeze({
|
|
|
2452
2452
|
failed: "Failed"
|
|
2453
2453
|
});
|
|
2454
2454
|
var STATUS_ZH = Object.freeze({
|
|
2455
|
-
queued: "
|
|
2456
|
-
preparing: "
|
|
2457
|
-
running: "
|
|
2458
|
-
validating: "
|
|
2459
|
-
"awaiting-review": "
|
|
2460
|
-
applying: "
|
|
2461
|
-
applied: "
|
|
2462
|
-
completed: "
|
|
2463
|
-
cancelling: "
|
|
2464
|
-
cancelled: "
|
|
2465
|
-
reverting: "
|
|
2466
|
-
reverted: "
|
|
2467
|
-
failed: "
|
|
2455
|
+
queued: "已排队",
|
|
2456
|
+
preparing: "准备中",
|
|
2457
|
+
running: "执行中",
|
|
2458
|
+
validating: "验证中",
|
|
2459
|
+
"awaiting-review": "等待审阅",
|
|
2460
|
+
applying: "应用中",
|
|
2461
|
+
applied: "已应用",
|
|
2462
|
+
completed: "已完成",
|
|
2463
|
+
cancelling: "取消中",
|
|
2464
|
+
cancelled: "已取消",
|
|
2465
|
+
reverting: "撤销中",
|
|
2466
|
+
reverted: "已撤销",
|
|
2467
|
+
failed: "失败"
|
|
2468
2468
|
});
|
|
2469
2469
|
var EXECUTION_ACTIVITY_EN = Object.freeze({
|
|
2470
2470
|
prepare: "Preparing context",
|
|
@@ -2480,17 +2480,17 @@ var EXECUTION_ACTIVITY_EN = Object.freeze({
|
|
|
2480
2480
|
unknown: "Processing the current task"
|
|
2481
2481
|
});
|
|
2482
2482
|
var EXECUTION_ACTIVITY_ZH = Object.freeze({
|
|
2483
|
-
prepare: "
|
|
2484
|
-
dispatch: "
|
|
2485
|
-
discover: "
|
|
2486
|
-
search: "
|
|
2487
|
-
read: "
|
|
2488
|
-
patch: "
|
|
2489
|
-
check: "
|
|
2490
|
-
audit: "
|
|
2491
|
-
apply: "
|
|
2492
|
-
sync: "
|
|
2493
|
-
unknown: "
|
|
2483
|
+
prepare: "正在准备上下文",
|
|
2484
|
+
dispatch: "正在派发上下文",
|
|
2485
|
+
discover: "正在查找项目文件",
|
|
2486
|
+
search: "正在搜索源码",
|
|
2487
|
+
read: "正在读取",
|
|
2488
|
+
patch: "正在生成最小修改补丁",
|
|
2489
|
+
check: "正在运行",
|
|
2490
|
+
audit: "正在审计候选修改",
|
|
2491
|
+
apply: "正在应用已验证修改",
|
|
2492
|
+
sync: "正在将结果回流 SpotPatch",
|
|
2493
|
+
unknown: "正在处理当前任务"
|
|
2494
2494
|
});
|
|
2495
2495
|
var EXECUTION_LANE_LABELS = Object.freeze({
|
|
2496
2496
|
prepare: "prepare",
|
|
@@ -2509,10 +2509,10 @@ function executionActivityAction(labels, kind, detail) {
|
|
|
2509
2509
|
return detail === void 0 || detail.length === 0 ? labels[kind] : `${labels[kind]} ${detail}`;
|
|
2510
2510
|
}
|
|
2511
2511
|
function executionActivityLane(kind, detail) {
|
|
2512
|
-
return detail === void 0 || detail.length === 0 ? EXECUTION_LANE_LABELS[kind] : `${EXECUTION_LANE_LABELS[kind]}
|
|
2512
|
+
return detail === void 0 || detail.length === 0 ? EXECUTION_LANE_LABELS[kind] : `${EXECUTION_LANE_LABELS[kind]} · ${detail}`;
|
|
2513
2513
|
}
|
|
2514
2514
|
var EXTERNAL_HANDOFF_ERROR_EN = "The external Agent handoff request failed.";
|
|
2515
|
-
var EXTERNAL_HANDOFF_ERROR_ZH = "
|
|
2515
|
+
var EXTERNAL_HANDOFF_ERROR_ZH = "外部 Agent 交接请求失败。";
|
|
2516
2516
|
var ERROR_MESSAGES_EN = Object.freeze({
|
|
2517
2517
|
[ERROR_CODES2.INVALID_REQUEST]: "The Agent request was rejected as invalid.",
|
|
2518
2518
|
[ERROR_CODES2.INVALID_TOKEN]: "The local SpotPatch session expired.",
|
|
@@ -2570,26 +2570,26 @@ var ERROR_MESSAGES_EN = Object.freeze({
|
|
|
2570
2570
|
[ERROR_CODES2.INTERNAL_ERROR]: "The Agent failed without exposing private details."
|
|
2571
2571
|
});
|
|
2572
2572
|
var ERROR_MESSAGES_ZH = Object.freeze({
|
|
2573
|
-
[ERROR_CODES2.INVALID_REQUEST]: "Agent
|
|
2574
|
-
[ERROR_CODES2.INVALID_TOKEN]: "
|
|
2575
|
-
[ERROR_CODES2.ORIGIN_NOT_ALLOWED]: "
|
|
2576
|
-
[ERROR_CODES2.SOURCE_NOT_FOUND]: "
|
|
2577
|
-
[ERROR_CODES2.SOURCE_OUTSIDE_ROOT]: "
|
|
2578
|
-
[ERROR_CODES2.SOURCE_TOO_LARGE]: "
|
|
2579
|
-
[ERROR_CODES2.EDITOR_OPEN_FAILED]: "
|
|
2580
|
-
[ERROR_CODES2.DATA_FLOW_DISABLED]: "
|
|
2581
|
-
[ERROR_CODES2.DATA_FLOW_SOURCE_STALE]: "
|
|
2582
|
-
[ERROR_CODES2.DATA_FLOW_ANALYSIS_CANCELLED]: "
|
|
2583
|
-
[ERROR_CODES2.AI_DISABLED]: "Vite
|
|
2584
|
-
[ERROR_CODES2.PROVIDER_NOT_CONFIGURED]: "
|
|
2585
|
-
[ERROR_CODES2.PROVIDER_AUTH_FAILED]: "
|
|
2586
|
-
[ERROR_CODES2.PROVIDER_PROTOCOL_UNSUPPORTED]: "
|
|
2587
|
-
[ERROR_CODES2.MODEL_NOT_ALLOWED]: "
|
|
2588
|
-
[ERROR_CODES2.MODEL_TOOL_CALL_UNSUPPORTED]: "
|
|
2589
|
-
[ERROR_CODES2.PROVIDER_RATE_LIMITED]: "
|
|
2590
|
-
[ERROR_CODES2.AGENT_BUSY]: "
|
|
2591
|
-
[ERROR_CODES2.AGENT_LIMIT_EXCEEDED]: "Agent
|
|
2592
|
-
[ERROR_CODES2.AGENT_CANCELLED]: "Agent
|
|
2573
|
+
[ERROR_CODES2.INVALID_REQUEST]: "Agent 请求无效,已被拒绝。",
|
|
2574
|
+
[ERROR_CODES2.INVALID_TOKEN]: "本地 SpotPatch 会话已失效。",
|
|
2575
|
+
[ERROR_CODES2.ORIGIN_NOT_ALLOWED]: "当前页面来源未获授权。",
|
|
2576
|
+
[ERROR_CODES2.SOURCE_NOT_FOUND]: "选中目标对应的源码已不可用。",
|
|
2577
|
+
[ERROR_CODES2.SOURCE_OUTSIDE_ROOT]: "选中源码位于项目根目录之外。",
|
|
2578
|
+
[ERROR_CODES2.SOURCE_TOO_LARGE]: "选中源码超过安全大小限制。",
|
|
2579
|
+
[ERROR_CODES2.EDITOR_OPEN_FAILED]: "编辑器打开请求失败。",
|
|
2580
|
+
[ERROR_CODES2.DATA_FLOW_DISABLED]: "组件数据链路分析未启用。",
|
|
2581
|
+
[ERROR_CODES2.DATA_FLOW_SOURCE_STALE]: "选中源码已经变化,请重新选择组件。",
|
|
2582
|
+
[ERROR_CODES2.DATA_FLOW_ANALYSIS_CANCELLED]: "组件数据链路分析已取消。",
|
|
2583
|
+
[ERROR_CODES2.AI_DISABLED]: "Vite 配置未启用 AI 执行。",
|
|
2584
|
+
[ERROR_CODES2.PROVIDER_NOT_CONFIGURED]: "启动 Vite 的进程中缺少模型服务 Key 环境变量。",
|
|
2585
|
+
[ERROR_CODES2.PROVIDER_AUTH_FAILED]: "模型服务鉴权失败,请检查服务端 Key。",
|
|
2586
|
+
[ERROR_CODES2.PROVIDER_PROTOCOL_UNSUPPORTED]: "中转服务与配置的 OpenAI 兼容协议不一致。",
|
|
2587
|
+
[ERROR_CODES2.MODEL_NOT_ALLOWED]: "当前模型配置未获授权。",
|
|
2588
|
+
[ERROR_CODES2.MODEL_TOOL_CALL_UNSUPPORTED]: "当前模型未完成必要的工具调用或结果续接。",
|
|
2589
|
+
[ERROR_CODES2.PROVIDER_RATE_LIMITED]: "模型服务正在限流,请稍后重试。",
|
|
2590
|
+
[ERROR_CODES2.AGENT_BUSY]: "当前项目已有一个写入任务正在运行。",
|
|
2591
|
+
[ERROR_CODES2.AGENT_LIMIT_EXCEEDED]: "Agent 达到时间、轮次、输出或变更规模限制。",
|
|
2592
|
+
[ERROR_CODES2.AGENT_CANCELLED]: "Agent 任务已取消。",
|
|
2593
2593
|
[ERROR_CODES2.EXTERNAL_HANDOFF_DISABLED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2594
2594
|
[ERROR_CODES2.EXTERNAL_HANDOFF_UNAVAILABLE]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2595
2595
|
[ERROR_CODES2.HANDOFF_VALIDATION_FAILED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
@@ -2608,22 +2608,22 @@ var ERROR_MESSAGES_ZH = Object.freeze({
|
|
|
2608
2608
|
[ERROR_CODES2.SESSION_NOT_FOUND]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2609
2609
|
[ERROR_CODES2.SESSION_AMBIGUOUS]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2610
2610
|
[ERROR_CODES2.SESSION_CLOSED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2611
|
-
[ERROR_CODES2.WORKTREE_DIRTY]: "
|
|
2612
|
-
[ERROR_CODES2.WORKTREE_NOT_REPOSITORY]: "Vite
|
|
2613
|
-
[ERROR_CODES2.WORKTREE_OPERATION_IN_PROGRESS]: "
|
|
2614
|
-
[ERROR_CODES2.WORKTREE_CONFLICTED]: "
|
|
2615
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "
|
|
2616
|
-
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "
|
|
2617
|
-
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "
|
|
2618
|
-
[ERROR_CODES2.TOOL_DENIED]: "
|
|
2619
|
-
[ERROR_CODES2.TOOL_INPUT_INVALID]: "
|
|
2620
|
-
[ERROR_CODES2.TOOL_ARGUMENTS_INVALID]: "
|
|
2621
|
-
[ERROR_CODES2.TOOL_CALL_ID_CONFLICT]: "
|
|
2622
|
-
[ERROR_CODES2.TOOL_PATH_DENIED]: "
|
|
2623
|
-
[ERROR_CODES2.PATCH_REJECTED]: "
|
|
2624
|
-
[ERROR_CODES2.VALIDATION_FAILED]: "
|
|
2625
|
-
[ERROR_CODES2.APPLY_CONFLICT]: "Agent
|
|
2626
|
-
[ERROR_CODES2.INTERNAL_ERROR]: "Agent
|
|
2611
|
+
[ERROR_CODES2.WORKTREE_DIRTY]: "运行 AI 前,请明确同意将当前本地修改纳入隔离基线。",
|
|
2612
|
+
[ERROR_CODES2.WORKTREE_NOT_REPOSITORY]: "Vite 根目录不是已初始化 Git 仓库的顶层目录。",
|
|
2613
|
+
[ERROR_CODES2.WORKTREE_OPERATION_IN_PROGRESS]: "请先完成当前 merge、rebase、cherry-pick 或 revert,再运行 AI。",
|
|
2614
|
+
[ERROR_CODES2.WORKTREE_CONFLICTED]: "请先解决全部 Git 冲突,再运行 AI。",
|
|
2615
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "未跟踪文件超过安全数量或体积上限,请先精简。",
|
|
2616
|
+
[ERROR_CODES2.WORKTREE_UNTRACKED_UNSUPPORTED]: "未跟踪项已丢失、是符号链接或不是普通文件。",
|
|
2617
|
+
[ERROR_CODES2.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "当前本地修改无法安全隔离。",
|
|
2618
|
+
[ERROR_CODES2.TOOL_DENIED]: "工具请求违反本地安全策略。",
|
|
2619
|
+
[ERROR_CODES2.TOOL_INPUT_INVALID]: "工具请求无效。",
|
|
2620
|
+
[ERROR_CODES2.TOOL_ARGUMENTS_INVALID]: "工具参数无效。",
|
|
2621
|
+
[ERROR_CODES2.TOOL_CALL_ID_CONFLICT]: "本轮工具 ID 冲突。",
|
|
2622
|
+
[ERROR_CODES2.TOOL_PATH_DENIED]: "模型请求了受保护或项目外路径。",
|
|
2623
|
+
[ERROR_CODES2.PATCH_REJECTED]: "补丁违反本地策略。",
|
|
2624
|
+
[ERROR_CODES2.VALIDATION_FAILED]: "必需检查失败,无法应用变更。",
|
|
2625
|
+
[ERROR_CODES2.APPLY_CONFLICT]: "Agent 触及文件已变化,未覆盖。",
|
|
2626
|
+
[ERROR_CODES2.INTERNAL_ERROR]: "Agent 失败,未暴露私有细节。"
|
|
2627
2627
|
});
|
|
2628
2628
|
var SUMMARY_MESSAGES_EN = Object.freeze({
|
|
2629
2629
|
adapter: "React adapter",
|
|
@@ -2666,54 +2666,54 @@ var SUMMARY_MESSAGES_EN = Object.freeze({
|
|
|
2666
2666
|
warning: "Warning"
|
|
2667
2667
|
});
|
|
2668
2668
|
var SUMMARY_MESSAGES_ZH = Object.freeze({
|
|
2669
|
-
adapter: "React
|
|
2669
|
+
adapter: "React 适配器",
|
|
2670
2670
|
api: "API",
|
|
2671
2671
|
apiStatuses: Object.freeze({
|
|
2672
|
-
connected: "
|
|
2673
|
-
failed: "
|
|
2674
|
-
loading: "
|
|
2675
|
-
"not-required": "
|
|
2672
|
+
connected: "已连接",
|
|
2673
|
+
failed: "失败",
|
|
2674
|
+
loading: "加载中",
|
|
2675
|
+
"not-required": "无需请求"
|
|
2676
2676
|
}),
|
|
2677
|
-
available: "
|
|
2678
|
-
boundary: "
|
|
2677
|
+
available: "可用",
|
|
2678
|
+
boundary: "代码边界",
|
|
2679
2679
|
boundaries: Object.freeze({
|
|
2680
|
-
component: "
|
|
2681
|
-
"nearby-lines": "
|
|
2680
|
+
component: "完整组件",
|
|
2681
|
+
"nearby-lines": "附近代码"
|
|
2682
2682
|
}),
|
|
2683
|
-
browserContext: "
|
|
2683
|
+
browserContext: "浏览器上下文",
|
|
2684
2684
|
collectionStatuses: Object.freeze({
|
|
2685
|
-
failed: "
|
|
2686
|
-
loading: "
|
|
2687
|
-
ready: "
|
|
2685
|
+
failed: "失败",
|
|
2686
|
+
loading: "采集中",
|
|
2687
|
+
ready: "已就绪"
|
|
2688
2688
|
}),
|
|
2689
|
-
component: "
|
|
2690
|
-
confidence: "
|
|
2689
|
+
component: "组件",
|
|
2690
|
+
confidence: "置信度",
|
|
2691
2691
|
confidenceLabels: Object.freeze({
|
|
2692
|
-
exact: "
|
|
2693
|
-
probable: "
|
|
2694
|
-
approximate: "
|
|
2695
|
-
unknown: "
|
|
2692
|
+
exact: "精确元素源码",
|
|
2693
|
+
probable: "可能的所属组件",
|
|
2694
|
+
approximate: "最近业务容器",
|
|
2695
|
+
unknown: "未找到源码"
|
|
2696
2696
|
}),
|
|
2697
|
-
cssWarnings: "CSS
|
|
2698
|
-
lineLocation: (line, column) =>
|
|
2699
|
-
origin: "
|
|
2700
|
-
source: "
|
|
2701
|
-
sourceContext: "
|
|
2702
|
-
stack: "
|
|
2703
|
-
target: (index, active) =>
|
|
2704
|
-
unavailable: "
|
|
2705
|
-
unsupported: "
|
|
2706
|
-
warning: "
|
|
2697
|
+
cssWarnings: "CSS 警告",
|
|
2698
|
+
lineLocation: (line, column) => `第 ${String(line)} 行${column === void 0 ? "" : `,第 ${String(column)} 列`}`,
|
|
2699
|
+
origin: "定位来源",
|
|
2700
|
+
source: "源码",
|
|
2701
|
+
sourceContext: "源码上下文",
|
|
2702
|
+
stack: "组件栈",
|
|
2703
|
+
target: (index, active) => `目标 ${String(index)}${active ? "(当前)" : ""}`,
|
|
2704
|
+
unavailable: "不可用",
|
|
2705
|
+
unsupported: "不支持",
|
|
2706
|
+
warning: "警告"
|
|
2707
2707
|
});
|
|
2708
2708
|
var UI_MESSAGES = Object.freeze({
|
|
2709
2709
|
"en-US": Object.freeze({
|
|
2710
2710
|
localeName: "EN",
|
|
2711
|
-
alternateLocaleName: "
|
|
2711
|
+
alternateLocaleName: "中",
|
|
2712
2712
|
switchLocale: "Switch interface language to Chinese",
|
|
2713
2713
|
brand: Object.freeze({
|
|
2714
2714
|
name: "SpotPatch",
|
|
2715
2715
|
context: "Live context",
|
|
2716
|
-
repository: "GitHub
|
|
2716
|
+
repository: "GitHub ↗",
|
|
2717
2717
|
repositoryTitle: "Star SpotPatch on GitHub"
|
|
2718
2718
|
}),
|
|
2719
2719
|
trigger: Object.freeze({
|
|
@@ -2747,14 +2747,14 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2747
2747
|
count: (selected, maximum) => `${String(selected)} of ${String(maximum)}`,
|
|
2748
2748
|
complete: (complete, total) => `${String(complete)} of ${String(total)} described`,
|
|
2749
2749
|
instructionBudget: (used, maximum) => `${String(used)} / ${String(maximum)} characters`,
|
|
2750
|
-
instructionBudgetExceeded: (used, maximum) => `${String(used)} / ${String(maximum)} characters
|
|
2750
|
+
instructionBudgetExceeded: (used, maximum) => `${String(used)} / ${String(maximum)} characters — reduce the request`,
|
|
2751
2751
|
statusReady: "Ready",
|
|
2752
2752
|
statusPartial: "Partial",
|
|
2753
2753
|
statusCollecting: "Collecting",
|
|
2754
2754
|
instructionReady: "Instruction added",
|
|
2755
2755
|
instructionMissing: "Needs instruction",
|
|
2756
2756
|
instructionLabel: (name) => `Change for ${name}`,
|
|
2757
|
-
instructionPlaceholder: "Describe the desired result for this target, including constraints
|
|
2757
|
+
instructionPlaceholder: "Describe the desired result for this target, including constraints…",
|
|
2758
2758
|
instructionCount: (used, maximum) => `${String(used)} / ${String(maximum)}`,
|
|
2759
2759
|
activate: (index) => `Edit target ${String(index)}`,
|
|
2760
2760
|
remove: (index) => `Remove target ${String(index)}`,
|
|
@@ -2764,7 +2764,7 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2764
2764
|
}),
|
|
2765
2765
|
diagnostics: Object.freeze({
|
|
2766
2766
|
title: "Captured context",
|
|
2767
|
-
resolving: "Resolving source
|
|
2767
|
+
resolving: "Resolving source…",
|
|
2768
2768
|
noExactSource: "No exact source marker",
|
|
2769
2769
|
promptAriaLabel: "Generated prompt"
|
|
2770
2770
|
}),
|
|
@@ -2793,22 +2793,22 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2793
2793
|
trustedFastConsent: (provider) => `Enable trusted direct mode for ${provider}: send allowed project context, include current local changes, skip project validation checks, and immediately apply AI changes, including file deletions and configuration changes.`,
|
|
2794
2794
|
connectionNotTested: "Optional connection check not run",
|
|
2795
2795
|
workspaceNotChecked: "Local workspace not checked",
|
|
2796
|
-
checkingWorkspace: "Checking Git workspace and isolated execution
|
|
2796
|
+
checkingWorkspace: "Checking Git workspace and isolated execution…",
|
|
2797
2797
|
workspaceReady: "Local workspace is ready for isolated execution",
|
|
2798
|
-
workspaceDirty: (staged, unstaged, untracked) => `Local changes found
|
|
2798
|
+
workspaceDirty: (staged, unstaged, untracked) => `Local changes found · ${String(staged)} staged · ${String(unstaged)} unstaged · ${String(untracked)} untracked`,
|
|
2799
2799
|
includeLocalChanges: "Allow the Agent to continue from my current local changes",
|
|
2800
2800
|
includeLocalChangesHelp: "The Agent may edit these files. SpotPatch preserves the baseline and applies or reverts only the Agent delta.",
|
|
2801
2801
|
localChangesConsentRequired: "Confirm inclusion of current local changes before running AI.",
|
|
2802
2802
|
capabilityVerified: "Agent capability verified",
|
|
2803
2803
|
capabilityVerifiedAnnouncement: "AI provider capability verified.",
|
|
2804
|
-
testingCapability: "Testing authentication, tools, continuation, and streaming
|
|
2804
|
+
testingCapability: "Testing authentication, tools, continuation, and streaming…",
|
|
2805
2805
|
applying: "Applying changes to the project.",
|
|
2806
2806
|
cancelling: "Cancelling Agent job.",
|
|
2807
2807
|
reverting: "Reverting the applied Agent change.",
|
|
2808
2808
|
consentRequired: "Confirm remote provider data transmission before running AI.",
|
|
2809
2809
|
toolsReady: "tools and streaming ready",
|
|
2810
2810
|
testConnection: "Check environment",
|
|
2811
|
-
verifying: "Verifying
|
|
2811
|
+
verifying: "Verifying…",
|
|
2812
2812
|
run: "Run AI",
|
|
2813
2813
|
cancel: "Cancel agent",
|
|
2814
2814
|
discard: "Discard changes",
|
|
@@ -2859,7 +2859,7 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2859
2859
|
detachedTargetPreserved: "The page element was unloaded; its collected context remains selected.",
|
|
2860
2860
|
contextWarning: "Browser context collection completed with a warning.",
|
|
2861
2861
|
contextCollected: "Browser context collected.",
|
|
2862
|
-
editorOpening: "Opening source
|
|
2862
|
+
editorOpening: "Opening source…",
|
|
2863
2863
|
editorOpened: "Source opened in the editor.",
|
|
2864
2864
|
editorFailed: "Could not open the editor. Start it or configure editor.",
|
|
2865
2865
|
completeInstructions: "Add an instruction for every target and wait for context collection to finish.",
|
|
@@ -2871,166 +2871,166 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2871
2871
|
errors: ERROR_MESSAGES_EN
|
|
2872
2872
|
}),
|
|
2873
2873
|
"zh-CN": Object.freeze({
|
|
2874
|
-
localeName: "
|
|
2874
|
+
localeName: "中",
|
|
2875
2875
|
alternateLocaleName: "EN",
|
|
2876
|
-
switchLocale: "
|
|
2876
|
+
switchLocale: "将界面语言切换为英文",
|
|
2877
2877
|
brand: Object.freeze({
|
|
2878
2878
|
name: "SpotPatch",
|
|
2879
|
-
context: "
|
|
2880
|
-
repository: "GitHub
|
|
2881
|
-
repositoryTitle: "
|
|
2879
|
+
context: "实时上下文",
|
|
2880
|
+
repository: "GitHub ↗",
|
|
2881
|
+
repositoryTitle: "在 GitHub 上 Star SpotPatch"
|
|
2882
2882
|
}),
|
|
2883
2883
|
trigger: Object.freeze({
|
|
2884
|
-
select: "
|
|
2885
|
-
stop: "
|
|
2886
|
-
title: (shortcut) =>
|
|
2884
|
+
select: "选择元素",
|
|
2885
|
+
stop: "停止选择",
|
|
2886
|
+
title: (shortcut) => `切换 SpotPatch(${shortcut})`
|
|
2887
2887
|
}),
|
|
2888
2888
|
dialog: Object.freeze({
|
|
2889
|
-
close: "
|
|
2890
|
-
editTitle: "
|
|
2891
|
-
editSubtitle: "
|
|
2892
|
-
previewTitle: "
|
|
2893
|
-
previewSubtitle: "
|
|
2889
|
+
close: "关闭 SpotPatch",
|
|
2890
|
+
editTitle: "规划本次修改",
|
|
2891
|
+
editSubtitle: "为每个选中目标分别写清楚修改要求。",
|
|
2892
|
+
previewTitle: "审阅修改请求",
|
|
2893
|
+
previewSubtitle: "发送给 AI 前,请核对完整上下文与每项目标说明。"
|
|
2894
2894
|
}),
|
|
2895
2895
|
floatingSurface: Object.freeze({
|
|
2896
|
-
dragHandle: "
|
|
2897
|
-
resetPosition: "
|
|
2898
|
-
positionReset: "SpotPatch
|
|
2896
|
+
dragHandle: "拖拽以移动 SpotPatch 工作台",
|
|
2897
|
+
resetPosition: "重置工作台位置",
|
|
2898
|
+
positionReset: "SpotPatch 已恢复到右下角。"
|
|
2899
2899
|
}),
|
|
2900
2900
|
context: Object.freeze({
|
|
2901
|
-
collecting: "
|
|
2902
|
-
ready: "
|
|
2903
|
-
partial: "
|
|
2904
|
-
sourceUnavailable: "
|
|
2905
|
-
selectedElement: "
|
|
2906
|
-
selectedCount: (count) =>
|
|
2901
|
+
collecting: "正在采集上下文",
|
|
2902
|
+
ready: "上下文已就绪",
|
|
2903
|
+
partial: "部分上下文可用",
|
|
2904
|
+
sourceUnavailable: "源码位置不可用",
|
|
2905
|
+
selectedElement: "已选元素",
|
|
2906
|
+
selectedCount: (count) => `已选择 ${String(count)} 个元素`
|
|
2907
2907
|
}),
|
|
2908
2908
|
targets: Object.freeze({
|
|
2909
|
-
title: "
|
|
2910
|
-
ariaLabel: "
|
|
2909
|
+
title: "修改目标",
|
|
2910
|
+
ariaLabel: "已选目标与逐项目标说明",
|
|
2911
2911
|
count: (selected, maximum) => `${String(selected)} / ${String(maximum)}`,
|
|
2912
|
-
complete: (complete, total) =>
|
|
2913
|
-
instructionBudget: (used, maximum) =>
|
|
2914
|
-
instructionBudgetExceeded: (used, maximum) =>
|
|
2915
|
-
statusReady: "
|
|
2916
|
-
statusPartial: "
|
|
2917
|
-
statusCollecting: "
|
|
2918
|
-
instructionReady: "
|
|
2919
|
-
instructionMissing: "
|
|
2920
|
-
instructionLabel: (name) => `${name}
|
|
2921
|
-
instructionPlaceholder: "
|
|
2912
|
+
complete: (complete, total) => `已描述 ${String(complete)} / ${String(total)}`,
|
|
2913
|
+
instructionBudget: (used, maximum) => `说明字符 ${String(used)} / ${String(maximum)}`,
|
|
2914
|
+
instructionBudgetExceeded: (used, maximum) => `说明字符 ${String(used)} / ${String(maximum)},请精简后继续`,
|
|
2915
|
+
statusReady: "已就绪",
|
|
2916
|
+
statusPartial: "部分可用",
|
|
2917
|
+
statusCollecting: "采集中",
|
|
2918
|
+
instructionReady: "已填写修改说明",
|
|
2919
|
+
instructionMissing: "待填写修改说明",
|
|
2920
|
+
instructionLabel: (name) => `${name} 的修改说明`,
|
|
2921
|
+
instructionPlaceholder: "描述这个目标期望达到的结果,以及不能破坏的约束……",
|
|
2922
2922
|
instructionCount: (used, maximum) => `${String(used)} / ${String(maximum)}`,
|
|
2923
|
-
activate: (index) =>
|
|
2924
|
-
remove: (index) =>
|
|
2925
|
-
removeTitle: "
|
|
2926
|
-
addTitle: "
|
|
2927
|
-
limitTitle: (maximum) =>
|
|
2923
|
+
activate: (index) => `编辑目标 ${String(index)}`,
|
|
2924
|
+
remove: (index) => `移除目标 ${String(index)}`,
|
|
2925
|
+
removeTitle: "移除目标",
|
|
2926
|
+
addTitle: "继续为本次请求选择元素",
|
|
2927
|
+
limitTitle: (maximum) => `已达到 ${String(maximum)} 个目标的上限`
|
|
2928
2928
|
}),
|
|
2929
2929
|
diagnostics: Object.freeze({
|
|
2930
|
-
title: "
|
|
2931
|
-
resolving: "
|
|
2932
|
-
noExactSource: "
|
|
2933
|
-
promptAriaLabel: "
|
|
2930
|
+
title: "已采集上下文",
|
|
2931
|
+
resolving: "正在解析源码……",
|
|
2932
|
+
noExactSource: "没有精确源码标记",
|
|
2933
|
+
promptAriaLabel: "生成的 Prompt"
|
|
2934
2934
|
}),
|
|
2935
2935
|
summary: SUMMARY_MESSAGES_ZH,
|
|
2936
2936
|
actions: Object.freeze({
|
|
2937
|
-
addElement: "
|
|
2938
|
-
reselect: "
|
|
2939
|
-
openEditor: "
|
|
2940
|
-
openTarget: (index) =>
|
|
2941
|
-
preview: "
|
|
2942
|
-
copy: "
|
|
2943
|
-
back: "
|
|
2937
|
+
addElement: "添加元素",
|
|
2938
|
+
reselect: "重新开始",
|
|
2939
|
+
openEditor: "打开源码",
|
|
2940
|
+
openTarget: (index) => `打开目标 ${String(index)} 的源码`,
|
|
2941
|
+
preview: "预览 Prompt",
|
|
2942
|
+
copy: "复制 Prompt",
|
|
2943
|
+
back: "返回编辑"
|
|
2944
2944
|
}),
|
|
2945
2945
|
agent: Object.freeze({
|
|
2946
|
-
title: "AI
|
|
2947
|
-
mode: "
|
|
2948
|
-
review: "
|
|
2949
|
-
autoGated: "
|
|
2950
|
-
trustedFast: "
|
|
2951
|
-
provider: "
|
|
2952
|
-
model: "
|
|
2953
|
-
providerAriaLabel: "AI
|
|
2954
|
-
modelAriaLabel: "AI
|
|
2955
|
-
providerUnavailable: "
|
|
2956
|
-
consent: (provider) =>
|
|
2957
|
-
trustedFastConsent: (provider) =>
|
|
2958
|
-
connectionNotTested: "
|
|
2959
|
-
workspaceNotChecked: "
|
|
2960
|
-
checkingWorkspace: "
|
|
2961
|
-
workspaceReady: "
|
|
2962
|
-
workspaceDirty: (staged, unstaged, untracked) =>
|
|
2963
|
-
includeLocalChanges: "
|
|
2964
|
-
includeLocalChangesHelp: "Agent
|
|
2965
|
-
localChangesConsentRequired: "
|
|
2966
|
-
capabilityVerified: "Agent
|
|
2967
|
-
capabilityVerifiedAnnouncement: "AI
|
|
2968
|
-
testingCapability: "
|
|
2969
|
-
applying: "
|
|
2970
|
-
cancelling: "
|
|
2971
|
-
reverting: "
|
|
2972
|
-
consentRequired: "
|
|
2973
|
-
toolsReady: "
|
|
2974
|
-
testConnection: "
|
|
2975
|
-
verifying: "
|
|
2976
|
-
run: "
|
|
2977
|
-
cancel: "
|
|
2978
|
-
discard: "
|
|
2979
|
-
apply: "
|
|
2980
|
-
revert: "
|
|
2981
|
-
revise: "
|
|
2982
|
-
diffAriaLabel: "
|
|
2983
|
-
noOutput: "
|
|
2946
|
+
title: "AI 代码 Agent",
|
|
2947
|
+
mode: "执行方式",
|
|
2948
|
+
review: "审阅模式",
|
|
2949
|
+
autoGated: "受控自动模式",
|
|
2950
|
+
trustedFast: "可信极速模式",
|
|
2951
|
+
provider: "模型服务",
|
|
2952
|
+
model: "模型",
|
|
2953
|
+
providerAriaLabel: "AI 模型服务",
|
|
2954
|
+
modelAriaLabel: "AI 模型",
|
|
2955
|
+
providerUnavailable: "模型服务配置不可用。",
|
|
2956
|
+
consent: (provider) => `我了解选中上下文与获准源码可能发送到 ${provider},并自行负责其数据策略。`,
|
|
2957
|
+
trustedFastConsent: (provider) => `为 ${provider} 启用可信极速模式:发送获准的项目上下文、纳入当前本地修改、跳过项目验证检查,并立即应用 AI 变更,包括删除文件与配置变更。`,
|
|
2958
|
+
connectionNotTested: "尚未执行可选连接检查",
|
|
2959
|
+
workspaceNotChecked: "尚未检查本地工作区",
|
|
2960
|
+
checkingWorkspace: "正在检查 Git 工作区与隔离执行环境……",
|
|
2961
|
+
workspaceReady: "本地工作区已满足隔离执行条件",
|
|
2962
|
+
workspaceDirty: (staged, unstaged, untracked) => `发现本地修改 · 暂存 ${String(staged)} · 未暂存 ${String(unstaged)} · 未跟踪 ${String(untracked)}`,
|
|
2963
|
+
includeLocalChanges: "允许 Agent 基于我当前的本地修改继续",
|
|
2964
|
+
includeLocalChangesHelp: "Agent 可能继续修改这些文件;SpotPatch 会保留原基线,仅应用或撤销 Agent 自己的增量。",
|
|
2965
|
+
localChangesConsentRequired: "运行 AI 前,请确认允许纳入当前本地修改。",
|
|
2966
|
+
capabilityVerified: "Agent 能力验证通过",
|
|
2967
|
+
capabilityVerifiedAnnouncement: "AI 模型服务能力验证通过。",
|
|
2968
|
+
testingCapability: "正在验证鉴权、工具调用、连续调用与流式响应……",
|
|
2969
|
+
applying: "正在将变更应用到项目。",
|
|
2970
|
+
cancelling: "正在取消 Agent 任务。",
|
|
2971
|
+
reverting: "正在撤销已应用的 Agent 变更。",
|
|
2972
|
+
consentRequired: "运行 AI 前,请先确认允许向远程模型服务传输数据。",
|
|
2973
|
+
toolsReady: "工具调用与流式响应已就绪",
|
|
2974
|
+
testConnection: "检查运行环境",
|
|
2975
|
+
verifying: "验证中……",
|
|
2976
|
+
run: "运行 AI",
|
|
2977
|
+
cancel: "取消 Agent",
|
|
2978
|
+
discard: "放弃变更",
|
|
2979
|
+
apply: "应用变更",
|
|
2980
|
+
revert: "撤销变更",
|
|
2981
|
+
revise: "修改请求",
|
|
2982
|
+
diffAriaLabel: "建议的源码差异",
|
|
2983
|
+
noOutput: "没有输出。",
|
|
2984
2984
|
status: (status) => STATUS_ZH[status]
|
|
2985
2985
|
}),
|
|
2986
2986
|
execution: Object.freeze({
|
|
2987
2987
|
claude: "Claude",
|
|
2988
2988
|
codex: "Codex",
|
|
2989
|
-
receivingTitle: "
|
|
2990
|
-
dispatchingTitle: (identity) =>
|
|
2991
|
-
runningTitle: (target2) =>
|
|
2992
|
-
expandedRunningTitle: (identity) => `${identity}
|
|
2993
|
-
completedTitle: "
|
|
2994
|
-
expandedCompletedTitle: "
|
|
2995
|
-
failedTitle: "
|
|
2996
|
-
receivingStatus: "
|
|
2997
|
-
dispatchingStatus: "
|
|
2998
|
-
runningStatus: "
|
|
2999
|
-
checkingStatus: "
|
|
3000
|
-
completedStatus: "
|
|
3001
|
-
failedStatus: "
|
|
3002
|
-
resultReturned: "
|
|
3003
|
-
resultSummary: (files) => `${String(files)}
|
|
2989
|
+
receivingTitle: "正在接收上下文",
|
|
2990
|
+
dispatchingTitle: (identity) => `正在交接给 ${identity}`,
|
|
2991
|
+
runningTitle: (target2) => `正在修改 ${target2}`,
|
|
2992
|
+
expandedRunningTitle: (identity) => `${identity} 正在执行修改`,
|
|
2993
|
+
completedTitle: "修改完成",
|
|
2994
|
+
expandedCompletedTitle: "修改已完成",
|
|
2995
|
+
failedTitle: "执行失败",
|
|
2996
|
+
receivingStatus: "接收中",
|
|
2997
|
+
dispatchingStatus: "派发中",
|
|
2998
|
+
runningStatus: "执行中",
|
|
2999
|
+
checkingStatus: "检查中",
|
|
3000
|
+
completedStatus: "完成",
|
|
3001
|
+
failedStatus: "失败",
|
|
3002
|
+
resultReturned: "结果已回流 SpotPatch",
|
|
3003
|
+
resultSummary: (files) => `${String(files)} 个文件`,
|
|
3004
3004
|
activityAction: (kind, detail) => executionActivityAction(EXECUTION_ACTIVITY_ZH, kind, detail),
|
|
3005
3005
|
activityLane: executionActivityLane
|
|
3006
3006
|
}),
|
|
3007
3007
|
announcements: Object.freeze({
|
|
3008
|
-
adapterDisabled: "React
|
|
3009
|
-
selectionEnabled: "
|
|
3010
|
-
chooseAnother: "
|
|
3011
|
-
reselectAfterChange: "
|
|
3012
|
-
sourceLoaded: "
|
|
3013
|
-
sourceFailed: "
|
|
3014
|
-
addCancelled: "
|
|
3015
|
-
selectionLimit: (maximum) =>
|
|
3016
|
-
chooseAdditional: (selected, maximum) =>
|
|
3017
|
-
duplicate: "
|
|
3018
|
-
sourceProbable: "
|
|
3019
|
-
sourceMissing: "
|
|
3020
|
-
noSelectable: "
|
|
3021
|
-
allTargetsRemoved: "
|
|
3022
|
-
targetRemoved: "
|
|
3023
|
-
detachedTargetPreserved: "
|
|
3024
|
-
contextWarning: "
|
|
3025
|
-
contextCollected: "
|
|
3026
|
-
editorOpening: "
|
|
3027
|
-
editorOpened: "
|
|
3028
|
-
editorFailed: "
|
|
3029
|
-
completeInstructions: "
|
|
3030
|
-
promptCopied: "Prompt
|
|
3031
|
-
clipboardUnavailable: "
|
|
3032
|
-
copyFailed: "
|
|
3033
|
-
appliedTargetsDetached: "
|
|
3008
|
+
adapterDisabled: "React 适配器异常,本次会话已停用 React 检查。",
|
|
3009
|
+
selectionEnabled: "元素选择已启用。",
|
|
3010
|
+
chooseAnother: "请选择另一个元素。",
|
|
3011
|
+
reselectAfterChange: "文件变更后,请重新选择当前页面元素。",
|
|
3012
|
+
sourceLoaded: "源码上下文已加载。",
|
|
3013
|
+
sourceFailed: "源码上下文加载失败。",
|
|
3014
|
+
addCancelled: "已取消追加选择。",
|
|
3015
|
+
selectionLimit: (maximum) => `已达到 ${String(maximum)} 个元素的选择上限。`,
|
|
3016
|
+
chooseAdditional: (selected, maximum) => `请选择另一个元素,当前已选 ${String(selected)} / ${String(maximum)}。`,
|
|
3017
|
+
duplicate: "该源码目标已经在当前选择中。",
|
|
3018
|
+
sourceProbable: "找到可能的 React 组件,但没有获授权的源码标记。",
|
|
3019
|
+
sourceMissing: "选中元素没有获授权的源码标记。",
|
|
3020
|
+
noSelectable: "当前位置没有可选择的元素。",
|
|
3021
|
+
allTargetsRemoved: "已移除全部目标,请重新选择元素。",
|
|
3022
|
+
targetRemoved: "已移除选中目标。",
|
|
3023
|
+
detachedTargetPreserved: "页面元素已卸载,已采集的上下文仍保留在选择中。",
|
|
3024
|
+
contextWarning: "浏览器上下文采集完成,但存在警告。",
|
|
3025
|
+
contextCollected: "浏览器上下文采集完成。",
|
|
3026
|
+
editorOpening: "正在打开源码……",
|
|
3027
|
+
editorOpened: "源码已在编辑器中打开。",
|
|
3028
|
+
editorFailed: "无法打开编辑器。请先启动编辑器或检查 editor 配置。",
|
|
3029
|
+
completeInstructions: "请为每个目标填写修改说明,并等待上下文采集完成。",
|
|
3030
|
+
promptCopied: "Prompt 已复制到剪贴板。",
|
|
3031
|
+
clipboardUnavailable: "无法访问剪贴板,请手动选择并复制 Prompt。",
|
|
3032
|
+
copyFailed: "复制失败,请手动选择并复制 Prompt。",
|
|
3033
|
+
appliedTargetsDetached: "变更已应用;HMR 后请重新选择页面元素再发起新请求。"
|
|
3034
3034
|
}),
|
|
3035
3035
|
errors: ERROR_MESSAGES_ZH
|
|
3036
3036
|
})
|
|
@@ -4032,7 +4032,7 @@ function createStyles(document) {
|
|
|
4032
4032
|
.spotpatch-diagnostics > summary::-webkit-details-marker { display: none; }
|
|
4033
4033
|
.spotpatch-diagnostics > summary::before {
|
|
4034
4034
|
color: #778193;
|
|
4035
|
-
content: "
|
|
4035
|
+
content: "›";
|
|
4036
4036
|
font-size: 16px;
|
|
4037
4037
|
line-height: 1;
|
|
4038
4038
|
transform: rotate(0deg);
|
|
@@ -4120,7 +4120,7 @@ function createStyles(document) {
|
|
|
4120
4120
|
box-shadow: 0 8px 20px -8px rgb(139 123 255 / 55%);
|
|
4121
4121
|
}
|
|
4122
4122
|
.spotpatch-actions .spotpatch-primary:hover:not(:disabled) { color: var(--spotpatch-text-on-accent); filter: brightness(1.08); }
|
|
4123
|
-
.spotpatch-actions .spotpatch-primary::after { margin-left: 8px; content: "
|
|
4123
|
+
.spotpatch-actions .spotpatch-primary::after { margin-left: 8px; content: "↗"; font-size: 12px; }
|
|
4124
4124
|
.spotpatch-actions .spotpatch-secondary-action {
|
|
4125
4125
|
min-height: 30px;
|
|
4126
4126
|
border-style: dashed;
|
|
@@ -4214,7 +4214,7 @@ function createFallbackExecutionIsland(document) {
|
|
|
4214
4214
|
root,
|
|
4215
4215
|
setExpanded: () => void 0,
|
|
4216
4216
|
render(projection) {
|
|
4217
|
-
const text2 = [projection.headline, projection.action, projection.meta].filter((value) => value.length > 0).join("
|
|
4217
|
+
const text2 = [projection.headline, projection.action, projection.meta].filter((value) => value.length > 0).join(" · ");
|
|
4218
4218
|
copy.textContent = text2;
|
|
4219
4219
|
root.setAttribute("aria-label", text2);
|
|
4220
4220
|
},
|
|
@@ -4316,8 +4316,8 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4316
4316
|
repositoryLink.target = "_blank";
|
|
4317
4317
|
repositoryLink.rel = "noopener noreferrer";
|
|
4318
4318
|
const localeButton = createButton(document, "", "spotpatch-locale");
|
|
4319
|
-
const resetPositionButton = createButton(document, "
|
|
4320
|
-
const closeButton = createButton(document, "
|
|
4319
|
+
const resetPositionButton = createButton(document, "⌖", "spotpatch-reset-position");
|
|
4320
|
+
const closeButton = createButton(document, "×", "spotpatch-close");
|
|
4321
4321
|
headerControls.append(repositoryLink, localeButton, resetPositionButton, closeButton);
|
|
4322
4322
|
brandRow.append(brand, headerControls);
|
|
4323
4323
|
const title = createMarkedElement(document, "h2");
|
|
@@ -4441,7 +4441,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4441
4441
|
addTargetButton.classList.add("spotpatch-icon-action");
|
|
4442
4442
|
addTargetButton.dataset.compactIcon = "+";
|
|
4443
4443
|
agentPanel.testButton.classList.add("spotpatch-icon-action");
|
|
4444
|
-
agentPanel.testButton.dataset.compactIcon = "
|
|
4444
|
+
agentPanel.testButton.dataset.compactIcon = "✓";
|
|
4445
4445
|
openEditorButton.classList.add("spotpatch-secondary-action");
|
|
4446
4446
|
reselectButton.classList.add("spotpatch-secondary-action");
|
|
4447
4447
|
secondaryActions.append(openEditorButton, reselectButton);
|
|
@@ -4560,7 +4560,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4560
4560
|
}
|
|
4561
4561
|
function currentTargetContext() {
|
|
4562
4562
|
const target2 = currentTargetSummary();
|
|
4563
|
-
return target2.source.length === 0 ? target2.label : `${target2.label}
|
|
4563
|
+
return target2.source.length === 0 ? target2.label : `${target2.label} · ${target2.source}`;
|
|
4564
4564
|
}
|
|
4565
4565
|
function beginObservedExecution() {
|
|
4566
4566
|
observedExecutionStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -4895,7 +4895,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4895
4895
|
name.textContent = target2.label;
|
|
4896
4896
|
const source2 = createMarkedElement(document, "span");
|
|
4897
4897
|
source2.className = "spotpatch-target-source";
|
|
4898
|
-
source2.textContent = `${statusText(target2)}
|
|
4898
|
+
source2.textContent = `${statusText(target2)} · ${target2.source}`;
|
|
4899
4899
|
copy.append(name, source2);
|
|
4900
4900
|
const instructionComplete = target2.instruction.trim().length > 0;
|
|
4901
4901
|
const state = createMarkedElement(document, "span");
|
|
@@ -4903,12 +4903,12 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4903
4903
|
state.dataset.complete = String(instructionComplete);
|
|
4904
4904
|
state.textContent = instructionComplete ? messages.targets.instructionReady : messages.targets.instructionMissing;
|
|
4905
4905
|
select.append(number, copy, state);
|
|
4906
|
-
const open = createButton(document, "
|
|
4906
|
+
const open = createButton(document, "↗", "spotpatch-target-open");
|
|
4907
4907
|
open.dataset.openTargetId = target2.id;
|
|
4908
4908
|
open.disabled = !target2.canOpenEditor;
|
|
4909
4909
|
open.setAttribute("aria-label", messages.actions.openTarget(index + 1));
|
|
4910
4910
|
open.title = messages.actions.openTarget(index + 1);
|
|
4911
|
-
const remove = createButton(document, "
|
|
4911
|
+
const remove = createButton(document, "×", "spotpatch-target-remove");
|
|
4912
4912
|
remove.dataset.removeTargetId = target2.id;
|
|
4913
4913
|
remove.disabled = !editingEnabled;
|
|
4914
4914
|
remove.setAttribute("aria-label", messages.targets.remove(index + 1));
|
|
@@ -5011,7 +5011,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
5011
5011
|
box.style.width = `${String(target2.rect.width)}px`;
|
|
5012
5012
|
box.style.height = `${String(target2.rect.height)}px`;
|
|
5013
5013
|
const label = createMarkedElement(document, "span");
|
|
5014
|
-
label.textContent = `${String(index + 1)}
|
|
5014
|
+
label.textContent = `${String(index + 1)} · ${target2.label}`;
|
|
5015
5015
|
box.append(label);
|
|
5016
5016
|
selectionHighlights.append(box);
|
|
5017
5017
|
}
|
|
@@ -5512,7 +5512,7 @@ function activityFromEvent(event) {
|
|
|
5512
5512
|
key: `tool:${String(event.data.turn)}:${event.data.toolCallId}`,
|
|
5513
5513
|
kind: toolActivityKind(event.data.toolName),
|
|
5514
5514
|
...detail === void 0 ? {} : { detail },
|
|
5515
|
-
label: `${event.data.toolName}${detail === void 0 ? "" : `
|
|
5515
|
+
label: `${event.data.toolName}${detail === void 0 ? "" : ` · ${detail}`} · ${event.data.state}`,
|
|
5516
5516
|
state: event.data.state === "started" ? "active" : event.data.state === "succeeded" ? "success" : "failure"
|
|
5517
5517
|
});
|
|
5518
5518
|
}
|
|
@@ -5521,7 +5521,7 @@ function activityFromEvent(event) {
|
|
|
5521
5521
|
key: `check:${event.data.result.checkId}:${String(event.sequence)}`,
|
|
5522
5522
|
kind: "check",
|
|
5523
5523
|
detail: event.data.result.label,
|
|
5524
|
-
label: `${event.data.result.label}
|
|
5524
|
+
label: `${event.data.result.label} · ${event.data.result.status}`,
|
|
5525
5525
|
state: event.data.result.status === "passed" ? "success" : event.data.result.status === "failed" || event.data.result.status === "timed-out" ? "failure" : "info"
|
|
5526
5526
|
});
|
|
5527
5527
|
}
|