@qilin-agent/client-ui-workspace 0.0.0-stage → 3.1.4
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 +21 -0
- package/README.i18n.yaml +67 -0
- package/README.md +134 -2
- package/README.zh.md +135 -0
- package/lib/client.js +3334 -0
- package/lib/index.js +11 -0
- package/lib/types/client/WorkspacePicker.d.ts +57 -0
- package/lib/types/client/contract/slots.d.ts +213 -0
- package/lib/types/client/index.d.ts +49 -0
- package/lib/types/client/locales.d.ts +160 -0
- package/lib/types/client/navigation.d.ts +148 -0
- package/lib/types/client/pin-order.d.ts +26 -0
- package/lib/types/client/rows/Rows.d.ts +116 -0
- package/lib/types/client/rows/WorkspaceBrowser.d.ts +8 -0
- package/lib/types/client/shortcuts.d.ts +39 -0
- package/lib/types/client/stores.d.ts +54 -0
- package/lib/types/client/subagent-lineage.d.ts +21 -0
- package/lib/types/client/tree.d.ts +187 -0
- package/lib/types/index.d.ts +9 -0
- package/package.json +85 -3
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.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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/ui-workspace/README.md
|
|
5
|
+
/:
|
|
6
|
+
en: a92228dd36f58c28
|
|
7
|
+
zh: d2bcff3de67211c9
|
|
8
|
+
/qilin-agent-client-ui-workspace:
|
|
9
|
+
en: 7c92dee86395fa5e
|
|
10
|
+
zh: eb914b3268d653ac
|
|
11
|
+
/qilin-agent-client-ui-workspace/summary:
|
|
12
|
+
en: 1fb6e04bffdf985e
|
|
13
|
+
zh: 5068ce8d141f377e
|
|
14
|
+
/qilin-agent-client-ui-workspace/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/qilin-agent-client-ui-workspace/use-this-package:
|
|
18
|
+
en: d2973905f9fc3331
|
|
19
|
+
zh: 5d557bd5c8eb783a
|
|
20
|
+
/qilin-agent-client-ui-workspace/use-this-package/reordering-and-view-options:
|
|
21
|
+
en: 6cea302320f00839
|
|
22
|
+
zh: d695994ec569a43e
|
|
23
|
+
/qilin-agent-client-ui-workspace/use-this-package/workspace-hierarchy:
|
|
24
|
+
en: 5e049b90c55eddb3
|
|
25
|
+
zh: e06dc8d0d25c013f
|
|
26
|
+
/qilin-agent-client-ui-workspace/use-this-package/search:
|
|
27
|
+
en: faf570bcad825439
|
|
28
|
+
zh: a65300b0b40a8550
|
|
29
|
+
/qilin-agent-client-ui-workspace/use-this-package/managing-sessions:
|
|
30
|
+
en: 7a50621fbde08357
|
|
31
|
+
zh: 735a575e236e3860
|
|
32
|
+
/qilin-agent-client-ui-workspace/use-this-package/pending-interactions:
|
|
33
|
+
en: efcede0546e167c5
|
|
34
|
+
zh: 74afe770abb49016
|
|
35
|
+
/qilin-agent-client-ui-workspace/use-this-package/active-schedule-markers:
|
|
36
|
+
en: 2b0cda3b7b38ce39
|
|
37
|
+
zh: e33243b642a6164a
|
|
38
|
+
/qilin-agent-client-ui-workspace/understand-the-implementation:
|
|
39
|
+
en: f08ceb1f5612a6ac
|
|
40
|
+
zh: a75b56cc094b5c45
|
|
41
|
+
/qilin-agent-client-ui-workspace/understand-the-implementation/the-directory-flow-hole:
|
|
42
|
+
en: 978415ec6b2e0cc0
|
|
43
|
+
zh: 0d5c705ff34fb1da
|
|
44
|
+
/qilin-agent-client-ui-workspace/understand-the-implementation/the-hero-run-mode-chip:
|
|
45
|
+
en: 745e917ae00da6ab
|
|
46
|
+
zh: 32c745f9078829b8
|
|
47
|
+
/qilin-agent-client-ui-workspace/understand-the-implementation/view-state:
|
|
48
|
+
en: dc93d10e80153f62
|
|
49
|
+
zh: 5caa3399dbf84f62
|
|
50
|
+
/qilin-agent-client-ui-workspace/understand-the-implementation/hover-cards:
|
|
51
|
+
en: f236cadca4c98088
|
|
52
|
+
zh: 8b36850c1d5f73d2
|
|
53
|
+
/qilin-agent-client-ui-workspace/further-exploration:
|
|
54
|
+
en: cf79dbc3c0a50622
|
|
55
|
+
zh: e86fbbd598a7fe77
|
|
56
|
+
/qilin-agent-client-ui-workspace/model-experience:
|
|
57
|
+
en: 3120df665299c634
|
|
58
|
+
zh: 1d9f365d091d0d2a
|
|
59
|
+
/qilin-agent-client-ui-workspace/model-experience/kv-cache-effect:
|
|
60
|
+
en: ca75c51c89c2c9b0
|
|
61
|
+
zh: de54f3467ef3b9be
|
|
62
|
+
/qilin-agent-client-ui-workspace/known-limitations-and-deferred-work:
|
|
63
|
+
en: ead58471d372f64f
|
|
64
|
+
zh: 3af32ed381b76179
|
|
65
|
+
/qilin-agent-client-ui-workspace/known-limitations-and-deferred-work/dev-note:
|
|
66
|
+
en: e67f633dc6fe7773
|
|
67
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -1,3 +1,135 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Shared Workspace browser and picker plugin for the qilin web client: grouped or flat session rows, add/rename/reorder, search, fork, archive, and the directory-flow picking hole."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# @qilin-agent/client-ui-workspace
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
This package lets users browse grouped or flat Session lists, choose a Workspace for a new Session, and manage Workspaces and Sessions through add, rename, reorder, pin, search, fork, archive, and Workspace deletion. Pending interactions appear as warning dots, active scheduled tasks as alarm markers, and subagent-origin Sessions remain hidden. Canonically distinct folder paths remain separate Workspaces. Adding a Workspace requires a composed directory picker; without one, the add action is unavailable. The new-task screen carries the run-mode chip: each tag remembers its own preset and offers the others — the creator preset included.
|
|
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 the sidebar to browse Workspaces and their Sessions, reorder them, and start new ones; use the picker in the Session Intent hero to choose a Workspace for a new session. An open Workspace shows five non-blank Sessions by default and keeps the selected blank **New Session** as one provisional extra row until its first prompt. **Show more** reveals the hidden remainder; closing and reopening the Workspace restores this folded projection.
|
|
29
|
+
|
|
30
|
+
### Reordering and view options
|
|
31
|
+
|
|
32
|
+
**Last updated** orders ordinary Sessions by their latest user prompt or steer time, newest first, in both grouped and flat views. **Manual** freezes the current displayed order and holds positions when activity changes; newly discovered ordinary Sessions append to the end, newest first when several arrive together. Returning to Last updated discards every manual position, and entering Manual again freezes the then-current recency order. The browser defaults to Last updated and remembers the selected mode across reloads. Dragging an ordinary Session applies the move locally and selects Manual. The selected blank **New Session** is always pinned first and cannot be dragged; after its first prompt it becomes an ordinary draggable row, retaining its first position in Manual or following its current timestamp in Last updated. In a collapsed group, drag boundaries follow rendered rows and place the source before intervening hidden rows, so a drag cannot hide its source. Session display orders for real Workspaces, Ungrouped, and the flat list are browser-local; Workspace group drag order remains Host-durable.
|
|
33
|
+
|
|
34
|
+
### Workspace hierarchy
|
|
35
|
+
|
|
36
|
+
Choose **Add workspace** and select a directory to register it and open a Session. **View options → Group by** defaults to **WorkSpace**, which lists Workspaces as sibling sections. Select **Workspace Tree** to nest each Workspace under its nearest registered ancestor, including Workspaces added later. Each Workspace keeps its own Sessions and row actions. Child Workspaces appear before the parent's own Sessions. Ancestors start expanded unless a saved collapsed state exists. A saved collapse also hides the current Session; ancestor folder icons stay highlighted when a descendant Workspace contains it. Row fills and hit targets span the same width at every level; only the contents indent. Workspace dragging reorders siblings; dropping on a descendant targets the nearest compatible ancestor, so an expanded parent can be moved past without collapsing it. Search-result navigation expands every ancestor. Grouping and expansion are saved in the current browser; switching modes preserves each Workspace's expansion preference, and the single-list view stays flat.
|
|
37
|
+
|
|
38
|
+
Hierarchy uses registered canonical paths only. It does not scan for projects or resolve symlink aliases. Nesting does not change Session working directories, logs, or Workspace membership. Deleting a parent Workspace leaves its child Workspaces registered and places them under their next registered ancestor, or at the root.
|
|
39
|
+
|
|
40
|
+
### Search
|
|
41
|
+
|
|
42
|
+
Collapsed search is one header action beside the view and add actions: activating it expands the field across the header. A non-blank query replaces either browsing mode with one flat result list — case-insensitive title and Workspace substring matches appear immediately, while a 250 ms debounced Host request adds ranked current-conversation content matches and snippets. Each new query aborts the preceding request; a failed content search leaves metadata matches visible with a warning. The list is capped at 20. Choosing a result clears and collapses search, opens the Session, and scrolls its row into view in the configured browsing mode; grouped browsing also expands its Workspace and the full Session list when required.
|
|
43
|
+
|
|
44
|
+
### Managing sessions
|
|
45
|
+
|
|
46
|
+
The Session row's Rename action opens a dialog prefilled with the row's display title; confirming an unchanged title is deliberately allowed — it pins the current automatic title against regeneration. Rename uses a temporary `workspaceOperation` reference, while fork-title assignment uses a temporary `controllerOperation` reference inside Session Controller; both await the reference's initial history opening. Archive commits without a confirmation dialog and the row disappears from every grouping surface when the archive-set echo lands. Fork forks at the source's last completed turn, increments the inherited persisted title on the client, and then opens the child. Workspace Delete opens a confirmation that states the retention boundary; success removes the group while its Sessions remain under Ungrouped.
|
|
47
|
+
|
|
48
|
+
Pin is a registry-global fact, not a browser-local order: the row menu and its hover button toggle it, a pinned row leads its group and the flat list and draws a marker in the trailing cell, and the Host call fronts the Session in every saved manual order that owns it. Unpin leaves those saved positions alone. An archived Session cannot be pinned, and archiving drops its pin in the same durable write.
|
|
49
|
+
|
|
50
|
+
A Session title wider than its row is clipped with an ellipsis at rest. Hovering the row scrolls the title to its far edge — the incremented title of a fork, for example — and reveals it without the ellipsis; leaving the row returns the title to its start.
|
|
51
|
+
|
|
52
|
+
### Pending interactions
|
|
53
|
+
|
|
54
|
+
Session rows render the runtime's live `pendingInteraction` classification: approvals report **Waiting for approval**, plan reviews report **Plan awaiting review**, and ordinary questions report **Waiting for answer**. Every pending interaction uses an amber warning dot that takes precedence over the running indicator.
|
|
55
|
+
|
|
56
|
+
### Active Schedule markers
|
|
57
|
+
|
|
58
|
+
Grouped and flat Session rows, plus search results, show an outline alarm when `SessionSummary.projectionValues.schedule` is a non-empty array. The marker sits after the title; an ordinary row keeps its update time after the marker, while a search result has no update time. It is not a button, has no independent pointer action or tab stop, and clicking its area still opens the row. The localized tooltip and matching screen-reader label say **Has active scheduled task**.
|
|
59
|
+
|
|
60
|
+
The value is intentionally best effort for cold Sessions. An identity-matching usable projection-cache row can prewarm the alarm without opening the Session; a missing or stale cache may briefly omit or retain it. The marker means only that the current list value contains an undispatched or undeleted Schedule record. It does not report whether a Schedule runtime is live or able to wake the Session.
|
|
61
|
+
|
|
62
|
+
-----
|
|
63
|
+
|
|
64
|
+
`ctx.uiWorkspace.openSession(target)` synchronously replaces the owned `mainView` reference and returns the main area to Conversation without waiting for `reference.ready`, so history loading renders inside the selected Session view. The target may be a known Session id or a durable direct-parent subagent address; an explicit address does not require a preloaded parent catalog. `openWorkspace(id, beforeOpen?)` and `forkSession(id)` open their result only if no later navigation has superseded the request; New Session uses `openWorkspace`. The optional synchronous preparation callback runs after the target is retained and only for a current Workspace request, so superseded requests do not move composer drafts. Navigation or owner disposal suppresses the late UI commit, not the underlying Session creation. Archiving the main Session releases its reference and clears the main selection. Selection failure leaves a global panel visible. Session rows read `usePanelInfo` to suppress their selected appearance while a global panel is active; search and directory-picker focus alone do not leave that panel.
|
|
65
|
+
|
|
66
|
+
<a id="understand-the-implementation"></a>
|
|
67
|
+
## Understand the implementation
|
|
68
|
+
|
|
69
|
+
<details>
|
|
70
|
+
<summary>Implementation internals — click to expand</summary>
|
|
71
|
+
|
|
72
|
+
The package is one composition: both target slots are declared by other plugins, so `apply` uses `slots.inject()` to register for each declaration lifetime and re-register after a declaring slot is restored.
|
|
73
|
+
|
|
74
|
+
### The directory-flow hole
|
|
75
|
+
|
|
76
|
+
Each registration declares a **directory-flow child hole** (`single` kind: `conversation.hero.workspace.directoryFlow` / `sidebar.workspaces.directoryFlow`) that the composed picker package's client half fills with its picking interaction — the `-native` backend's renderless OS-chooser driver, an in-app browsing dialog under a `-browse` composition. The flat **Add workspace...** action renders only while the surface's hole is occupied; an empty hole means the composition has no picking affordance. This package owns the trigger and the adoption: the occupant reports one picked path per open through the hole's owner conversation (`open`/`busy`/`onPicked`/`onCancel`/`onError`), and the owner adopts it through the object layer, selecting the committed Workspace only after its list projection has refreshed.
|
|
77
|
+
|
|
78
|
+
### The hero run-mode chip
|
|
79
|
+
|
|
80
|
+
The chip occupies the conversation hero's `conversation.hero.agentPreset` hole and turns the workbench owner's per-tag preset memory into a choice: the menu lists the active tag's shipped presets in tag order, trails a roster preset neither tag names (a user copy), and hides itself while the roster is unavailable, failed, or offers fewer than two choices. A pick records the tag's new-task preset — the next task names it at create — and immediately rebinds the on-screen blank session, whose composition the Host locks once a turn runs. The registration sits below the default priority so a composition that deliberately re-enables the retired `ui-agent-preset` seat keeps the cell.
|
|
81
|
+
|
|
82
|
+
### View state
|
|
83
|
+
|
|
84
|
+
Once the Workspace list baseline is ready, browser-persisted expansion and manual Session-order records retain only current Workspace ids plus Ungrouped and the flat-list account. `WorkspaceView.sessionIds` supplies real-Workspace membership, not Session display order. View actions require the current account orders explicitly. Flat-list membership and ordering use Session ids; row rendering adds status indicators once. Entering Manual snapshots every active account from the current display; reconciliation retains saved members that still belong to the account, removes departed members, and appends newly known members by recency. A new membership entry without a Session summary is omitted until that summary arrives, while an already saved slot survives a temporarily missing summary. During Workspace reconnection, Manual records an observed blank Session at the front of its saved flat and known group orders without removing other saved members; full membership reconciliation waits for the Workspace baseline. This reconciliation remains mounted while the sidebar is a rail or search replaces its body. Last updated derives directly from each current list snapshot without reading or writing saved positions; equal timestamps use Session ids as a stable tie-break. The shared sidebar projection hides rows whose durable Session summary has `origin: 'subagent'`, and each visible ordinary row inherits the blue activity indicator while any descendant reached through uninterrupted subagent-origin lineage is running. The same pure derivation reads the Schedule key from list projection values for grouped, flat, and search nodes; the package uses only the type-only `@qilin-agent/schedule/client` dependency and does not import the Schedule runtime or `ui-schedule`.
|
|
85
|
+
|
|
86
|
+
### Hover cards
|
|
87
|
+
|
|
88
|
+
Workspace and Session hover cards copy the value their row clips: activating a Workspace card writes its full directory path, while activating a non-blank Session card writes its full display title. A provisional blank New Session card remains read-only because its localized label is a placeholder rather than session content.
|
|
89
|
+
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
-----
|
|
93
|
+
|
|
94
|
+
<a id="further-exploration"></a>
|
|
95
|
+
## Further Exploration
|
|
96
|
+
|
|
97
|
+
These pages cover the sidebar host, the hero surface, and the picking backends.
|
|
98
|
+
|
|
99
|
+
- [ui-sidebar](../ui-sidebar/README.md) — the sidebar shell hosting the `sidebar.workspaces` hole.
|
|
100
|
+
- [ui-conversation](../ui-conversation/README.md) — the chat surface hosting the Session Intent hero's picker hole.
|
|
101
|
+
- [directory-picker-native](../../host/directory-picker-native/README.md) — the OS-chooser backend filling the directory-flow hole.
|
|
102
|
+
- [Workspace Controller](../../api/workspace-controller/README.md) — the Host mutations and framework-neutral Client projection that own Workspaces, membership, and Workspace group order.
|
|
103
|
+
|
|
104
|
+
-----
|
|
105
|
+
|
|
106
|
+
<a id="model-experience"></a>
|
|
107
|
+
## Model Experience
|
|
108
|
+
|
|
109
|
+
None, as the package is a browser-side UI plugin layer that registers nothing model-facing.
|
|
110
|
+
|
|
111
|
+
#### KV Cache effect
|
|
112
|
+
|
|
113
|
+
None; this package neither assembles nor sends a provider request.
|
|
114
|
+
|
|
115
|
+
## Known Limitations and Deferred Work
|
|
116
|
+
|
|
117
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
These limits define the search depth, the archive surface, and the picking carrier; they are current package constraints.
|
|
121
|
+
|
|
122
|
+
- **No fuzzy content search or event deep links** — the content backend uses literal token/phrase matching, and selecting a result opens the Session rather than the matching event.
|
|
123
|
+
- **No Session deletion, and unarchive lives in Settings** — sessions can be archived but never deleted; the archived-sessions Settings page ([ui-settings-unarchive-sessions](../ui-settings-unarchive-sessions/README.md)) owns viewing and restoring them, and Workspace registration deletion does not delete Sessions.
|
|
124
|
+
- **Pending user interaction is not aggregated into collapsed groups** — a waiting row inside a collapsed group lights no group-header indicator and becomes visible only after that group is expanded.
|
|
125
|
+
- **Native folder selection depends on the local Host carrier** — under the `-native` composition, in-process or remote browser deployments cannot open a local operating-system dialog; remote-capable picking is the `-browse` composition's in-app flow.
|
|
126
|
+
|
|
127
|
+
<a id="dev-note"></a>
|
|
128
|
+
### Dev Note
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
132
|
+
|
|
133
|
+
None.
|
|
134
|
+
|
|
135
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "qilin Web 客户端的共享 Workspace 浏览器与选择器插件:分组或扁平的会话行、添加、重命名、重排序、搜索、fork、归档,以及目录流选取子 slot。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @qilin-agent/client-ui-workspace
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
本包让用户浏览分组或扁平的 Session 列表、为新 Session 选择 Workspace,并通过添加、重命名、重排序、置顶、搜索、fork、归档和删除 Workspace 来管理 Workspace 与 Session。待处理交互显示为警告点,活动定时任务显示为闹钟标识,subagent 来源的 Session 则保持隐藏。规范化后仍有差异的文件夹路径会保留为独立 Workspace。添加 Workspace 需要组合目录选择器;没有目录选择器时,添加操作不可用。新任务屏幕承载运行模式 chip:每个标签记住自己的预设,也可改选其他预设——包括创造模式。
|
|
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
|
+
用侧边栏浏览 Workspace 及其 Session、重排它们并新建会话;在 Session Intent 主视觉区用选择器为新会话选择 Workspace。打开的 Workspace 默认显示五条非空白 Session,并在首条提示词落地前把当前选中的空白**新会话**作为一条临时额外行。**展开其余**会显示隐藏条目;关闭再打开 Workspace 会恢复该折叠投影。
|
|
29
|
+
|
|
30
|
+
### 重排序与视图选项
|
|
31
|
+
|
|
32
|
+
**最近更新**在分组和单列表视图中都按普通 Session 的最近一次用户提示词或 steering(中途引导)时间降序排列。**手动排序**会冻结当前显示顺序,并在活动变化时保持已有位置;新发现的普通 Session 追加到末尾,多条同时到达时按最近更新时间降序排列。返回最近更新会丢弃所有手动位置;再次进入手动排序时,则冻结当时的最近更新顺序。浏览器默认采用最近更新,并在重新加载后记住所选模式。拖拽普通 Session 会在浏览器本地应用移动并选中手动排序。当前选中的空白**新会话**始终固定在首位且无法拖拽;首条提示词落地后,它成为可拖拽的普通行,在手动排序中保留首位,在最近更新中按当前时间戳排列。折叠分组的拖拽边界按渲染行确定,并把来源行放在中间隐藏行之前,因此拖拽不会隐藏来源行。真实 Workspace、Ungrouped 与单列表的 Session 显示顺序都保留在浏览器本地;Workspace 分组的拖拽顺序仍由 Host 持久化。
|
|
33
|
+
|
|
34
|
+
### 工作区层级
|
|
35
|
+
|
|
36
|
+
选择**添加工作区**并选取目录,即可注册工作区并打开 Session。**视图选项 → 分组方式**默认为**按工作区**,将工作区作为同级分组显示。选择**按工作区树**后,每个 Workspace 会位于最近的已注册祖先之下,之后添加的 Workspace 也会自动归入。每个 Workspace 保留自己的 Session 和行操作,子 Workspace 显示在父级自己的 Session 之前。祖先默认展开,已有的折叠偏好除外。保存的折叠状态也会隐藏当前 Session;如果后代 Workspace 包含当前 Session,祖先文件夹图标仍保持高亮。各层级的高亮和点击区域保持整行同宽,仅内容缩进。拖拽 Workspace 仅重排同级项目;落在后代行上时,由最近的兼容祖先接收,因此无需先折叠父级就能将其他工作区拖到其后。选择搜索结果会展开全部祖先。分组方式和展开状态保存在当前浏览器中;切换模式会保留各 Workspace 的展开偏好,单列表视图保持平铺。
|
|
37
|
+
|
|
38
|
+
层级仅使用已注册的规范路径,不扫描项目,也不解析符号链接别名。嵌套不会改变 Session 的工作目录、日志或 Workspace 归属。删除父 Workspace 后,子 Workspace 仍保持注册,并归入下一个已注册祖先;没有祖先时显示在根层级。
|
|
39
|
+
|
|
40
|
+
### 搜索
|
|
41
|
+
|
|
42
|
+
折叠搜索是视图和添加操作旁的一枚区头按钮:激活后输入框会扩展并占据区头。非空白查询会以单一扁平结果列表替代任一浏览模式——不区分大小写的标题和 Workspace 子串匹配项会立即显示,经 250 ms 防抖的 Host 请求则会加入经过排序的当前对话内容匹配项及其摘要片段。每次新查询都会中止前一个请求;内容搜索失败时,元数据匹配项仍会显示,同时给出警告。列表最多显示 20 条结果。选择结果会清空并收起搜索、打开 Session,并在当前浏览模式中将其行滚动到可见区域;分组浏览还会按需展开所属 Workspace 和完整 Session 列表。
|
|
43
|
+
|
|
44
|
+
### 管理会话
|
|
45
|
+
|
|
46
|
+
Session 行内的 Rename 操作打开一个以该行显示标题预填的对话框;确认未修改的标题是有意允许的——这正是把当前自动标题钉住、不再被重新生成覆盖的手势。Rename 使用临时 `workspaceOperation` reference,fork 标题设置则由 Session Controller 使用临时 `controllerOperation` reference;两者都等待该 reference 的首次历史打开。Archive 不经确认对话框直接提交,归档集合回声落地后,该行从所有分组视图中消失。Fork 在源会话最后一个已完成轮次处 fork,在客户端递增继承的持久化标题后再打开子会话。Workspace 行内的 Delete 操作会打开确认框,说明保留边界;成功后该分组被移除,其 Session 则留在 Ungrouped 下。
|
|
47
|
+
|
|
48
|
+
置顶是注册表全局事实,而非浏览器的本地排序:行菜单与悬停按钮切换它,被置顶的行领在其分组与单列列表之前,并在尾随格绘制标记;Host 调用会把该 Session 提到每个拥有它的已保存手动排序之前。取消置顶不改动这些已保存位置。已归档的 Session 不可置顶,归档会在同一次持久化写入中丢弃它的置顶。
|
|
49
|
+
|
|
50
|
+
标题宽于所在行时,静止状态以省略号裁切。把指针停在行上,标题会滚动到远端——例如 fork 递增后的标题——并在揭示时不显示省略号;指针离开后标题回到开头。
|
|
51
|
+
|
|
52
|
+
### 待处理交互
|
|
53
|
+
|
|
54
|
+
Session 行渲染运行时的实时 `pendingInteraction` 分类:审批显示**等待审批**,计划审阅显示**计划待审**,普通问题显示**等待回答**。每个待处理交互都使用一枚琥珀色警告点,优先级高于运行指示器。
|
|
55
|
+
|
|
56
|
+
### 活动 Schedule 标识
|
|
57
|
+
|
|
58
|
+
分组与平铺 Session 行以及搜索结果会在 `SessionSummary.projectionValues.schedule` 为非空数组时显示一枚轮廓闹钟。标识位于标题之后;普通行的更新时间仍位于标识之后,搜索结果则没有更新时间。它不是按钮,没有独立 pointer 行为或 Tab stop,点击所在区域仍会打开整行。本地化 tooltip 与文本相同的读屏标签均为**有活动定时任务**。
|
|
59
|
+
|
|
60
|
+
对于 cold Session,该值有意采用尽力而为语义。身份匹配且可用的 projection-cache 行可以在不打开 Session 的情况下预热闹钟;cache 缺失或陈旧可能造成短暂漏显或残留。标识只表示当前列表值包含尚未 dispatch 或 delete 的 Schedule 记录,不表示 Schedule 运行时当前 live 或能够唤醒该 Session。
|
|
61
|
+
|
|
62
|
+
-----
|
|
63
|
+
|
|
64
|
+
`ctx.uiWorkspace.openSession(target)` 会同步替换其拥有的 `mainView` reference,并让主区域返回 Conversation,而不等待 `reference.ready`,因此历史加载会显示在已经选中的 Session 视图内。目标可以是已知 Session id,也可以是持久的直接父子 subagent 地址;显式地址不要求预先加载 parent catalog。`openWorkspace(id, beforeOpen?)` 和 `forkSession(id)` 仅在请求未被后续导航替代时打开结果;新会话使用 `openWorkspace`。可选的同步准备回调在目标被 retain 后执行,并且仅对仍有效的 Workspace 请求执行,因此过期请求不会搬移 composer 草稿。后续导航或 owner 释放会阻止晚到的 UI 提交,但不取消底层 Session 创建。归档主 Session 会释放其 reference 并清除主选择。选择失败时保留当前全局面板。Session 行读取 `usePanelInfo`,在全局面板活跃时不显示 Session 选中样式;仅把焦点移到搜索框或目录选择器不会离开该面板。
|
|
65
|
+
|
|
66
|
+
<a id="understand-the-implementation"></a>
|
|
67
|
+
## 理解实现
|
|
68
|
+
|
|
69
|
+
<details>
|
|
70
|
+
<summary>实现细节——点击展开</summary>
|
|
71
|
+
|
|
72
|
+
本包是一条组合:两个目标 slot 都由其他插件声明,因此 `apply` 使用 `slots.inject()` 在各自的声明生命周期内完成注册,并在目标 slot 的声明恢复后重新注册。
|
|
73
|
+
|
|
74
|
+
### 目录流子 slot
|
|
75
|
+
|
|
76
|
+
每个注册各自声明一个**目录流子 slot**(`single` kind:`conversation.hero.workspace.directoryFlow`/`sidebar.workspaces.directoryFlow`),由组合的选择器包 client half 填入其选取交互——`-native` 后端的无渲染 OS 选择器驱动,`-browse` 组合下则是应用内浏览对话框。平铺显示的**添加工作区…** 操作仅在当前界面的 slot 被占用时渲染;slot 为空意味着该组合没有目录选择能力。本包持有触发与接纳:占用方通过 slot 的属主交互约定(`open`/`busy`/`onPicked`/`onCancel`/`onError`)每次打开上报一个所选路径,owner 通过对象层接纳它,并等待 Workspace 列表投影刷新后才选中已提交的 Workspace。
|
|
77
|
+
|
|
78
|
+
### 英雄区运行模式 chip
|
|
79
|
+
|
|
80
|
+
chip 占据会话英雄区的 `conversation.hero.agentPreset` 槽位,把工作台 owner 的每标签预设记忆变成一次可见的选择:菜单按标签顺序列出该标签的随附预设,其后再列出两个标签词汇都未点名的新增预设(用户副本);roster 不可用、读取失败、或可选不足两项时 chip 自行隐藏。一次选择记录该标签的新任务预设——下一个任务在创建时显式点名它——并立即改绑屏幕上的空白会话,因为轮次开始后 Host 会锁定会话组合。注册优先级低于默认值,刻意重新启用已退役 `ui-agent-preset` seat 的组合(e2e 通道的被测对象)得以保住该槽位。
|
|
81
|
+
|
|
82
|
+
### 视图状态
|
|
83
|
+
|
|
84
|
+
Workspace 列表基线就绪后,浏览器持久化的展开状态和手动 Session 顺序记录只保留当前 Workspace id、Ungrouped 和单列表记账。`WorkspaceView.sessionIds` 提供真实 Workspace 的成员关系,而不提供 Session 显示顺序。视图操作要求显式传入当前各记账的顺序。单列表的成员筛选和排序使用 Session id,行渲染只计算一次状态指示。进入手动排序会从当前显示结果一次性记录每个有效记账;对账会保留仍属于该记账的已保存成员、移除已经离开的成员,并按最近更新时间追加新发现的成员。尚无 Session 摘要的新成员会等摘要到达后再加入,而已经保存的位置在摘要暂时缺失时仍会保留。Workspace 重连期间,手动排序会将已观察到的空白 Session 记录到已保存的单列表及已知分组顺序首位,不移除其他已保存成员;完整成员对账等待 Workspace 基线到齐。即使侧边栏收成窄栏或搜索替代列表主体,这项对账也保持挂载。最近更新直接从每份当前列表快照派生,不读取或写入已保存位置;时间相同时按 Session id 稳定排序。共享侧边栏投影会隐藏持久化 Session 摘要中带有 `origin: 'subagent'` 的行;每个可见普通行都会在经不间断的 subagent 谱系可达的任一后代运行时继承蓝色活动指示器。同一项纯派生逻辑还会为分组、平铺与搜索节点读取列表 projection value 中的 Schedule key;本包只使用纯类型依赖 `@qilin-agent/schedule/client`,不会导入 Schedule 运行时或 `ui-schedule`。
|
|
85
|
+
|
|
86
|
+
### 悬浮卡片
|
|
87
|
+
|
|
88
|
+
Workspace 与 Session 悬浮卡片会复制对应行被截断的值:激活 Workspace 卡片会写入其完整目录路径,激活非空白 Session 卡片则会写入其完整显示标题。临时的空白「新会话」卡片保持只读,因为其本地化标签是占位文案,并非会话内容。
|
|
89
|
+
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
-----
|
|
93
|
+
|
|
94
|
+
<a id="further-exploration"></a>
|
|
95
|
+
## 进一步探索
|
|
96
|
+
|
|
97
|
+
以下页面覆盖侧边栏宿主、主视觉区界面与选取后端。
|
|
98
|
+
|
|
99
|
+
- [ui-sidebar](../ui-sidebar/README.zh.md)——承载 `sidebar.workspaces` 子 slot 的侧边栏外壳。
|
|
100
|
+
- [ui-conversation](../ui-conversation/README.zh.md)——承载 Session Intent 主视觉区选择器子 slot 的聊天界面。
|
|
101
|
+
- [directory-picker-native](../../host/directory-picker-native/README.zh.md)——填充目录流子 slot 的 OS 选择器后端。
|
|
102
|
+
- [Workspace Controller](../../api/workspace-controller/README.zh.md)——负责 Workspace、成员关系与 Workspace 分组顺序的 Host 变更和框架无关 Client 投影。
|
|
103
|
+
|
|
104
|
+
-----
|
|
105
|
+
|
|
106
|
+
<a id="model-experience"></a>
|
|
107
|
+
## 模型体验
|
|
108
|
+
|
|
109
|
+
无。该包是浏览器端 UI 插件层,不注册任何面向模型的内容。
|
|
110
|
+
|
|
111
|
+
#### KV Cache 影响
|
|
112
|
+
|
|
113
|
+
无;该包既不组装也不发送提供方请求。
|
|
114
|
+
|
|
115
|
+
## 已知限制与延期工作
|
|
116
|
+
|
|
117
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
这些限制定义搜索深度、归档界面与选取载体;它们是当前包约束。
|
|
121
|
+
|
|
122
|
+
- **没有模糊内容搜索或事件深链接**:内容后端采用字面 token/短语匹配,选择结果会打开 Session,而不是匹配的事件。
|
|
123
|
+
- **没有 Session 删除,取消归档位于设置中**:会话可以归档但绝不会被删除;已归档会话的查看与恢复由「已归档会话」设置页([ui-settings-unarchive-sessions](../ui-settings-unarchive-sessions/README.zh.md))负责,删除 Workspace 注册记录不会删除 Session。
|
|
124
|
+
- **待处理的用户交互不会聚合到折叠的分组上**:折叠分组内正在等待的行不会点亮分组头指示,只有展开该分组后才可见。
|
|
125
|
+
- **原生文件夹选择依赖本地 Host 载体**:在 `-native` 组合下,进程内部署或远程浏览器部署无法打开本地操作系统对话框;可远程的选取是 `-browse` 组合的应用内流程。
|
|
126
|
+
|
|
127
|
+
<a id="dev-note"></a>
|
|
128
|
+
### 开发备注
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
132
|
+
|
|
133
|
+
无。
|
|
134
|
+
|
|
135
|
+
</details>
|