From a3c36e6f151b291a448be8f2129adb74af760bda Mon Sep 17 00:00:00 2001
From: QLHazyCoder <2825305047@qq.com>
Date: Tue, 19 May 2026 03:22:14 +0800
Subject: [PATCH] fix: remove default kiro.rs admin URL
---
background.js | 8 ++------
shared/flow-registry.js | 2 +-
shared/settings-schema.js | 2 +-
sidepanel/sidepanel.html | 7 +++++--
sidepanel/sidepanel.js | 15 +++++++--------
tests/background-account-history-settings.test.js | 4 ++--
...background-settings-schema-persistence.test.js | 2 +-
tests/sidepanel-flow-source-registry.test.js | 1 +
8 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/background.js b/background.js
index 51cc9cb..5dc8522 100644
--- a/background.js
+++ b/background.js
@@ -913,7 +913,7 @@ const PERSISTED_SETTING_DEFAULTS = {
panelMode: 'cpa',
activeFlowId: DEFAULT_ACTIVE_FLOW_ID,
kiroTargetId: 'kiro-rs',
- kiroRsUrl: self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin',
+ kiroRsUrl: String(self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL || '').trim(),
kiroRsKey: '',
vpsUrl: '',
vpsPassword: '',
@@ -2769,11 +2769,7 @@ function normalizePersistentSettingValue(key, value) {
}
return String(value || '').trim().toLowerCase() === 'kiro-rs' ? 'kiro-rs' : 'kiro-rs';
case 'kiroRsUrl':
- return String(
- value
- || self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL
- || 'https://kiro.leftcode.xyz/admin'
- ).trim() || 'https://kiro.leftcode.xyz/admin';
+ return String(value || '').trim();
case 'kiroRsKey':
return String(value || '').trim();
case 'vpsUrl':
diff --git a/shared/flow-registry.js b/shared/flow-registry.js
index 136ec20..49c7dc5 100644
--- a/shared/flow-registry.js
+++ b/shared/flow-registry.js
@@ -5,7 +5,7 @@
const DEFAULT_OPENAI_TARGET_ID = 'cpa';
const DEFAULT_KIRO_TARGET_ID = 'kiro-rs';
const DEFAULT_KIRO_PUBLICATION_TARGET_ID = 'kiro-rs';
- const DEFAULT_KIRO_RS_URL = 'https://kiro.leftcode.xyz/admin';
+ const DEFAULT_KIRO_RS_URL = '';
const OPENAI_TARGET_IDS = Object.freeze(['cpa', 'sub2api', 'codex2api']);
const SHARED_SERVICE_IDS = Object.freeze(['account', 'email', 'proxy']);
diff --git a/shared/settings-schema.js b/shared/settings-schema.js
index 2086d98..dd5a1bf 100644
--- a/shared/settings-schema.js
+++ b/shared/settings-schema.js
@@ -37,7 +37,7 @@
).trim().toLowerCase() || 'openai';
const defaultOpenAiTargetId = flowRegistry.DEFAULT_OPENAI_TARGET_ID || 'cpa';
const defaultKiroTargetId = flowRegistry.DEFAULT_KIRO_TARGET_ID || 'kiro-rs';
- const defaultKiroRsUrl = flowRegistry.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin';
+ const defaultKiroRsUrl = String(flowRegistry.DEFAULT_KIRO_RS_URL || '').trim();
const normalizeFlowId = typeof flowRegistry.normalizeFlowId === 'function'
? flowRegistry.normalizeFlowId
: ((value = '', fallback = defaultFlowId) => {
diff --git a/sidepanel/sidepanel.html b/sidepanel/sidepanel.html
index 7d73a75..161aa40 100644
--- a/sidepanel/sidepanel.html
+++ b/sidepanel/sidepanel.html
@@ -243,8 +243,11 @@
API Key
diff --git a/sidepanel/sidepanel.js b/sidepanel/sidepanel.js
index 4e0c746..a6b2919 100644
--- a/sidepanel/sidepanel.js
+++ b/sidepanel/sidepanel.js
@@ -173,6 +173,7 @@ const rowCodex2ApiAdminKey = document.getElementById('row-codex2api-admin-key');
const inputCodex2ApiAdminKey = document.getElementById('input-codex2api-admin-key');
const rowKiroRsUrl = document.getElementById('row-kiro-rs-url');
const inputKiroRsUrl = document.getElementById('input-kiro-rs-url');
+const btnOpenKiroRsGithub = document.getElementById('btn-open-kiro-rs-github');
const rowKiroRsKey = document.getElementById('row-kiro-rs-key');
const inputKiroRsKey = document.getElementById('input-kiro-rs-key');
const btnTestKiroRs = document.getElementById('btn-test-kiro-rs');
@@ -4256,9 +4257,7 @@ function collectSettingsPayload() {
return Number.isSafeInteger(numeric) && numeric >= 1 ? numeric : 1;
});
const flowRegistryApi = typeof getFlowRegistry === 'function' ? getFlowRegistry() : null;
- const defaultKiroRsUrl = String(
- flowRegistryApi?.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin'
- ).trim() || 'https://kiro.leftcode.xyz/admin';
+ const defaultKiroRsUrl = String(flowRegistryApi?.DEFAULT_KIRO_RS_URL || '').trim();
const normalizeKiroTargetIdSafe = typeof normalizeTargetIdForFlow === 'function'
? normalizeTargetIdForFlow
: ((_flowId, targetId = '', fallback = 'kiro-rs') => {
@@ -10034,11 +10033,7 @@ function applySettingsState(state) {
}
inputSub2ApiDefaultProxy.value = state?.sub2apiDefaultProxyName || '';
if (typeof inputKiroRsUrl !== 'undefined' && inputKiroRsUrl) {
- inputKiroRsUrl.value = String(
- state?.kiroRsUrl
- || getFlowRegistry()?.DEFAULT_KIRO_RS_URL
- || 'https://kiro.leftcode.xyz/admin'
- ).trim();
+ inputKiroRsUrl.value = String(state?.kiroRsUrl || '').trim();
}
if (typeof inputKiroRsKey !== 'undefined' && inputKiroRsKey) {
inputKiroRsKey.value = String(state?.kiroRsKey || '');
@@ -13893,6 +13888,10 @@ btnGpcHelperConvertApiKey?.addEventListener('click', () => {
openExternalUrl(GPC_HELPER_PORTAL_URL);
});
+btnOpenKiroRsGithub?.addEventListener('click', () => {
+ openExternalUrl('https://github.com/hank9999/kiro.rs');
+});
+
btnGpcHelperBalance?.addEventListener('click', async () => {
try {
const response = await chrome.runtime.sendMessage({
diff --git a/tests/background-account-history-settings.test.js b/tests/background-account-history-settings.test.js
index 1ce803d..425efd4 100644
--- a/tests/background-account-history-settings.test.js
+++ b/tests/background-account-history-settings.test.js
@@ -134,7 +134,7 @@ const FIVE_SIM_SUPPORTED_COUNTRY_ID_SET = new Set(['indonesia', 'thailand', 'vie
const HERO_SMS_SUPPORTED_COUNTRY_ID_SET = new Set(['6', '52', '10']);
const self = {
MultiPageFlowRegistry: {
- DEFAULT_KIRO_RS_URL: 'https://kiro.leftcode.xyz/admin',
+ DEFAULT_KIRO_RS_URL: '',
normalizeFlowId(value, fallback = 'openai') {
const normalized = String(value || '').trim().toLowerCase();
if (normalized === 'kiro') {
@@ -277,7 +277,7 @@ return {
assert.equal(api.normalizePersistentSettingValue('activeFlowId', 'codex'), 'openai');
assert.equal(api.normalizePersistentSettingValue('activeFlowId', 'kiro'), 'kiro');
assert.equal(api.normalizePersistentSettingValue('kiroTargetId', 'unknown'), 'kiro-rs');
- assert.equal(api.normalizePersistentSettingValue('kiroRsUrl', ''), 'https://kiro.leftcode.xyz/admin');
+ assert.equal(api.normalizePersistentSettingValue('kiroRsUrl', ''), '');
assert.equal(api.normalizePersistentSettingValue('kiroRsKey', ' key-1 '), 'key-1');
assert.equal(api.normalizePersistentSettingValue('phoneSmsProvider', '5SIM'), '5sim');
assert.equal(api.normalizePersistentSettingValue('phoneSmsProvider', 'NEXSMS'), 'nexsms');
diff --git a/tests/background-settings-schema-persistence.test.js b/tests/background-settings-schema-persistence.test.js
index 6630399..daf5b37 100644
--- a/tests/background-settings-schema-persistence.test.js
+++ b/tests/background-settings-schema-persistence.test.js
@@ -101,7 +101,7 @@ const PERSISTED_SETTING_DEFAULTS = {
ipProxyService: '711proxy',
ipProxyMode: 'account',
kiroTargetId: 'kiro-rs',
- kiroRsUrl: 'https://kiro.leftcode.xyz/admin',
+ kiroRsUrl: '',
kiroRsKey: '',
stepExecutionRangeByFlow: {},
};
diff --git a/tests/sidepanel-flow-source-registry.test.js b/tests/sidepanel-flow-source-registry.test.js
index 7105eb7..c8be10a 100644
--- a/tests/sidepanel-flow-source-registry.test.js
+++ b/tests/sidepanel-flow-source-registry.test.js
@@ -39,6 +39,7 @@ test('sidepanel html exposes flow selector and kiro source fields', () => {
'id="label-source-selector"',
'id="row-step6-cookie-settings"',
'id="row-kiro-rs-url"',
+ 'id="btn-open-kiro-rs-github"',
'id="row-kiro-rs-key"',
'id="btn-test-kiro-rs"',
'id="row-kiro-rs-test-status"',