@deepseek-ai/dsh-creation-recommendations 0.0.0-stage → 0.2.2-alpha.2

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 DeepSeek
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,49 @@
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/experimental/creation-recommendations/README.md
5
+ /:
6
+ en: dca7dd27c5f2c369
7
+ zh: 00d34e3837bed75a
8
+ /deepseek-ai-dsh-creation-recommendations:
9
+ en: f2cefc8c9ad1d38f
10
+ zh: 9d3a5dc7ac8e2329
11
+ /deepseek-ai-dsh-creation-recommendations/summary:
12
+ en: 3c8dec4a44f298a4
13
+ zh: 6d6bd77206942c76
14
+ /deepseek-ai-dsh-creation-recommendations/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: b00dddf4c88f0a45
17
+ /deepseek-ai-dsh-creation-recommendations/use-this-package:
18
+ en: e5e313410faf1ec0
19
+ zh: 0683eb113eb52c96
20
+ /deepseek-ai-dsh-creation-recommendations/use-this-package/outcomes-and-recovery:
21
+ en: 1d96f4897b1a5a28
22
+ zh: 25ca08bc167d1e4a
23
+ /deepseek-ai-dsh-creation-recommendations/understand-the-implementation:
24
+ en: 825aa7414c0a8d90
25
+ zh: 082dd0334a10dca0
26
+ /deepseek-ai-dsh-creation-recommendations/further-exploration:
27
+ en: 056d3e9b67fd628e
28
+ zh: 71db00e1a971d495
29
+ /deepseek-ai-dsh-creation-recommendations/model-experience:
30
+ en: 215e7ba838619b7b
31
+ zh: a311da3843709f90
32
+ /deepseek-ai-dsh-creation-recommendations/model-experience/creation-recommendations:
33
+ en: b950fbe9f29693d4
34
+ zh: 2dd7edb2d1c72941
35
+ /deepseek-ai-dsh-creation-recommendations/model-experience/creation-recommendations/what-the-model-sees:
36
+ en: 8911f9d135dbfe34
37
+ zh: c3cb68ecd4dd9308
38
+ /deepseek-ai-dsh-creation-recommendations/model-experience/creation-recommendations/token-effect:
39
+ en: bd78818f4a9f5422
40
+ zh: 0f54dbd0f41c5622
41
+ /deepseek-ai-dsh-creation-recommendations/model-experience/creation-recommendations/kv-cache-effect:
42
+ en: c2046060f1ce1f08
43
+ zh: 08e37f9f758939bc
44
+ /deepseek-ai-dsh-creation-recommendations/known-limitations-and-deferred-work:
45
+ en: 7f6c43730b74d1f5
46
+ zh: 8fdd41c9abba4190
47
+ /deepseek-ai-dsh-creation-recommendations/known-limitations-and-deferred-work/dev-note:
48
+ en: e67f633dc6fe7773
49
+ zh: 8ec3e73528ddb1a6
package/README.md CHANGED
@@ -1,3 +1,128 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Create persistent removable interface plugins after an explicit user choice."
3
+ kind: "package-reference"
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
+ # @deepseek-ai/dsh-creation-recommendations
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ For an explicit interface request, a clear implied viewing or editing need, or a result with concrete continuing use, the Agent answers first and may offer one optional creation card at the completed Turn’s end. Explicit requests can serve a single task. The user can change the suggested location, then choose Create. A background Creator builds a new plugin and installs it into the profile. Keep confirms retention; Undo removes that plugin, and Restore reinstalls it.
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
+ Open Plugins → More → Experimental plugins and enable [Personalized recommendations](../personalized-recommendations/README.md); its Personalized pages row is this package. Shipped profiles leave it disabled. Enabling pins it to the main Plugins list; disabling returns it to the secondary page only. The Personalized recommendations bundle also enables the shared [action card service](../action-cards/README.md) and its browser half; that service's `queuedMessageLimit` sets how many queued next-turn messages make the card tool refuse the current turn's card. An explicit user location takes precedence; otherwise the Agent recommends a location by scope and interaction:
29
+
30
+ | Location | Use |
31
+ |:--|:--|
32
+ | `sidebar-right` | Session-bound viewer, editor or Context inspection beside the conversation. |
33
+ | `page` | Session-bound streaming output or interaction in a tab beside Chat and Trajectory. |
34
+ | `sidebar-left` | Global feature: a left-sidebar entry opens a standalone main-area page without Chat/Trajectory tabs. |
35
+
36
+ The left entry and its global page form one placement, including global streaming tools. Watching content while chatting means simultaneous visibility and takes the right sidebar, including for live logs. Otherwise default selection distinguishes global from Session scope first; Session streaming output or interaction takes the tab, while other viewers and editors take the right sidebar. Background work not blocking the conversation alone does not imply simultaneous visibility. An ongoing personal record defaults to a global page unless tied to a task or Session; supplying its data in a conversation alone does not make it Session-bound. A task- or Session-local viewer defaults to the right sidebar. Clarification is needed only when missing scope changes the outcome.
37
+
38
+ The card also offers Write your own. Its human-authored placement overrides earlier location text and is saved in the acceptance receipt. Creator resolves it through existing DSH extension points using the three placement references as needed; it does not add a fourth Slot or call a separate routing model. An unsupported request must fail rather than silently choose another location. Blank or over-1,000-character custom input is refused before spawning a child.
39
+
40
+ Personalized pages works on its own. It plans new interfaces for work and personal tasks, not just DSH features. The skill uses the current official-plugin catalog only after a page need qualifies, to avoid creating a duplicate. Questions about existing features do not load this planning skill. A matching plugin is explained through its Plugins entry instead of a card.
41
+
42
+ An explicit interface request does not require repeated use or changing data. A requested file, code snippet or change to an existing project keeps that delivery form; visual or interactive content alone does not justify an installed plugin. Without an interface request, a recommendation needs a concrete later action that the current answer cannot provide, such as maintaining a record or exploring changing results; repackaging static prose or a table is insufficient. Editing an existing page stays with that page's development workflow; this creation action does not replace it with a new plugin. An explanation-only request needs no source investigation. Persistence, manual maintenance, refreshing when opened and unattended updates are separate requirements.
43
+
44
+ For multiple independent needs, guidance selects one page proposal for the answer. Explicit user priority wins; otherwise an existing plugin takes precedence. Other needs stay in the answer. Clarification asks only for missing facts that change the outcome; the plan must not infer purpose or data from another wish. A rejected proposal creates no card and does not schedule a future one. Discovery for an unselected page is unnecessary once an existing plugin is selected. These semantic instructions supplement the Host’s limit of one card per turn: only the first accepted `propose_action` call of a turn becomes a card.
45
+
46
+ ### Outcomes and recovery
47
+
48
+ The card appears after the Turn of its accepted call ends. An unstarted proposal stays available across later human messages, including follow-ups about its plan. The next proposal in the same conversation replaces it: the old card shows Replaced without creation controls, and the Host refuses its stale clicks, so one unstarted card exists per conversation. Refreshing, switching views and background notices do not change a card. Already-started work keeps its progress and retry controls. Replacement is derived from the later proposal, not a new persisted decision record. While the user has queued `queuedMessageLimit` or more messages for later turns, the card tool refuses the proposal, so no card is offered.
49
+
50
+ Creation requires a live root conversation, permission to modify the profile, and a Session sandbox mode other than read-only: the Creator inherits that mode, so a read-only Session refuses Create and leaves the card unstarted. Cancel is available during generation; retry waits for the child’s cleanup. Once installation starts, the card shows Installing and lets the accepted operation finish. Closing or leaving the conversation does not uninstall a completed plugin. Receipts survive reconnects; interrupted or uncertain runs are reconciled with the installed bundle before any card action, including Not now, so an uncertain run whose page was installed shows Installed with Undo instead of being dismissed. Failed removal preserves the existing receipt and its application outcome for retry. Unloading this plugin stops its Creator work and local follow-up. Plugin Manager owns accepted profile changes and may finish after reload; reopening checks the installed profile before retrying. Installed plugins remain. Recovery confirms installation only; it does not infer runtime activation from the profile’s enabled flag.
51
+
52
+ Undo uninstalls the plugin and keeps its files. On the removed card, Restore validates the retained profile copy again and reinstalls it without running the Creator; it needs the same live root conversation and profile permission as Create. If that copy is missing or fails validation, Restore is refused and a new proposal is needed.
53
+
54
+ The next naturally occurring model request receives the latest unreported status for each changed card. Status updates never wake the conversation or authorize another action. The Session projection acknowledges delivery only after the status context is logged, so cancellation, reload and reopen retain undelivered updates. Several background transitions before a request collapse to the latest receipt.
55
+
56
+ -----
57
+
58
+ <a id="understand-the-implementation"></a>
59
+ ## Understand the implementation
60
+
61
+ <details>
62
+ <summary>Implementation internals — click to expand</summary>
63
+
64
+ The Host entry is a function plugin that injects `actionCards`; it provides no service or Remote of its own and adds nothing to `dsh-base`. Disabling the feature removes its skill and card kind and drains its owned Creator work.
65
+
66
+ The plugin registers the `create_personalized_page` kind with the shared [action card service](../action-cards/README.md): the `personalized-pages` skill, `details` with `slot` and optional `initialContent`, and the verbs Create, Keep, Undo, Cancel and Restore. The service owns the `propose_action` tool, the card projection, Not now, the Remote action and the status notice. This plugin handles the other verbs and records decisions whose data carries the location, any written placement, the reserved package name and the latest installation outcome; the status notice reports all but the package name. The plugin's `reconcile` checks interrupted or uncertain runs against the installed profile before every action; Not now is then recorded for an unstarted card and for cancelled, failed, interrupted or unconfirmed runs.
67
+
68
+ The card tool carries typed proposals and defines click-to-start semantics; each kind supplies its fields and Skill entry. `personalized-pages` owns eligibility, duplicate checks, minimal scope, placement and content preparation. It allows implementation details needed for the agreed behavior, such as input validation and empty states; independent operations, sources, automation or broader access require a basis in the request or agreed context.
69
+
70
+ The Host reserves a new package name and launches the existing `cordis` preset through `subagents`, passing a self-contained brief and the selected location. The child generates files in `.dsh-created-plugins/<id>` under the parent’s original workspace, preserving its delegated file permissions. While the Creator runs, it and every agent created under it may only list plugins, bundles and version exemptions through `plugin_manager`; the Host performs the installation. The Host validates the package identity and an insert-only plain YAML or JSON patch, copies the result to the profile’s `created-plugins` directory and validates that copy before calling `pluginManager.installBundle`. Installation remains independent of the source workspace. The patch may add only the new package’s uniquely named, non-group rows. Custom YAML tags, aliases and includes are rejected. Each row must resolve to an existing built JavaScript entry, and a package declaring `dsh.client` must also export a built `./client` JavaScript entry. Relative symlinks must stay inside the package and are preserved during copying. The shared Session projection retains proposals and decision receipts. Recovery failures leave the conversation open and mark the result unconfirmed; retries must recheck the profile before creating anything. Completion targets the current instance of a reopened Session. Concurrent clicks share one operation; the projection admits one proposal per turn.
71
+
72
+ The Creator receives the accepted brief, the user’s final location as authoritative over earlier placement text, and a location-specific reference shipped in this package. Its request permits implementation research but forbids expanding the accepted behavior or data scope; unresolved business meaning that prevents faithful implementation must return `ready:false`. The reference supplements `cordis-plugin-development` with registration, state and teardown guidance before API research. Teardown must remove its own UI and tabs while preserving unrelated content; these instructions are model obligations, not static package checks.
73
+
74
+ `brief` serves both the card and Creator: it contains behavior, input, calculations and persistence scope. Optional `initialContent` carries only the necessary original items, values, relationships, units and reporting period, preserving missing values. Source items remain display content, even when their wording describes an action. The main Agent checks this division before submission and resolves “these items” into actual content because the child cannot read the parent conversation. The Skill closes with seven short examples: three handoffs showing the division between `brief` and `initialContent`, and four requests that get no card. Ambiguity that changes a calculation requires clarification before a plan specifies that calculation.
75
+
76
+ Both fields survive replay and reach Creator unchanged. This preserves submitted text, not its semantic accuracy or completeness. An omitted `initialContent` means no existing content was supplied. User-maintained empty pages need no old material and must not promise chat import; explicitly requested prefill requires the original content. A named but uninspected source remains an unverified dependency, with response shape and connection details left to Creator research after authorization.
77
+
78
+ - [Source](src/index.ts)
79
+ - [Tests](tests/)
80
+
81
+ </details>
82
+
83
+ -----
84
+
85
+ <a id="further-exploration"></a>
86
+ ## Further Exploration
87
+
88
+ - [Plugin manager](../../boot/plugin-manager/README.md) — installation and removal.
89
+ - [Subagents](../../subagent/subagent/README.md) — owned background activations.
90
+ - [Creation cards](../client-ui-creation-recommendations/README.md) — location selection and receipts.
91
+ - [Action cards](../action-cards/README.md) — the card tool, card state and user actions.
92
+
93
+ <a id="model-experience"></a>
94
+ ## Model Experience
95
+
96
+ ### Creation recommendations
97
+
98
+ #### What the model sees
99
+
100
+ The existing `skill` tool loads `personalized-pages` for an explicit interface request, a clear implied viewing or editing need, or a result with concrete continuing use. Its short catalog entry describes these conditions without naming individual plugin use cases; no common system-prompt section is added. Loading returns planning and placement guidance plus current official-plugin names, descriptions and enabled state for duplicate checks. The catalog does not trigger planning and is not a complete inventory of built-in UI. Existing-feature questions, edits to an existing page, ordinary answers or coding, quoted wishes, discussion-only and declined requests need no creation card. An explicitly requested one-off interface remains eligible. A live view of the app's own data qualifies without an explicit page request. A suitable existing capability replaces a duplicate page proposal; unconfirmed details remain explicit. The proposal is one [`propose_action`](../action-cards/README.md#model-experience) call in the same Turn as the skill load, with `action: "create_personalized_page"`, `title`, a one-to-three-sentence `brief` containing only requested or essential behavior, and `details` holding `slot` plus optional `initialContent` for supplied data without invented rows or units. No business field such as an assignee is required. The call itself is the submission; nothing starts until the user clicks Create. Plan-only and read-only requests permit a proposal. The invitation guidance comes with the accepted call's result rather than the skill, so the answer ends with one short invitation, naming the background build, its time and token cost and the Create click, only when a card exists. Only clicking Create starts background Creator work; the Agent must not wait, poll, claim installation or request a refresh/report-back.
101
+
102
+ #### Token effect
103
+
104
+ While enabled, requests carry the Skill catalog entry; the shared card tool is declared only after this skill loads. Full planning policy, handoff examples and current official-plugin descriptions load through `skill` when needed. A creation recommendation needs one skill load and one `propose_action` call before the final answer. Only an accepted creation spends a background Creator run. The card's information button explains potentially long generation and substantial token use; reading it starts no work.
105
+
106
+ #### KV Cache effect
107
+
108
+ Skill contents and proposal metadata append to the transcript; loading the skill does not rewrite the common system prompt. Enabling or disabling this experiment adds or removes its Skill catalog entry; the card tool joins the declarations only after the skill loads, as the [action cards](../action-cards/README.md#model-experience) page describes. Installing a generated plugin can change later tool declarations and cache reuse. Changed card receipts append a short status notice to the next request; unchanged cards add no repeated context. The shared card service adds that notice during request preparation without a model call.
109
+
110
+ ## Known Limitations and Deferred Work
111
+
112
+ <a id="known-limitations-and-deferred-work"></a>
113
+
114
+ - Only new plugins are supported; editing existing plugins is deferred. Restore reinstalls only the profile copy named by the card’s receipt; there is no version history.
115
+ - Intent recognition depends on model semantics. Guidance does not enforce tool choice or factual grounding: the Agent can still inspect files unnecessarily or infer capabilities absent from the catalog. Generated code runs with the existing Creator permissions; package validation is not a code sandbox.
116
+ - Source directories and profile copies remain after success, failure, cancellation and Undo. Undo removes the installed plugin and its UI, not these files. The card identifies `.dsh-created-plugins/` in the original workspace as the source location. Historical receipts do not continuously track manual plugin changes.
117
+
118
+ - There is no automatic creation timeout. Closing the Session or disabling this experiment stops owned generation; Plugin Manager retains ownership of an accepted installation.
119
+
120
+ <a id="dev-note"></a>
121
+ ### Dev Note
122
+
123
+ <details>
124
+ <summary>Working context for maintainers — click to expand</summary>
125
+
126
+ None.
127
+
128
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,128 @@
1
+ ---
2
+ description: "经用户明确选择后创建可持久保留、可移除的界面插件。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-creation-recommendations
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 用户明确提出界面需求、隐含表达清晰的查看或编辑需求,或任务结果有具体的后续用途时,Agent 先回答,再视情况在本轮末尾提供一张可选创建卡片。明确提出的界面可以只服务一次任务。用户可修改建议位置,再选择创建。后台 Creator 生成一个新插件并安装到配置档案;保留用于确认继续使用,撤销则移除该插件,恢复会重新安装它。
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
+ 打开插件 → 更多 → 实验性插件,启用[个性化推荐](../personalized-recommendations/README.zh.md),其中的个性化页面行就是本包。内置配置档案默认不启用此插件。启用后在插件一级页显示,关闭后仅保留在二级页。个性化推荐 Bundle 同时启用共享的[操作卡片服务](../action-cards/README.zh.md)及其浏览器端;该服务的 `queuedMessageLimit` 规定为下一轮排队的消息达到多少条时,卡片工具拒绝本轮的卡片。用户明确指定的位置优先;否则 Agent 根据作用范围和交互方式推荐:
29
+
30
+ | 位置 | 用途 |
31
+ |:--|:--|
32
+ | `sidebar-right` | 与 Session 关联的查看器、编辑器或 Context 检查,显示在对话右侧。 |
33
+ | `page` | 与 Session 关联的流式输出或交互,在对话、轨迹旁新增 Tab。 |
34
+ | `sidebar-left` | 全局功能:左侧入口打开主区域独立页面,不显示对话、轨迹 Tab。 |
35
+
36
+ 左侧入口和全局页面属于同一落点,也适用于全局流式工具。“边看边聊”意味着需要同时可见,使用右侧栏,实时日志也适用。否则默认选位先区分全局与 Session;Session 内的流式输出或交互优先使用顶部 Tab,其余查看器、编辑器放右侧栏。仅要求后台任务不阻塞对话,不代表需要同时可见。未绑定任务或 Session 的长期个人记录默认全局页面;仅在当前对话提供数据,不代表绑定当前 Session。任务或 Session 内的查看器默认放右侧。仅当缺失的范围信息会改变结果时才澄清。
37
+
38
+ 卡片还提供“自行撰写”。手写位置优先于早先的位置描述,并保存在接受记录中。Creator 按需读取三种位置指南,通过现有 DSH 扩展点实现,不增加第四种 Slot,也不额外调用路由模型。无法支持的位置应报告失败,不得悄悄替换成其他位置。空白或超过 1,000 字的输入在启动子任务前被拒绝。
39
+
40
+ 个性化页面可独立使用。它为工作和个人任务规划新界面,不局限于 DSH 功能。只有需求符合页面规划条件后,Skill 才使用当前官方插件目录避免重复创建。询问现成功能不加载此规划 Skill。匹配到现有插件时说明它在插件页的入口,不出卡片。
41
+
42
+ 明确提出界面需求时,不要求反复使用或数据变化。用户要求文件、代码片段或修改现有项目时,保留该交付形式;内容可视化或可交互本身不构成安装插件的理由。没有界面请求时,推荐需要当前回答无法提供的具体后续操作,例如维护记录或探索变化的结果;仅重新包装静态正文或表格不够。修改已有页面沿用该页面的开发流程,此创建动作不以新插件替代原页面。只要求讲解改法时,不调查源码。持久化、手动维护、打开时刷新和关闭后自动更新是不同需求。
43
+
44
+ 面对多个独立需求,指引要求回答只选定一个页面方案。优先遵循用户明确指定的顺序,否则先推荐现成插件。其余需求在正文说明。仅当缺失信息会改变功能结果时才澄清,不从另一个愿望推断用途或数据来源。被拒绝的建议不会生成卡片,也不会安排未来自动出卡。选定现成插件后,无需为未选中的页面需求查询目录。这些语义指引补充 Host 每轮最多一张卡片的限制:一轮里只有第一个被接受的 `propose_action` 调用会成为卡片。
45
+
46
+ ### 操作结果与恢复
47
+
48
+ 卡片在被接受的调用所在轮次结束后出现。尚未创建的方案在后续人工消息之后仍然可用,包括对方案的追问。同一会话里的下一个方案会替换它:旧卡片显示“已替换”,没有创建控件,Host 也会拒绝对它的过时点击,因此每个会话只有一张未开始的卡片。刷新、切换视图和后台通知不会改变卡片。已开始的任务保留进度和重试控件。替换由后来的方案推导得出,不是新的持久化决定记录。当用户为后续轮次排队的消息达到 `queuedMessageLimit` 条及以上时,卡片工具拒绝该方案,因此不会出卡。
49
+
50
+ 创建要求当前会话是活动的根会话、连接有权修改配置档案,且 Session 的沙箱模式不是只读:Creator 继承该模式,因此只读 Session 拒绝创建,卡片保持未开始。生成阶段可取消,子任务清理完毕后才能重试。安装开始后显示“正在安装”,等待已接纳的操作结束。关闭或离开会话不会卸载已完成的插件。重新连接后会恢复操作记录;任何卡片操作(包括“暂不需要”)之前,都会对照已安装插件检查中断或结果不明的创建,因此页面其实已安装的不明结果会显示“已安装”和撤销,而不是被忽略。移除失败时保留已有记录和实际生效结果,以便重试。卸载推荐插件会停止它负责的 Creator 任务和本地后续处理。已接纳的配置变更由插件管理器负责,可能在重载后完成;重新打开会话时先检查安装状态再允许重试。已安装插件仍然保留。恢复只确认安装,不根据配置中的开启标记推断运行时已生效。
51
+
52
+ 撤销会卸载插件,但保留其文件。已移除的卡片提供“恢复”:重新校验配置档案中保留的副本并重新安装,不运行 Creator;与创建一样,需要活动的根会话和修改配置档案的权限。副本缺失或校验失败时拒绝恢复,需要重新提案。
53
+
54
+ 下一次自然发起的模型请求会收到各张已变化卡片尚未告知模型的最新状态。状态更新不会唤醒对话,也不授权其他动作。Session 投影只在状态上下文写入日志后确认送达,因此取消、重载和重新打开会话都保留未送达的更新。一次请求之前发生的多次后台变化合并为最新记录。
55
+
56
+ -----
57
+
58
+ <a id="understand-the-implementation"></a>
59
+ ## 实现原理
60
+
61
+ <details>
62
+ <summary>实现细节 — 点击展开</summary>
63
+
64
+ Host 入口是注入 `actionCards` 的普通函数插件;它不提供自己的 service 或 Remote,也不向 `dsh-base` 增加任何内容。关闭功能插件时移除它的 Skill 和卡片种类,并清理其负责的 Creator 任务。
65
+
66
+ 插件向共享的[操作卡片服务](../action-cards/README.zh.md)注册 `create_personalized_page` 种类:`personalized-pages` Skill、含 `slot` 和可选 `initialContent` 的 `details`,以及创建、保留、撤销、取消和恢复五个操作。该服务负责 `propose_action` 工具、卡片投影、“暂不需要”、Remote 操作和状态通知。本插件处理其余操作,记录的决定数据包含位置、手写位置、预留包名和最近一次安装结果;状态通知报告其中除包名以外的字段。每次操作之前,插件的 `reconcile` 会对照已安装的配置档案检查中断或结果不明的创建;之后,尚未开始的卡片,以及已取消、失败、中断或结果不明的创建,都可以记录“暂不需要”。
67
+
68
+ 卡片工具承载类型化提案,定义点击后执行的语义;各种类提供自己的字段和 Skill 入口。`personalized-pages` 负责适用条件、查重、最小范围、选位和内容准备。它允许补齐实现已确认行为所需的细节,例如输入校验和空状态;新增独立操作、数据源、自动任务或访问范围,需要用户请求或已确认上下文的依据。
69
+
70
+ Host 预留新包名,通过 `subagents` 启动已有的 `cordis` 预设,传入完整需求和选定位置。子 Agent 在父会话原工作区的 `.dsh-created-plugins/<id>` 下生成文件,保留委派时的文件权限。Creator 运行期间,它和在它之下创建的每个 Agent 只能通过 `plugin_manager` 列出插件、Bundle 和版本豁免;安装由 Host 执行。Host 校验包身份和仅允许新增的普通 YAML 或 JSON 补丁,将结果复制到配置档案的 `created-plugins` 目录并再次校验,再调用 `pluginManager.installBundle`;安装后的插件不依赖原工作区。补丁只能添加该新包自身且名称唯一的非分组条目;不接受自定义 YAML 标签、别名或 include。每个条目必须能解析到已构建的 JavaScript 文件;声明了 `dsh.client` 的包还必须导出已构建的 `./client` JavaScript 入口。相对符号链接必须留在包内,复制时保留原目标。共享的 Session 投影保存建议和操作记录。恢复失败时仍可打开会话,卡片显示结果不明;重试必须先检查配置档案。后台完成结果写入重新打开的当前 Session 实例。并发点击共用一次操作;投影每轮只接纳一个提案。
71
+
72
+ Creator 收到已接受的完整方案、优先于早先位置描述的用户最终选位,以及本插件随包提供的位置指南。执行请求允许调研实现细节,但不得扩大已接受的行为和数据范围;业务含义不明导致无法忠实实现时,应返回 `ready:false`。位置指南补充 `cordis-plugin-development`,在 API 调研前提供注册、状态和卸载指引。卸载时应移除自己的界面和页签,保留其他内容;这些是模型执行要求,不是静态包校验。
73
+
74
+ `brief` 同时用于卡片和 Creator,承载行为、输入、计算方法与持久化范围。可选的 `initialContent` 只承载所需的原始条目、数值、对应关系、单位和统计周期,缺失值仍保持缺失。原始条目即使描述了动作,也仍是待展示内容。主 Agent 在提交前检查这项分工,并将“这些条目”等指代补成实际内容,因为子 Agent 无法读取主对话。Skill 末尾有七个短示例:三个交接示例展示 `brief` 与 `initialContent` 的分工,四个不出卡的请求。会改变计算结果的口径歧义,需要在方案确定计算方法前澄清。
75
+
76
+ 两个字段均可从日志恢复并原样传给 Creator;这保证文本不丢失,不保证语义准确或完整。省略 `initialContent` 表示未提供已有内容。用户自行维护的空白页面无需旧资料,也不得承诺自动导入聊天;明确要求预填时则需要原始内容。已命名但未检查的数据源仍是未验证的依赖,响应格式和连接方式留待授权后的 Creator 调研。
77
+
78
+ - [源码](src/index.ts)
79
+ - [测试](tests/)
80
+
81
+ </details>
82
+
83
+ -----
84
+
85
+ <a id="further-exploration"></a>
86
+ ## 延伸阅读
87
+
88
+ - [插件管理](../../boot/plugin-manager/README.zh.md) — 安装和移除。
89
+ - [子 Agent](../../subagent/subagent/README.zh.md) — 后台任务生命周期。
90
+ - [创建卡片](../client-ui-creation-recommendations/README.zh.md) — 位置选择与操作记录。
91
+ - [操作卡片](../action-cards/README.zh.md) — 卡片工具、卡片状态与用户操作。
92
+
93
+ <a id="model-experience"></a>
94
+ ## 模型体验
95
+
96
+ ### 创建建议
97
+
98
+ #### 模型看到的内容
99
+
100
+ 已有 `skill` 工具在用户明确提出界面需求、隐含表达清晰的查看或编辑需求,或结果有具体后续用途时加载 `personalized-pages`。简短目录描述这些适用条件,不逐项列举插件场景,也不新增公共 system prompt。加载后返回规划和位置指引,以及供查重的当前官方插件名称、描述和启用状态。目录不负责触发规划,也不是内置 UI 的完整清单。询问现成功能、修改已有页面、普通回答或开发、引用中的愿望、只讨论及已拒绝的请求不需要创建卡。明确提出的一次性界面仍可出卡。查看本应用自身数据(会话、任务、日志、工作区文件)的实时视图,不需要明确要求页面也可出卡。已有能力合适时不再提重复页面方案;无法确认的细节保持明确。提案是与加载 Skill 同一轮中的一次 [`propose_action`](../action-cards/README.zh.md#model-experience) 调用,含 `action: "create_personalized_page"`、`title`、只写请求或必要行为的一到三句 `brief`,以及 `details`:其中有 `slot`,可选的 `initialContent` 用于已提供的数据,不编造行或单位。调用本身就是提交;用户点击创建之前不会开始任何工作。先给方案、只读模式仍允许提交建议。邀请指引随被接受的调用结果给出,而不在 Skill 中,因此只有卡片存在时,回答末尾才用一句简短邀请说明后台创建、耗时和 token 成本以及点击创建;只有点击创建才后台启动 Creator;Agent 不等待、轮询、声称已安装或要求刷新、报告完成。
101
+
102
+ #### Token 影响
103
+
104
+ 启用后,请求带 Skill 目录里的一条摘要;共享的卡片工具只在此 Skill 加载后才声明。完整规划策略、交接示例和当前官方插件描述由 `skill` 按需加载。一次创建推荐需要一次 Skill 加载,并在最终回答前调用一次 `propose_action`。只有用户接受创建后,才会产生后台 Creator 调用。卡片的信息按钮说明生成可能耗时较长、消耗大量 token;查看说明不会启动任务。
105
+
106
+ #### KV Cache effect
107
+
108
+ Skill 内容和建议元数据追加到对话;加载 Skill 不改写公共 system prompt。开启或关闭本实验会添加或移除它的 Skill 目录条目;卡片工具只在 Skill 加载后才加入声明,见[操作卡片](../action-cards/README.zh.md#model-experience)页面。安装生成的插件可能改变后续工具声明和缓存复用。变化后的卡片记录会以简短状态通知追加到下一次请求;状态不变的卡片不重复增加上下文。该通知由共享卡片服务在请求准备阶段追加,不增加模型调用。
109
+
110
+ ## 已知限制与后续工作
111
+
112
+ <a id="known-limitations-and-deferred-work"></a>
113
+
114
+ - 只支持新增插件;修改已有插件留待后续。恢复只重新安装卡片记录对应的配置档案副本,不提供版本历史。
115
+ - 意图识别依赖模型语义。指引不强制工具选择或事实依据:Agent 仍可能多余地查看文件,或推断目录没有说明的能力。生成代码使用现有 Creator 权限执行,包校验不构成代码沙箱。
116
+ - 成功、失败、取消及撤销后均保留工作区源目录和配置档案副本。撤销移除已安装插件及其界面,不删除这些文件。卡片会说明源码位于原工作区的 `.dsh-created-plugins/` 目录。历史记录不会持续跟踪手动插件变更。
117
+
118
+ - 暂不自动超时取消创建。关闭 Session 或关闭此实验会停止它负责的生成任务;已接纳的安装继续由插件管理器负责。
119
+
120
+ <a id="dev-note"></a>
121
+ ### 开发备注
122
+
123
+ <details>
124
+ <summary>维护者工作上下文 — 点击展开</summary>
125
+
126
+ 无。
127
+
128
+ </details>
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8 9.5C8 8.67157 8.67157 8 9.5 8H15.5C16.3284 8 17 8.67157 17 9.5V15.5C17 16.3284 16.3284 17 15.5 17H9.5C8.67157 17 8 16.3284 8 15.5V9.5ZM19 9.5C19 8.67157 19.6716 8 20.5 8H26.5C27.3284 8 28 8.67157 28 9.5V15.5C28 16.3284 27.3284 17 26.5 17H20.5C19.6716 17 19 16.3284 19 15.5V9.5ZM8 20.5C8 19.6716 8.67157 19 9.5 19H15.5C16.3284 19 17 19.6716 17 20.5V26.5C17 27.3284 16.3284 28 15.5 28H9.5C8.67157 28 8 27.3284 8 26.5V20.5ZM22.25 19H24.75V22.25H28V24.75H24.75V28H22.25V24.75H19V22.25H22.25V19Z" fill="url(#paint0_linear_plugin_market)" />
3
+ <defs>
4
+ <linearGradient id="paint0_linear_plugin_market" x1="8.5" y1="10" x2="30" y2="26" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#67C7FE" />
6
+ <stop offset="1" stop-color="#3F77D8" />
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>