@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.cjs
CHANGED
|
@@ -632,7 +632,7 @@ var import_shared4 = require("@spotpatch/shared");
|
|
|
632
632
|
var MAX_ATTRIBUTE_CHARACTERS = 500;
|
|
633
633
|
var MAX_SVG_PATH_CHARACTERS = 256;
|
|
634
634
|
function truncate(value, maxCharacters) {
|
|
635
|
-
return value.length <= maxCharacters ? value : `${value.slice(0, Math.max(0, maxCharacters - 1))}
|
|
635
|
+
return value.length <= maxCharacters ? value : `${value.slice(0, Math.max(0, maxCharacters - 1))}…`;
|
|
636
636
|
}
|
|
637
637
|
function isSensitiveAttributeName(name) {
|
|
638
638
|
return (0, import_shared4.isSensitiveName)(name);
|
|
@@ -645,7 +645,7 @@ function sanitizeAttributeValue(name, value, baseUrl) {
|
|
|
645
645
|
return (0, import_shared4.sanitizeUrl)(value, baseUrl);
|
|
646
646
|
}
|
|
647
647
|
if (name === "d" && value.length > MAX_SVG_PATH_CHARACTERS) {
|
|
648
|
-
return `${value.slice(0, MAX_SVG_PATH_CHARACTERS)}
|
|
648
|
+
return `${value.slice(0, MAX_SVG_PATH_CHARACTERS)}…`;
|
|
649
649
|
}
|
|
650
650
|
return truncate((0, import_shared4.redactSensitiveText)(value), MAX_ATTRIBUTE_CHARACTERS);
|
|
651
651
|
}
|
|
@@ -950,7 +950,7 @@ function serializeElement(element2, depth, state, lines) {
|
|
|
950
950
|
const text2 = normalizedText(child.textContent ?? "");
|
|
951
951
|
if (text2.length > 0) {
|
|
952
952
|
state.nodeCount += 1;
|
|
953
|
-
const truncated = text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}
|
|
953
|
+
const truncated = text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}…`;
|
|
954
954
|
lines.push(`${" ".repeat(depth + 1)}${escapeHtml(truncated)}`);
|
|
955
955
|
}
|
|
956
956
|
continue;
|
|
@@ -965,7 +965,7 @@ function serializeElement(element2, depth, state, lines) {
|
|
|
965
965
|
serializeElement(child, depth + 1, state, lines);
|
|
966
966
|
}
|
|
967
967
|
if (state.truncated && depth === 0) {
|
|
968
|
-
lines.push("
|
|
968
|
+
lines.push(" …");
|
|
969
969
|
}
|
|
970
970
|
lines.push(`${indent}</${tagName}>`);
|
|
971
971
|
}
|
|
@@ -982,7 +982,7 @@ function truncateContext(value, maxCharacters) {
|
|
|
982
982
|
if (value.length <= maxCharacters) {
|
|
983
983
|
return value;
|
|
984
984
|
}
|
|
985
|
-
return `${value.slice(0, Math.max(0, maxCharacters - 1)).trimEnd()}
|
|
985
|
+
return `${value.slice(0, Math.max(0, maxCharacters - 1)).trimEnd()}…`;
|
|
986
986
|
}
|
|
987
987
|
function escapeCssIdentifier(value) {
|
|
988
988
|
return Array.from(value).map(
|
|
@@ -1038,7 +1038,7 @@ function collectElementContext(options) {
|
|
|
1038
1038
|
selector: createSelector(options.element),
|
|
1039
1039
|
sanitizedHtml: truncateContext(lines.join("\n"), options.maxCharacters),
|
|
1040
1040
|
...text2.length === 0 ? {} : {
|
|
1041
|
-
textPreview: text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}
|
|
1041
|
+
textPreview: text2.length <= DOM_COLLECTION_LIMITS.maxTextCharacters ? text2 : `${text2.slice(0, DOM_COLLECTION_LIMITS.maxTextCharacters)}…`
|
|
1042
1042
|
},
|
|
1043
1043
|
...role === null ? {} : { role },
|
|
1044
1044
|
rect: Object.freeze({
|
|
@@ -1207,36 +1207,36 @@ var PROMPT_MESSAGES = Object.freeze({
|
|
|
1207
1207
|
none: "None"
|
|
1208
1208
|
}),
|
|
1209
1209
|
"zh-CN": Object.freeze({
|
|
1210
|
-
adapter: "
|
|
1211
|
-
boundary: "
|
|
1212
|
-
code: "
|
|
1213
|
-
component: "
|
|
1214
|
-
computedStyles: "
|
|
1215
|
-
confidence: "
|
|
1216
|
-
devicePixelRatio: "
|
|
1217
|
-
element: "
|
|
1218
|
-
file: "
|
|
1219
|
-
modificationConstraint: "
|
|
1220
|
-
modificationRequirements: "
|
|
1221
|
-
origin: "
|
|
1222
|
-
pageEnvironment: "
|
|
1223
|
-
pathname: "
|
|
1224
|
-
reactContext: "React
|
|
1210
|
+
adapter: "适配器",
|
|
1211
|
+
boundary: "代码边界",
|
|
1212
|
+
code: "附近代码",
|
|
1213
|
+
component: "组件",
|
|
1214
|
+
computedStyles: "关键计算样式",
|
|
1215
|
+
confidence: "置信度",
|
|
1216
|
+
devicePixelRatio: "设备像素比",
|
|
1217
|
+
element: "选中元素",
|
|
1218
|
+
file: "文件",
|
|
1219
|
+
modificationConstraint: "请先判断根因,再把每个目标各自的修改说明作为一个原子任务,完成一致且最小范围的修改。不要合并、忽略或扩大目标说明,不要改动无关组件;如果上下文不足,请明确说明需要哪些信息。",
|
|
1220
|
+
modificationRequirements: "修改要求",
|
|
1221
|
+
origin: "定位来源",
|
|
1222
|
+
pageEnvironment: "页面环境",
|
|
1223
|
+
pathname: "路径",
|
|
1224
|
+
reactContext: "React 上下文",
|
|
1225
1225
|
reactVersion: "React",
|
|
1226
|
-
requestedChange: "
|
|
1227
|
-
selectedTargets: (count) =>
|
|
1228
|
-
source: "
|
|
1229
|
-
stack: "
|
|
1230
|
-
styles: "
|
|
1231
|
-
supported: "
|
|
1232
|
-
target: (index) =>
|
|
1233
|
-
title: "
|
|
1234
|
-
unavailable: "
|
|
1235
|
-
unsupported: "
|
|
1226
|
+
requestedChange: "修改说明",
|
|
1227
|
+
selectedTargets: (count) => `已选目标(${String(count)})`,
|
|
1228
|
+
source: "源码定位",
|
|
1229
|
+
stack: "组件栈",
|
|
1230
|
+
styles: "相关样式",
|
|
1231
|
+
supported: "支持",
|
|
1232
|
+
target: (index) => `目标 ${String(index)}`,
|
|
1233
|
+
title: "标题",
|
|
1234
|
+
unavailable: "不可用",
|
|
1235
|
+
unsupported: "不支持",
|
|
1236
1236
|
url: "URL",
|
|
1237
|
-
viewport: "
|
|
1238
|
-
warnings: "
|
|
1239
|
-
none: "
|
|
1237
|
+
viewport: "视口",
|
|
1238
|
+
warnings: "采集警告",
|
|
1239
|
+
none: "无"
|
|
1240
1240
|
})
|
|
1241
1241
|
});
|
|
1242
1242
|
function longestBacktickRun(value) {
|
|
@@ -1339,7 +1339,7 @@ function renderPrompt(annotation, draft) {
|
|
|
1339
1339
|
`- ${messages.url}: <${pageUrl}>
|
|
1340
1340
|
- ${messages.pathname}: ${(0, import_shared4.redactSensitiveText)(annotation.page.pathname)}
|
|
1341
1341
|
- ${messages.title}: ${draft.pageTitle.length === 0 ? messages.unavailable : draft.pageTitle}
|
|
1342
|
-
- ${messages.viewport}: ${String(annotation.page.viewportWidth)}
|
|
1342
|
+
- ${messages.viewport}: ${String(annotation.page.viewportWidth)} × ${String(annotation.page.viewportHeight)}
|
|
1343
1343
|
- ${messages.devicePixelRatio}: ${String(annotation.page.devicePixelRatio)}`,
|
|
1344
1344
|
`## ${messages.selectedTargets(annotation.targets.length)}`,
|
|
1345
1345
|
annotation.targets.map((target2, index) => {
|
|
@@ -1362,7 +1362,7 @@ function shrinkCode(target2, draft) {
|
|
|
1362
1362
|
if (line.length <= 120) {
|
|
1363
1363
|
draft.codeLines = [];
|
|
1364
1364
|
} else {
|
|
1365
|
-
draft.codeLines = [`${line.slice(0, 119)}
|
|
1365
|
+
draft.codeLines = [`${line.slice(0, 119)}…`];
|
|
1366
1366
|
}
|
|
1367
1367
|
return true;
|
|
1368
1368
|
}
|
|
@@ -1954,7 +1954,7 @@ var AGENT_PANEL_STYLES = `
|
|
|
1954
1954
|
}
|
|
1955
1955
|
.spotpatch-agent-activity { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
|
|
1956
1956
|
.spotpatch-agent-activity li { display: flex; gap: 8px; color: #929bab; font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
1957
|
-
.spotpatch-agent-activity li::before { color: #64748b; content: "
|
|
1957
|
+
.spotpatch-agent-activity li::before { color: #64748b; content: "•"; }
|
|
1958
1958
|
.spotpatch-agent-activity li[data-state="active"]::before { color: #fbbf24; }
|
|
1959
1959
|
.spotpatch-agent-activity li[data-state="success"]::before { color: #34d399; }
|
|
1960
1960
|
.spotpatch-agent-activity li[data-state="failure"]::before { color: #fb7185; }
|
|
@@ -2234,7 +2234,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2234
2234
|
}
|
|
2235
2235
|
const snapshot = latestSnapshot;
|
|
2236
2236
|
const result = latestResult;
|
|
2237
|
-
jobModel.textContent = `${snapshot.providerLabel}
|
|
2237
|
+
jobModel.textContent = `${snapshot.providerLabel} · ${snapshot.modelLabel}`;
|
|
2238
2238
|
jobStatus.textContent = messages.agent.status(snapshot.status);
|
|
2239
2239
|
phase.textContent = snapshot.phaseMessage;
|
|
2240
2240
|
const jobErrorCode = latestErrorCode ?? snapshot.errorCode;
|
|
@@ -2260,7 +2260,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2260
2260
|
for (const check of result?.checks ?? []) {
|
|
2261
2261
|
const details = createMarkedElement(document, "details");
|
|
2262
2262
|
const checkTitle = createMarkedElement(document, "summary");
|
|
2263
|
-
checkTitle.textContent = `${check.label}: ${check.status}
|
|
2263
|
+
checkTitle.textContent = `${check.label}: ${check.status} · ${String(check.durationMs)} ms`;
|
|
2264
2264
|
const output = createMarkedElement(document, "pre");
|
|
2265
2265
|
output.textContent = check.output.length === 0 ? messages.agent.noOutput : check.output;
|
|
2266
2266
|
details.append(checkTitle, output);
|
|
@@ -2299,7 +2299,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2299
2299
|
} else if (latestCapabilityState === "probing") {
|
|
2300
2300
|
capability.textContent = messages.agent.testingCapability;
|
|
2301
2301
|
} else if (latestCapabilityState === "ready") {
|
|
2302
|
-
capability.textContent = `${messages.agent.capabilityVerified}
|
|
2302
|
+
capability.textContent = `${messages.agent.capabilityVerified} · ${messages.agent.toolsReady}`;
|
|
2303
2303
|
} else if (latestCapabilityErrorCode !== void 0) {
|
|
2304
2304
|
capability.textContent = messages.errors[latestCapabilityErrorCode];
|
|
2305
2305
|
} else if (selectedProvider() === void 0) {
|
|
@@ -2350,7 +2350,7 @@ function createAgentPanel(document, ai, localizer) {
|
|
|
2350
2350
|
capabilityProbing = state === "probing";
|
|
2351
2351
|
capabilityReady = state === "ready" && capabilitySnapshot?.state === "agent-ready";
|
|
2352
2352
|
capability.dataset.state = state;
|
|
2353
|
-
capability.textContent = capabilitySnapshot?.state === "agent-ready" ? `${message}
|
|
2353
|
+
capability.textContent = capabilitySnapshot?.state === "agent-ready" ? `${message} · ${messages.agent.toolsReady}` : message;
|
|
2354
2354
|
refreshActions();
|
|
2355
2355
|
},
|
|
2356
2356
|
renderWorkspaceHealth(state, snapshot, errorCode) {
|
|
@@ -2582,19 +2582,19 @@ var STATUS_EN = Object.freeze({
|
|
|
2582
2582
|
failed: "Failed"
|
|
2583
2583
|
});
|
|
2584
2584
|
var STATUS_ZH = Object.freeze({
|
|
2585
|
-
queued: "
|
|
2586
|
-
preparing: "
|
|
2587
|
-
running: "
|
|
2588
|
-
validating: "
|
|
2589
|
-
"awaiting-review": "
|
|
2590
|
-
applying: "
|
|
2591
|
-
applied: "
|
|
2592
|
-
completed: "
|
|
2593
|
-
cancelling: "
|
|
2594
|
-
cancelled: "
|
|
2595
|
-
reverting: "
|
|
2596
|
-
reverted: "
|
|
2597
|
-
failed: "
|
|
2585
|
+
queued: "已排队",
|
|
2586
|
+
preparing: "准备中",
|
|
2587
|
+
running: "执行中",
|
|
2588
|
+
validating: "验证中",
|
|
2589
|
+
"awaiting-review": "等待审阅",
|
|
2590
|
+
applying: "应用中",
|
|
2591
|
+
applied: "已应用",
|
|
2592
|
+
completed: "已完成",
|
|
2593
|
+
cancelling: "取消中",
|
|
2594
|
+
cancelled: "已取消",
|
|
2595
|
+
reverting: "撤销中",
|
|
2596
|
+
reverted: "已撤销",
|
|
2597
|
+
failed: "失败"
|
|
2598
2598
|
});
|
|
2599
2599
|
var EXECUTION_ACTIVITY_EN = Object.freeze({
|
|
2600
2600
|
prepare: "Preparing context",
|
|
@@ -2610,17 +2610,17 @@ var EXECUTION_ACTIVITY_EN = Object.freeze({
|
|
|
2610
2610
|
unknown: "Processing the current task"
|
|
2611
2611
|
});
|
|
2612
2612
|
var EXECUTION_ACTIVITY_ZH = Object.freeze({
|
|
2613
|
-
prepare: "
|
|
2614
|
-
dispatch: "
|
|
2615
|
-
discover: "
|
|
2616
|
-
search: "
|
|
2617
|
-
read: "
|
|
2618
|
-
patch: "
|
|
2619
|
-
check: "
|
|
2620
|
-
audit: "
|
|
2621
|
-
apply: "
|
|
2622
|
-
sync: "
|
|
2623
|
-
unknown: "
|
|
2613
|
+
prepare: "正在准备上下文",
|
|
2614
|
+
dispatch: "正在派发上下文",
|
|
2615
|
+
discover: "正在查找项目文件",
|
|
2616
|
+
search: "正在搜索源码",
|
|
2617
|
+
read: "正在读取",
|
|
2618
|
+
patch: "正在生成最小修改补丁",
|
|
2619
|
+
check: "正在运行",
|
|
2620
|
+
audit: "正在审计候选修改",
|
|
2621
|
+
apply: "正在应用已验证修改",
|
|
2622
|
+
sync: "正在将结果回流 SpotPatch",
|
|
2623
|
+
unknown: "正在处理当前任务"
|
|
2624
2624
|
});
|
|
2625
2625
|
var EXECUTION_LANE_LABELS = Object.freeze({
|
|
2626
2626
|
prepare: "prepare",
|
|
@@ -2639,10 +2639,10 @@ function executionActivityAction(labels, kind, detail) {
|
|
|
2639
2639
|
return detail === void 0 || detail.length === 0 ? labels[kind] : `${labels[kind]} ${detail}`;
|
|
2640
2640
|
}
|
|
2641
2641
|
function executionActivityLane(kind, detail) {
|
|
2642
|
-
return detail === void 0 || detail.length === 0 ? EXECUTION_LANE_LABELS[kind] : `${EXECUTION_LANE_LABELS[kind]}
|
|
2642
|
+
return detail === void 0 || detail.length === 0 ? EXECUTION_LANE_LABELS[kind] : `${EXECUTION_LANE_LABELS[kind]} · ${detail}`;
|
|
2643
2643
|
}
|
|
2644
2644
|
var EXTERNAL_HANDOFF_ERROR_EN = "The external Agent handoff request failed.";
|
|
2645
|
-
var EXTERNAL_HANDOFF_ERROR_ZH = "
|
|
2645
|
+
var EXTERNAL_HANDOFF_ERROR_ZH = "外部 Agent 交接请求失败。";
|
|
2646
2646
|
var ERROR_MESSAGES_EN = Object.freeze({
|
|
2647
2647
|
[import_shared6.ERROR_CODES.INVALID_REQUEST]: "The Agent request was rejected as invalid.",
|
|
2648
2648
|
[import_shared6.ERROR_CODES.INVALID_TOKEN]: "The local SpotPatch session expired.",
|
|
@@ -2700,26 +2700,26 @@ var ERROR_MESSAGES_EN = Object.freeze({
|
|
|
2700
2700
|
[import_shared6.ERROR_CODES.INTERNAL_ERROR]: "The Agent failed without exposing private details."
|
|
2701
2701
|
});
|
|
2702
2702
|
var ERROR_MESSAGES_ZH = Object.freeze({
|
|
2703
|
-
[import_shared6.ERROR_CODES.INVALID_REQUEST]: "Agent
|
|
2704
|
-
[import_shared6.ERROR_CODES.INVALID_TOKEN]: "
|
|
2705
|
-
[import_shared6.ERROR_CODES.ORIGIN_NOT_ALLOWED]: "
|
|
2706
|
-
[import_shared6.ERROR_CODES.SOURCE_NOT_FOUND]: "
|
|
2707
|
-
[import_shared6.ERROR_CODES.SOURCE_OUTSIDE_ROOT]: "
|
|
2708
|
-
[import_shared6.ERROR_CODES.SOURCE_TOO_LARGE]: "
|
|
2709
|
-
[import_shared6.ERROR_CODES.EDITOR_OPEN_FAILED]: "
|
|
2710
|
-
[import_shared6.ERROR_CODES.DATA_FLOW_DISABLED]: "
|
|
2711
|
-
[import_shared6.ERROR_CODES.DATA_FLOW_SOURCE_STALE]: "
|
|
2712
|
-
[import_shared6.ERROR_CODES.DATA_FLOW_ANALYSIS_CANCELLED]: "
|
|
2713
|
-
[import_shared6.ERROR_CODES.AI_DISABLED]: "Vite
|
|
2714
|
-
[import_shared6.ERROR_CODES.PROVIDER_NOT_CONFIGURED]: "
|
|
2715
|
-
[import_shared6.ERROR_CODES.PROVIDER_AUTH_FAILED]: "
|
|
2716
|
-
[import_shared6.ERROR_CODES.PROVIDER_PROTOCOL_UNSUPPORTED]: "
|
|
2717
|
-
[import_shared6.ERROR_CODES.MODEL_NOT_ALLOWED]: "
|
|
2718
|
-
[import_shared6.ERROR_CODES.MODEL_TOOL_CALL_UNSUPPORTED]: "
|
|
2719
|
-
[import_shared6.ERROR_CODES.PROVIDER_RATE_LIMITED]: "
|
|
2720
|
-
[import_shared6.ERROR_CODES.AGENT_BUSY]: "
|
|
2721
|
-
[import_shared6.ERROR_CODES.AGENT_LIMIT_EXCEEDED]: "Agent
|
|
2722
|
-
[import_shared6.ERROR_CODES.AGENT_CANCELLED]: "Agent
|
|
2703
|
+
[import_shared6.ERROR_CODES.INVALID_REQUEST]: "Agent 请求无效,已被拒绝。",
|
|
2704
|
+
[import_shared6.ERROR_CODES.INVALID_TOKEN]: "本地 SpotPatch 会话已失效。",
|
|
2705
|
+
[import_shared6.ERROR_CODES.ORIGIN_NOT_ALLOWED]: "当前页面来源未获授权。",
|
|
2706
|
+
[import_shared6.ERROR_CODES.SOURCE_NOT_FOUND]: "选中目标对应的源码已不可用。",
|
|
2707
|
+
[import_shared6.ERROR_CODES.SOURCE_OUTSIDE_ROOT]: "选中源码位于项目根目录之外。",
|
|
2708
|
+
[import_shared6.ERROR_CODES.SOURCE_TOO_LARGE]: "选中源码超过安全大小限制。",
|
|
2709
|
+
[import_shared6.ERROR_CODES.EDITOR_OPEN_FAILED]: "编辑器打开请求失败。",
|
|
2710
|
+
[import_shared6.ERROR_CODES.DATA_FLOW_DISABLED]: "组件数据链路分析未启用。",
|
|
2711
|
+
[import_shared6.ERROR_CODES.DATA_FLOW_SOURCE_STALE]: "选中源码已经变化,请重新选择组件。",
|
|
2712
|
+
[import_shared6.ERROR_CODES.DATA_FLOW_ANALYSIS_CANCELLED]: "组件数据链路分析已取消。",
|
|
2713
|
+
[import_shared6.ERROR_CODES.AI_DISABLED]: "Vite 配置未启用 AI 执行。",
|
|
2714
|
+
[import_shared6.ERROR_CODES.PROVIDER_NOT_CONFIGURED]: "启动 Vite 的进程中缺少模型服务 Key 环境变量。",
|
|
2715
|
+
[import_shared6.ERROR_CODES.PROVIDER_AUTH_FAILED]: "模型服务鉴权失败,请检查服务端 Key。",
|
|
2716
|
+
[import_shared6.ERROR_CODES.PROVIDER_PROTOCOL_UNSUPPORTED]: "中转服务与配置的 OpenAI 兼容协议不一致。",
|
|
2717
|
+
[import_shared6.ERROR_CODES.MODEL_NOT_ALLOWED]: "当前模型配置未获授权。",
|
|
2718
|
+
[import_shared6.ERROR_CODES.MODEL_TOOL_CALL_UNSUPPORTED]: "当前模型未完成必要的工具调用或结果续接。",
|
|
2719
|
+
[import_shared6.ERROR_CODES.PROVIDER_RATE_LIMITED]: "模型服务正在限流,请稍后重试。",
|
|
2720
|
+
[import_shared6.ERROR_CODES.AGENT_BUSY]: "当前项目已有一个写入任务正在运行。",
|
|
2721
|
+
[import_shared6.ERROR_CODES.AGENT_LIMIT_EXCEEDED]: "Agent 达到时间、轮次、输出或变更规模限制。",
|
|
2722
|
+
[import_shared6.ERROR_CODES.AGENT_CANCELLED]: "Agent 任务已取消。",
|
|
2723
2723
|
[import_shared6.ERROR_CODES.EXTERNAL_HANDOFF_DISABLED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2724
2724
|
[import_shared6.ERROR_CODES.EXTERNAL_HANDOFF_UNAVAILABLE]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2725
2725
|
[import_shared6.ERROR_CODES.HANDOFF_VALIDATION_FAILED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
@@ -2738,22 +2738,22 @@ var ERROR_MESSAGES_ZH = Object.freeze({
|
|
|
2738
2738
|
[import_shared6.ERROR_CODES.SESSION_NOT_FOUND]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2739
2739
|
[import_shared6.ERROR_CODES.SESSION_AMBIGUOUS]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2740
2740
|
[import_shared6.ERROR_CODES.SESSION_CLOSED]: EXTERNAL_HANDOFF_ERROR_ZH,
|
|
2741
|
-
[import_shared6.ERROR_CODES.WORKTREE_DIRTY]: "
|
|
2742
|
-
[import_shared6.ERROR_CODES.WORKTREE_NOT_REPOSITORY]: "Vite
|
|
2743
|
-
[import_shared6.ERROR_CODES.WORKTREE_OPERATION_IN_PROGRESS]: "
|
|
2744
|
-
[import_shared6.ERROR_CODES.WORKTREE_CONFLICTED]: "
|
|
2745
|
-
[import_shared6.ERROR_CODES.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "
|
|
2746
|
-
[import_shared6.ERROR_CODES.WORKTREE_UNTRACKED_UNSUPPORTED]: "
|
|
2747
|
-
[import_shared6.ERROR_CODES.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "
|
|
2748
|
-
[import_shared6.ERROR_CODES.TOOL_DENIED]: "
|
|
2749
|
-
[import_shared6.ERROR_CODES.TOOL_INPUT_INVALID]: "
|
|
2750
|
-
[import_shared6.ERROR_CODES.TOOL_ARGUMENTS_INVALID]: "
|
|
2751
|
-
[import_shared6.ERROR_CODES.TOOL_CALL_ID_CONFLICT]: "
|
|
2752
|
-
[import_shared6.ERROR_CODES.TOOL_PATH_DENIED]: "
|
|
2753
|
-
[import_shared6.ERROR_CODES.PATCH_REJECTED]: "
|
|
2754
|
-
[import_shared6.ERROR_CODES.VALIDATION_FAILED]: "
|
|
2755
|
-
[import_shared6.ERROR_CODES.APPLY_CONFLICT]: "Agent
|
|
2756
|
-
[import_shared6.ERROR_CODES.INTERNAL_ERROR]: "Agent
|
|
2741
|
+
[import_shared6.ERROR_CODES.WORKTREE_DIRTY]: "运行 AI 前,请明确同意将当前本地修改纳入隔离基线。",
|
|
2742
|
+
[import_shared6.ERROR_CODES.WORKTREE_NOT_REPOSITORY]: "Vite 根目录不是已初始化 Git 仓库的顶层目录。",
|
|
2743
|
+
[import_shared6.ERROR_CODES.WORKTREE_OPERATION_IN_PROGRESS]: "请先完成当前 merge、rebase、cherry-pick 或 revert,再运行 AI。",
|
|
2744
|
+
[import_shared6.ERROR_CODES.WORKTREE_CONFLICTED]: "请先解决全部 Git 冲突,再运行 AI。",
|
|
2745
|
+
[import_shared6.ERROR_CODES.WORKTREE_LOCAL_CHANGES_TOO_LARGE]: "未跟踪文件超过安全数量或体积上限,请先精简。",
|
|
2746
|
+
[import_shared6.ERROR_CODES.WORKTREE_UNTRACKED_UNSUPPORTED]: "未跟踪项已丢失、是符号链接或不是普通文件。",
|
|
2747
|
+
[import_shared6.ERROR_CODES.WORKTREE_LOCAL_CHANGES_UNSUPPORTED]: "当前本地修改无法安全隔离。",
|
|
2748
|
+
[import_shared6.ERROR_CODES.TOOL_DENIED]: "工具请求违反本地安全策略。",
|
|
2749
|
+
[import_shared6.ERROR_CODES.TOOL_INPUT_INVALID]: "工具请求无效。",
|
|
2750
|
+
[import_shared6.ERROR_CODES.TOOL_ARGUMENTS_INVALID]: "工具参数无效。",
|
|
2751
|
+
[import_shared6.ERROR_CODES.TOOL_CALL_ID_CONFLICT]: "本轮工具 ID 冲突。",
|
|
2752
|
+
[import_shared6.ERROR_CODES.TOOL_PATH_DENIED]: "模型请求了受保护或项目外路径。",
|
|
2753
|
+
[import_shared6.ERROR_CODES.PATCH_REJECTED]: "补丁违反本地策略。",
|
|
2754
|
+
[import_shared6.ERROR_CODES.VALIDATION_FAILED]: "必需检查失败,无法应用变更。",
|
|
2755
|
+
[import_shared6.ERROR_CODES.APPLY_CONFLICT]: "Agent 触及文件已变化,未覆盖。",
|
|
2756
|
+
[import_shared6.ERROR_CODES.INTERNAL_ERROR]: "Agent 失败,未暴露私有细节。"
|
|
2757
2757
|
});
|
|
2758
2758
|
var SUMMARY_MESSAGES_EN = Object.freeze({
|
|
2759
2759
|
adapter: "React adapter",
|
|
@@ -2796,54 +2796,54 @@ var SUMMARY_MESSAGES_EN = Object.freeze({
|
|
|
2796
2796
|
warning: "Warning"
|
|
2797
2797
|
});
|
|
2798
2798
|
var SUMMARY_MESSAGES_ZH = Object.freeze({
|
|
2799
|
-
adapter: "React
|
|
2799
|
+
adapter: "React 适配器",
|
|
2800
2800
|
api: "API",
|
|
2801
2801
|
apiStatuses: Object.freeze({
|
|
2802
|
-
connected: "
|
|
2803
|
-
failed: "
|
|
2804
|
-
loading: "
|
|
2805
|
-
"not-required": "
|
|
2802
|
+
connected: "已连接",
|
|
2803
|
+
failed: "失败",
|
|
2804
|
+
loading: "加载中",
|
|
2805
|
+
"not-required": "无需请求"
|
|
2806
2806
|
}),
|
|
2807
|
-
available: "
|
|
2808
|
-
boundary: "
|
|
2807
|
+
available: "可用",
|
|
2808
|
+
boundary: "代码边界",
|
|
2809
2809
|
boundaries: Object.freeze({
|
|
2810
|
-
component: "
|
|
2811
|
-
"nearby-lines": "
|
|
2810
|
+
component: "完整组件",
|
|
2811
|
+
"nearby-lines": "附近代码"
|
|
2812
2812
|
}),
|
|
2813
|
-
browserContext: "
|
|
2813
|
+
browserContext: "浏览器上下文",
|
|
2814
2814
|
collectionStatuses: Object.freeze({
|
|
2815
|
-
failed: "
|
|
2816
|
-
loading: "
|
|
2817
|
-
ready: "
|
|
2815
|
+
failed: "失败",
|
|
2816
|
+
loading: "采集中",
|
|
2817
|
+
ready: "已就绪"
|
|
2818
2818
|
}),
|
|
2819
|
-
component: "
|
|
2820
|
-
confidence: "
|
|
2819
|
+
component: "组件",
|
|
2820
|
+
confidence: "置信度",
|
|
2821
2821
|
confidenceLabels: Object.freeze({
|
|
2822
|
-
exact: "
|
|
2823
|
-
probable: "
|
|
2824
|
-
approximate: "
|
|
2825
|
-
unknown: "
|
|
2822
|
+
exact: "精确元素源码",
|
|
2823
|
+
probable: "可能的所属组件",
|
|
2824
|
+
approximate: "最近业务容器",
|
|
2825
|
+
unknown: "未找到源码"
|
|
2826
2826
|
}),
|
|
2827
|
-
cssWarnings: "CSS
|
|
2828
|
-
lineLocation: (line, column) =>
|
|
2829
|
-
origin: "
|
|
2830
|
-
source: "
|
|
2831
|
-
sourceContext: "
|
|
2832
|
-
stack: "
|
|
2833
|
-
target: (index, active) =>
|
|
2834
|
-
unavailable: "
|
|
2835
|
-
unsupported: "
|
|
2836
|
-
warning: "
|
|
2827
|
+
cssWarnings: "CSS 警告",
|
|
2828
|
+
lineLocation: (line, column) => `第 ${String(line)} 行${column === void 0 ? "" : `,第 ${String(column)} 列`}`,
|
|
2829
|
+
origin: "定位来源",
|
|
2830
|
+
source: "源码",
|
|
2831
|
+
sourceContext: "源码上下文",
|
|
2832
|
+
stack: "组件栈",
|
|
2833
|
+
target: (index, active) => `目标 ${String(index)}${active ? "(当前)" : ""}`,
|
|
2834
|
+
unavailable: "不可用",
|
|
2835
|
+
unsupported: "不支持",
|
|
2836
|
+
warning: "警告"
|
|
2837
2837
|
});
|
|
2838
2838
|
var UI_MESSAGES = Object.freeze({
|
|
2839
2839
|
"en-US": Object.freeze({
|
|
2840
2840
|
localeName: "EN",
|
|
2841
|
-
alternateLocaleName: "
|
|
2841
|
+
alternateLocaleName: "中",
|
|
2842
2842
|
switchLocale: "Switch interface language to Chinese",
|
|
2843
2843
|
brand: Object.freeze({
|
|
2844
2844
|
name: "SpotPatch",
|
|
2845
2845
|
context: "Live context",
|
|
2846
|
-
repository: "GitHub
|
|
2846
|
+
repository: "GitHub ↗",
|
|
2847
2847
|
repositoryTitle: "Star SpotPatch on GitHub"
|
|
2848
2848
|
}),
|
|
2849
2849
|
trigger: Object.freeze({
|
|
@@ -2877,14 +2877,14 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2877
2877
|
count: (selected, maximum) => `${String(selected)} of ${String(maximum)}`,
|
|
2878
2878
|
complete: (complete, total) => `${String(complete)} of ${String(total)} described`,
|
|
2879
2879
|
instructionBudget: (used, maximum) => `${String(used)} / ${String(maximum)} characters`,
|
|
2880
|
-
instructionBudgetExceeded: (used, maximum) => `${String(used)} / ${String(maximum)} characters
|
|
2880
|
+
instructionBudgetExceeded: (used, maximum) => `${String(used)} / ${String(maximum)} characters — reduce the request`,
|
|
2881
2881
|
statusReady: "Ready",
|
|
2882
2882
|
statusPartial: "Partial",
|
|
2883
2883
|
statusCollecting: "Collecting",
|
|
2884
2884
|
instructionReady: "Instruction added",
|
|
2885
2885
|
instructionMissing: "Needs instruction",
|
|
2886
2886
|
instructionLabel: (name) => `Change for ${name}`,
|
|
2887
|
-
instructionPlaceholder: "Describe the desired result for this target, including constraints
|
|
2887
|
+
instructionPlaceholder: "Describe the desired result for this target, including constraints…",
|
|
2888
2888
|
instructionCount: (used, maximum) => `${String(used)} / ${String(maximum)}`,
|
|
2889
2889
|
activate: (index) => `Edit target ${String(index)}`,
|
|
2890
2890
|
remove: (index) => `Remove target ${String(index)}`,
|
|
@@ -2894,7 +2894,7 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2894
2894
|
}),
|
|
2895
2895
|
diagnostics: Object.freeze({
|
|
2896
2896
|
title: "Captured context",
|
|
2897
|
-
resolving: "Resolving source
|
|
2897
|
+
resolving: "Resolving source…",
|
|
2898
2898
|
noExactSource: "No exact source marker",
|
|
2899
2899
|
promptAriaLabel: "Generated prompt"
|
|
2900
2900
|
}),
|
|
@@ -2923,22 +2923,22 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2923
2923
|
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.`,
|
|
2924
2924
|
connectionNotTested: "Optional connection check not run",
|
|
2925
2925
|
workspaceNotChecked: "Local workspace not checked",
|
|
2926
|
-
checkingWorkspace: "Checking Git workspace and isolated execution
|
|
2926
|
+
checkingWorkspace: "Checking Git workspace and isolated execution…",
|
|
2927
2927
|
workspaceReady: "Local workspace is ready for isolated execution",
|
|
2928
|
-
workspaceDirty: (staged, unstaged, untracked) => `Local changes found
|
|
2928
|
+
workspaceDirty: (staged, unstaged, untracked) => `Local changes found · ${String(staged)} staged · ${String(unstaged)} unstaged · ${String(untracked)} untracked`,
|
|
2929
2929
|
includeLocalChanges: "Allow the Agent to continue from my current local changes",
|
|
2930
2930
|
includeLocalChangesHelp: "The Agent may edit these files. SpotPatch preserves the baseline and applies or reverts only the Agent delta.",
|
|
2931
2931
|
localChangesConsentRequired: "Confirm inclusion of current local changes before running AI.",
|
|
2932
2932
|
capabilityVerified: "Agent capability verified",
|
|
2933
2933
|
capabilityVerifiedAnnouncement: "AI provider capability verified.",
|
|
2934
|
-
testingCapability: "Testing authentication, tools, continuation, and streaming
|
|
2934
|
+
testingCapability: "Testing authentication, tools, continuation, and streaming…",
|
|
2935
2935
|
applying: "Applying changes to the project.",
|
|
2936
2936
|
cancelling: "Cancelling Agent job.",
|
|
2937
2937
|
reverting: "Reverting the applied Agent change.",
|
|
2938
2938
|
consentRequired: "Confirm remote provider data transmission before running AI.",
|
|
2939
2939
|
toolsReady: "tools and streaming ready",
|
|
2940
2940
|
testConnection: "Check environment",
|
|
2941
|
-
verifying: "Verifying
|
|
2941
|
+
verifying: "Verifying…",
|
|
2942
2942
|
run: "Run AI",
|
|
2943
2943
|
cancel: "Cancel agent",
|
|
2944
2944
|
discard: "Discard changes",
|
|
@@ -2989,7 +2989,7 @@ var UI_MESSAGES = Object.freeze({
|
|
|
2989
2989
|
detachedTargetPreserved: "The page element was unloaded; its collected context remains selected.",
|
|
2990
2990
|
contextWarning: "Browser context collection completed with a warning.",
|
|
2991
2991
|
contextCollected: "Browser context collected.",
|
|
2992
|
-
editorOpening: "Opening source
|
|
2992
|
+
editorOpening: "Opening source…",
|
|
2993
2993
|
editorOpened: "Source opened in the editor.",
|
|
2994
2994
|
editorFailed: "Could not open the editor. Start it or configure editor.",
|
|
2995
2995
|
completeInstructions: "Add an instruction for every target and wait for context collection to finish.",
|
|
@@ -3001,166 +3001,166 @@ var UI_MESSAGES = Object.freeze({
|
|
|
3001
3001
|
errors: ERROR_MESSAGES_EN
|
|
3002
3002
|
}),
|
|
3003
3003
|
"zh-CN": Object.freeze({
|
|
3004
|
-
localeName: "
|
|
3004
|
+
localeName: "中",
|
|
3005
3005
|
alternateLocaleName: "EN",
|
|
3006
|
-
switchLocale: "
|
|
3006
|
+
switchLocale: "将界面语言切换为英文",
|
|
3007
3007
|
brand: Object.freeze({
|
|
3008
3008
|
name: "SpotPatch",
|
|
3009
|
-
context: "
|
|
3010
|
-
repository: "GitHub
|
|
3011
|
-
repositoryTitle: "
|
|
3009
|
+
context: "实时上下文",
|
|
3010
|
+
repository: "GitHub ↗",
|
|
3011
|
+
repositoryTitle: "在 GitHub 上 Star SpotPatch"
|
|
3012
3012
|
}),
|
|
3013
3013
|
trigger: Object.freeze({
|
|
3014
|
-
select: "
|
|
3015
|
-
stop: "
|
|
3016
|
-
title: (shortcut) =>
|
|
3014
|
+
select: "选择元素",
|
|
3015
|
+
stop: "停止选择",
|
|
3016
|
+
title: (shortcut) => `切换 SpotPatch(${shortcut})`
|
|
3017
3017
|
}),
|
|
3018
3018
|
dialog: Object.freeze({
|
|
3019
|
-
close: "
|
|
3020
|
-
editTitle: "
|
|
3021
|
-
editSubtitle: "
|
|
3022
|
-
previewTitle: "
|
|
3023
|
-
previewSubtitle: "
|
|
3019
|
+
close: "关闭 SpotPatch",
|
|
3020
|
+
editTitle: "规划本次修改",
|
|
3021
|
+
editSubtitle: "为每个选中目标分别写清楚修改要求。",
|
|
3022
|
+
previewTitle: "审阅修改请求",
|
|
3023
|
+
previewSubtitle: "发送给 AI 前,请核对完整上下文与每项目标说明。"
|
|
3024
3024
|
}),
|
|
3025
3025
|
floatingSurface: Object.freeze({
|
|
3026
|
-
dragHandle: "
|
|
3027
|
-
resetPosition: "
|
|
3028
|
-
positionReset: "SpotPatch
|
|
3026
|
+
dragHandle: "拖拽以移动 SpotPatch 工作台",
|
|
3027
|
+
resetPosition: "重置工作台位置",
|
|
3028
|
+
positionReset: "SpotPatch 已恢复到右下角。"
|
|
3029
3029
|
}),
|
|
3030
3030
|
context: Object.freeze({
|
|
3031
|
-
collecting: "
|
|
3032
|
-
ready: "
|
|
3033
|
-
partial: "
|
|
3034
|
-
sourceUnavailable: "
|
|
3035
|
-
selectedElement: "
|
|
3036
|
-
selectedCount: (count) =>
|
|
3031
|
+
collecting: "正在采集上下文",
|
|
3032
|
+
ready: "上下文已就绪",
|
|
3033
|
+
partial: "部分上下文可用",
|
|
3034
|
+
sourceUnavailable: "源码位置不可用",
|
|
3035
|
+
selectedElement: "已选元素",
|
|
3036
|
+
selectedCount: (count) => `已选择 ${String(count)} 个元素`
|
|
3037
3037
|
}),
|
|
3038
3038
|
targets: Object.freeze({
|
|
3039
|
-
title: "
|
|
3040
|
-
ariaLabel: "
|
|
3039
|
+
title: "修改目标",
|
|
3040
|
+
ariaLabel: "已选目标与逐项目标说明",
|
|
3041
3041
|
count: (selected, maximum) => `${String(selected)} / ${String(maximum)}`,
|
|
3042
|
-
complete: (complete, total) =>
|
|
3043
|
-
instructionBudget: (used, maximum) =>
|
|
3044
|
-
instructionBudgetExceeded: (used, maximum) =>
|
|
3045
|
-
statusReady: "
|
|
3046
|
-
statusPartial: "
|
|
3047
|
-
statusCollecting: "
|
|
3048
|
-
instructionReady: "
|
|
3049
|
-
instructionMissing: "
|
|
3050
|
-
instructionLabel: (name) => `${name}
|
|
3051
|
-
instructionPlaceholder: "
|
|
3042
|
+
complete: (complete, total) => `已描述 ${String(complete)} / ${String(total)}`,
|
|
3043
|
+
instructionBudget: (used, maximum) => `说明字符 ${String(used)} / ${String(maximum)}`,
|
|
3044
|
+
instructionBudgetExceeded: (used, maximum) => `说明字符 ${String(used)} / ${String(maximum)},请精简后继续`,
|
|
3045
|
+
statusReady: "已就绪",
|
|
3046
|
+
statusPartial: "部分可用",
|
|
3047
|
+
statusCollecting: "采集中",
|
|
3048
|
+
instructionReady: "已填写修改说明",
|
|
3049
|
+
instructionMissing: "待填写修改说明",
|
|
3050
|
+
instructionLabel: (name) => `${name} 的修改说明`,
|
|
3051
|
+
instructionPlaceholder: "描述这个目标期望达到的结果,以及不能破坏的约束……",
|
|
3052
3052
|
instructionCount: (used, maximum) => `${String(used)} / ${String(maximum)}`,
|
|
3053
|
-
activate: (index) =>
|
|
3054
|
-
remove: (index) =>
|
|
3055
|
-
removeTitle: "
|
|
3056
|
-
addTitle: "
|
|
3057
|
-
limitTitle: (maximum) =>
|
|
3053
|
+
activate: (index) => `编辑目标 ${String(index)}`,
|
|
3054
|
+
remove: (index) => `移除目标 ${String(index)}`,
|
|
3055
|
+
removeTitle: "移除目标",
|
|
3056
|
+
addTitle: "继续为本次请求选择元素",
|
|
3057
|
+
limitTitle: (maximum) => `已达到 ${String(maximum)} 个目标的上限`
|
|
3058
3058
|
}),
|
|
3059
3059
|
diagnostics: Object.freeze({
|
|
3060
|
-
title: "
|
|
3061
|
-
resolving: "
|
|
3062
|
-
noExactSource: "
|
|
3063
|
-
promptAriaLabel: "
|
|
3060
|
+
title: "已采集上下文",
|
|
3061
|
+
resolving: "正在解析源码……",
|
|
3062
|
+
noExactSource: "没有精确源码标记",
|
|
3063
|
+
promptAriaLabel: "生成的 Prompt"
|
|
3064
3064
|
}),
|
|
3065
3065
|
summary: SUMMARY_MESSAGES_ZH,
|
|
3066
3066
|
actions: Object.freeze({
|
|
3067
|
-
addElement: "
|
|
3068
|
-
reselect: "
|
|
3069
|
-
openEditor: "
|
|
3070
|
-
openTarget: (index) =>
|
|
3071
|
-
preview: "
|
|
3072
|
-
copy: "
|
|
3073
|
-
back: "
|
|
3067
|
+
addElement: "添加元素",
|
|
3068
|
+
reselect: "重新开始",
|
|
3069
|
+
openEditor: "打开源码",
|
|
3070
|
+
openTarget: (index) => `打开目标 ${String(index)} 的源码`,
|
|
3071
|
+
preview: "预览 Prompt",
|
|
3072
|
+
copy: "复制 Prompt",
|
|
3073
|
+
back: "返回编辑"
|
|
3074
3074
|
}),
|
|
3075
3075
|
agent: Object.freeze({
|
|
3076
|
-
title: "AI
|
|
3077
|
-
mode: "
|
|
3078
|
-
review: "
|
|
3079
|
-
autoGated: "
|
|
3080
|
-
trustedFast: "
|
|
3081
|
-
provider: "
|
|
3082
|
-
model: "
|
|
3083
|
-
providerAriaLabel: "AI
|
|
3084
|
-
modelAriaLabel: "AI
|
|
3085
|
-
providerUnavailable: "
|
|
3086
|
-
consent: (provider) =>
|
|
3087
|
-
trustedFastConsent: (provider) =>
|
|
3088
|
-
connectionNotTested: "
|
|
3089
|
-
workspaceNotChecked: "
|
|
3090
|
-
checkingWorkspace: "
|
|
3091
|
-
workspaceReady: "
|
|
3092
|
-
workspaceDirty: (staged, unstaged, untracked) =>
|
|
3093
|
-
includeLocalChanges: "
|
|
3094
|
-
includeLocalChangesHelp: "Agent
|
|
3095
|
-
localChangesConsentRequired: "
|
|
3096
|
-
capabilityVerified: "Agent
|
|
3097
|
-
capabilityVerifiedAnnouncement: "AI
|
|
3098
|
-
testingCapability: "
|
|
3099
|
-
applying: "
|
|
3100
|
-
cancelling: "
|
|
3101
|
-
reverting: "
|
|
3102
|
-
consentRequired: "
|
|
3103
|
-
toolsReady: "
|
|
3104
|
-
testConnection: "
|
|
3105
|
-
verifying: "
|
|
3106
|
-
run: "
|
|
3107
|
-
cancel: "
|
|
3108
|
-
discard: "
|
|
3109
|
-
apply: "
|
|
3110
|
-
revert: "
|
|
3111
|
-
revise: "
|
|
3112
|
-
diffAriaLabel: "
|
|
3113
|
-
noOutput: "
|
|
3076
|
+
title: "AI 代码 Agent",
|
|
3077
|
+
mode: "执行方式",
|
|
3078
|
+
review: "审阅模式",
|
|
3079
|
+
autoGated: "受控自动模式",
|
|
3080
|
+
trustedFast: "可信极速模式",
|
|
3081
|
+
provider: "模型服务",
|
|
3082
|
+
model: "模型",
|
|
3083
|
+
providerAriaLabel: "AI 模型服务",
|
|
3084
|
+
modelAriaLabel: "AI 模型",
|
|
3085
|
+
providerUnavailable: "模型服务配置不可用。",
|
|
3086
|
+
consent: (provider) => `我了解选中上下文与获准源码可能发送到 ${provider},并自行负责其数据策略。`,
|
|
3087
|
+
trustedFastConsent: (provider) => `为 ${provider} 启用可信极速模式:发送获准的项目上下文、纳入当前本地修改、跳过项目验证检查,并立即应用 AI 变更,包括删除文件与配置变更。`,
|
|
3088
|
+
connectionNotTested: "尚未执行可选连接检查",
|
|
3089
|
+
workspaceNotChecked: "尚未检查本地工作区",
|
|
3090
|
+
checkingWorkspace: "正在检查 Git 工作区与隔离执行环境……",
|
|
3091
|
+
workspaceReady: "本地工作区已满足隔离执行条件",
|
|
3092
|
+
workspaceDirty: (staged, unstaged, untracked) => `发现本地修改 · 暂存 ${String(staged)} · 未暂存 ${String(unstaged)} · 未跟踪 ${String(untracked)}`,
|
|
3093
|
+
includeLocalChanges: "允许 Agent 基于我当前的本地修改继续",
|
|
3094
|
+
includeLocalChangesHelp: "Agent 可能继续修改这些文件;SpotPatch 会保留原基线,仅应用或撤销 Agent 自己的增量。",
|
|
3095
|
+
localChangesConsentRequired: "运行 AI 前,请确认允许纳入当前本地修改。",
|
|
3096
|
+
capabilityVerified: "Agent 能力验证通过",
|
|
3097
|
+
capabilityVerifiedAnnouncement: "AI 模型服务能力验证通过。",
|
|
3098
|
+
testingCapability: "正在验证鉴权、工具调用、连续调用与流式响应……",
|
|
3099
|
+
applying: "正在将变更应用到项目。",
|
|
3100
|
+
cancelling: "正在取消 Agent 任务。",
|
|
3101
|
+
reverting: "正在撤销已应用的 Agent 变更。",
|
|
3102
|
+
consentRequired: "运行 AI 前,请先确认允许向远程模型服务传输数据。",
|
|
3103
|
+
toolsReady: "工具调用与流式响应已就绪",
|
|
3104
|
+
testConnection: "检查运行环境",
|
|
3105
|
+
verifying: "验证中……",
|
|
3106
|
+
run: "运行 AI",
|
|
3107
|
+
cancel: "取消 Agent",
|
|
3108
|
+
discard: "放弃变更",
|
|
3109
|
+
apply: "应用变更",
|
|
3110
|
+
revert: "撤销变更",
|
|
3111
|
+
revise: "修改请求",
|
|
3112
|
+
diffAriaLabel: "建议的源码差异",
|
|
3113
|
+
noOutput: "没有输出。",
|
|
3114
3114
|
status: (status) => STATUS_ZH[status]
|
|
3115
3115
|
}),
|
|
3116
3116
|
execution: Object.freeze({
|
|
3117
3117
|
claude: "Claude",
|
|
3118
3118
|
codex: "Codex",
|
|
3119
|
-
receivingTitle: "
|
|
3120
|
-
dispatchingTitle: (identity) =>
|
|
3121
|
-
runningTitle: (target2) =>
|
|
3122
|
-
expandedRunningTitle: (identity) => `${identity}
|
|
3123
|
-
completedTitle: "
|
|
3124
|
-
expandedCompletedTitle: "
|
|
3125
|
-
failedTitle: "
|
|
3126
|
-
receivingStatus: "
|
|
3127
|
-
dispatchingStatus: "
|
|
3128
|
-
runningStatus: "
|
|
3129
|
-
checkingStatus: "
|
|
3130
|
-
completedStatus: "
|
|
3131
|
-
failedStatus: "
|
|
3132
|
-
resultReturned: "
|
|
3133
|
-
resultSummary: (files) => `${String(files)}
|
|
3119
|
+
receivingTitle: "正在接收上下文",
|
|
3120
|
+
dispatchingTitle: (identity) => `正在交接给 ${identity}`,
|
|
3121
|
+
runningTitle: (target2) => `正在修改 ${target2}`,
|
|
3122
|
+
expandedRunningTitle: (identity) => `${identity} 正在执行修改`,
|
|
3123
|
+
completedTitle: "修改完成",
|
|
3124
|
+
expandedCompletedTitle: "修改已完成",
|
|
3125
|
+
failedTitle: "执行失败",
|
|
3126
|
+
receivingStatus: "接收中",
|
|
3127
|
+
dispatchingStatus: "派发中",
|
|
3128
|
+
runningStatus: "执行中",
|
|
3129
|
+
checkingStatus: "检查中",
|
|
3130
|
+
completedStatus: "完成",
|
|
3131
|
+
failedStatus: "失败",
|
|
3132
|
+
resultReturned: "结果已回流 SpotPatch",
|
|
3133
|
+
resultSummary: (files) => `${String(files)} 个文件`,
|
|
3134
3134
|
activityAction: (kind, detail) => executionActivityAction(EXECUTION_ACTIVITY_ZH, kind, detail),
|
|
3135
3135
|
activityLane: executionActivityLane
|
|
3136
3136
|
}),
|
|
3137
3137
|
announcements: Object.freeze({
|
|
3138
|
-
adapterDisabled: "React
|
|
3139
|
-
selectionEnabled: "
|
|
3140
|
-
chooseAnother: "
|
|
3141
|
-
reselectAfterChange: "
|
|
3142
|
-
sourceLoaded: "
|
|
3143
|
-
sourceFailed: "
|
|
3144
|
-
addCancelled: "
|
|
3145
|
-
selectionLimit: (maximum) =>
|
|
3146
|
-
chooseAdditional: (selected, maximum) =>
|
|
3147
|
-
duplicate: "
|
|
3148
|
-
sourceProbable: "
|
|
3149
|
-
sourceMissing: "
|
|
3150
|
-
noSelectable: "
|
|
3151
|
-
allTargetsRemoved: "
|
|
3152
|
-
targetRemoved: "
|
|
3153
|
-
detachedTargetPreserved: "
|
|
3154
|
-
contextWarning: "
|
|
3155
|
-
contextCollected: "
|
|
3156
|
-
editorOpening: "
|
|
3157
|
-
editorOpened: "
|
|
3158
|
-
editorFailed: "
|
|
3159
|
-
completeInstructions: "
|
|
3160
|
-
promptCopied: "Prompt
|
|
3161
|
-
clipboardUnavailable: "
|
|
3162
|
-
copyFailed: "
|
|
3163
|
-
appliedTargetsDetached: "
|
|
3138
|
+
adapterDisabled: "React 适配器异常,本次会话已停用 React 检查。",
|
|
3139
|
+
selectionEnabled: "元素选择已启用。",
|
|
3140
|
+
chooseAnother: "请选择另一个元素。",
|
|
3141
|
+
reselectAfterChange: "文件变更后,请重新选择当前页面元素。",
|
|
3142
|
+
sourceLoaded: "源码上下文已加载。",
|
|
3143
|
+
sourceFailed: "源码上下文加载失败。",
|
|
3144
|
+
addCancelled: "已取消追加选择。",
|
|
3145
|
+
selectionLimit: (maximum) => `已达到 ${String(maximum)} 个元素的选择上限。`,
|
|
3146
|
+
chooseAdditional: (selected, maximum) => `请选择另一个元素,当前已选 ${String(selected)} / ${String(maximum)}。`,
|
|
3147
|
+
duplicate: "该源码目标已经在当前选择中。",
|
|
3148
|
+
sourceProbable: "找到可能的 React 组件,但没有获授权的源码标记。",
|
|
3149
|
+
sourceMissing: "选中元素没有获授权的源码标记。",
|
|
3150
|
+
noSelectable: "当前位置没有可选择的元素。",
|
|
3151
|
+
allTargetsRemoved: "已移除全部目标,请重新选择元素。",
|
|
3152
|
+
targetRemoved: "已移除选中目标。",
|
|
3153
|
+
detachedTargetPreserved: "页面元素已卸载,已采集的上下文仍保留在选择中。",
|
|
3154
|
+
contextWarning: "浏览器上下文采集完成,但存在警告。",
|
|
3155
|
+
contextCollected: "浏览器上下文采集完成。",
|
|
3156
|
+
editorOpening: "正在打开源码……",
|
|
3157
|
+
editorOpened: "源码已在编辑器中打开。",
|
|
3158
|
+
editorFailed: "无法打开编辑器。请先启动编辑器或检查 editor 配置。",
|
|
3159
|
+
completeInstructions: "请为每个目标填写修改说明,并等待上下文采集完成。",
|
|
3160
|
+
promptCopied: "Prompt 已复制到剪贴板。",
|
|
3161
|
+
clipboardUnavailable: "无法访问剪贴板,请手动选择并复制 Prompt。",
|
|
3162
|
+
copyFailed: "复制失败,请手动选择并复制 Prompt。",
|
|
3163
|
+
appliedTargetsDetached: "变更已应用;HMR 后请重新选择页面元素再发起新请求。"
|
|
3164
3164
|
}),
|
|
3165
3165
|
errors: ERROR_MESSAGES_ZH
|
|
3166
3166
|
})
|
|
@@ -4162,7 +4162,7 @@ function createStyles(document) {
|
|
|
4162
4162
|
.spotpatch-diagnostics > summary::-webkit-details-marker { display: none; }
|
|
4163
4163
|
.spotpatch-diagnostics > summary::before {
|
|
4164
4164
|
color: #778193;
|
|
4165
|
-
content: "
|
|
4165
|
+
content: "›";
|
|
4166
4166
|
font-size: 16px;
|
|
4167
4167
|
line-height: 1;
|
|
4168
4168
|
transform: rotate(0deg);
|
|
@@ -4250,7 +4250,7 @@ function createStyles(document) {
|
|
|
4250
4250
|
box-shadow: 0 8px 20px -8px rgb(139 123 255 / 55%);
|
|
4251
4251
|
}
|
|
4252
4252
|
.spotpatch-actions .spotpatch-primary:hover:not(:disabled) { color: var(--spotpatch-text-on-accent); filter: brightness(1.08); }
|
|
4253
|
-
.spotpatch-actions .spotpatch-primary::after { margin-left: 8px; content: "
|
|
4253
|
+
.spotpatch-actions .spotpatch-primary::after { margin-left: 8px; content: "↗"; font-size: 12px; }
|
|
4254
4254
|
.spotpatch-actions .spotpatch-secondary-action {
|
|
4255
4255
|
min-height: 30px;
|
|
4256
4256
|
border-style: dashed;
|
|
@@ -4344,7 +4344,7 @@ function createFallbackExecutionIsland(document) {
|
|
|
4344
4344
|
root,
|
|
4345
4345
|
setExpanded: () => void 0,
|
|
4346
4346
|
render(projection) {
|
|
4347
|
-
const text2 = [projection.headline, projection.action, projection.meta].filter((value) => value.length > 0).join("
|
|
4347
|
+
const text2 = [projection.headline, projection.action, projection.meta].filter((value) => value.length > 0).join(" · ");
|
|
4348
4348
|
copy.textContent = text2;
|
|
4349
4349
|
root.setAttribute("aria-label", text2);
|
|
4350
4350
|
},
|
|
@@ -4446,8 +4446,8 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4446
4446
|
repositoryLink.target = "_blank";
|
|
4447
4447
|
repositoryLink.rel = "noopener noreferrer";
|
|
4448
4448
|
const localeButton = createButton(document, "", "spotpatch-locale");
|
|
4449
|
-
const resetPositionButton = createButton(document, "
|
|
4450
|
-
const closeButton = createButton(document, "
|
|
4449
|
+
const resetPositionButton = createButton(document, "⌖", "spotpatch-reset-position");
|
|
4450
|
+
const closeButton = createButton(document, "×", "spotpatch-close");
|
|
4451
4451
|
headerControls.append(repositoryLink, localeButton, resetPositionButton, closeButton);
|
|
4452
4452
|
brandRow.append(brand, headerControls);
|
|
4453
4453
|
const title = createMarkedElement(document, "h2");
|
|
@@ -4571,7 +4571,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4571
4571
|
addTargetButton.classList.add("spotpatch-icon-action");
|
|
4572
4572
|
addTargetButton.dataset.compactIcon = "+";
|
|
4573
4573
|
agentPanel.testButton.classList.add("spotpatch-icon-action");
|
|
4574
|
-
agentPanel.testButton.dataset.compactIcon = "
|
|
4574
|
+
agentPanel.testButton.dataset.compactIcon = "✓";
|
|
4575
4575
|
openEditorButton.classList.add("spotpatch-secondary-action");
|
|
4576
4576
|
reselectButton.classList.add("spotpatch-secondary-action");
|
|
4577
4577
|
secondaryActions.append(openEditorButton, reselectButton);
|
|
@@ -4690,7 +4690,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
4690
4690
|
}
|
|
4691
4691
|
function currentTargetContext() {
|
|
4692
4692
|
const target2 = currentTargetSummary();
|
|
4693
|
-
return target2.source.length === 0 ? target2.label : `${target2.label}
|
|
4693
|
+
return target2.source.length === 0 ? target2.label : `${target2.label} · ${target2.source}`;
|
|
4694
4694
|
}
|
|
4695
4695
|
function beginObservedExecution() {
|
|
4696
4696
|
observedExecutionStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -5025,7 +5025,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
5025
5025
|
name.textContent = target2.label;
|
|
5026
5026
|
const source2 = createMarkedElement(document, "span");
|
|
5027
5027
|
source2.className = "spotpatch-target-source";
|
|
5028
|
-
source2.textContent = `${statusText(target2)}
|
|
5028
|
+
source2.textContent = `${statusText(target2)} · ${target2.source}`;
|
|
5029
5029
|
copy.append(name, source2);
|
|
5030
5030
|
const instructionComplete = target2.instruction.trim().length > 0;
|
|
5031
5031
|
const state = createMarkedElement(document, "span");
|
|
@@ -5033,12 +5033,12 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
5033
5033
|
state.dataset.complete = String(instructionComplete);
|
|
5034
5034
|
state.textContent = instructionComplete ? messages.targets.instructionReady : messages.targets.instructionMissing;
|
|
5035
5035
|
select.append(number, copy, state);
|
|
5036
|
-
const open = createButton(document, "
|
|
5036
|
+
const open = createButton(document, "↗", "spotpatch-target-open");
|
|
5037
5037
|
open.dataset.openTargetId = target2.id;
|
|
5038
5038
|
open.disabled = !target2.canOpenEditor;
|
|
5039
5039
|
open.setAttribute("aria-label", messages.actions.openTarget(index + 1));
|
|
5040
5040
|
open.title = messages.actions.openTarget(index + 1);
|
|
5041
|
-
const remove = createButton(document, "
|
|
5041
|
+
const remove = createButton(document, "×", "spotpatch-target-remove");
|
|
5042
5042
|
remove.dataset.removeTargetId = target2.id;
|
|
5043
5043
|
remove.disabled = !editingEnabled;
|
|
5044
5044
|
remove.setAttribute("aria-label", messages.targets.remove(index + 1));
|
|
@@ -5141,7 +5141,7 @@ function createRuntimeView(document, shortcut, ai = Object.freeze({ enabled: fal
|
|
|
5141
5141
|
box.style.width = `${String(target2.rect.width)}px`;
|
|
5142
5142
|
box.style.height = `${String(target2.rect.height)}px`;
|
|
5143
5143
|
const label = createMarkedElement(document, "span");
|
|
5144
|
-
label.textContent = `${String(index + 1)}
|
|
5144
|
+
label.textContent = `${String(index + 1)} · ${target2.label}`;
|
|
5145
5145
|
box.append(label);
|
|
5146
5146
|
selectionHighlights.append(box);
|
|
5147
5147
|
}
|
|
@@ -5640,7 +5640,7 @@ function activityFromEvent(event) {
|
|
|
5640
5640
|
key: `tool:${String(event.data.turn)}:${event.data.toolCallId}`,
|
|
5641
5641
|
kind: toolActivityKind(event.data.toolName),
|
|
5642
5642
|
...detail === void 0 ? {} : { detail },
|
|
5643
|
-
label: `${event.data.toolName}${detail === void 0 ? "" : `
|
|
5643
|
+
label: `${event.data.toolName}${detail === void 0 ? "" : ` · ${detail}`} · ${event.data.state}`,
|
|
5644
5644
|
state: event.data.state === "started" ? "active" : event.data.state === "succeeded" ? "success" : "failure"
|
|
5645
5645
|
});
|
|
5646
5646
|
}
|
|
@@ -5649,7 +5649,7 @@ function activityFromEvent(event) {
|
|
|
5649
5649
|
key: `check:${event.data.result.checkId}:${String(event.sequence)}`,
|
|
5650
5650
|
kind: "check",
|
|
5651
5651
|
detail: event.data.result.label,
|
|
5652
|
-
label: `${event.data.result.label}
|
|
5652
|
+
label: `${event.data.result.label} · ${event.data.result.status}`,
|
|
5653
5653
|
state: event.data.result.status === "passed" ? "success" : event.data.result.status === "failed" || event.data.result.status === "timed-out" ? "failure" : "info"
|
|
5654
5654
|
});
|
|
5655
5655
|
}
|