From feba51da6511ad8ea87bee002c338f6ba6d34927 Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Mon, 18 May 2026 03:27:30 +0800 Subject: [PATCH] Refactor auto-run flow state preservation --- background.js | 168 ++++++++++++- background/auto-run-controller.js | 99 +++++--- background/message-router.js | 77 +++++- background/runtime-state.js | 12 +- background/steps/kiro-device-auth.js | 6 +- shared/flow-registry.js | 4 +- shared/settings-schema.js | 10 +- sidepanel/sidepanel.html | 4 - sidepanel/sidepanel.js | 56 +++-- tests/auto-run-kiro-flow-selection.test.js | 228 ++++++++++++++++++ ...ackground-account-history-settings.test.js | 2 - tests/background-auto-run-module.test.js | 1 + ...background-kiro-device-auth-module.test.js | 8 +- .../background-message-router-module.test.js | 119 +++++++++ tests/background-runtime-state-module.test.js | 31 +++ ...ground-settings-schema-persistence.test.js | 15 +- tests/flow-registry-settings-schema.test.js | 5 +- ...sidepanel-auto-run-content-refresh.test.js | 46 +++- tests/sidepanel-flow-source-registry.test.js | 47 +++- 项目完整链路说明.md | 6 +- 项目文件结构说明.md | 2 +- 21 files changed, 835 insertions(+), 111 deletions(-) create mode 100644 tests/auto-run-kiro-flow-selection.test.js diff --git a/background.js b/background.js index 424e752..245bbe9 100644 --- a/background.js +++ b/background.js @@ -892,7 +892,6 @@ const PERSISTED_SETTING_DEFAULTS = { kiroSourceId: 'kiro-rs', kiroRsUrl: self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin', kiroRsKey: '', - kiroRegion: self.MultiPageFlowRegistry?.DEFAULT_KIRO_REGION || 'us-east-1', vpsUrl: '', vpsPassword: '', localCpaStep9Mode: DEFAULT_LOCAL_CPA_STEP9_MODE, @@ -2815,12 +2814,6 @@ function normalizePersistentSettingValue(key, value) { ).trim() || 'https://kiro.leftcode.xyz/admin'; case 'kiroRsKey': return String(value || ''); - case 'kiroRegion': - return String( - value - || self.MultiPageFlowRegistry?.DEFAULT_KIRO_REGION - || 'us-east-1' - ).trim() || 'us-east-1'; case 'vpsUrl': return String(value || '').trim(); case 'vpsPassword': @@ -3408,6 +3401,166 @@ async function getPersistedSettings() { return buildPersistentSettingsPayload(stored, { fillDefaults: true }); } +function cloneAutoRunKeepStateValue(value) { + if (Array.isArray(value)) { + return value.map((entry) => cloneAutoRunKeepStateValue(entry)); + } + if (isPlainObjectValue(value)) { + return Object.fromEntries( + Object.entries(value).map(([key, entryValue]) => [key, cloneAutoRunKeepStateValue(entryValue)]) + ); + } + return value; +} + +function mergeAutoRunKeepStateValue(baseValue, patchValue) { + if (Array.isArray(patchValue)) { + return patchValue.map((entry) => cloneAutoRunKeepStateValue(entry)); + } + if (!isPlainObjectValue(patchValue)) { + return patchValue === undefined ? cloneAutoRunKeepStateValue(baseValue) : patchValue; + } + + const baseObject = isPlainObjectValue(baseValue) ? baseValue : {}; + const nextObject = { + ...cloneAutoRunKeepStateValue(baseObject), + }; + for (const [key, entryValue] of Object.entries(patchValue)) { + nextObject[key] = mergeAutoRunKeepStateValue(baseObject[key], entryValue); + } + return nextObject; +} + +function collectAutoRunFreshResetRuntimeSettingKeys() { + const keySet = new Set(); + const flowFieldGroups = isPlainObjectValue(runtimeStateHelpers?.FLOW_FIELD_GROUPS) + ? runtimeStateHelpers.FLOW_FIELD_GROUPS + : {}; + + for (const groups of Object.values(flowFieldGroups)) { + if (!isPlainObjectValue(groups)) { + continue; + } + for (const fields of Object.values(groups)) { + if (!Array.isArray(fields)) { + continue; + } + for (const field of fields) { + const normalizedField = String(field || '').trim(); + if (normalizedField) { + keySet.add(normalizedField); + } + } + } + } + + const sharedRuntimeFieldGroups = [ + runtimeStateHelpers?.RUNTIME_SHARED_FIELDS, + runtimeStateHelpers?.RUNTIME_PROXY_FIELDS, + ]; + for (const fields of sharedRuntimeFieldGroups) { + if (!Array.isArray(fields)) { + continue; + } + for (const field of fields) { + const normalizedField = String(field || '').trim(); + if (normalizedField) { + keySet.add(normalizedField); + } + } + } + + return keySet; +} + +function buildAutoRunFreshResetSettingsState(prevState = {}, activeFlowId = DEFAULT_ACTIVE_FLOW_ID) { + const currentSettingsState = isPlainObjectValue(prevState?.settingsState) + ? prevState.settingsState + : {}; + const normalizedStepExecutionRangeByFlow = normalizeStepExecutionRangeByFlow(prevState?.stepExecutionRangeByFlow || {}); + const nextSettingsStatePatch = { + activeFlowId, + services: { + email: { + provider: prevState?.mailProvider, + }, + proxy: { + enabled: prevState?.ipProxyEnabled, + provider: prevState?.ipProxyService, + mode: prevState?.ipProxyMode, + }, + }, + flows: { + openai: { + source: { + selected: prevState?.panelMode, + }, + autoRun: normalizedStepExecutionRangeByFlow.openai + ? { + stepExecutionRange: normalizedStepExecutionRangeByFlow.openai, + } + : undefined, + }, + kiro: { + source: { + selected: prevState?.kiroSourceId, + }, + autoRun: normalizedStepExecutionRangeByFlow.kiro + ? { + stepExecutionRange: normalizedStepExecutionRangeByFlow.kiro, + } + : undefined, + }, + }, + }; + + return mergeAutoRunKeepStateValue(currentSettingsState, nextSettingsStatePatch); +} + +function buildFreshAutoRunKeepState(prevState = {}) { + const sourceState = isPlainObjectValue(prevState) ? prevState : {}; + const activeFlowId = self.MultiPageFlowRegistry?.normalizeFlowId + ? self.MultiPageFlowRegistry.normalizeFlowId( + sourceState.activeFlowId || sourceState.flowId, + DEFAULT_ACTIVE_FLOW_ID + ) + : (String(sourceState.activeFlowId || sourceState.flowId || DEFAULT_ACTIVE_FLOW_ID).trim().toLowerCase() + || DEFAULT_ACTIVE_FLOW_ID); + const settingsState = buildAutoRunFreshResetSettingsState(sourceState, activeFlowId); + const persistedSnapshot = buildPersistentSettingsPayload({ + ...sourceState, + activeFlowId, + settingsState, + }, { + fillDefaults: false, + }); + const runtimeOnlyKeys = collectAutoRunFreshResetRuntimeSettingKeys(); + const keepState = {}; + + for (const [key, value] of Object.entries(persistedSnapshot)) { + if (runtimeOnlyKeys.has(key)) { + continue; + } + keepState[key] = value; + } + + keepState.activeFlowId = activeFlowId; + keepState.flowId = activeFlowId; + if (Object.prototype.hasOwnProperty.call(sourceState, 'panelMode')) { + keepState.panelMode = normalizePanelMode(sourceState.panelMode); + } + if (Object.prototype.hasOwnProperty.call(sourceState, 'kiroSourceId')) { + keepState.kiroSourceId = self.MultiPageFlowRegistry?.normalizeSourceId + ? self.MultiPageFlowRegistry.normalizeSourceId('kiro', sourceState.kiroSourceId, 'kiro-rs') + : String(sourceState.kiroSourceId || 'kiro-rs').trim().toLowerCase(); + } + if (Object.prototype.hasOwnProperty.call(sourceState, 'settingsSchemaVersion')) { + keepState.settingsSchemaVersion = Number(sourceState.settingsSchemaVersion) || 0; + } + keepState.settingsState = settingsState; + return keepState; +} + async function getPersistedAliasState() { try { const stored = await chrome.storage.local.get(PERSISTENT_ALIAS_STATE_KEYS); @@ -11674,6 +11827,7 @@ const autoRunController = self.MultiPageBackgroundAutoRunController?.createAutoR AUTO_RUN_TIMER_KIND_BETWEEN_ROUNDS, broadcastAutoRunStatus, broadcastStopToContentScripts, + buildFreshAutoRunKeepState, cancelPendingCommands, clearStopRequest: () => clearStopRequest(), createAutoRunSessionId: () => createAutoRunSessionId(), diff --git a/background/auto-run-controller.js b/background/auto-run-controller.js index 234d0e8..a3eb886 100644 --- a/background/auto-run-controller.js +++ b/background/auto-run-controller.js @@ -11,6 +11,7 @@ AUTO_RUN_TIMER_KIND_BETWEEN_ROUNDS, broadcastAutoRunStatus, broadcastStopToContentScripts, + buildFreshAutoRunKeepState, cancelPendingCommands, clearStopRequest, createAutoRunSessionId, @@ -77,6 +78,67 @@ throw new Error('自动运行节点执行器未接入。'); } + function buildFreshStartStateSnapshot(state = {}) { + return { + ...(state || {}), + currentNodeId: '', + nodeStatuses: {}, + stepStatuses: {}, + }; + } + + function resolveFreshStartNodeId(state = {}) { + const freshState = buildFreshStartStateSnapshot(state); + return String(getFirstUnfinishedWorkflowNode(freshState) || '').trim(); + } + + function buildFreshAttemptKeepState(state = {}, context = {}) { + if (typeof buildFreshAutoRunKeepState === 'function') { + const helperPatch = buildFreshAutoRunKeepState(state, context); + if (helperPatch && typeof helperPatch === 'object' && !Array.isArray(helperPatch)) { + return { + ...helperPatch, + }; + } + } + + return { + activeFlowId: state.activeFlowId, + flowId: state.flowId || state.activeFlowId, + panelMode: state.panelMode, + kiroSourceId: state.kiroSourceId, + vpsUrl: state.vpsUrl, + vpsPassword: state.vpsPassword, + customPassword: state.customPassword, + plusModeEnabled: state.plusModeEnabled, + plusPaymentMethod: state.plusPaymentMethod, + phoneVerificationEnabled: state.phoneVerificationEnabled, + phoneSignupReloginAfterBindEmailEnabled: state.phoneSignupReloginAfterBindEmailEnabled, + paypalEmail: state.paypalEmail, + paypalPassword: state.paypalPassword, + kiroRsUrl: state.kiroRsUrl, + kiroRsKey: state.kiroRsKey, + autoRunSkipFailures: state.autoRunSkipFailures, + autoRunFallbackThreadIntervalMinutes: state.autoRunFallbackThreadIntervalMinutes, + autoRunDelayEnabled: state.autoRunDelayEnabled, + autoRunDelayMinutes: state.autoRunDelayMinutes, + autoStepDelaySeconds: state.autoStepDelaySeconds, + stepExecutionRangeByFlow: state.stepExecutionRangeByFlow, + signupMethod: state.signupMethod, + mailProvider: state.mailProvider, + emailGenerator: state.emailGenerator, + gmailBaseEmail: state.gmailBaseEmail, + mail2925BaseEmail: state.mail2925BaseEmail, + currentMail2925AccountId: state.currentMail2925AccountId, + emailPrefix: state.emailPrefix, + inbucketHost: state.inbucketHost, + inbucketMailbox: state.inbucketMailbox, + cloudflareDomain: state.cloudflareDomain, + cloudflareDomains: state.cloudflareDomains, + reusablePhoneActivation: state.reusablePhoneActivation, + }; + } + function createAutoRunRoundSummary(round) { return { round, @@ -502,12 +564,13 @@ autoRunAttemptRun: attemptRun, }); roundSummary.attempts = attemptRun; - const defaultStartNodeId = typeof runAutoSequenceFromNode === 'function' ? 'open-chatgpt' : 1; + const attemptState = await getState(); + const defaultStartNodeId = resolveFreshStartNodeId(attemptState); let startNodeId = defaultStartNodeId; let useExistingProgress = false; if (reuseExistingProgress) { - let currentState = await getState(); + let currentState = attemptState; if (getRunningWorkflowNodes(currentState).length) { currentState = await waitForRunningWorkflowNodesToFinish({ currentRun: targetRun, @@ -525,32 +588,14 @@ } if (!useExistingProgress) { - const prevState = await getState(); + const prevState = attemptState; const keepSettings = { - vpsUrl: prevState.vpsUrl, - vpsPassword: prevState.vpsPassword, - customPassword: prevState.customPassword, - plusModeEnabled: prevState.plusModeEnabled, - paypalEmail: prevState.paypalEmail, - paypalPassword: prevState.paypalPassword, - autoRunSkipFailures: prevState.autoRunSkipFailures, - autoRunFallbackThreadIntervalMinutes: prevState.autoRunFallbackThreadIntervalMinutes, - autoRunDelayEnabled: prevState.autoRunDelayEnabled, - autoRunDelayMinutes: prevState.autoRunDelayMinutes, - autoStepDelaySeconds: prevState.autoStepDelaySeconds, - stepExecutionRangeByFlow: prevState.stepExecutionRangeByFlow, - signupMethod: prevState.signupMethod, - mailProvider: prevState.mailProvider, - emailGenerator: prevState.emailGenerator, - gmailBaseEmail: prevState.gmailBaseEmail, - mail2925BaseEmail: prevState.mail2925BaseEmail, - currentMail2925AccountId: prevState.currentMail2925AccountId, - emailPrefix: prevState.emailPrefix, - inbucketHost: prevState.inbucketHost, - inbucketMailbox: prevState.inbucketMailbox, - cloudflareDomain: prevState.cloudflareDomain, - cloudflareDomains: prevState.cloudflareDomains, - reusablePhoneActivation: prevState.reusablePhoneActivation, + ...buildFreshAttemptKeepState(prevState, { + targetRun, + totalRuns, + attemptRun, + sessionId, + }), autoRunRoundSummaries: serializeAutoRunRoundSummaries(totalRuns, roundSummaries), autoRunSessionId: sessionId, tabRegistry: {}, diff --git a/background/message-router.js b/background/message-router.js index 53da5ac..a576c5f 100644 --- a/background/message-router.js +++ b/background/message-router.js @@ -191,6 +191,59 @@ verifyHotmailAccount, } = deps; + function normalizeMessageFlowId(value = '', fallback = 'openai') { + const rootScope = typeof self !== 'undefined' ? self : globalThis; + if (typeof rootScope.MultiPageFlowRegistry?.normalizeFlowId === 'function') { + return rootScope.MultiPageFlowRegistry.normalizeFlowId(value, fallback); + } + const fallbackFlowId = String(fallback || 'openai').trim().toLowerCase() || 'openai'; + const normalized = String(value || '').trim().toLowerCase(); + if (!normalized || normalized === 'codex') { + return fallbackFlowId; + } + return normalized; + } + + function normalizeMessageSourceId(flowId, sourceId = '', fallback = '') { + const rootScope = typeof self !== 'undefined' ? self : globalThis; + if (typeof rootScope.MultiPageFlowRegistry?.normalizeSourceId === 'function') { + return rootScope.MultiPageFlowRegistry.normalizeSourceId(flowId, sourceId, fallback); + } + const fallbackSourceId = String( + fallback || (normalizeMessageFlowId(flowId) === 'kiro' ? 'kiro-rs' : 'cpa') + ).trim().toLowerCase(); + return String(sourceId || fallbackSourceId).trim().toLowerCase() || fallbackSourceId; + } + + function mapAutoRunSourceIdToPanelMode(sourceId = '', fallback = 'cpa') { + const rootScope = typeof self !== 'undefined' ? self : globalThis; + if (typeof rootScope.MultiPageFlowRegistry?.mapSourceIdToPanelMode === 'function') { + return rootScope.MultiPageFlowRegistry.mapSourceIdToPanelMode('openai', sourceId, fallback); + } + return String(sourceId || fallback || 'cpa').trim().toLowerCase() || 'cpa'; + } + + function buildAutoRunFlowStateUpdates(payload = {}) { + const hasActiveFlowId = Object.prototype.hasOwnProperty.call(payload, 'activeFlowId'); + const hasSourceId = Object.prototype.hasOwnProperty.call(payload, 'sourceId'); + if (!hasActiveFlowId && !hasSourceId) { + return {}; + } + const activeFlowId = normalizeMessageFlowId(payload.activeFlowId, 'openai'); + const updates = { + activeFlowId, + flowId: activeFlowId, + }; + if (hasSourceId) { + if (activeFlowId === 'kiro') { + updates.kiroSourceId = normalizeMessageSourceId('kiro', payload.sourceId, 'kiro-rs'); + } else { + updates.panelMode = mapAutoRunSourceIdToPanelMode(payload.sourceId, 'cpa'); + } + } + return updates; + } + function preserveKeyFromState(updates, currentState, key) { if (!Object.prototype.hasOwnProperty.call(updates, key)) { return; @@ -1208,8 +1261,16 @@ }); } } + const autoRunFlowStateUpdates = buildAutoRunFlowStateUpdates(message.payload || {}); + if (Object.keys(autoRunFlowStateUpdates).length > 0 && typeof setState === 'function') { + await setState(autoRunFlowStateUpdates); + } const state = await getState(); - const autoRunStartValidation = validateAutoRunStart(state, { state }); + const autoRunStartValidation = validateAutoRunStart(state, { + activeFlowId: autoRunFlowStateUpdates.activeFlowId ?? state?.activeFlowId, + panelMode: autoRunFlowStateUpdates.panelMode ?? state?.panelMode, + state, + }); if (autoRunStartValidation?.ok === false) { throw new Error(autoRunStartValidation.errors?.[0]?.message || '当前设置不支持启动自动流程。'); } @@ -1240,8 +1301,16 @@ }); } } + const autoRunFlowStateUpdates = buildAutoRunFlowStateUpdates(message.payload || {}); + if (Object.keys(autoRunFlowStateUpdates).length > 0 && typeof setState === 'function') { + await setState(autoRunFlowStateUpdates); + } const state = await getState(); - const autoRunStartValidation = validateAutoRunStart(state, { state }); + const autoRunStartValidation = validateAutoRunStart(state, { + activeFlowId: autoRunFlowStateUpdates.activeFlowId ?? state?.activeFlowId, + panelMode: autoRunFlowStateUpdates.panelMode ?? state?.panelMode, + state, + }); if (autoRunStartValidation?.ok === false) { throw new Error(autoRunStartValidation.errors?.[0]?.message || '当前设置不支持启动自动流程。'); } @@ -1374,6 +1443,10 @@ oauthFlowDeadlineSourceUrl: null, } : {}), }; + if (Object.prototype.hasOwnProperty.call(updates, 'activeFlowId') + && !Object.prototype.hasOwnProperty.call(stateUpdates, 'flowId')) { + stateUpdates.flowId = updates.activeFlowId; + } if (Object.prototype.hasOwnProperty.call(updates, 'icloudHostPreference')) { const nextHostPreference = String(updates.icloudHostPreference || '').trim().toLowerCase(); stateUpdates.preferredIcloudHost = nextHostPreference === 'icloud.com' || nextHostPreference === 'icloud.com.cn' diff --git a/background/runtime-state.js b/background/runtime-state.js index 59d7154..babc891 100644 --- a/background/runtime-state.js +++ b/background/runtime-state.js @@ -321,13 +321,13 @@ ...cloneValue(normalizePlainObject(state.runtimeState)), }; const activeFlowId = normalizeFlowId( - Object.prototype.hasOwnProperty.call(state, 'flowId') - ? state.flowId - : Object.prototype.hasOwnProperty.call(state, 'activeFlowId') + Object.prototype.hasOwnProperty.call(state, 'activeFlowId') ? state.activeFlowId - : Object.prototype.hasOwnProperty.call(baseRuntimeState, 'flowId') - ? baseRuntimeState.flowId - : baseRuntimeState.activeFlowId + : Object.prototype.hasOwnProperty.call(state, 'flowId') + ? state.flowId + : Object.prototype.hasOwnProperty.call(baseRuntimeState, 'activeFlowId') + ? baseRuntimeState.activeFlowId + : baseRuntimeState.flowId ); const currentNodeId = String( Object.prototype.hasOwnProperty.call(state, 'currentNodeId') diff --git a/background/steps/kiro-device-auth.js b/background/steps/kiro-device-auth.js index a8efa96..1cc6fb9 100644 --- a/background/steps/kiro-device-auth.js +++ b/background/steps/kiro-device-auth.js @@ -326,7 +326,7 @@ try { const latestState = await getExecutionState(state); const auth = await startBuilderIdDeviceLogin( - latestState.kiroRegion || DEFAULT_REGION, + DEFAULT_REGION, fetchImpl ); const loginUrl = cleanString(auth.verificationUriComplete || auth.verificationUri); @@ -379,7 +379,7 @@ const clientId = cleanString(latestState.kiroClientId); const clientSecret = String(latestState.kiroClientSecret || ''); const deviceCode = String(latestState.kiroDeviceAuthorizationCode || ''); - const region = normalizeRegion(latestState.kiroAuthRegion || latestState.kiroRegion || DEFAULT_REGION); + const region = normalizeRegion(latestState.kiroAuthRegion, DEFAULT_REGION); const expiresAt = Math.max(0, Number(latestState.kiroAuthExpiresAt) || 0); if (!clientId || !clientSecret || !deviceCode) { throw new Error('Kiro device login has not been started yet.'); @@ -443,7 +443,7 @@ const refreshToken = String(latestState.kiroRefreshToken || ''); const clientId = cleanString(latestState.kiroClientId); const clientSecret = String(latestState.kiroClientSecret || ''); - const region = normalizeRegion(latestState.kiroAuthRegion || latestState.kiroRegion || DEFAULT_REGION); + const region = normalizeRegion(latestState.kiroAuthRegion, DEFAULT_REGION); const kiroRsUrl = String(latestState.kiroRsUrl || ''); const kiroRsKey = String(latestState.kiroRsKey || ''); if (!refreshToken || !clientId || !clientSecret) { diff --git a/shared/flow-registry.js b/shared/flow-registry.js index f6875ed..c1a378a 100644 --- a/shared/flow-registry.js +++ b/shared/flow-registry.js @@ -5,7 +5,6 @@ const LEGACY_OPENAI_FLOW_ALIAS = 'codex'; const DEFAULT_OPENAI_SOURCE_ID = 'cpa'; const DEFAULT_KIRO_SOURCE_ID = 'kiro-rs'; - const DEFAULT_KIRO_REGION = 'us-east-1'; const DEFAULT_KIRO_RS_URL = 'https://kiro.leftcode.xyz/admin'; const OPENAI_SOURCE_IDS = Object.freeze(['cpa', 'sub2api', 'codex2api']); const SHARED_SERVICE_IDS = Object.freeze(['email', 'proxy']); @@ -310,7 +309,7 @@ 'kiro-source-kiro-rs': { id: 'kiro-source-kiro-rs', label: 'kiro.rs 配置', - rowIds: ['row-kiro-rs-url', 'row-kiro-rs-key', 'row-kiro-region'], + rowIds: ['row-kiro-rs-url', 'row-kiro-rs-key'], }, 'kiro-runtime-status': { id: 'kiro-runtime-status', @@ -461,7 +460,6 @@ return { DEFAULT_FLOW_CAPABILITIES, DEFAULT_FLOW_ID, - DEFAULT_KIRO_REGION, DEFAULT_KIRO_RS_URL, DEFAULT_KIRO_SOURCE_ID, DEFAULT_OPENAI_SOURCE_ID, diff --git a/shared/settings-schema.js b/shared/settings-schema.js index 3564750..04363da 100644 --- a/shared/settings-schema.js +++ b/shared/settings-schema.js @@ -35,7 +35,6 @@ const defaultFlowId = String(deps.defaultFlowId || flowRegistry.DEFAULT_FLOW_ID || 'openai').trim().toLowerCase() || 'openai'; const defaultOpenAiSourceId = flowRegistry.DEFAULT_OPENAI_SOURCE_ID || 'cpa'; const defaultKiroSourceId = flowRegistry.DEFAULT_KIRO_SOURCE_ID || 'kiro-rs'; - const defaultKiroRegion = flowRegistry.DEFAULT_KIRO_REGION || 'us-east-1'; const defaultKiroRsUrl = flowRegistry.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin'; const normalizeFlowId = typeof flowRegistry.normalizeFlowId === 'function' ? flowRegistry.normalizeFlowId @@ -123,7 +122,6 @@ }, }, options: { - kiroRegion: defaultKiroRegion, kiroRsPriority: 0, kiroRsEndpoint: '', kiroRsAuthRegion: '', @@ -286,11 +284,6 @@ }, }, options: { - kiroRegion: String( - input?.kiroRegion - ?? nested?.flows?.kiro?.options?.kiroRegion - ?? defaults.flows.kiro.options.kiroRegion - ).trim() || defaults.flows.kiro.options.kiroRegion, kiroRsPriority: Number( input?.kiroRsPriority ?? nested?.flows?.kiro?.options?.kiroRsPriority @@ -389,11 +382,11 @@ next.ipProxyMode = normalizedState.services.proxy.mode; next.kiroRsUrl = kiroState.source.entries['kiro-rs'].kiroRsUrl; next.kiroRsKey = kiroState.source.entries['kiro-rs'].kiroRsKey; - next.kiroRegion = kiroState.options.kiroRegion; next.kiroRsPriority = kiroState.options.kiroRsPriority; next.kiroRsEndpoint = kiroState.options.kiroRsEndpoint; next.kiroRsAuthRegion = kiroState.options.kiroRsAuthRegion; next.kiroRsApiRegion = kiroState.options.kiroRsApiRegion; + delete next.kiroRegion; next.stepExecutionRangeByFlow = buildStepExecutionRangeByFlow(normalizedState); next.settingsSchemaVersion = normalizedState.schemaVersion; next.settingsState = cloneValue(normalizedState); @@ -409,7 +402,6 @@ sourceId: getSelectedSourceId(normalizedState, 'kiro'), kiroRsUrl: normalizedState.flows.kiro.source.entries['kiro-rs'].kiroRsUrl, kiroRsKey: normalizedState.flows.kiro.source.entries['kiro-rs'].kiroRsKey, - kiroRegion: normalizedState.flows.kiro.options.kiroRegion, }; } return { diff --git a/sidepanel/sidepanel.html b/sidepanel/sidepanel.html index 21798fd..f86febf 100644 --- a/sidepanel/sidepanel.html +++ b/sidepanel/sidepanel.html @@ -257,10 +257,6 @@ title="显示 kiro.rs API Key"> -