@qilin-agent/client-web 0.0.0-stage → 3.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kkutysllb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,61 @@
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/client/web/README.md
5
+ /:
6
+ en: bd6e5fc50f07893f
7
+ zh: 0ee146674eb01770
8
+ /qilin-client-web:
9
+ en: 04c05bfce1fc0ba8
10
+ zh: ecc7ce8105bdd345
11
+ /qilin-client-web/summary:
12
+ en: 62a6c964d63305ee
13
+ zh: 10795f6aa125b7a5
14
+ /qilin-client-web/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: 09388d293f9be9cb
17
+ /qilin-client-web/use-this-package:
18
+ en: c95f464b989f6287
19
+ zh: 55306650ca73a466
20
+ /qilin-client-web/use-this-package/what-boot-looks-like:
21
+ en: f3b01aa878764e5c
22
+ zh: f02eab65d441bfe0
23
+ /qilin-client-web/use-this-package/the-boot-page:
24
+ en: add354591107b80d
25
+ zh: 41136254a00d785e
26
+ /qilin-client-web/use-this-package/the-shared-module-table:
27
+ en: bb1e403b7c945747
28
+ zh: cb4de1e2af1c01d5
29
+ /qilin-client-web/use-this-package/configuration:
30
+ en: a44013c67622d4ca
31
+ zh: d5117f1e5bc9f74a
32
+ /qilin-client-web/understand-the-implementation:
33
+ en: 90338f53cf18114c
34
+ zh: 15660681f8414c07
35
+ /qilin-client-web/understand-the-implementation/design-concept:
36
+ en: f06c09d08d740b91
37
+ zh: 84a747d56f590946
38
+ /qilin-client-web/understand-the-implementation/two-stage-boot:
39
+ en: fb3cab79c1505627
40
+ zh: 875897afe593aeb3
41
+ /qilin-client-web/understand-the-implementation/boot-page-mechanics:
42
+ en: 83f9195138da9a82
43
+ zh: 135d7da735fb870a
44
+ /qilin-client-web/understand-the-implementation/source-map:
45
+ en: e6406b1c66cb52cd
46
+ zh: 76887d3e036f9597
47
+ /qilin-client-web/further-exploration:
48
+ en: 6e9e25c2b963cd16
49
+ zh: 02b677b77a3fc026
50
+ /qilin-client-web/model-experience:
51
+ en: ec17334dcce181f3
52
+ zh: bc8bc6e25ecbf9e8
53
+ /qilin-client-web/model-experience/kv-cache-effect:
54
+ en: ca75c51c89c2c9b0
55
+ zh: de54f3467ef3b9be
56
+ /qilin-client-web/known-limitations-and-deferred-work:
57
+ en: f498ba05d4ea96d5
58
+ zh: c3e57dd8ca9b5bda
59
+ /qilin-client-web/known-limitations-and-deferred-work/dev-note:
60
+ en: e67f633dc6fe7773
61
+ zh: 3bb0c20c93f16f98
package/README.md CHANGED
@@ -1,3 +1,129 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Web boot kernel for the web GUI: two-stage boot of the client plugin tree, the framework-free boot page, and the shared module table, for users and maintainers composing or debugging the browser application."
3
+ kind: "package-library"
4
+ ---
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ # @qilin-agent/client-web
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ `qilin-client-web` boots the web GUI: it loads the client module system from the Host-provided boot graph, then activates every client plugin before the application mounts, so the full UI appears only when every plugin is up. A framework-free boot page reports per-entry status, so a failing bundle or plugin stays visible instead of a blank screen. It also defines the shared module table (`PLATFORM_MODULES`) that every dynamic bundle resolves its externals against. The model never sees this package.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Use it when you assemble the browser application: `apps/web`'s Vite entry runs `new AppWebEntry(container).run()` against the mount point, and the boot page carries the user through activation. Ordinary browser callers pass no options. A pre-injected page transport is the default ahead of the `seams` override: when `globalThis.__QILIN_TRANSPORT__` carries `loadBundle`, the module stage adopts it as the bundle transport and skips the immediate-tier HTTP prefetch, while explicit `seams` still win (for example jsdom tests, where external `<script>` execution cannot reach the page context).
29
+
30
+ Static application pages install `__QILIN_BOOT_READY__` before the entry runs. The boot page renders immediately while `run()` waits; the page owner applies the Host rows with `applyIndexInjections` (also exported from `./injections`) and resolves the deferred after all scripts finish. A rejected deferred renders a boot failure unless the caller supplies `run(onFailure)` to present the error externally while retaining the loading page. Desktop uses this callback to request native recovery. Desktop and WebWorker share the injection interpreter; server-side `tapIndex` HTML transforms apply only to served documents.
31
+
32
+ The shell base styles apply automatic CJK/Latin spacing to ordinary content in supporting browsers. Semantic code and terminal, diff, read, and search output containers retain literal source spacing and column alignment; browsers without `text-autospace` support ignore both declarations.
33
+
34
+ ### What boot looks like
35
+
36
+ Boot runs in two stages: the module stage adopts the parser-loaded bootstrap batch, builds the module system from the Host-provided boot graph, and prefetches the `immediately` tier through the shared application-batch URL, which executes once. The plugin stage then activates every graph entry and waits for all of them before handing the marked boot DOM to the UI renderer, which hydrates it and switches to the complete UI.
37
+
38
+ ### The boot page
39
+
40
+ The boot page uses plain DOM and local CSS, so bundle and plugin-activation failures remain visible: it shows one spinner node whose CSS arc grows as entries activate, and reports per-entry status. The spinner and its animation phase persist until the full UI replaces the boot page. A plugin that fails import or activation is reported by name with the reason (missing service, import failure, or state) instead of a blank page. The console contains the original import error.
41
+
42
+ ### The shared module table
43
+
44
+ `PLATFORM_MODULES` (in `src/platform.ts`) names the shell-seeded shared modules — React, Kylin, and static UI libraries — and together with `PRELOADED_CLIENT_EXTERNALS` (the parser-preloaded runtime row) defines the implicit external baseline every dynamic bundle resolves against. `qilin.client.external` adds only exact non-baseline requests; see [shared modules and the module graph](../AGENTS.md#shared-modules-and-the-module-graph).
45
+
46
+ ### Configuration
47
+
48
+ The package accepts no plugin config of its own; the generated [configuration catalog](../../../docs/config-catalog.md) lists every plugin config in the repo for comparison.
49
+
50
+ -----
51
+
52
+ <a id="understand-the-implementation"></a>
53
+ ## Understand the implementation
54
+
55
+ <details>
56
+ <summary>Implementation internals — click to expand</summary>
57
+
58
+ This section explains how the boot kernel is built; observable behavior is covered in [Use this package](#use-this-package).
59
+
60
+ ### Design concept
61
+
62
+ The kernel owns exactly three things: the module system, the Kylin Loader, and the boot page. The Host owns the graph, batch preload, and loader facade, so `AppWebEntry` never knows the bootstrap package id or parses the wire format. The dynamic UI renderer receives the mount point only after every client entry activates.
63
+
64
+ ### Two-stage boot
65
+
66
+ `run()` calls the Host-installed `window.__ModuleLoader__.create({ boot, staticModules, ...seams })`; the facade returns the constructed module system and parsed manifest after adopting the parser-loaded bootstrap batch. The module stage prefetches the `immediately` tier through the one shared application-batch URL. The plugin stage mounts the Loader, assigns `loader.internal = modules`, creates every graph entry uniformly, awaits quiescence, then audits activation: any entry that failed import, stayed pending on a missing service, or landed in another non-active state throws one aggregated error naming every failing entry.
67
+
68
+ ### Boot page mechanics
69
+
70
+ The boot page is plain DOM with local CSS whose fallback fonts and colors match the theme tokens that arrive during loading. `internal/status` events drive one spinner node and per-entry labels; hydration preserves the node and animation phase through the application commit, and `fail()` renders the thrown reason. React mounting, slot rendering, and assembly live in `ui-renderer`; `ui-layout` owns the assembled browser-title projection.
71
+
72
+ The boot kernel delegates manifest entry creation to Client Modules so live graph synchronization owns the same entry identities after startup. The initial activation audit remains strict; later page-local failures appear in Settings → Plugins → Plugin list.
73
+
74
+ ### Source map
75
+
76
+ | File | Role |
77
+ |---|---|
78
+ | [`src/index.ts`](src/index.ts) | Library entry: `AppWebEntry`, `getStaticModules`, platform tables |
79
+ | [`src/boot.ts`](src/boot.ts) | `AppWebEntry`: module stage, boot page, immediate-tier prefetch, then `bootClient` + `mountClient` |
80
+ | [`src/boot-client.ts`](src/boot-client.ts) | `bootClient` / `assertEntriesActive`: Loader mount, one entry per manifest row, activation audit |
81
+ | [`src/mount.ts`](src/mount.ts) | `mountClient`: renderer handoff through a `uiRenderer` dependency fiber |
82
+ | [`src/boot-page.ts`](src/boot-page.ts) | Framework-free boot page: spinner, per-entry status, failure rendering |
83
+ | [`src/platform.ts`](src/platform.ts) | `PLATFORM_MODULES` / `PRELOADED_CLIENT_EXTERNALS`: the implicit external baseline |
84
+ | [`src/seed.ts`](src/seed.ts) | Static module table handed to the loader at boot |
85
+
86
+ </details>
87
+
88
+ -----
89
+
90
+ <a id="further-exploration"></a>
91
+ ## Further Exploration
92
+
93
+ Read these when the boot contract is not enough: the module system it boots, the renderer that mounts the app, and the client authoring rules behind the baseline.
94
+
95
+ - [Client module system](../modules/README.md) — the lazy module table and boot graph this kernel consumes.
96
+ - [UI renderer](../ui-renderer/README.md) — receives the mount point and binds slot data to React.
97
+ - [Client modules subsystem](../../../docs/subsystems/client-modules.md) — the web plugin table, boot graph wire, and bundle route.
98
+ - [Client authoring rules](../AGENTS.md#shared-modules-and-the-module-graph) — the shared-module baseline and `qilin.client.external` semantics.
99
+ - [Client group map](../README.md) — the browser half this package belongs to.
100
+
101
+ -----
102
+
103
+ <a id="model-experience"></a>
104
+ ## Model Experience
105
+
106
+ None, as the boot kernel is a browser-side UI plugin layer that registers nothing model-facing.
107
+
108
+ #### KV Cache effect
109
+
110
+ None; this package neither assembles nor sends a provider request.
111
+
112
+ ## Known Limitations and Deferred Work
113
+
114
+ <a id="known-limitations-and-deferred-work"></a>
115
+
116
+
117
+ These limits define what the boot kernel does not support. They are current package constraints, not a task backlog.
118
+
119
+ - **The application waits for the full roster** — one failed entry keeps the framework-free boot page visible with a per-entry report; partial UI availability is not supported.
120
+
121
+ <a id="dev-note"></a>
122
+ ### Dev Note
123
+
124
+ <details>
125
+ <summary>Working context for maintainers — click to expand</summary>
126
+
127
+ None.
128
+
129
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,129 @@
1
+ ---
2
+ description: "面向用户与维护者的 web GUI 启动内核说明:客户端插件树的两阶段启动、无框架启动页与共享模块表,用于组合或排查浏览器应用。"
3
+ kind: "package-library"
4
+ ---
5
+
6
+ # @qilin-agent/client-web
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ `qilin-client-web` 启动 web GUI:它先从 Host 提供的启动图加载客户端模块系统,再在应用挂载前激活每一个客户端插件,因此只有当所有插件都就绪时完整 UI 才会出现。无框架启动页会逐 entry 报告状态,因此失败的 bundle 或插件保持可见,而不是白屏。它还定义共享模块表(`PLATFORM_MODULES`),每个动态 bundle 都依据它解析 external。模型永远看不到本包。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 组装浏览器应用时使用它:`apps/web` 的 Vite 入口对挂载点运行 `new AppWebEntry(container).run()`,启动页会在激活过程中向用户展示进度。普通浏览器调用方不传任何选项。默认使用预注入的页面传输,除非提供 `seams` 覆盖:当 `globalThis.__QILIN_TRANSPORT__` 携带 `loadBundle` 时,模块阶段将其采纳为 bundle 传输并跳过 `immediately` 层级的 HTTP 预取,而显式 `seams` 仍然优先(例如外部 `<script>` 执行无法到达页面上下文的 jsdom 测试)。
29
+
30
+ 静态应用页面在入口运行前安装 `__QILIN_BOOT_READY__`。`run()` 等待期间会立即显示启动页;页面所有者通过 `applyIndexInjections`(也从 `./injections` 导出)应用 Host 注入项,并在所有脚本完成后兑现延迟对象。延迟对象拒绝时显示启动失败;若调用方提供 `run(onFailure)`,则由外部呈现错误并保留加载页。Desktop 使用该回调请求原生恢复。Desktop 与 WebWorker 共享注入解释器;服务端 `tapIndex` HTML 转换仅适用于服务端提供的文档。
31
+
32
+ 外壳基础样式会在支持的浏览器中为普通内容自动添加中西文间距。语义化代码以及终端、diff、读取和搜索输出容器会保留源码中的原始间距和列对齐;不支持 `text-autospace` 的浏览器会忽略这两项声明。
33
+
34
+ ### 启动过程是怎样的
35
+
36
+ 启动分两个阶段:模块阶段接纳 parser 已加载的 bootstrap 批次,从 Host 提供的启动图构建模块系统,并通过只执行一次的共享 application 批次 URL 预取 `immediately` 层级。插件阶段随后激活每个图 entry 并等待全部就绪,之后才把带标记的启动 DOM 交给 UI 渲染器,由它 hydrate 并切换到完整 UI。
37
+
38
+ ### 启动页
39
+
40
+ 启动页只使用原生 DOM 与本地 CSS,因此 bundle 与插件激活失败保持可见:它显示一个 spinner 节点,其 CSS 圆弧随 entry 激活而增长,并逐 entry 报告状态。spinner 及其动画相位会一直保留,直到完整 UI 替换启动页。导入或激活失败的插件会按名称报告并给出原因(缺失服务、导入失败或状态),而不是白屏。控制台包含原始导入错误。
41
+
42
+ ### 共享模块表
43
+
44
+ `PLATFORM_MODULES`(位于 `src/platform.ts`)列出外壳预置的共享模块——React、Kylin 与静态 UI 库——并与 `PRELOADED_CLIENT_EXTERNALS`(parser 预载的运行时行)一起定义每个动态 bundle 解析所依据的隐式 external 基座。`qilin.client.external` 只添加基座之外的精确请求;参见[共享模块与模块图](../AGENTS.md#shared-modules-and-the-module-graph)。
45
+
46
+ ### 配置
47
+
48
+ 本包自身不接受任何插件配置;生成的[配置目录](../../../docs/config-catalog.zh.md)列出仓库中每个插件配置以供对照。
49
+
50
+ -----
51
+
52
+ <a id="understand-the-implementation"></a>
53
+ ## 理解实现
54
+
55
+ <details>
56
+ <summary>实现细节——点击展开</summary>
57
+
58
+ 本节解释启动内核的构建方式;可观察行为已在[使用本包](#use-this-package)中说明。
59
+
60
+ ### 设计理念
61
+
62
+ 内核恰好拥有三样东西:模块系统、Kylin Loader 与启动页。Graph、批次 preload 与 loader facade 归 Host 所有,因此 `AppWebEntry` 永不感知 bootstrap 包 id,也不解析协议格式(wire format)。动态 UI 渲染器只在每个客户端 entry 激活后收到挂载点。
63
+
64
+ ### 两阶段启动
65
+
66
+ `run()` 调用 Host 安装的 `window.__ModuleLoader__.create({ boot, staticModules, ...seams })`;facade 接纳 parser 已加载的 bootstrap 批次后返回构造好的模块系统与已解析 manifest(元数据清单)。模块阶段通过一个共享的 application 批次 URL 预取 `immediately` 层级。插件阶段挂载 Loader、把 `loader.internal` 赋为 `modules`、统一创建全部图 entry、等待完全停稳,然后审计激活:任何导入失败、因缺失服务而 pending,或落入其他非 active 状态的 entry,都会抛出一个聚合错误,点名每个失败 entry。
67
+
68
+ ### 启动页机制
69
+
70
+ 启动页是原生 DOM 加本地 CSS,其回退字体与颜色匹配加载期间到达的主题 token。`internal/status` 事件驱动一个 spinner 节点与逐 entry 标签;hydrate 会保留该节点与动画相位直到应用提交,`fail()` 渲染抛出的原因。React 挂载、slot 渲染与应用组装位于 `ui-renderer`;`ui-layout` 拥有组装后的浏览器标题投影。
71
+
72
+ 启动内核把清单条目创建交给 Client Modules,使启动后的动态图同步继续持有相同的条目身份。初始激活审计仍然严格;后续页面本地失败显示在「设置 → 插件 → 插件列表」。
73
+
74
+ ### 源码地图
75
+
76
+ | 文件 | 职责 |
77
+ |---|---|
78
+ | [`src/index.ts`](src/index.ts) | 库入口:`AppWebEntry`、`getStaticModules`、平台表 |
79
+ | [`src/boot.ts`](src/boot.ts) | `AppWebEntry`:模块阶段、启动页、immediately 层级预取,随后调用 `bootClient` + `mountClient` |
80
+ | [`src/boot-client.ts`](src/boot-client.ts) | `bootClient` / `assertEntriesActive`:挂载 Loader、每个 manifest 行一个 entry、激活审计 |
81
+ | [`src/mount.ts`](src/mount.ts) | `mountClient`:经 `uiRenderer` 依赖 fiber 完成渲染器交接 |
82
+ | [`src/boot-page.ts`](src/boot-page.ts) | 无框架启动页:spinner、逐 entry 状态、失败渲染 |
83
+ | [`src/platform.ts`](src/platform.ts) | `PLATFORM_MODULES` / `PRELOADED_CLIENT_EXTERNALS`:隐式 external 基座 |
84
+ | [`src/seed.ts`](src/seed.ts) | 启动时交给 loader 的静态模块表 |
85
+
86
+ </details>
87
+
88
+ -----
89
+
90
+ <a id="further-exploration"></a>
91
+ ## 进一步探索
92
+
93
+ 当启动约定不够用时阅读以下页面:它所启动的模块系统、挂载应用的渲染器,以及基座背后的客户端编写规则。
94
+
95
+ - [客户端模块系统](../modules/README.zh.md)——本内核消费的惰性模块表与启动图。
96
+ - [UI 渲染器](../ui-renderer/README.zh.md)——接收挂载点并把 slot 数据绑定到 React。
97
+ - [客户端模块子系统](../../../docs/subsystems/client-modules.zh.md)——web 插件表、启动图协议与 bundle 路由。
98
+ - [客户端编写规则](../AGENTS.md#shared-modules-and-the-module-graph)——共享模块基座与 `qilin.client.external` 语义。
99
+ - [客户端组地图](../README.zh.md)——本包所属的浏览器半侧。
100
+
101
+ -----
102
+
103
+ <a id="model-experience"></a>
104
+ ## 模型体验
105
+
106
+ 无。启动内核属于浏览器侧 UI 插件层,不注册任何面向模型的内容。
107
+
108
+ #### KV Cache 影响
109
+
110
+ 无;该包既不组装也不发送提供方请求。
111
+
112
+ ## 已知限制与延期工作
113
+
114
+ <a id="known-limitations-and-deferred-work"></a>
115
+
116
+
117
+ 这些限制说明启动内核不支持什么。它们是当前包约束,不是任务积压。
118
+
119
+ - **应用会等待全部 entry 就绪**——只要一个 entry 失败,无框架启动页就会保留并逐项报告;不支持部分 UI 可用。
120
+
121
+ <a id="dev-note"></a>
122
+ ### 开发备注
123
+
124
+ <details>
125
+ <summary>维护者的工作上下文——点击展开</summary>
126
+
127
+ 无。
128
+
129
+ </details>
@@ -0,0 +1,40 @@
1
+ //#region lib/types/apply-injections.js
2
+ function assertNever(row) {
3
+ throw new Error(`web boot: unknown index injection row ${JSON.stringify(row)}`);
4
+ }
5
+ /**
6
+ * Execute every row in table order.
7
+ * @param rows - Injection table from the boot payload.
8
+ * @param loadScript - Executes one script-src row through the page owner's asset transport.
9
+ */
10
+ async function applyIndexInjections(rows, loadScript) {
11
+ for (const row of rows) switch (row.kind) {
12
+ case "global":
13
+ globalThis[row.name] = row.value;
14
+ break;
15
+ case "script": {
16
+ const el = document.createElement("script");
17
+ el.textContent = row.text;
18
+ (row.placement === "head" ? document.head : document.body).append(el);
19
+ break;
20
+ }
21
+ case "script-src":
22
+ await loadScript(row.src);
23
+ break;
24
+ case "script-preload": break;
25
+ case "style": {
26
+ const el = document.createElement("style");
27
+ el.textContent = row.text;
28
+ document.head.append(el);
29
+ break;
30
+ }
31
+ case "html":
32
+ (row.placement === "head" ? document.head : document.body).insertAdjacentHTML("beforeend", row.html);
33
+ break;
34
+ default: assertNever(row);
35
+ }
36
+ }
37
+ //#endregion
38
+ export { applyIndexInjections };
39
+
40
+ //# sourceMappingURL=apply-injections.js.map
package/lib/base.css ADDED
@@ -0,0 +1,106 @@
1
+ /* Shell-owned mount defaults. Theme tokens arrive with the ui-theme client
2
+ * plugin before the loader roster activates. */
3
+
4
+ html,
5
+ body,
6
+ #root {
7
+ height: 100%;
8
+ margin: 0;
9
+ }
10
+
11
+ body {
12
+ font-family: var(
13
+ --qilin-font-family,
14
+ -apple-system,
15
+ BlinkMacSystemFont,
16
+ 'Segoe UI',
17
+ 'PingFang SC',
18
+ 'Hiragino Sans GB',
19
+ 'Microsoft YaHei',
20
+ 'Helvetica Neue',
21
+ Helvetica,
22
+ Arial,
23
+ sans-serif
24
+ );
25
+ /* Grayscale antialiasing over subpixel rendering: WebKit/Blink and the
26
+ Firefox macOS equivalent; other engines ignore both lines. */
27
+ -webkit-font-smoothing: antialiased;
28
+ -moz-osx-font-smoothing: grayscale;
29
+ color: var(--qilin-alias-label-primary, #0f1115);
30
+ background: var(--qilin-alias-bg-base, #fff);
31
+ /* Supporting browsers insert CJK/Latin spacing in inherited prose. */
32
+ text-autospace: normal;
33
+ }
34
+
35
+ /* macOS desktop (the Electron preload sets data-platform): the window's
36
+ sidebar vibrancy shows only through a transparent page background. */
37
+ html[data-platform='darwin'],
38
+ html[data-platform='darwin'] body {
39
+ background: transparent;
40
+ }
41
+
42
+ code,
43
+ pre,
44
+ [data-diff],
45
+ [data-read],
46
+ [data-search],
47
+ [data-terminal] {
48
+ /* Literal payloads retain source spacing and column alignment. */
49
+ text-autospace: no-autospace;
50
+ }
51
+
52
+ /* Form controls don't inherit the body font (UA sheets pin their families —
53
+ Chrome buttons fall back to Arial, textareas to monospace), so the app
54
+ stack is re-applied to them explicitly, as upstream's global reset does. */
55
+ button,
56
+ input,
57
+ select,
58
+ textarea {
59
+ font-family: inherit;
60
+ }
61
+
62
+ /* macOS desktop: the one drag declaration. A chrome row marks itself in markup
63
+ (`data-window-drag`: the sidebar's top strip, the right sidebar's dockkit
64
+ strip, the Conversation header, the plugin manager's page head and shared
65
+ detail head) and its own box becomes its draggable geometry, so no fixed
66
+ band has to match any row's height. Electron composes app-regions from
67
+ geometry, not hit testing, so a surface covering a row would otherwise drag
68
+ the window instead of receiving clicks; every covering overlay portals to
69
+ document.body beside #root, which also puts it after every drag row in
70
+ document order, and one rule subtracts them all. */
71
+ html[data-platform='darwin'] [data-window-drag] {
72
+ -webkit-app-region: drag;
73
+ }
74
+
75
+ /* One-frame app-region pulse that forces Electron to recollect the window's
76
+ drag rects (electron#32341): a change to a computed app-region value is what
77
+ dirties them. The shell's window drag watcher (window-drag/recall.ts) sets
78
+ this attribute on the body for each frame in which a marked row's box moved,
79
+ and clears it on the frame that finds the geometry settled. The box it
80
+ subtracts is the body's own: the row marks inside still declare drag and win
81
+ over it in document order, so the pulse changes nothing about the composed
82
+ surface — it only makes Electron collect it again. */
83
+ html[data-platform='darwin'] [data-window-drag-recall] {
84
+ -webkit-app-region: no-drag;
85
+ }
86
+
87
+ html[data-platform='darwin'] body > :not(#root) {
88
+ -webkit-app-region: no-drag;
89
+ }
90
+
91
+ /* Inside #root, interactive controls and raised surfaces (dialogs, menus)
92
+ subtract themselves from any drag row they overlap, wherever they render.
93
+ Electron composes app-regions from geometry in document order, so a drag
94
+ rule must sit on a chrome row that precedes the overlays covering it —
95
+ never on a content container, which would override every overlay mounted
96
+ earlier in the DOM. One selector on the native elements, ARIA roles, and
97
+ tabindexed custom widgets replaces per-component no-drag opt-outs. */
98
+ html[data-platform='darwin'] :is(
99
+ button, a, input, select, textarea, summary, [contenteditable='true'], [tabindex],
100
+ [role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox'], [role='tooltip'],
101
+ [role='button'], [role='link'], [role='tab'], [role='menuitem'], [role='menuitemcheckbox'],
102
+ [role='menuitemradio'], [role='option'], [role='checkbox'], [role='radio'], [role='switch'],
103
+ [role='slider'], [role='combobox'], [role='textbox']
104
+ ) {
105
+ -webkit-app-region: no-drag;
106
+ }
@@ -0,0 +1,103 @@
1
+ /* The framework-free boot page cannot depend on theme delivery succeeding. */
2
+
3
+ .boot {
4
+ --qilin-boot-label-primary: #0f1115;
5
+ --qilin-boot-label-secondary: #61666b;
6
+ --qilin-boot-label-tertiary: #81858c;
7
+ --qilin-boot-border: rgb(0 0 0 / 10%);
8
+ --qilin-boot-brand: #0f1115;
9
+
10
+ height: 100%;
11
+ display: grid;
12
+ place-items: center;
13
+ background: var(--qilin-alias-bg-base, var(--qilin-boot-bg, Canvas));
14
+ }
15
+
16
+ :global(body[data-ds-dark-theme]) .boot {
17
+ --qilin-boot-label-primary: #f9fafb;
18
+ --qilin-boot-label-secondary: #cfd3d6;
19
+ --qilin-boot-label-tertiary: #adb2b8;
20
+ --qilin-boot-border: rgb(255 255 255 / 12%);
21
+ --qilin-boot-brand: #f9fafb;
22
+ }
23
+
24
+ .card {
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ gap: 16px;
29
+ }
30
+
31
+ .wordmark {
32
+ font-size: 16px;
33
+ line-height: 24px;
34
+ font-weight: 600;
35
+ letter-spacing: 0.08em;
36
+ color: var(--qilin-alias-label-primary, var(--qilin-boot-label-primary));
37
+ }
38
+
39
+ .hint {
40
+ font-size: 12px;
41
+ line-height: 18px;
42
+ color: var(--qilin-alias-label-tertiary, var(--qilin-boot-label-tertiary));
43
+ }
44
+
45
+ .spinner {
46
+ position: relative;
47
+ width: 20px;
48
+ height: 20px;
49
+ border-radius: 50%;
50
+ corner-shape: round;
51
+ border: 2px solid var(--qilin-alias-border-l2, var(--qilin-boot-border));
52
+ animation: spin 0.8s linear infinite;
53
+ }
54
+
55
+ .spinner::after {
56
+ content: '';
57
+ position: absolute;
58
+ inset: -2px;
59
+ border-radius: inherit;
60
+ background: conic-gradient(
61
+ var(--qilin-alias-brand-primary, var(--qilin-boot-brand)) var(--qilin-boot-arc, 72deg),
62
+ transparent 0
63
+ );
64
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
65
+ mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
66
+ }
67
+
68
+ @keyframes spin {
69
+ to { transform: rotate(360deg); }
70
+ }
71
+
72
+ .failed {
73
+ max-width: 480px;
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: 8px;
77
+ }
78
+
79
+ .failedTitle {
80
+ font-size: 14px;
81
+ line-height: 22px;
82
+ font-weight: 600;
83
+ color: var(--qilin-alias-label-primary, var(--qilin-boot-label-primary));
84
+ }
85
+
86
+ .failedItem {
87
+ font-family: var(
88
+ --ds-font-family-code,
89
+ 'SF Mono',
90
+ 'JetBrains Mono',
91
+ 'Fira Code',
92
+ Consolas,
93
+ 'Liberation Mono',
94
+ Menlo,
95
+ Courier,
96
+ 'PingFang SC',
97
+ 'Microsoft YaHei'
98
+ );
99
+ font-size: 12px;
100
+ line-height: 18px;
101
+ color: var(--qilin-alias-label-secondary, var(--qilin-boot-label-secondary));
102
+ white-space: pre-wrap;
103
+ }