/)
assert.match(html, /id="proxy-provider-info-dialog"[\s\S]*id="proxy-provider-info-detail"/)
assert.match(script, /proxy-provider-info-dialog[\s\S]*event\.target === event\.currentTarget[\s\S]*\.close\(\)/)
assert.match(script, /function splitDirectRules\(value\)[\s\S]*noProxy:[\s\S]*bypass:/)
assert.match(html, /id="proxy-direct-rules"/)
assert.match(html, /id="proxy-system-rules-dialog"[\s\S]*id="proxy-system-rules-list"/)
assert.doesNotMatch(html, /id="proxy-no-proxy"|id="proxy-bypass"/)
assert.doesNotMatch(style, /\.proxy-provider-description/)
assert.match(html, /class="log-summary-row"> fileOperationMessage\(''\), 3_000\)/)
assert.match(html, /id="file-editor-status" role="status" aria-live="polite"/)
assert.match(script, /function renderFileEditorState\(\)[\s\S]*fileEditorSaving[\s\S]*fileEditorDirty/)
assert.match(script, /const content = elements\['file-editor-content'\]\.value[\s\S]*body: \{ path, content, revision, create \}[\s\S]*fileEditorDirty = elements\['file-editor-content'\]\.value !== fileEditorOriginal/)
assert.match(style, /\.file-editor-footer \{[^}]*justify-content: space-between;/)
assert.match(style, /@media \(max-width: 640px\)[\s\S]*\.plugin-draft-actions \{ display: grid; width: 100%; grid-template-columns: 1fr; \}/)
})
test('standalone console keeps localized feature parity on the shared Management API', async () => {
const publicRoot = new URL('../../control-plane/services/management/public/', import.meta.url)
const html = await readFile(new URL('index.html', publicRoot), 'utf8')
const script = await readFile(new URL('app.js', publicRoot), 'utf8')
const style = await readFile(new URL('style.css', publicRoot), 'utf8')
const serverSource = await readFile(new URL('../../control-plane/services/management/server.mjs', import.meta.url), 'utf8')
const maintenanceSource = await readFile(new URL('../stage0/lib/maintenance-server.mjs', import.meta.url), 'utf8')
const pluginSource = await readFile(new URL('../../environment/resources/plugins/platform-management/package/lib/client.js', import.meta.url), 'utf8')
for (const panel of ['updates', 'proxy', 'auth-settings', 'maintenance', 'plugins', 'skills', 'user-skills', 'user-plugins', 'terminal', 'files']) {
assert.match(html, new RegExp(`id="panel-${panel}"`))
}
const extensionTabs = [
'tab-maintenance', 'tab-files', 'tab-terminal', 'tab-plugins',
'tab-skills', 'tab-user-plugins', 'tab-user-skills', 'tab-proxy', 'tab-updates', 'tab-auth-settings',
]
.map(id => html.indexOf(`id="${id}"`))
assert.deepEqual(extensionTabs, [...extensionTabs].sort((left, right) => left - right))
assert.match(html, /id="tab-maintenance"[^>]*aria-selected="true"/)
assert.match(html, /id="panel-maintenance"[^>]*aria-labelledby="tab-maintenance">/)
assert.match(html, /id="panel-updates"[^>]*hidden>/)
assert.match(script, /void selectTab\('maintenance'\)/)
for (const route of [
'status', 'check', 'update', 'channel', 'automatic-check', 'holds/retry', 'rollback',
'return-stable', 'start-dsh', 'stop-dsh', 'restart-dsh', 'runtime/reset', 'bundled-plugins', 'bundled-plugins/recovery-action',
'bundled-plugins/discard', 'system-skills', 'system-skills/action', 'user-skills', 'user-skills/action', 'user-plugins', 'user-plugins/apply', 'user-plugins/task/', 'logs/stream',
'terminal/sessions',
'files/config', 'files/list', 'files/content', 'files/upload', 'files/download', 'files/tasks',
'proxy/provider-inventory', 'proxy/test', 'proxy/test/tasks/',
]) assert.match(script, new RegExp(route.replace('/', '\\/')))
assert.match(script, /const COPY = Object\.freeze\(\{[\s\S]*zh:[\s\S]*en:/)
assert.match(script, /projected\.enabled \? t\('userPluginEnabled'\) : t\('userPluginDisabled'\)/)
assert.match(script, /skill\.enabled \? t\('userSkillEnabled'\) : t\('userSkillDisabled'\)/)
assert.match(script, /dialogFocusTriggers = new WeakMap/)
assert.match(script, /dialogOpenObserver = new MutationObserver/)
assert.match(html, /