@qilin-agent/client-ui-plan 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 +21 -0
- package/README.i18n.yaml +46 -0
- package/README.md +99 -2
- package/README.zh.md +100 -0
- package/lib/client.js +704 -0
- package/lib/index.js +13 -0
- package/lib/types/client/PlanCard.d.ts +26 -0
- package/lib/types/client/PlanModeControl.d.ts +11 -0
- package/lib/types/client/PlanPreview.d.ts +16 -0
- package/lib/types/client/failure-line.d.ts +11 -0
- package/lib/types/client/index.d.ts +25 -0
- package/lib/types/client/locales.d.ts +48 -0
- package/lib/types/client/plan-definition.d.ts +11 -0
- package/lib/types/client/plan-resource.d.ts +32 -0
- package/lib/types/client/plan.d.ts +39 -0
- package/lib/types/client/review-preview.d.ts +25 -0
- package/lib/types/client/review-store.d.ts +15 -0
- package/lib/types/index.d.ts +11 -0
- package/package.json +81 -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,46 @@
|
|
|
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-plan/README.md
|
|
5
|
+
/:
|
|
6
|
+
en: 1d5e0e4466f12e0f
|
|
7
|
+
zh: 14072627e89bc20b
|
|
8
|
+
/qilin-client-ui-plan:
|
|
9
|
+
en: f790e922ec11dc28
|
|
10
|
+
zh: 23c8438c433b1e7a
|
|
11
|
+
/qilin-client-ui-plan/summary:
|
|
12
|
+
en: 958c2c8bf80759a0
|
|
13
|
+
zh: 57ffbbfa1bcbdff4
|
|
14
|
+
/qilin-client-ui-plan/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/qilin-client-ui-plan/use-this-package:
|
|
18
|
+
en: c67141de844d03a3
|
|
19
|
+
zh: 3bf066bfd402af49
|
|
20
|
+
/qilin-client-ui-plan/use-this-package/what-the-chip-shows:
|
|
21
|
+
en: 0ffdea04f33f8520
|
|
22
|
+
zh: 79fe215cdebec220
|
|
23
|
+
/qilin-client-ui-plan/use-this-package/reading-submitted-plans:
|
|
24
|
+
en: ba19b73f47797435
|
|
25
|
+
zh: da61bcbbde8a2a86
|
|
26
|
+
/qilin-client-ui-plan/use-this-package/failures:
|
|
27
|
+
en: a13078ade4ef3b9d
|
|
28
|
+
zh: 2c8b3e8b62ad5652
|
|
29
|
+
/qilin-client-ui-plan/understand-the-implementation:
|
|
30
|
+
en: da55abb94651facd
|
|
31
|
+
zh: cb75c8058ceec764
|
|
32
|
+
/qilin-client-ui-plan/further-exploration:
|
|
33
|
+
en: 26a32f5e40f19292
|
|
34
|
+
zh: 0d6eeaede67a5025
|
|
35
|
+
/qilin-client-ui-plan/model-experience:
|
|
36
|
+
en: 96ed1b5ce91494bc
|
|
37
|
+
zh: ed81f84a47d08886
|
|
38
|
+
/qilin-client-ui-plan/model-experience/kv-cache-effect:
|
|
39
|
+
en: 0eeecf007103b9ba
|
|
40
|
+
zh: 4a105d4b5ec85547
|
|
41
|
+
/qilin-client-ui-plan/known-limitations-and-deferred-work:
|
|
42
|
+
en: f74784ddad90a7e1
|
|
43
|
+
zh: 638ce5a243e6b5cc
|
|
44
|
+
/qilin-client-ui-plan/known-limitations-and-deferred-work/dev-note:
|
|
45
|
+
en: e67f633dc6fe7773
|
|
46
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Plan-mode status chip for the Web GUI: the composer control that shows plan mode is on and turns it off; for users and maintainers of plan mode."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# @qilin-agent/client-ui-plan
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
Plan mode lets you review a plan before implementation. Enter with `/plan` and leave with the composer chip. Submitted plans open automatically in the right sidebar for review and remain available from cards in the completed Turn’s final artifact area after approval, rejection, or dismissal. Reopening a plan focuses its existing tab, and browser reload restores the document from Session history.
|
|
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
|
+
Mount this plugin alongside `ui-conversation` and `qilin-plan-mode`; the chip then occupies the composer's plan seat to the right of the access-mode control whenever plan mode is active. Enter plan mode through the `/plan` command path — choose Plan from the composer's `+` Command menu or type `/plan` — and turn it off with the chip.
|
|
29
|
+
|
|
30
|
+
### What the chip shows
|
|
31
|
+
|
|
32
|
+
While the effective target is plan mode, the seat renders the warn-colored "Plan ×" status button, which executes `/plan off`. Otherwise the seat stays empty: a host without plan mode, or a Draft with no session, shows nothing. While plan mode is the effective target, the composer textarea's placeholder switches to the plan-task hint — "describe your task to generate plan" — unless the owning surface supplies its own placeholder.
|
|
33
|
+
|
|
34
|
+
### Reading submitted plans
|
|
35
|
+
|
|
36
|
+
When a Turn ends, each submitted plan appears in its final artifact area, using the file-delivery card treatment with a Markdown icon, title, and Open action. A pending plan opens automatically once per submission in the current browser session. Closing it stays effective across review remounts; a new submission opens its own plan. Historical cards open only when clicked. Use the card or review strip’s View full plan link to read and copy the complete Markdown. Plan tabs show a document-and-pen icon. Different submissions retain separate tabs; the review buttons alone decide whether implementation may begin.
|
|
37
|
+
|
|
38
|
+
A review without a logged invocation also opens automatically. Its complete text lives only in the tab’s navigation memory, and the pending review card can reopen it. Reloading the page loses that text; an expired preview directs the user back to a pending review.
|
|
39
|
+
|
|
40
|
+
### Failures
|
|
41
|
+
|
|
42
|
+
Admission failures (`matched: false`, business errors, transport faults) surface as an inline error and the chip stays until the projection confirms the exit.
|
|
43
|
+
|
|
44
|
+
-----
|
|
45
|
+
|
|
46
|
+
<a id="understand-the-implementation"></a>
|
|
47
|
+
## Understand the implementation
|
|
48
|
+
|
|
49
|
+
<details>
|
|
50
|
+
<summary>Implementation internals — click to expand</summary>
|
|
51
|
+
|
|
52
|
+
The chip occupies the conversation-declared `conversation.input.plan` single seat; the node half is an empty apply (the roster row). Reads ride the generic projection pair through the standard-kit `useProjection`: the effective target is `pending ? !active : active` — a folded host value, not client optimism, so an arriving frame corrects the chip either way. The seat's injected face carries one verb, `exitPlanMode`, which executes `/plan off` through `ctx.remote.commands.execute` and maps admission failures to an inline error line. The placeholder and hint text live in ui-conversation's `conversation` locale namespace and are shared verbatim with the claimed `/plan` command hint. The accessible description is "Plan mode on, press to turn off".
|
|
53
|
+
|
|
54
|
+
Plan cards derive from native `tool/call` or PTC dispatch arguments through a Conversation Definition, with each invocation’s resolved Turn location. They contribute to the additive `conversation.chat.turnTail` list alongside file deliveries. The plan resource address identifies the invocation and its complete ordinary or direct-parent subagent Session address; its provider reads existing Session history, including older pages, without storing document text in sidebar layout. The question plugin owns the review action slot and supplies its request key, complete text, and optional invocation identity. The [decision](../../../.agents/notes/implemented/feature/2026-09-17-persistent-plan-cards.md) explains why review lifetime and document lifetime remain separate.
|
|
55
|
+
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
-----
|
|
59
|
+
|
|
60
|
+
<a id="further-exploration"></a>
|
|
61
|
+
## Further Exploration
|
|
62
|
+
|
|
63
|
+
Read these pages when the plan surface is not enough. They move from the chip to the plan-mode domain and the composer shell.
|
|
64
|
+
|
|
65
|
+
- [qilin-plan-mode](../../plan/plan-mode/README.md) — owns plan mode, the `/plan` command, the projection, and the policy section.
|
|
66
|
+
- [ui-conversation](../ui-conversation/README.md) — declares the composer's `conversation.input.plan` seat and the placeholder locale keys.
|
|
67
|
+
- [Tool catalog](../../../docs/tool-catalog.md#qilin-agentplan-mode) — the `exit_plan_mode` tool schema the model uses to leave plan mode.
|
|
68
|
+
- [Client package map](../README.md) — adjacent browser UI packages.
|
|
69
|
+
|
|
70
|
+
-----
|
|
71
|
+
|
|
72
|
+
<a id="model-experience"></a>
|
|
73
|
+
## Model Experience
|
|
74
|
+
|
|
75
|
+
Indirectly, through the `/plan off` command line the chip dispatches: `qilin-plan-mode` owns the model-visible policy section, the exit-tool schema, and the logged state that line drives.
|
|
76
|
+
|
|
77
|
+
#### KV Cache effect
|
|
78
|
+
|
|
79
|
+
Entering or leaving plan mode changes the active `plan:policy` system-prompt section and therefore the request prefix; the chip itself adds no prompt content.
|
|
80
|
+
|
|
81
|
+
## Known Limitations and Deferred Work
|
|
82
|
+
|
|
83
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
These limits define the current plan chip. They are current package constraints, not a plan-mode comparison or a task backlog.
|
|
87
|
+
|
|
88
|
+
- **Plan mode is guidance, not an execution sandbox** — deployments that require enforced read-only planning must compose the independent sandbox and approval policies.
|
|
89
|
+
- **The chip belongs to the default composer** — a pending whole-composer interaction such as plan review temporarily replaces the InputBar and its chip.
|
|
90
|
+
- **No inactive plan control** — entry uses the shared Command source; a session with the capability but inactive mode shows no plan affordance in the tool row.
|
|
91
|
+
|
|
92
|
+
<a id="dev-note"></a>
|
|
93
|
+
### Dev Note
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
97
|
+
|
|
98
|
+
None.
|
|
99
|
+
|
|
100
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Web GUI 的 plan 模式状态徽章:显示 plan 模式已开启并可将其关闭的 composer 控件;供 plan 模式的用户与维护者阅读。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @qilin-agent/client-ui-plan
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
计划模式让你在实施前审阅计划。通过 `/plan` 进入,通过编辑器中的状态按钮退出。提交的计划自动在右侧边栏打开供审阅;批准、拒绝或关闭审批后,仍可通过已完成回合末尾的产物卡片查看。重新打开同一计划会聚焦已有标签页,刷新浏览器后会从会话历史恢复正文。
|
|
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
|
+
与 `ui-conversation` 及 `qilin-plan-mode` 一起挂载本插件;plan 模式激活时,徽章随即占据 composer 的 plan 座位(访问模式控件右侧)。经 `/plan` 命令路径进入 plan 模式——从 composer 的 `+` Command 菜单选择 Plan,或键入 `/plan`——再用徽章将其关闭。
|
|
29
|
+
|
|
30
|
+
### 徽章显示什么
|
|
31
|
+
|
|
32
|
+
当有效目标为 plan 模式时,该座位渲染 warn 色「Plan ×」状态按钮,执行 `/plan off`。否则座位保持为空:未组合 plan-mode 的宿主,或尚无会话的 Draft,都不显示任何内容。plan 模式为有效目标期间,composer 文本框的 placeholder 切换为 plan 任务提示——「describe your task to generate plan」——除非所属 surface 提供自己的 placeholder。
|
|
33
|
+
|
|
34
|
+
### 查看已提交的计划
|
|
35
|
+
|
|
36
|
+
回合结束后,每次提交的计划都会显示在该回合末尾的产物区域,并采用文件产物卡片的样式,包含 Markdown 图标、标题和“打开”操作。在当前浏览器会话中,每份待审计划自动打开一次;关闭后,重新挂载审批组件不会再次展开,新提交会打开其对应计划。历史卡片仅在点击后打开。通过卡片或审批条带上的“查看全文”链接可阅读和复制完整 Markdown。计划标签页显示文档加笔的图标。不同提交保留独立标签页;是否开始实施仍由审批按钮决定。
|
|
37
|
+
|
|
38
|
+
没有已记录调用标识的审批也会自动打开。完整正文只保存在标签页的导航内存中,待处理审批卡片可以重新打开它。刷新页面会丢失该正文;失效的预览会提示用户返回待处理审批。
|
|
39
|
+
|
|
40
|
+
### 失败
|
|
41
|
+
|
|
42
|
+
准入失败(`matched: false`、业务错误、传输故障)以内联错误呈现,徽章保持显示直至投影确认退出。
|
|
43
|
+
|
|
44
|
+
-----
|
|
45
|
+
|
|
46
|
+
<a id="understand-the-implementation"></a>
|
|
47
|
+
## 理解实现
|
|
48
|
+
|
|
49
|
+
<details>
|
|
50
|
+
<summary>实现细节——点击展开</summary>
|
|
51
|
+
|
|
52
|
+
徽章占据 conversation 声明的 `conversation.input.plan` 单实例座位;node 半部是空 apply(roster 行)。读取经 standard-kit 的 `useProjection` 走通用投影对:有效目标是 `pending ? !active : active`——折叠的宿主值而非客户端乐观态,因此到达的帧无论哪个方向都会纠正徽章。座位注入面携带一个动词 `exitPlanMode`,经 `ctx.remote.commands.execute` 执行 `/plan off`,并把准入失败映射为一行内联错误。placeholder 与提示文案位于 ui-conversation 的 `conversation` locale 命名空间,与已认领 `/plan` 命令的提示逐字共用。无障碍描述是「Plan mode on, press to turn off」。
|
|
53
|
+
|
|
54
|
+
计划卡片通过 Conversation Definition 从原生 `tool/call` 或 PTC dispatch 参数派生,并使用每次调用已解析的回合位置。它们与文件产物一起贡献到可追加的 `conversation.chat.turnTail` 列表。计划资源地址标识调用及完整的普通会话地址或子会话直接父级地址;provider 读取已有会话历史及较早分页,不把正文存入侧边栏布局。提问插件拥有审批操作插槽,并提供请求键、完整正文和可选的调用标识。[决策记录](../../../.agents/notes/implemented/feature/2026-09-17-persistent-plan-cards.zh.md)说明审批与文档为何保持独立生命周期。
|
|
55
|
+
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
-----
|
|
59
|
+
|
|
60
|
+
<a id="further-exploration"></a>
|
|
61
|
+
## 进一步探索
|
|
62
|
+
|
|
63
|
+
当 plan surface 不够用时阅读以下页面。它们从徽章进入 plan 模式领域与 composer 外壳。
|
|
64
|
+
|
|
65
|
+
- [qilin-plan-mode](../../plan/plan-mode/README.zh.md)——拥有 plan 模式、`/plan` 命令、投影与 policy 段。
|
|
66
|
+
- [ui-conversation](../ui-conversation/README.zh.md)——声明 composer 的 `conversation.input.plan` 座位与 placeholder locale 键。
|
|
67
|
+
- [工具目录](../../../docs/tool-catalog.zh.md#qilin-agentplan-mode)——模型退出 plan 模式所用的 `exit_plan_mode` 工具 schema。
|
|
68
|
+
- [客户端包映射](../README.zh.md)——相邻的浏览器 UI 包。
|
|
69
|
+
|
|
70
|
+
-----
|
|
71
|
+
|
|
72
|
+
<a id="model-experience"></a>
|
|
73
|
+
## 模型体验
|
|
74
|
+
|
|
75
|
+
间接地,通过 chip 派发的 `/plan off` 命令行:`qilin-plan-mode` 拥有该命令行驱动的模型可见 policy 段、退出工具 schema 与已记录状态。
|
|
76
|
+
|
|
77
|
+
#### KV Cache 影响
|
|
78
|
+
|
|
79
|
+
进入或离开 plan mode 会改变活跃的 `plan:policy` 系统提示词段,因此改变请求前缀;chip 本身不添加任何提示词内容。
|
|
80
|
+
|
|
81
|
+
## 已知限制与延期工作
|
|
82
|
+
|
|
83
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
这些限制界定了当前 plan 徽章。它们是当前包约束,不是 plan 模式对比或任务积压。
|
|
87
|
+
|
|
88
|
+
- **Plan 模式是引导而非执行沙箱**——需要强制只读规划的部署必须组合独立的沙箱与审批策略。
|
|
89
|
+
- **徽章属于默认 composer**——待处理的涉及整个 composer 的交互(如 plan 评审)会临时取代 InputBar 及其徽章。
|
|
90
|
+
- **未激活时无 plan 控件**——入口使用共享 Command source;有能力但模式未激活的会话在工具行不显示 plan 入口。
|
|
91
|
+
|
|
92
|
+
<a id="dev-note"></a>
|
|
93
|
+
### 开发备注
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
97
|
+
|
|
98
|
+
无。
|
|
99
|
+
|
|
100
|
+
</details>
|