@crazx/dsh-client-ui-agent-preset 0.0.0-stage → 0.2.2-rc.3.zw.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.i18n.yaml +37 -0
  2. package/README.md +85 -2
  3. package/README.zh.md +86 -0
  4. package/lib/client.js +270 -0
  5. package/lib/client.js.map +1 -0
  6. package/lib/index.js +11 -0
  7. package/lib/types/client/AgentPresetLabel.d.ts +30 -0
  8. package/lib/types/client/AgentPresetLabel.d.ts.map +1 -0
  9. package/lib/types/client/AgentPresetLabel.js.map +1 -0
  10. package/lib/types/client/AgentPresetRow.d.ts +35 -0
  11. package/lib/types/client/AgentPresetRow.d.ts.map +1 -0
  12. package/lib/types/client/AgentPresetRow.js.map +1 -0
  13. package/lib/types/client/AgentPresetSeat.d.ts +42 -0
  14. package/lib/types/client/AgentPresetSeat.d.ts.map +1 -0
  15. package/lib/types/client/AgentPresetSeat.js.map +1 -0
  16. package/lib/types/client/AgentPresetSection.d.ts +27 -0
  17. package/lib/types/client/AgentPresetSection.d.ts.map +1 -0
  18. package/lib/types/client/AgentPresetSection.js.map +1 -0
  19. package/lib/types/client/CreatePluginMenuItem.d.ts +20 -0
  20. package/lib/types/client/CreatePluginMenuItem.d.ts.map +1 -0
  21. package/lib/types/client/CreatePluginMenuItem.js.map +1 -0
  22. package/lib/types/client/PresetGuideDialog.d.ts +35 -0
  23. package/lib/types/client/PresetGuideDialog.d.ts.map +1 -0
  24. package/lib/types/client/PresetGuideDialog.js.map +1 -0
  25. package/lib/types/client/PresetMenu.d.ts +42 -0
  26. package/lib/types/client/PresetMenu.d.ts.map +1 -0
  27. package/lib/types/client/PresetMenu.js.map +1 -0
  28. package/lib/types/client/analytics.d.ts +8 -0
  29. package/lib/types/client/analytics.d.ts.map +1 -0
  30. package/lib/types/client/analytics.js.map +1 -0
  31. package/lib/types/client/guide-locales.d.ts +159 -0
  32. package/lib/types/client/guide-locales.d.ts.map +1 -0
  33. package/lib/types/client/guide-locales.js.map +1 -0
  34. package/lib/types/client/index.d.ts +41 -0
  35. package/lib/types/client/index.d.ts.map +1 -0
  36. package/lib/types/client/index.js.map +1 -0
  37. package/lib/types/client/locales.d.ts +311 -0
  38. package/lib/types/client/locales.d.ts.map +1 -0
  39. package/lib/types/client/locales.js.map +1 -0
  40. package/lib/types/client/seat-store.d.ts +133 -0
  41. package/lib/types/client/seat-store.d.ts.map +1 -0
  42. package/lib/types/client/seat-store.js.map +1 -0
  43. package/lib/types/client/section-store.d.ts +58 -0
  44. package/lib/types/client/section-store.d.ts.map +1 -0
  45. package/lib/types/client/section-store.js.map +1 -0
  46. package/lib/types/client/settings-store.d.ts +115 -0
  47. package/lib/types/client/settings-store.d.ts.map +1 -0
  48. package/lib/types/client/settings-store.js.map +1 -0
  49. package/lib/types/index.d.ts +9 -0
  50. package/lib/types/index.d.ts.map +1 -0
  51. package/lib/types/index.js.map +1 -0
  52. package/lib/types/invariant.d.ts +16 -0
  53. package/lib/types/invariant.d.ts.map +1 -0
  54. package/lib/types/invariant.js.map +1 -0
  55. package/locale/de.json +6 -0
  56. package/locale/en.json +5 -0
  57. package/locale/es.json +6 -0
  58. package/locale/fr.json +6 -0
  59. package/locale/ja.json +6 -0
  60. package/locale/pt.json +6 -0
  61. package/locale/ru.json +6 -0
  62. package/locale/zh.json +6 -0
  63. package/package.json +81 -3
  64. package/src/client/AgentPresetLabel.module.css +31 -0
  65. package/src/client/AgentPresetLabel.tsx +68 -0
  66. package/src/client/AgentPresetSeat.module.css +144 -0
  67. package/src/client/AgentPresetSeat.tsx +221 -0
  68. package/src/client/AgentPresetSection.module.css +420 -0
  69. package/src/client/AgentPresetSection.tsx +176 -0
  70. package/src/client/CreatePluginMenuItem.module.css +19 -0
  71. package/src/client/CreatePluginMenuItem.tsx +50 -0
  72. package/src/client/PresetGuideDialog.module.css +146 -0
  73. package/src/client/PresetGuideDialog.tsx +160 -0
  74. package/src/client/analytics.ts +17 -0
  75. package/src/client/guide-locales.ts +552 -0
  76. package/src/client/index.ts +291 -0
  77. package/src/client/locales.ts +385 -0
  78. package/src/client/seat-store.ts +273 -0
  79. package/src/client/section-store.ts +122 -0
  80. package/src/client/settings-store.ts +179 -0
  81. package/src/css-modules.d.ts +4 -0
  82. package/src/index.ts +9 -0
@@ -0,0 +1,37 @@
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-agent-preset/README.md
5
+ /:
6
+ en: 03dc41b8fb76229e
7
+ zh: a66439c4378fc6fc
8
+ /deepseek-ai-dsh-client-ui-agent-preset:
9
+ en: e1743eaa8f8847d0
10
+ zh: 8cf1ba5beb7ad8ed
11
+ /deepseek-ai-dsh-client-ui-agent-preset/summary:
12
+ en: 405fc7224ffd6c97
13
+ zh: 4ff5930a4c5bc64a
14
+ /deepseek-ai-dsh-client-ui-agent-preset/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: b3ad7867f23dad1c
17
+ /deepseek-ai-dsh-client-ui-agent-preset/use-this-package:
18
+ en: b53d5c356c6a7a83
19
+ zh: ade3f5f551e73c7e
20
+ /deepseek-ai-dsh-client-ui-agent-preset/understand-the-implementation:
21
+ en: 0373c5425a952881
22
+ zh: 609c5829283f515d
23
+ /deepseek-ai-dsh-client-ui-agent-preset/further-exploration:
24
+ en: bbae8d79844bc481
25
+ zh: 4302107fd1f460e6
26
+ /deepseek-ai-dsh-client-ui-agent-preset/model-experience:
27
+ en: ff77436515de40ff
28
+ zh: 6c6a23f85ba318bc
29
+ /deepseek-ai-dsh-client-ui-agent-preset/model-experience/kv-cache-effect:
30
+ en: 713c6916c3dd7360
31
+ zh: 9c582f94b926d51b
32
+ /deepseek-ai-dsh-client-ui-agent-preset/known-limitations-and-deferred-work:
33
+ en: 2c5e994e86b1ae4a
34
+ zh: 8bc5a90d3a2133ba
35
+ /deepseek-ai-dsh-client-ui-agent-preset/known-limitations-and-deferred-work/dev-note:
36
+ en: e67f633dc6fe7773
37
+ zh: 8ec3e73528ddb1a6
package/README.md CHANGED
@@ -1,3 +1,86 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Choose Agent presets and the new-task default in Web, read what each mode does and what it declares. Authoring is guided to Creator mode."
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-client-ui-agent-preset
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ Choose Agent presets and the new-task default in Web, read what each mode does and what it declares. Authoring is guided to Creator mode.
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
+ Settings shows the built-in and custom card groups with default highlighting and card-body selection; a group without presets is omitted, except the custom group, which keeps its Creator entry on screen. Coarse-pointer devices show complete card descriptions; other devices clamp descriptions to four lines with the full text available on hover. Every card offers “View configuration”, which opens the preset's declared plugin list as read-only YAML in the Loader's own dialect (`!!js` conditions included); a failed preset stays readable because its diagnostic points into that YAML. Escape closes only the viewer and returns focus to its card; leaving Settings clears the viewer, and a late read does not reopen it. The page edits nothing: the Creator entry starts a Creator-mode task that authors or overrides a preset as a bundle, offered while the `cordis` preset is on the roster and a conversation flow exists.
29
+
30
+ With Coding Tools off in General Settings, the new-session picker and Settings roster offer Standard, Creator, and custom presets; turning them on also offers PTC and Minimal. Default selection and the Creator entry remain available in both states. Choosing a healthy default also synchronizes the blank session on the current new-task surface. Creator starts a new task using the `cordis` preset.
31
+
32
+ Turning Coding Tools off clears all unapplied choices through the existing Developer tools subscription. Once the off value is accepted, every authenticated browser resets a saved built-in PTC or Minimal default to Standard. Saved Standard, Creator, and custom defaults (including named PTC or Minimal overrides) stay unchanged. The user can select an available preset again after turning Coding Tools off. Existing sessions keep their selected mode; New Session uses the current default. An existing mode's label remains visible even when that mode is absent from the menu. Turning Coding Tools back on does not restore the old default or cleared choice. If Standard is missing or broken, the default remains unchanged and an error is shown.
33
+
34
+ Known shipped presets offer mode details and usage examples in a read-only dialog. Minimal's guide explains image reading, automatic history compaction, and the idle-session `/compact` command. Its tabs preserve each page's scroll position; closing returns focus to the opening action. Help does not change the new-task default. The default badge replaces the card's group badge, and the preset id appears beside the title. Guide copy and examples belong to this package.
35
+
36
+ **Let the agent create a plugin** in the Plugins page's **Add plugin** arrow menu enters the same Creator flow as Settings. It submits no message and preserves unsent drafts. While the roster loads or Creator is unavailable, the menu item is disabled with an explanation. Both entries show a Toast with the reason if the Host refuses the preset switch.
37
+
38
+ Entering Creator selects `cordis` for the receiving blank Session without changing the new-task default or Coding Tools setting. If no workspace or blank Session is bound yet, the choice waits for that binding. After the choice is applied, the Creator Session keeps its preset; a later newly created Session uses the configured default, such as Standard.
39
+
40
+ On Desktop, the optional [product analytics](../product-analytics/README.md) service receives `agent_preset_switch` when a direct mode-picker choice moves to a different built-in preset: an unbound choice counts once it is staged for the next Session, and a choice for the bound blank Session counts once the Host applies it. The event carries the source and target categories mapped from the preset id (`cordis` is `creator`; `ptc`, `minimal`, and `standard` keep their ids; any other id is `other`) and the Coding Tools setting known at the choice. Custom targets, refused choices, choices the Host settles on another preset, default changes and their blank-Session synchronization report nothing, and neither does a choice made while the source mode or Coding Tools setting is unknown. Custom preset ids and names are not collected.
41
+
42
+ <a id="understand-the-implementation"></a>
43
+ ## Understand the implementation
44
+
45
+ <details>
46
+ <summary>Implementation internals — click to expand</summary>
47
+
48
+ `agentPresets/list` supplies the roster and marks the current default, and `agentPresets/read` one declaration's YAML for the viewer; default changes write the `agent-preset-registry` settings namespace. The picker, blank-session synchronization and read-only session label use recorded preset identities. Connection resets and settings updates refresh the roster.
49
+
50
+ `CreatePluginMenuItem` contributes to `plugins.add.actions` using the shared roster store. Its selection calls the owner's `onDismiss()` before the same `startCreatorDraft` callback exposed to Settings as `creatorDraft`. That callback stages `cordis` through `AgentPresetSeatController`, except when the main blank Session lists a different preset (navigation then opens another blank and leaves that one unchanged), and opens the task through `uiWorkspace.startSession` with explicit draft preservation and `agentPreset: 'cordis'`, so the Host composes the reused blank or new Session under Creator; without a target Workspace, the staged choice applies when a Session binding becomes available. The choice is consumed once applied. Both Coding Tools states use the same picker and selection store, and `AgentPresetSeat` renders refusals through the shared `Toast` component.
51
+
52
+ `AgentPresetSeatController.select()` and `apply()` return the attempt's outcome: `applied` when the Host commits the staged preset, `staged` while no Session is current, `unchanged` when busy, without a stage, for a started or already matching Session, or when the Host settles on another preset, and `refused` with the bare Host reason. The chip's injected `select` reports `agent_preset_switch` from that outcome and returns only the refusal reason.
53
+
54
+ </details>
55
+
56
+ <a id="further-exploration"></a>
57
+ ## Further Exploration
58
+
59
+ - [Scope](../../core/scope/README.md) — Registration isolation.
60
+ - [Agent](../../core/agent/README.md) — Session runtime.
61
+ - [Cordis](../../../docs/cordis-primer.md) — Plugin configuration and lifecycle.
62
+
63
+ <a id="model-experience"></a>
64
+ ## Model Experience
65
+
66
+ Indirectly, through the selected preset, whose plugins own model-visible capabilities.
67
+
68
+ #### KV Cache effect
69
+
70
+ Selection changes affect only later tasks; existing plugins and prompts remain unchanged.
71
+
72
+ ## Known Limitations and Deferred Work
73
+
74
+ <a id="known-limitations-and-deferred-work"></a>
75
+
76
+ - Web creates and edits no preset: the configuration viewer is read-only, and a bundle installed through Creator mode declares a new preset or overrides a shipped one by row id, replacing its complete child list.
77
+
78
+ <a id="dev-note"></a>
79
+ ### Dev Note
80
+
81
+ <details>
82
+ <summary>Working context for maintainers — click to expand</summary>
83
+
84
+ None.
85
+
86
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,86 @@
1
+ ---
2
+ description: "在 Web 中选择 Agent preset 和新任务默认值,查看各模式的说明与声明的配置。创建与修改引导至创造模式。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-client-ui-agent-preset
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 在 Web 中选择 Agent preset 和新任务默认值,查看各模式的说明与声明的配置。创建与修改引导至创造模式。
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
+ 设置页显示内置与自定义卡片分组、默认项高亮和点击卡片选择;没有 preset 的分组不显示,但自定义分组会保留其创造入口。粗指针设备完整显示卡片描述;其他设备最多显示四行描述,悬停可查看全文。每张卡片都提供「查看配置」,以只读 YAML 打开该 preset 声明的插件列表,使用 Loader 自己的方言(含 `!!js` 条件);加载失败的 preset 同样可读,因为其诊断信息正指向这份 YAML。Escape 只关闭查看器并将焦点还给卡片;离开设置页会清空查看器,迟到的读取结果不会重新打开它。本页不编辑任何内容:创造入口启动一个创造模式任务,以 bundle 形式创建或覆盖 preset;当 `cordis` preset 在列表中且存在会话流程时提供。
29
+
30
+ 关闭通用设置中的代码工作工具后,新会话选择器和设置页列表提供标准、创造和自定义预设;开启后还提供 PTC 和极简模式。两种状态下均保留默认值选择和创造入口。选择健康定义作为默认值也会同步当前新任务页面的空白会话。Creator 入口开启一个使用 `cordis` preset 的新任务。
31
+
32
+ 关闭代码工作工具时,沿用现有 Developer tools 订阅清空所有尚未应用的选择。关闭状态被接受后,每个已认证浏览器都会将已保存的内置 PTC 或极简默认值回退为标准模式。已保存的标准、创造和自定义默认值(包括有名称的 PTC 或极简覆盖项)保持不变。关闭后用户仍可重新选择可用预设。已有会话保留所选模式;新会话使用当前默认值。即使已有会话的模式不在菜单中,其标签仍会显示。重新开启代码工作工具不会恢复原默认值或已清除的选择。标准模式缺失或损坏时,默认值保持不变,并显示错误。
33
+
34
+ 已知的内置预设提供只读的模式说明与使用示例对话框。极简模式指南介绍图片读取、自动历史压缩以及会话空闲时的 `/compact` 命令。各页签保留各自的滚动位置;关闭后焦点回到打开它的操作。帮助不会改变新任务默认值。默认徽标取代卡片的分组徽标,预设 id 显示在标题旁。指南文案与示例归本包所有。
35
+
36
+ 插件页**添加插件**箭头菜单中的**让 Agent 创建插件**进入与设置页相同的创造流程,不发送消息,并保留未发送的草稿。读取预设列表或创造模式不可用时,菜单项禁用并说明原因。Host 拒绝切换预设时,两处入口均通过 Toast 显示原因。
37
+
38
+ 进入创造模式会为接收该选择的空白 Session 选择 `cordis`,不改变新任务默认值或代码工作工具设置。尚未绑定工作区或空白 Session 时,选择等待绑定完成后应用。应用后,创造 Session 保留该预设;之后真正创建的新 Session 使用配置的默认值,例如标准模式。
39
+
40
+ 在桌面端,模式选择器中的直接选择切换到另一个内置 preset 时,可选的[产品埋点](../product-analytics/README.zh.md)服务会收到 `agent_preset_switch`:未绑定 Session 的选择在暂存给下一个 Session 时计入,已绑定空白 Session 的选择在 Host 应用后计入。事件携带按 preset id 映射的来源与目标类别(`cordis` 记为 `creator`;`ptc`、`minimal`、`standard` 保持原 id;其他 id 记为 `other`),以及选择时已知的代码工作工具设置。选择自定义目标、被拒绝的选择、Host 最终落在其他 preset 的选择、默认值修改及其空白 Session 同步均不报告;来源模式或代码工作工具设置未知时做出的选择同样不报告。不采集自定义 preset 的 id 和名称。
41
+
42
+ <a id="understand-the-implementation"></a>
43
+ ## 理解实现
44
+
45
+ <details>
46
+ <summary>实现细节 — 点击展开</summary>
47
+
48
+ `agentPresets/list` 提供列表并标记当前默认值,`agentPresets/read` 为查看器提供一条声明的 YAML;默认值的修改写入 `agent-preset-registry` settings 命名空间。选择器、空白会话同步和只读会话标签使用记录的 preset 标识。连接重置和设置更新会刷新列表。
49
+
50
+ `CreatePluginMenuItem` 使用共享的预设列表 store,向 `plugins.add.actions` 贡献菜单项。选择时先调用页面传入的 `onDismiss()`,再调用与设置页 `creatorDraft` 相同的 `startCreatorDraft` 回调。该回调通过 `AgentPresetSeatController` 暂存 `cordis`(主区空白 Session 列出其他 preset 时不暂存,因为导航会打开另一个空白 Session,原空白 Session 保持不变),再通过显式保留草稿并传入 `agentPreset: 'cordis'` 的 `uiWorkspace.startSession` 调用打开任务,由 Host 以创造模式组合被复用的空白 Session 或新 Session;没有目标工作区时,暂存选择在 Session 绑定可用时应用。暂存选择应用后即清除。代码工作工具开启或关闭时均使用同一个选择器和选择 store,`AgentPresetSeat` 通过共享的 `Toast` 组件显示拒绝原因。
51
+
52
+ `AgentPresetSeatController.select()` 与 `apply()` 返回本次尝试的结果:Host 提交暂存 preset 时为 `applied`;没有当前 Session 时为 `staged`;忙碌、没有暂存选择、Session 已开始或已使用该 preset,或 Host 最终落在其他 preset 时为 `unchanged`;Host 拒绝时为携带原始原因的 `refused`。选择器注入的 `select` 根据该结果报告 `agent_preset_switch`,并且只返回拒绝原因。
53
+
54
+ </details>
55
+
56
+ <a id="further-exploration"></a>
57
+ ## 延伸阅读
58
+
59
+ - [Scope](../../core/scope/README.zh.md) — 注册隔离。
60
+ - [Agent](../../core/agent/README.zh.md) — 会话运行时。
61
+ - [Cordis](../../../docs/cordis-primer.zh.md) — 插件配置与生命周期。
62
+
63
+ <a id="model-experience"></a>
64
+ ## 模型体验
65
+
66
+ 通过选定的 preset 间接影响模型,其插件拥有模型可见能力。
67
+
68
+ #### KV Cache effect
69
+
70
+ 选择变更只影响之后的任务,已有插件与提示词保持不变。
71
+
72
+ ## 已知限制与待办
73
+
74
+ <a id="known-limitations-and-deferred-work"></a>
75
+
76
+ - Web 不创建也不编辑 preset:配置查看器是只读的;通过创造模式安装的 bundle 声明新 preset,或按行 id 覆盖内置 preset,覆盖会替换整个子插件列表。
77
+
78
+ <a id="dev-note"></a>
79
+ ### 开发备注
80
+
81
+ <details>
82
+ <summary>维护者工作上下文 — 点击展开</summary>
83
+
84
+ 无。
85
+
86
+ </details>