vc-extras 0.0.0-stage → 0.1.1
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/README.md +128 -3
- package/agent-install.mjs +159 -0
- package/agents/tester.md +23 -0
- package/install-extras.mjs +66 -0
- package/install-menu.mjs +42 -0
- package/install-skills.mjs +112 -0
- package/package.json +72 -6
- package/plugin-registry.mjs +73 -0
- package/plugins/config-ui/index.ts +160 -0
- package/plugins/config-ui/lib/arguments.mjs +24 -0
- package/plugins/config-ui/lib/documents.mjs +67 -0
- package/plugins/config-ui/lib/frontmatter.mjs +91 -0
- package/plugins/config-ui/lib/open.mjs +17 -0
- package/plugins/config-ui/lib/ownership.mjs +99 -0
- package/plugins/config-ui/lib/page.mjs +11 -0
- package/plugins/config-ui/lib/patch.mjs +36 -0
- package/plugins/config-ui/lib/paths.mjs +14 -0
- package/plugins/config-ui/lib/plugin-fields.mjs +86 -0
- package/plugins/config-ui/lib/plugin-validation.mjs +28 -0
- package/plugins/config-ui/lib/redaction.mjs +8 -0
- package/plugins/config-ui/lib/registry.mjs +282 -0
- package/plugins/config-ui/lib/secrets.mjs +45 -0
- package/plugins/config-ui/lib/server.mjs +251 -0
- package/plugins/config-ui/lib/sources.mjs +96 -0
- package/plugins/config-ui/lib/state.mjs +157 -0
- package/plugins/config-ui/lib/themes.mjs +113 -0
- package/plugins/config-ui/lib/writer.mjs +691 -0
- package/plugins/config-ui/package.json +12 -0
- package/plugins/config-ui/project-local-owner.ts +106 -0
- package/plugins/config-ui/vc-extras.plugin.json +13 -0
- package/plugins/config-ui/web/app.mjs +997 -0
- package/plugins/config-ui/web/index.html +342 -0
- package/plugins/pi-blackhole/vc-extras.plugin.json +12 -0
- package/plugins/pi-btw/vc-extras.plugin.json +12 -0
- package/plugins/pi-claude-code/vc-extras.plugin.json +12 -0
- package/plugins/pi-fff/vc-extras.plugin.json +12 -0
- package/plugins/pi-jev-auto-mode/vc-extras.plugin.json +12 -0
- package/plugins/pi-mcp-adapter/vc-extras.plugin.json +12 -0
- package/plugins/pi-web-access/vc-extras.plugin.json +12 -0
- package/plugins/vc-ask/claude-hook.mjs +37 -0
- package/plugins/vc-ask/codex-native.mjs +28 -0
- package/plugins/vc-ask/host-channel.mjs +75 -0
- package/plugins/vc-ask/index.ts +57 -0
- package/plugins/vc-ask/native-questions.mjs +33 -0
- package/plugins/vc-ask/package.json +10 -0
- package/plugins/vc-ask/payload.ts +170 -0
- package/plugins/vc-ask/questionnaire/LICENSE.ask-user-question +21 -0
- package/plugins/vc-ask/questionnaire/UPSTREAM.md +104 -0
- package/plugins/vc-ask/questionnaire/answer-channel.ts +135 -0
- package/plugins/vc-ask/questionnaire/config.ts +180 -0
- package/plugins/vc-ask/questionnaire/events.ts +154 -0
- package/plugins/vc-ask/questionnaire/execute.ts +688 -0
- package/plugins/vc-ask/questionnaire/i18n.ts +73 -0
- package/plugins/vc-ask/questionnaire/inline-entry.ts +312 -0
- package/plugins/vc-ask/questionnaire/locales/de.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/en.json +42 -0
- package/plugins/vc-ask/questionnaire/locales/es.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/fr.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/pt-BR.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/pt.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/ru.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/uk.json +43 -0
- package/plugins/vc-ask/questionnaire/locales/zh.json +46 -0
- package/plugins/vc-ask/questionnaire/presentation.ts +11 -0
- package/plugins/vc-ask/questionnaire/question-preview.ts +6 -0
- package/plugins/vc-ask/questionnaire/rpc.ts +221 -0
- package/plugins/vc-ask/questionnaire/session-timeout.ts +67 -0
- package/plugins/vc-ask/questionnaire/state/build-questionnaire.ts +144 -0
- package/plugins/vc-ask/questionnaire/state/external-editor.ts +62 -0
- package/plugins/vc-ask/questionnaire/state/geometry.ts +131 -0
- package/plugins/vc-ask/questionnaire/state/key-router.ts +382 -0
- package/plugins/vc-ask/questionnaire/state/panel-router.ts +32 -0
- package/plugins/vc-ask/questionnaire/state/questionnaire-session.ts +642 -0
- package/plugins/vc-ask/questionnaire/state/row-intent.ts +143 -0
- package/plugins/vc-ask/questionnaire/state/selectors/contract.ts +24 -0
- package/plugins/vc-ask/questionnaire/state/selectors/derivations.ts +40 -0
- package/plugins/vc-ask/questionnaire/state/selectors/focus.ts +17 -0
- package/plugins/vc-ask/questionnaire/state/selectors/projections.ts +99 -0
- package/plugins/vc-ask/questionnaire/state/state-reducer.ts +455 -0
- package/plugins/vc-ask/questionnaire/state/state.ts +90 -0
- package/plugins/vc-ask/questionnaire/state/vertical.ts +158 -0
- package/plugins/vc-ask/questionnaire/timeout.ts +59 -0
- package/plugins/vc-ask/questionnaire/tool/external-answer.ts +103 -0
- package/plugins/vc-ask/questionnaire/tool/format-answer.ts +24 -0
- package/plugins/vc-ask/questionnaire/tool/normalize-params.ts +37 -0
- package/plugins/vc-ask/questionnaire/tool/response-envelope.ts +75 -0
- package/plugins/vc-ask/questionnaire/tool/types.ts +74 -0
- package/plugins/vc-ask/questionnaire/tool/validate-questionnaire.ts +75 -0
- package/plugins/vc-ask/questionnaire/view/card-theme.ts +245 -0
- package/plugins/vc-ask/questionnaire/view/components/inline-input.ts +66 -0
- package/plugins/vc-ask/questionnaire/view/components/multi-select-view.ts +177 -0
- package/plugins/vc-ask/questionnaire/view/components/option-list-view.ts +65 -0
- package/plugins/vc-ask/questionnaire/view/components/preview/markdown-content-cache.ts +101 -0
- package/plugins/vc-ask/questionnaire/view/components/preview/preview-block-renderer.ts +130 -0
- package/plugins/vc-ask/questionnaire/view/components/preview/preview-box-renderer.ts +86 -0
- package/plugins/vc-ask/questionnaire/view/components/preview/preview-layout-decider.ts +204 -0
- package/plugins/vc-ask/questionnaire/view/components/preview/preview-pane.ts +257 -0
- package/plugins/vc-ask/questionnaire/view/components/submit-picker.ts +65 -0
- package/plugins/vc-ask/questionnaire/view/components/tab-bar.ts +57 -0
- package/plugins/vc-ask/questionnaire/view/components/wrapping-select.ts +269 -0
- package/plugins/vc-ask/questionnaire/view/dialog-builder.ts +319 -0
- package/plugins/vc-ask/questionnaire/view/document-theme.ts +53 -0
- package/plugins/vc-ask/questionnaire/view/document-view.ts +306 -0
- package/plugins/vc-ask/questionnaire/view/panel-chrome.ts +133 -0
- package/plugins/vc-ask/questionnaire/view/props-adapter.ts +77 -0
- package/plugins/vc-ask/questionnaire/view/stateful-view.ts +24 -0
- package/plugins/vc-ask/questionnaire/view/tab-components.ts +16 -0
- package/plugins/vc-ask/questionnaire/view/tab-content-strategy.ts +280 -0
- package/plugins/vc-ask/questionnaire/view/vertical-view.ts +218 -0
- package/plugins/vc-ask/user-input-events.ts +34 -0
- package/plugins/vc-ask/vc-extras.plugin.json +18 -0
- package/plugins/vc-footer/agents/claude-code/adapter.mjs +29 -0
- package/plugins/vc-footer/agents/claude-code/cli.mjs +23 -0
- package/plugins/vc-footer/agents/claude-code/renderer.mjs +1 -0
- package/plugins/vc-footer/agents/claude-code/types.d.ts +38 -0
- package/plugins/vc-footer/agents/codex/adapter.mjs +13 -0
- package/plugins/vc-footer/agents/codex/mcp.mjs +45 -0
- package/plugins/vc-footer/agents/codex/native.mjs +19 -0
- package/plugins/vc-footer/agents/codex/renderer.mjs +2 -0
- package/plugins/vc-footer/agents/pi/adapter.mjs +23 -0
- package/plugins/vc-footer/agents/pi/index.js +84 -0
- package/plugins/vc-footer/agents/pi/project-local-owner.mjs +97 -0
- package/plugins/vc-footer/agents/pi/renderer.mjs +5 -0
- package/plugins/vc-footer/core/data.mjs +218 -0
- package/plugins/vc-footer/core/render.mjs +291 -0
- package/plugins/vc-footer/core/types.d.ts +29 -0
- package/plugins/vc-footer/package.json +22 -0
- package/plugins/vc-footer/vc-extras.plugin.json +32 -0
- package/skills/animate/LICENSE +21 -0
- package/skills/animate/RECIPES.md +324 -0
- package/skills/animate/SKILL.md +208 -0
- package/skills/animate/UPSTREAM.md +19 -0
- package/skills/animation-performance/LICENSE +21 -0
- package/skills/animation-performance/SKILL.md +223 -0
- package/skills/animation-performance/UPSTREAM.md +19 -0
- package/skills/answer-me-with-html/SKILL.md +174 -0
- package/skills/answer-me-with-html/scripts/am.mjs +12896 -0
- package/skills/apple-design/LICENSE +21 -0
- package/skills/apple-design/SKILL.md +291 -0
- package/skills/apple-design/UPSTREAM.md +19 -0
- package/skills/bad-smell/SKILL.md +44 -0
- package/skills/commit/SKILL.md +90 -0
- package/skills/emil-design-eng/LICENSE +21 -0
- package/skills/emil-design-eng/SKILL.md +677 -0
- package/skills/emil-design-eng/UPSTREAM.md +19 -0
- package/skills/find-the-truth/SKILL.md +38 -0
- package/skills/find-the-truth/references/trace-method.md +48 -0
- package/skills/find-the-truth/references/truth-method.md +39 -0
- package/skills/gestures/LICENSE +21 -0
- package/skills/gestures/SKILL.md +107 -0
- package/skills/gestures/UPSTREAM.md +19 -0
- package/skills/humanizer-zh/LICENSE +21 -0
- package/skills/humanizer-zh/SKILL.md +409 -0
- package/skills/humanizer-zh/UPSTREAM.md +7 -0
- package/skills/impeccable/LICENSE +191 -0
- package/skills/impeccable/NOTICE.md +11 -0
- package/skills/impeccable/SKILL.md +90 -0
- package/skills/impeccable/licenses/modern-screenshot-MIT.txt +9 -0
- package/skills/impeccable/licenses/platform-design-skills-MIT.txt +21 -0
- package/skills/impeccable/reference/adapt.md +318 -0
- package/skills/impeccable/reference/adapt.native.md +58 -0
- package/skills/impeccable/reference/android.md +46 -0
- package/skills/impeccable/reference/animate.md +89 -0
- package/skills/impeccable/reference/audit.md +139 -0
- package/skills/impeccable/reference/audit.native.md +139 -0
- package/skills/impeccable/reference/bolder.md +33 -0
- package/skills/impeccable/reference/clarify.md +94 -0
- package/skills/impeccable/reference/colorize.md +86 -0
- package/skills/impeccable/reference/component-review.md +63 -0
- package/skills/impeccable/reference/craft-floor.md +44 -0
- package/skills/impeccable/reference/craft.md +5 -0
- package/skills/impeccable/reference/critique.md +819 -0
- package/skills/impeccable/reference/degraded/asset-producer.md +42 -0
- package/skills/impeccable/reference/degraded/documenter.md +24 -0
- package/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
- package/skills/impeccable/reference/degraded/manual-edit-applier.md +93 -0
- package/skills/impeccable/reference/delight.md +70 -0
- package/skills/impeccable/reference/distill.md +111 -0
- package/skills/impeccable/reference/doctor.md +54 -0
- package/skills/impeccable/reference/document.md +416 -0
- package/skills/impeccable/reference/extract.md +69 -0
- package/skills/impeccable/reference/generate.md +101 -0
- package/skills/impeccable/reference/harden.md +362 -0
- package/skills/impeccable/reference/hooks.md +114 -0
- package/skills/impeccable/reference/init.md +131 -0
- package/skills/impeccable/reference/ios.md +51 -0
- package/skills/impeccable/reference/layout.md +84 -0
- package/skills/impeccable/reference/live-setup.md +104 -0
- package/skills/impeccable/reference/live.md +327 -0
- package/skills/impeccable/reference/mode-operate.md +21 -0
- package/skills/impeccable/reference/mode-persuade.md +19 -0
- package/skills/impeccable/reference/mode-read.md +21 -0
- package/skills/impeccable/reference/new-work.md +152 -0
- package/skills/impeccable/reference/onboard.md +234 -0
- package/skills/impeccable/reference/operate.md +61 -0
- package/skills/impeccable/reference/optimize.md +257 -0
- package/skills/impeccable/reference/overdrive.md +127 -0
- package/skills/impeccable/reference/polish.md +105 -0
- package/skills/impeccable/reference/quieter.md +99 -0
- package/skills/impeccable/reference/region-map.md +26 -0
- package/skills/impeccable/reference/routing.md +24 -0
- package/skills/impeccable/reference/shape.md +59 -0
- package/skills/impeccable/reference/typeset.md +90 -0
- package/skills/impeccable/reference/visualize.md +47 -0
- package/skills/impeccable/scripts/VERSION +1 -0
- package/skills/impeccable/scripts/command-metadata.json +98 -0
- package/skills/impeccable/scripts/data/font-index-failures.json +121 -0
- package/skills/impeccable/scripts/data/font-index.json +1 -0
- package/skills/impeccable/scripts/engine-checksums.txt +9 -0
- package/skills/impeccable/scripts/impeccable +249 -0
- package/skills/impeccable/scripts/impeccable.cmd +278 -0
- package/skills/impeccable/scripts/live-browser-dom.js +320 -0
- package/skills/impeccable/scripts/live-browser-ignores.js +246 -0
- package/skills/impeccable/scripts/live-browser-session.js +183 -0
- package/skills/impeccable/scripts/live-browser.js +13862 -0
- package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/skills/improve-animations/AUDIT.md +115 -0
- package/skills/improve-animations/LICENSE +21 -0
- package/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
- package/skills/improve-animations/SKILL.md +110 -0
- package/skills/improve-animations/UPSTREAM.md +19 -0
- package/skills/pick-ui-library/LICENSE +21 -0
- package/skills/pick-ui-library/SKILL.md +85 -0
- package/skills/pick-ui-library/UPSTREAM.md +19 -0
- package/skills/review-animations/LICENSE +21 -0
- package/skills/review-animations/SKILL.md +120 -0
- package/skills/review-animations/STANDARDS.md +187 -0
- package/skills/review-animations/UPSTREAM.md +19 -0
- package/skills/test/SKILL.md +29 -0
- package/skills/test/references/test-method.md +60 -0
- package/skills/write-doc/SKILL.md +115 -0
- package/skills/write-doc/examples/result-report.md +53 -0
- package/skills/write-doc/examples/task-summary.md +45 -0
- package/skills/write-doc/references/terminology.md +147 -0
- package/specs/ask-host-protocol-v1.md +58 -0
- package/specs/design-demo.md +1102 -0
- package/specs/frontend-immersive.md +28 -0
- package/specs/plugin-install-v2.md +123 -0
- package/specs/plugin-install.md +38 -0
- package/specs/web-modes/explore.md +31 -0
- package/specs/web-modes/risk.md +15 -0
- package/specs/web-modes/verify.md +16 -0
- package/vc-extras.mjs +62 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>Emma · 配置</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
--bg: #f5f5f7;
|
|
11
|
+
--sidebar: #f2f2f7;
|
|
12
|
+
--panel: #fff;
|
|
13
|
+
--panel-soft: #fafafd;
|
|
14
|
+
--text: #1d1d1f;
|
|
15
|
+
--secondary: #6e6e73;
|
|
16
|
+
--tertiary: #8e8e93;
|
|
17
|
+
--separator: #dedee3;
|
|
18
|
+
--blue: #007aff;
|
|
19
|
+
--blue-soft: #e5f1ff;
|
|
20
|
+
--green: #34c759;
|
|
21
|
+
--orange: #ff9500;
|
|
22
|
+
--red: #ff3b30;
|
|
23
|
+
--radius-panel: 16px;
|
|
24
|
+
--radius-control: 10px;
|
|
25
|
+
--sidebar-width: 232px;
|
|
26
|
+
--content-width: 820px;
|
|
27
|
+
--system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
28
|
+
}
|
|
29
|
+
* { box-sizing: border-box; }
|
|
30
|
+
html, body { height: 100%; }
|
|
31
|
+
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.45 var(--system); -webkit-font-smoothing: antialiased; }
|
|
32
|
+
button, input, select { font: inherit; color: inherit; }
|
|
33
|
+
button { cursor: pointer; }
|
|
34
|
+
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(0,122,255,.32); outline-offset: 2px; }
|
|
35
|
+
::selection { color: var(--text); background: #cce4ff; }
|
|
36
|
+
|
|
37
|
+
.app { display: grid; grid-template-columns: var(--sidebar-width) 1fr; height: 100%; }
|
|
38
|
+
.sidebar { display: flex; flex-direction: column; padding: 22px 10px 18px; background: var(--sidebar); }
|
|
39
|
+
.logo { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; font-size: 18px; font-weight: 700; letter-spacing: -.035em; }
|
|
40
|
+
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--blue); position: relative; }
|
|
41
|
+
.logo-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 4px; background: #fff; }
|
|
42
|
+
.nav { display: grid; gap: 3px; margin-top: 26px; }
|
|
43
|
+
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--secondary); text-align: left; transition: background .15s, color .15s; }
|
|
44
|
+
.nav-button:hover { background: #e5e5ea; color: var(--text); }
|
|
45
|
+
.nav-button[aria-current="true"] { background: #d9d9df; color: var(--text); font-weight: 650; }
|
|
46
|
+
.nav-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
|
|
47
|
+
.nav-button[aria-current="true"] .nav-icon { color: var(--blue); }
|
|
48
|
+
.sidebar-footer { margin-top: auto; padding: 14px; color: var(--tertiary); font-size: 12px; }
|
|
49
|
+
|
|
50
|
+
.main { overflow: auto; }
|
|
51
|
+
.content { width: min(var(--content-width), calc(100vw - var(--sidebar-width) - 48px)); margin: 0 auto; padding: 46px 0 90px; }
|
|
52
|
+
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
|
|
53
|
+
h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.045em; }
|
|
54
|
+
.header-actions { display: flex; align-items: center; gap: 9px; }
|
|
55
|
+
.scope { min-height: 36px; padding: 0 12px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel); color: var(--secondary); }
|
|
56
|
+
.save { min-height: 36px; padding: 0 15px; border: 0; border-radius: var(--radius-control); background: var(--blue); color: #fff; font-weight: 650; transition: background .15s, transform .15s; }
|
|
57
|
+
.save:hover { background: #006ee6; }
|
|
58
|
+
.save:active { transform: scale(.98); }
|
|
59
|
+
|
|
60
|
+
.section { margin-top: 34px; }
|
|
61
|
+
.section:first-of-type { margin-top: 0; }
|
|
62
|
+
.section-title { display: none; }
|
|
63
|
+
.section-subtitle { display: none; }
|
|
64
|
+
.group { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius-panel); background: var(--separator); }
|
|
65
|
+
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; min-height: 72px; padding: 14px 18px; background: var(--panel); }
|
|
66
|
+
.setting-stack { grid-template-columns: 1fr; align-items: start; }
|
|
67
|
+
.subsection-label { margin: 28px 0 10px 12px; color: var(--secondary); font-size: 13px; font-weight: 650; }
|
|
68
|
+
.text-area { width: min(100%, 520px); min-height: 74px; padding: 10px 11px; resize: vertical; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel-soft); line-height: 1.5; }
|
|
69
|
+
.range { width: 190px; accent-color: var(--blue); }
|
|
70
|
+
.credential-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 360px; }
|
|
71
|
+
.role-grid .value { min-width: 330px; }
|
|
72
|
+
.role-grid .custom-select { min-width: 150px; }
|
|
73
|
+
.setting-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.3; }
|
|
74
|
+
.setting-description { max-width: 560px; margin: 3px 0 0; color: var(--secondary); font-size: 12px; line-height: 1.45; }
|
|
75
|
+
.value { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 190px; }
|
|
76
|
+
.select, .text-input { min-height: 36px; min-width: 180px; padding: 0 11px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel-soft); }
|
|
77
|
+
.custom-select { position: relative; display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 180px; min-height: 36px; padding: 0 11px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel-soft); text-align: left; }
|
|
78
|
+
.custom-select::after { content: "⌄"; color: var(--secondary); font-size: 15px; line-height: 1; transform: translateY(-2px); }
|
|
79
|
+
.select-menu { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 100%; padding: 5px; border: 1px solid var(--separator); border-radius: 12px; background: rgba(255,255,255,.98); }
|
|
80
|
+
.select-menu[hidden] { display: none; }
|
|
81
|
+
.select-option { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; white-space: nowrap; }
|
|
82
|
+
.select-option:hover, .select-option[aria-selected="true"] { background: var(--blue-soft); color: var(--blue); }
|
|
83
|
+
.select-host { position: relative; min-width: 180px; }
|
|
84
|
+
.select-host > .select { position: absolute; width: 0; height: 0; min-width: 0; min-height: 0; opacity: 0; pointer-events: none; }
|
|
85
|
+
.provider-workspace { display: grid; grid-template-columns: 1fr; min-height: 0; margin-top: 24px; gap: 1px; background: var(--separator); }
|
|
86
|
+
.provider-workspace.is-editing { grid-template-columns: 250px minmax(0,1fr); min-height: 520px; }
|
|
87
|
+
.provider-sidebar { display: flex; flex-direction: column; padding: 12px; background: #fafafd; }
|
|
88
|
+
.provider-sidebar-foot { margin-top: auto; padding: 12px 4px 2px; }
|
|
89
|
+
.provider-remove { width: 100%; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--red); text-align: left; }
|
|
90
|
+
.provider-remove:hover { background: #ffebe9; }
|
|
91
|
+
.remove-confirm { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(29,29,31,.24); color: var(--text); }
|
|
92
|
+
.confirm-dialog { width: min(360px, calc(100vw - 48px)); padding: 22px; border-radius: 14px; background: var(--panel); }
|
|
93
|
+
.confirm-dialog > span { display: block; font-weight: 650; }
|
|
94
|
+
.remove-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
|
|
95
|
+
.remove-confirm[hidden] { display: none; }
|
|
96
|
+
.remove-confirm-actions { display: flex; gap: 6px; }
|
|
97
|
+
.remove-confirm-actions button { min-height: 28px; padding: 0 9px; border: 0; border-radius: 7px; }
|
|
98
|
+
.remove-confirm-actions .confirm { background: var(--red); color: #fff; }
|
|
99
|
+
.remove-confirm-actions .cancel { background: #fff; color: var(--text); }
|
|
100
|
+
.provider-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
|
|
101
|
+
.provider-sidebar-head h3 { margin: 0; font-size: 13px; color: var(--secondary); }
|
|
102
|
+
.provider-add { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 19px; line-height: 1; }
|
|
103
|
+
.provider-items { display: grid; gap: 3px; }
|
|
104
|
+
.provider-item { display: grid; grid-template-columns: 30px 1fr 16px; align-items: center; gap: 9px; width: 100%; min-height: 58px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
|
|
105
|
+
.provider-item:hover { background: #eeeeF3; }
|
|
106
|
+
.provider-item[aria-selected="true"] { background: #e2e2e8; }
|
|
107
|
+
.provider-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
|
|
108
|
+
.provider-item strong, .provider-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
109
|
+
.provider-item small { margin-top: 2px; color: var(--secondary); font-size: 11px; }
|
|
110
|
+
.provider-chevron { color: var(--tertiary); font-size: 18px; }
|
|
111
|
+
.provider-editor { min-width: 0; padding: 22px 24px 24px; background: var(--panel); }
|
|
112
|
+
.provider-empty { display: none; place-items: center; min-height: 520px; padding: 24px; background: var(--panel); color: var(--secondary); text-align: center; }
|
|
113
|
+
.provider-empty[hidden] { display: none; }
|
|
114
|
+
.provider-editor[hidden] { display: none; }
|
|
115
|
+
.quiet-button { min-height: 32px; padding: 0 8px; border: 0; background: transparent; color: var(--secondary); }
|
|
116
|
+
.quiet-button:hover { color: var(--text); }
|
|
117
|
+
.remove-provider { min-height: 32px; padding: 0 8px; border: 0; background: transparent; color: var(--red); }
|
|
118
|
+
.remove-provider:hover { color: #c62828; }
|
|
119
|
+
.provider-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
|
|
120
|
+
.provider-editor-head h3 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
|
|
121
|
+
.provider-editor-head p { margin: 4px 0 0; color: var(--secondary); font-size: 12px; }
|
|
122
|
+
.provider-editor .add-provider { margin: 0; padding: 0; background: transparent; }
|
|
123
|
+
.choice-switches { display: grid; gap: 4px; }
|
|
124
|
+
.choice-row { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 10px; border-radius: 9px; background: var(--panel-soft); color: var(--text); }
|
|
125
|
+
.choice-row .switch { transform: scale(.78); transform-origin: right center; }
|
|
126
|
+
@media (max-width: 760px) { .provider-workspace.is-editing { grid-template-columns: 1fr; } .provider-sidebar { border-bottom: 0; } .provider-items { grid-template-columns: repeat(2, 1fr); } .provider-editor { padding: 18px 15px; } }
|
|
127
|
+
.add-provider { margin: 0 14px 14px; padding: 18px; border: 0; border-radius: 14px; background: var(--panel-soft); }
|
|
128
|
+
.add-provider[hidden] { display: none; }
|
|
129
|
+
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
|
|
130
|
+
.form-field { display: grid; gap: 6px; }
|
|
131
|
+
.form-field.full { grid-column: 1 / -1; }
|
|
132
|
+
.form-field .text-input { width: 100%; }
|
|
133
|
+
.form-field .select-host { width: 100%; }
|
|
134
|
+
.model-picker { position: relative; grid-column: 1 / -1; }
|
|
135
|
+
.model-input-row { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: #fff; }
|
|
136
|
+
.model-input-row:focus-within { border-color: var(--blue); outline: 3px solid rgba(0,122,255,.12); }
|
|
137
|
+
.model-tags { display: flex; flex-wrap: wrap; gap: 5px; }
|
|
138
|
+
.model-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
|
|
139
|
+
.model-tag button { width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: currentColor; line-height: 13px; }
|
|
140
|
+
.model-input { flex: 1; min-width: 130px; height: 28px; padding: 0 4px; border: 0; outline: 0; background: transparent; }
|
|
141
|
+
.model-dropdown { position: absolute; z-index: 10; top: calc(100% + 7px); left: 0; right: 0; padding: 6px; border: 1px solid var(--separator); border-radius: 12px; background: #fff; }
|
|
142
|
+
.model-dropdown[hidden] { display: none; }
|
|
143
|
+
.model-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 7px; color: var(--secondary); font-size: 12px; }
|
|
144
|
+
.refresh-models { min-height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: #e9e9ee; color: var(--text); }
|
|
145
|
+
.model-options { display: grid; gap: 2px; max-height: 180px; overflow: auto; }
|
|
146
|
+
.model-option { padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
|
|
147
|
+
.model-option:hover { background: var(--blue-soft); color: var(--blue); }
|
|
148
|
+
.model-empty { padding: 10px; color: var(--secondary); font-size: 12px; }
|
|
149
|
+
.provider-editor-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 20px; }
|
|
150
|
+
.provider-editor-actions .form-actions { margin-top: 0; }
|
|
151
|
+
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-control); background: #e9e9ee; }
|
|
152
|
+
.segmented button { min-height: 30px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--secondary); }
|
|
153
|
+
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--text); font-weight: 650; }
|
|
154
|
+
.segmented.multi { flex-wrap: wrap; justify-content: flex-end; max-width: 520px; }
|
|
155
|
+
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; }
|
|
156
|
+
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
|
|
157
|
+
.status.warning { color: var(--orange); }
|
|
158
|
+
.status.error { color: var(--red); }
|
|
159
|
+
.switch { position: relative; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: #d1d1d6; transition: background .16s; }
|
|
160
|
+
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .16s; }
|
|
161
|
+
.switch[aria-checked="true"] { background: var(--green); }
|
|
162
|
+
.switch[aria-checked="true"]::after { transform: translateX(18px); }
|
|
163
|
+
.helper { margin: 0; color: var(--secondary); font-size: 12px; }
|
|
164
|
+
.inline-note { grid-column: 1 / -1; margin: -2px 0 2px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--panel-soft); color: var(--secondary); font-size: 12px; }
|
|
165
|
+
.managed { color: var(--blue); font-size: 12px; }
|
|
166
|
+
|
|
167
|
+
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 14px); padding: 11px 16px; border-radius: 12px; background: #1d1d1f; color: #fff; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
|
|
168
|
+
.toast.show { opacity: 1; transform: translate(-50%, 0); }
|
|
169
|
+
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
|
|
170
|
+
@media (max-width: 760px) {
|
|
171
|
+
:root { --sidebar-width: 62px; }
|
|
172
|
+
.sidebar { padding: 16px 6px; }
|
|
173
|
+
.logo { justify-content: center; padding: 0; font-size: 0; }
|
|
174
|
+
.logo-mark { margin: 0; }
|
|
175
|
+
.nav { margin-top: 22px; }
|
|
176
|
+
.nav-button { justify-content: center; padding: 0; font-size: 0; }
|
|
177
|
+
.nav-icon { margin: 0; }
|
|
178
|
+
.sidebar-footer { display: none; }
|
|
179
|
+
.content { width: auto; padding: 28px 12px 64px; }
|
|
180
|
+
.page-header { align-items: flex-start; flex-direction: column; gap: 16px; margin-left: 4px; margin-right: 4px; }
|
|
181
|
+
.header-actions { width: 100%; }
|
|
182
|
+
.scope, .save { flex: 1; }
|
|
183
|
+
.section-title { display: none; }
|
|
184
|
+
.setting { grid-template-columns: 1fr; gap: 9px; padding: 15px; }
|
|
185
|
+
.value { justify-content: flex-start; min-width: 0; }
|
|
186
|
+
.select, .text-input { width: 100%; min-width: 0; }
|
|
187
|
+
.select-host { width: 100%; }
|
|
188
|
+
.custom-select { width: 100%; }
|
|
189
|
+
.segmented { width: 100%; }
|
|
190
|
+
.segmented button { flex: 1; }
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Live states and controls; the reference geometry remains the source of truth. */
|
|
194
|
+
.provider-sidebar-head h2 { margin: 0; font-size: 13px; color: var(--secondary); }
|
|
195
|
+
.provider-editor-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
|
|
196
|
+
[hidden] { display: none !important; }
|
|
197
|
+
button:disabled { opacity: .5; cursor: default; }
|
|
198
|
+
textarea { font: inherit; color: inherit; }
|
|
199
|
+
textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(0,122,255,.32); outline-offset: 2px; }
|
|
200
|
+
.sidebar { overflow-y: auto; }
|
|
201
|
+
.sidebar-footer { color: var(--secondary); }
|
|
202
|
+
.sidebar-footer strong { display: block; font-weight: 400; margin-top: 4px; }
|
|
203
|
+
.header-actions { flex-wrap: wrap; }
|
|
204
|
+
.quiet-button { border-radius: var(--radius-control); }
|
|
205
|
+
.section > .subsection-label:first-child { margin-top: 0; }
|
|
206
|
+
.group { overflow: hidden; }
|
|
207
|
+
.segment-select { width: auto !important; min-width: 0; }
|
|
208
|
+
.segment-select .sel-menu { position: static; display: inline-flex; width: auto; max-width: 100%; margin: 0; border: 1px solid var(--separator); box-shadow: none; padding: 3px; background: #ededf1; }
|
|
209
|
+
.segment-select .sel-menu button { white-space: normal; }
|
|
210
|
+
.sel-menu[popover] { margin: 0; }
|
|
211
|
+
.sel-opt:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
|
|
212
|
+
.sel .sel-menu:not(.segmented) { position: fixed; right: auto; max-height: 260px; overflow-y: auto; box-shadow: none; }
|
|
213
|
+
.value { max-width: none; flex-wrap: nowrap; }
|
|
214
|
+
.value > .text-input { width: auto; min-width: 180px; max-width: 100%; }
|
|
215
|
+
.value > .field { width: auto; min-width: 180px; max-width: 100%; }
|
|
216
|
+
.field input { width: 100%; min-width: 0; }
|
|
217
|
+
.setting-stack .value { width: 100%; max-width: none; justify-content: flex-start; }
|
|
218
|
+
.setting-stack .text-area { width: min(100%, 520px); max-width: 100%; }
|
|
219
|
+
.field-help, .key { display: block; color: var(--secondary); font-size: 12px; font-weight: 400; margin-top: 4px; }
|
|
220
|
+
.key { color: #9a4b00; }
|
|
221
|
+
.note { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--separator); border-radius: var(--radius-control); color: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
|
|
222
|
+
.switch-input { appearance: none; cursor: pointer; flex: none; min-width: 46px; }
|
|
223
|
+
.switch-input:checked { background: var(--green); }
|
|
224
|
+
.switch-input:checked::after { transform: translateX(18px); }
|
|
225
|
+
.sel { position: relative; min-width: 180px; max-width: 100%; }
|
|
226
|
+
.sel > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
|
|
227
|
+
.sel-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 36px; padding: 0 11px; border: 1px solid var(--separator); border-radius: var(--radius-control); background: var(--panel-soft); text-align: left; }
|
|
228
|
+
.sel-txt { overflow: hidden; text-overflow: ellipsis; }
|
|
229
|
+
.sel-chev::after { content: '⌄'; color: var(--secondary); font-style: normal; }
|
|
230
|
+
.sel-menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 100%; max-width: min(440px, 70vw); max-height: 300px; overflow: auto; padding: 5px; border: 1px solid var(--separator); border-radius: 12px; background: #fff; box-shadow: none; }
|
|
231
|
+
.sel-opt { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; overflow-wrap: anywhere; }
|
|
232
|
+
.sel-opt:hover, .sel-opt.on { background: var(--blue-soft); color: #005ec4; }
|
|
233
|
+
.range-value { min-width: 36px; font-variant-numeric: tabular-nums; color: var(--secondary); }
|
|
234
|
+
.status { color: #217a38; }
|
|
235
|
+
.status.warning { color: #9a4b00; }
|
|
236
|
+
.status.error { color: #ba251b; }
|
|
237
|
+
.provider-items { min-width: 0; }
|
|
238
|
+
.provider-item > span:nth-child(2) { min-width: 0; }
|
|
239
|
+
.provider-editor .form-field { min-width: 0; }
|
|
240
|
+
.provider-editor input { min-width: 0; }
|
|
241
|
+
.provider-editor .segmented { flex-wrap: wrap; }
|
|
242
|
+
.provider-editor .segmented button { padding: 0 13px; font-size: 12px; }
|
|
243
|
+
.model-tags:empty { display: none; }
|
|
244
|
+
.model-tag { overflow-wrap: anywhere; }
|
|
245
|
+
.model-options { max-height: 180px; }
|
|
246
|
+
.model-option[aria-pressed=true] { background: var(--blue-soft); color: #005ec4; }
|
|
247
|
+
.provider-empty { display: grid; min-height: 160px; }
|
|
248
|
+
.res { margin: 16px 0 0; color: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
|
|
249
|
+
.res:empty { display: none; }
|
|
250
|
+
.res.err { color: #ba251b; }
|
|
251
|
+
.mcp-server { padding: 14px 18px; background: var(--panel); }
|
|
252
|
+
.mcp-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
253
|
+
.mcp-heading strong { overflow-wrap: anywhere; }
|
|
254
|
+
.mcp-server input[type=url] { width: 100%; margin-top: 10px; }
|
|
255
|
+
.mcp-server p { margin-bottom: 0; }
|
|
256
|
+
.diffmask { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 24px; background: #1d1d1f40; }
|
|
257
|
+
.diff { width: min(760px, 100%); max-height: 85vh; overflow: auto; border-radius: 16px; background: var(--panel); box-shadow: 0 24px 80px #0002; }
|
|
258
|
+
.diff header, .diff footer { padding: 20px 22px; }
|
|
259
|
+
.diff header { border-bottom: 1px solid var(--separator); }
|
|
260
|
+
.diff h2 { margin: 0 0 6px; font-size: 20px; }
|
|
261
|
+
.diff footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--separator); }
|
|
262
|
+
.dgroup { padding: 16px 22px; }
|
|
263
|
+
.fp { font-size: 12px; color: var(--secondary); overflow-wrap: anywhere; }
|
|
264
|
+
.fp .n { margin-left: 10px; }
|
|
265
|
+
.dline { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; margin-top: 12px; font-size: 13px; }
|
|
266
|
+
.dline .v { display: flex; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; min-width: 0; }
|
|
267
|
+
.dline del { color: var(--secondary); }
|
|
268
|
+
.dline ins { color: #217a38; text-decoration: none; }
|
|
269
|
+
#diffSkip { padding: 16px 22px; color: #ba251b; }
|
|
270
|
+
@media (max-width: 1000px) and (min-width: 761px) { .provider-workspace.is-editing { grid-template-columns: 190px minmax(0,1fr); } .provider-editor { padding: 18px 15px; } .setting { gap: 16px; } .value { max-width: none; } }
|
|
271
|
+
@media (max-width: 760px) { .nav-button span { display: none; } .header-actions { gap: 6px; } .header-actions .quiet-button { flex: none; } .value { width: 100%; max-width: none; flex-wrap: wrap; } .value > .text-input, .value > .field, .sel { width: 100%; } .form-grid { grid-template-columns: minmax(0,1fr); } .provider-items { grid-template-columns: minmax(0,1fr); } .provider-workspace.is-editing { grid-template-columns: minmax(0,1fr); } .segmented { flex-wrap: wrap; } .segmented button { padding: 0 9px; } .dline { grid-template-columns: minmax(0,1fr); gap: 4px; } .diffmask { padding: 12px; } }
|
|
272
|
+
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; }
|
|
273
|
+
.theme-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--separator); border-radius: 12px; background: var(--panel); text-align: left; }
|
|
274
|
+
.theme-card:hover { border-color: #c3c3c9; }
|
|
275
|
+
.theme-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
|
|
276
|
+
.theme-preview { display: grid; gap: 4px; padding: 9px 8px; border-radius: 8px; background: var(--t-bg, #e3e3e8); }
|
|
277
|
+
.theme-preview span { display: block; height: 5px; border-radius: 3px; }
|
|
278
|
+
.theme-preview .t-line { width: 44%; background: var(--t-accent, #a5a5ad); }
|
|
279
|
+
.theme-preview .t-code { width: 76%; background: var(--t-fg, #7c7c85); opacity: .7; }
|
|
280
|
+
.theme-preview .t-status { width: 58%; background: var(--t-ok, #34c759); }
|
|
281
|
+
.theme-name { font: 650 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
282
|
+
.theme-source { color: var(--secondary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
283
|
+
.subsection-label { margin: 28px 0 10px 2px; color: var(--secondary); font-size: 13px; font-weight: 600; letter-spacing: 0; }
|
|
284
|
+
.setting { min-height: 64px; }
|
|
285
|
+
</style>
|
|
286
|
+
</head>
|
|
287
|
+
<body>
|
|
288
|
+
<!--__EMMA_BOOT__-->
|
|
289
|
+
<div class="app">
|
|
290
|
+
<aside class="sidebar">
|
|
291
|
+
<div class="logo"><span class="logo-mark" aria-hidden="true"></span><span>Emma</span></div>
|
|
292
|
+
<nav class="nav" aria-label="配置分类">
|
|
293
|
+
<button class="nav-button" aria-current="true" data-group="model"><svg class="nav-icon" viewBox="0 0 24 24"><rect x="4.5" y="7" width="15" height="10" rx="2"/><path d="M8 7V4.5M12 7V4.5M16 7V4.5M8 17v2.5M12 17v2.5M16 17v2.5"/></svg><span>模型与凭据</span></button>
|
|
294
|
+
<button class="nav-button" data-group="review"><svg class="nav-icon" viewBox="0 0 24 24"><path d="M12 3l7 3v6c0 4-3 6.6-7 8-4-1.4-7-4-7-8V6l7-3Z"/><path d="m9 12 2.2 2.2L15.5 10"/></svg><span>命令评审</span></button>
|
|
295
|
+
<button class="nav-button" data-group="compression"><svg class="nav-icon" viewBox="0 0 24 24"><path d="M5 7h14M5 12h14M5 17h9"/></svg><span>上下文压缩</span></button>
|
|
296
|
+
<button class="nav-button" data-group="web"><svg class="nav-icon" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17M12 3.5c2.4 2.4 3.6 5.3 3.6 8.5s-1.2 6.1-3.6 8.5c-2.4-2.4-3.6-5.3-3.6-8.5s1.2-6.1-3.6-8.5Z"/></svg><span>联网检索</span></button>
|
|
297
|
+
<button class="nav-button" data-group="agents"><svg class="nav-icon" viewBox="0 0 24 24"><circle cx="7" cy="6" r="2.5"/><circle cx="17" cy="6" r="2.5"/><path d="M7 8.5v3a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-3"/><circle cx="12" cy="18" r="2.5"/></svg><span>子代理</span></button>
|
|
298
|
+
<button class="nav-button" data-group="pi-cc-extensions"><svg class="nav-icon" viewBox="0 0 24 24"><path d="M5 7h14M5 12h10M5 17h7"/><path d="m16 15 3 3 3-3"/></svg><span>输出样式</span></button>
|
|
299
|
+
<button class="nav-button" data-group="fff"><svg class="nav-icon" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4.5 4.5M7.5 10.5h6"/></svg><span>文件查找</span></button>
|
|
300
|
+
<button class="nav-button" data-group="btw"><svg class="nav-icon" viewBox="0 0 24 24"><rect x="4" y="5" width="16" height="14" rx="2"/><path d="M8 9h8M8 13h5"/></svg><span>侧栏助手</span></button>
|
|
301
|
+
<button class="nav-button" data-group="mcp"><svg class="nav-icon" viewBox="0 0 24 24"><path d="M8 7h8v4H8zM4 16h6v4H4zM14 16h6v4h-6z"/><path d="M12 11v3M7 16v-2h10v2"/></svg><span>MCP 适配</span></button>
|
|
302
|
+
<button class="nav-button" data-group="appearance"><svg class="nav-icon" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.5"/><circle cx="9" cy="10" r="1.3"/><circle cx="14.6" cy="8.6" r="1.3"/><circle cx="15" cy="14.4" r="1.3"/><path d="M12 20.5c-2.2 0-2.6-1.4-1.4-2.4 1-.8.5-2.3-.9-2.3"/></svg><span>外观</span></button>
|
|
303
|
+
<button class="nav-button" data-group="pi-core"><svg class="nav-icon" viewBox="0 0 24 24"><circle cx="12" cy="12" r="2.8"/><path d="M18.9 14.6a1.5 1.5 0 0 0 .3 1.7l.1.1a1.8 1.8 0 1 1-2.6 2.6l-.1-.1a1.5 1.5 0 0 0-1.7-.3 1.5 1.5 0 0 0-.9 1.4v.2a1.8 1.8 0 1 1-3.6 0V20a1.5 1.5 0 0 0-.9-1.4 1.5 1.5 0 0 0-1.7.3l-.1.1a1.8 1.8 0 1 1-2.6-2.6l.1-.1a1.5 1.5 0 0 0 .3-1.7 1.5 1.5 0 0 0-1.4-.9H3.6a1.8 1.8 0 1 1 0-3.6h.2a1.5 1.5 0 0 0 1.4-.9 1.5 1.5 0 0 0-.3-1.7l-.1-.1a1.8 1.8 0 1 1 2.6-2.6l.1.1a1.5 1.5 0 0 0 1.7.3h.1a1.5 1.5 0 0 0 .9-1.4V3.6a1.8 1.8 0 1 1 3.6 0v.2a1.5 1.5 0 0 0 .9 1.4 1.5 1.5 0 0 0 1.7-.3l.1-.1a1.8 1.8 0 1 1 2.6 2.6l-.1.1a1.5 1.5 0 0 0-.3 1.7v.1a1.5 1.5 0 0 0 1.4.9h.2a1.8 1.8 0 1 1 0 3.6h-.2a1.5 1.5 0 0 0-1.4.9Z"/></svg><span>Pi 核心</span></button>
|
|
304
|
+
</nav>
|
|
305
|
+
</aside>
|
|
306
|
+
<main class="main"><div class="content">
|
|
307
|
+
<header class="page-header"><h1 id="page-title">模型与凭据</h1><div class="header-actions"><button class="quiet-button" id="reset" type="button">重置</button><button class="save" id="save" disabled>保存更改</button></div></header>
|
|
308
|
+
<section class="section" data-group="model" aria-labelledby="page-title">
|
|
309
|
+
<div class="group" id="model-settings"></div>
|
|
310
|
+
<div class="group provider-workspace" id="provider-workspace">
|
|
311
|
+
<aside class="provider-sidebar"><div class="provider-sidebar-head"><h2>Providers</h2><button class="provider-add" id="show-provider-form" type="button" aria-label="新增 Provider">+</button></div><div class="provider-items" id="pv-list"></div></aside>
|
|
312
|
+
<div class="provider-editor" id="pv-detail" hidden>
|
|
313
|
+
<div class="provider-editor-head"><div><h2 id="provider-editor-title">Provider</h2></div><span class="status" id="provider-status"></span></div>
|
|
314
|
+
<div class="form-grid">
|
|
315
|
+
<div class="form-field full"><label for="pv-name">Provider 名称</label><input class="text-input" id="pv-name" autocomplete="off" placeholder="例如 openai"></div>
|
|
316
|
+
<div class="form-field full"><label id="api-label">API 格式</label><div class="segmented" id="pv-seg-api" role="radiogroup" aria-labelledby="api-label"><button type="button" role="radio" aria-checked="false" data-value="chat">Chat Completions OpenAI</button><button type="button" role="radio" aria-checked="false" data-value="responses">Responses</button><button type="button" role="radio" aria-checked="false" data-value="anthropic">Anthropic Messages</button></div></div>
|
|
317
|
+
<div class="form-field full"><label for="pv-url">Base URL</label><input class="text-input" id="pv-url" type="url" placeholder="https://api.openai.com/v1"></div>
|
|
318
|
+
<div class="form-field full"><label for="pv-key">API 密钥</label><input class="text-input" id="pv-key" type="password" autocomplete="new-password" placeholder="粘贴密钥"></div>
|
|
319
|
+
<div class="form-field full model-picker"><label for="model-input">模型 ID</label><div class="model-input-row"><div class="model-tags" id="model-tags"></div><input class="model-input" id="model-input" autocomplete="off" placeholder="输入模型 ID,按 Enter 添加"></div><div class="model-options" id="model-options"></div></div>
|
|
320
|
+
<div class="form-field full"><label id="ctx-label">Context size</label><div class="segmented" id="pv-seg-ctx" role="radiogroup" aria-labelledby="ctx-label"><button type="button" role="radio" aria-checked="false" data-value="200000">200k</button><button type="button" role="radio" aria-checked="false" data-value="1000000">1m</button></div><input class="text-input" id="provider-context" type="number" min="1" step="1" aria-label="自定义 Context size" placeholder="自定义上下文窗口"></div>
|
|
321
|
+
</div>
|
|
322
|
+
<div class="provider-editor-actions"><button class="quiet-button" type="button" id="cancel-provider">收起</button></div>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</section>
|
|
326
|
+
<section class="section" data-group="review" aria-labelledby="page-title" hidden></section>
|
|
327
|
+
<section class="section" data-group="compression" aria-labelledby="page-title" hidden></section>
|
|
328
|
+
<section class="section" data-group="web" aria-labelledby="page-title" hidden></section>
|
|
329
|
+
<section class="section" data-group="agents" aria-labelledby="page-title" hidden></section>
|
|
330
|
+
<section class="section" data-group="pi-cc-extensions" aria-labelledby="page-title" hidden></section>
|
|
331
|
+
<section class="section" data-group="fff" aria-labelledby="page-title" hidden></section>
|
|
332
|
+
<section class="section" data-group="btw" aria-labelledby="page-title" hidden></section>
|
|
333
|
+
<section class="section" data-group="mcp" aria-labelledby="page-title" hidden></section>
|
|
334
|
+
<section class="section" data-group="appearance" aria-labelledby="page-title" hidden></section>
|
|
335
|
+
<section class="section" data-group="pi-core" aria-labelledby="page-title" hidden></section>
|
|
336
|
+
<div class="res" id="runResult" role="status" aria-live="polite"></div>
|
|
337
|
+
</div></main>
|
|
338
|
+
</div>
|
|
339
|
+
<div class="diffmask" id="diffmask" hidden><div class="diff" role="dialog" aria-modal="true" aria-labelledby="diffTitle" tabindex="-1"><header><h2 id="diffTitle">确认配置变更</h2><span class="helper" id="diffCount"></span></header><div id="diffBody"></div><div id="diffSkip" hidden></div><footer><button type="button" class="quiet-button" id="diffCancel">取消</button><button type="button" class="save" id="diffOk">确认写入</button></footer></div></div>
|
|
340
|
+
<script type="module" src="./app.mjs"></script>
|
|
341
|
+
</body>
|
|
342
|
+
</html>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url';
|
|
2
|
+
import { askHost } from './host-channel.mjs';
|
|
3
|
+
import { nativeQuestions, nativeAnswers } from './native-questions.mjs';
|
|
4
|
+
|
|
5
|
+
export async function handleQuestion(event, options) {
|
|
6
|
+
if (event?.hook_event_name !== 'PreToolUse' || event.tool_name !== 'AskUserQuestion' ||
|
|
7
|
+
typeof event.session_id !== 'string' || !event.session_id || typeof event.tool_use_id !== 'string' || !event.tool_use_id ||
|
|
8
|
+
Object.hasOwn(event.tool_input ?? {}, 'answers')) return;
|
|
9
|
+
const questions = nativeQuestions(event.tool_input?.questions);
|
|
10
|
+
if (!questions || new Set(questions.map(q => q.question)).size !== questions.length ||
|
|
11
|
+
questions.some(q => q.multiSelect && q.options.some(o => o.label.includes(',')))) return;
|
|
12
|
+
const result = await askHost({ agent: 'claude-code', sessionId: event.session_id, toolCallId: event.tool_use_id,
|
|
13
|
+
paneId: process.env.TTY7_PANE, questions }, reply => {
|
|
14
|
+
const values = nativeAnswers(questions, reply);
|
|
15
|
+
return values && Object.fromEntries(questions.map((q, i) => [q.question, values[i].join(',')]));
|
|
16
|
+
}, options);
|
|
17
|
+
if (result.status === 'unclaimed') return;
|
|
18
|
+
return { hookSpecificOutput: { hookEventName: 'PreToolUse', ...(result.status === 'answered'
|
|
19
|
+
? { permissionDecision: 'allow', updatedInput: { ...event.tool_input, answers: result.value } }
|
|
20
|
+
: { permissionDecision: 'deny', permissionDecisionReason: `Questionnaire ended (${result.status}). No user answer was received.` }) } };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url && process.env.VC_ASK_SOCKET) {
|
|
24
|
+
let bytes = 0;
|
|
25
|
+
const chunks = [];
|
|
26
|
+
for await (const chunk of process.stdin) {
|
|
27
|
+
bytes += chunk.length;
|
|
28
|
+
if (bytes > 256 * 1024) break;
|
|
29
|
+
chunks.push(chunk);
|
|
30
|
+
}
|
|
31
|
+
if (bytes <= 256 * 1024) {
|
|
32
|
+
let event;
|
|
33
|
+
try { event = JSON.parse(Buffer.concat(chunks).toString('utf8')); } catch { /* keep native UI */ }
|
|
34
|
+
const result = await handleQuestion(event);
|
|
35
|
+
if (result) process.stdout.write(JSON.stringify(result) + '\n');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { askHost } from './host-channel.mjs';
|
|
2
|
+
import { nativeQuestions, nativeAnswers } from './native-questions.mjs';
|
|
3
|
+
|
|
4
|
+
/** Call from an App Server client receiving the native user-input request. */
|
|
5
|
+
export async function handleCodexQuestion(request, options) {
|
|
6
|
+
if (request?.method !== 'item/tool/requestUserInput' ||
|
|
7
|
+
!['number', 'string'].includes(typeof request.id)) return;
|
|
8
|
+
const { threadId, questions: raw } = request.params ?? {};
|
|
9
|
+
const questions = nativeQuestions(raw, { freeText: true });
|
|
10
|
+
if (typeof threadId !== 'string' || !threadId || !questions ||
|
|
11
|
+
raw.some(q => typeof q.id !== 'string' || !q.id || q.isSecret === true) ||
|
|
12
|
+
new Set(raw.map(q => q.id)).size !== raw.length) return;
|
|
13
|
+
for (const [i, question] of questions.entries()) {
|
|
14
|
+
question.multiSelect = false;
|
|
15
|
+
question.allowFreeText = question.options.length === 0 || raw[i].isOther === true;
|
|
16
|
+
}
|
|
17
|
+
const result = await askHost({ agent: 'codex', sessionId: threadId, toolCallId: String(request.id),
|
|
18
|
+
paneId: process.env.TTY7_PANE, isBlocking: request.params.isBlocking !== false, questions }, reply => {
|
|
19
|
+
const values = nativeAnswers(questions, reply);
|
|
20
|
+
if (!values) return;
|
|
21
|
+
for (const answer of reply.answers) {
|
|
22
|
+
if (typeof answer.text === 'string') values[answer.questionIndex] = [`user_note: ${values[answer.questionIndex][0]}`];
|
|
23
|
+
}
|
|
24
|
+
return Object.fromEntries(raw.map((q, i) => [q.id, { answers: values[i] }]));
|
|
25
|
+
}, options);
|
|
26
|
+
if (result.status === 'unclaimed') return;
|
|
27
|
+
return { id: request.id, result: { answers: result.status === 'answered' ? result.value : {} } };
|
|
28
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createConnection } from 'node:net';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { isAbsolute } from 'node:path';
|
|
4
|
+
|
|
5
|
+
const LIMIT = 256 * 1024;
|
|
6
|
+
|
|
7
|
+
/** Local, trusted host socket. A claim is scoped to this connection and UUID. */
|
|
8
|
+
export function askHost(prompt, validate, { endpoint = process.env.VC_ASK_SOCKET, signal, claimMs = 1000, waitMs = 590000, onTimeout } = {}) {
|
|
9
|
+
if (signal?.aborted) return Promise.resolve({ status: 'cancelled' });
|
|
10
|
+
if (!endpoint || (process.platform === 'win32' ? !endpoint.startsWith('\\\\.\\pipe\\') : !isAbsolute(endpoint))) {
|
|
11
|
+
return Promise.resolve({ status: 'unclaimed' });
|
|
12
|
+
}
|
|
13
|
+
const requestId = randomUUID();
|
|
14
|
+
const deadlineAt = Number.isSafeInteger(prompt.deadlineAt) ? prompt.deadlineAt : waitMs === null ? undefined : Date.now() + waitMs;
|
|
15
|
+
const expired = () => deadlineAt !== undefined && Date.now() >= deadlineAt;
|
|
16
|
+
const claimDeadline = Date.now() + claimMs;
|
|
17
|
+
const message = JSON.stringify({ ...prompt, protocol: 'vc-ask/v1', event: 'prompt', requestId, deadlineAt }) + '\n';
|
|
18
|
+
if (Buffer.byteLength(message) > LIMIT) return Promise.resolve({ status: 'unclaimed' });
|
|
19
|
+
if (expired()) return Promise.resolve({ status: 'timeout', value: onTimeout?.().value });
|
|
20
|
+
return new Promise(resolve => {
|
|
21
|
+
let claimed = false, done = false, buffer = '';
|
|
22
|
+
const socket = createConnection(endpoint);
|
|
23
|
+
const send = (event, fields = {}) => socket.write(JSON.stringify({ protocol: 'vc-ask/v1', event, requestId, ...fields }) + '\n');
|
|
24
|
+
const timer = setTimeout(() => finish(expired() ? 'timeout' : 'unclaimed'), Math.max(0, Math.min(claimDeadline, deadlineAt ?? Infinity) - Date.now()));
|
|
25
|
+
let expiry;
|
|
26
|
+
function finish(status, value) {
|
|
27
|
+
if (done) return;
|
|
28
|
+
done = true;
|
|
29
|
+
clearTimeout(timer);
|
|
30
|
+
clearTimeout(expiry);
|
|
31
|
+
signal?.removeEventListener('abort', abort);
|
|
32
|
+
const timed = status === 'timeout' ? onTimeout?.() : undefined;
|
|
33
|
+
if (claimed && socket.writable) {
|
|
34
|
+
socket.end(JSON.stringify({ protocol: 'vc-ask/v1', event: 'closed', requestId, status, ...timed?.fields }) + '\n');
|
|
35
|
+
socket.destroySoon();
|
|
36
|
+
} else socket.destroy();
|
|
37
|
+
resolve({ status, value: timed ? timed.value : value });
|
|
38
|
+
}
|
|
39
|
+
const abort = () => finish('cancelled');
|
|
40
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
41
|
+
const disconnected = () => finish(claimed ? 'disconnected' : 'unclaimed');
|
|
42
|
+
socket.on('connect', () => socket.write(message));
|
|
43
|
+
socket.on('error', disconnected);
|
|
44
|
+
socket.on('close', disconnected);
|
|
45
|
+
socket.on('end', disconnected);
|
|
46
|
+
socket.setEncoding('utf8');
|
|
47
|
+
socket.on('data', chunk => {
|
|
48
|
+
if (done) return;
|
|
49
|
+
buffer += chunk;
|
|
50
|
+
if (Buffer.byteLength(buffer) > LIMIT) return disconnected();
|
|
51
|
+
let i;
|
|
52
|
+
while (!done && (i = buffer.indexOf('\n')) >= 0) {
|
|
53
|
+
const line = buffer.slice(0, i);
|
|
54
|
+
buffer = buffer.slice(i + 1);
|
|
55
|
+
let event;
|
|
56
|
+
try { event = JSON.parse(line); } catch { continue; }
|
|
57
|
+
if (event?.protocol !== 'vc-ask/v1' || event.requestId !== requestId) continue;
|
|
58
|
+
if (expired()) return finish('timeout');
|
|
59
|
+
if (event.event === 'claim' && !claimed) {
|
|
60
|
+
if (Date.now() >= claimDeadline) return finish('unclaimed');
|
|
61
|
+
claimed = true;
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
if (deadlineAt !== undefined) expiry = setTimeout(() => finish('timeout'), Math.max(0, deadlineAt - Date.now()));
|
|
64
|
+
send('claimed');
|
|
65
|
+
} else if (claimed && event.event === 'cancel') finish('cancelled');
|
|
66
|
+
else if (claimed && event.event === 'answer') {
|
|
67
|
+
let value;
|
|
68
|
+
try { value = validate(event); } catch { /* Invalid answer leaves request open. */ }
|
|
69
|
+
if (value === undefined) send('rejected', { reason: 'invalid_answer' });
|
|
70
|
+
else finish('answered', value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|