@michengai/dsh-pua 0.3.8

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 (170) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +38 -0
  4. package/README.md +150 -0
  5. package/assets/pua/command-again.md +23 -0
  6. package/assets/pua/command-done-check.md +21 -0
  7. package/assets/pua/command-evidence.md +18 -0
  8. package/assets/pua/flavors.md +388 -0
  9. package/assets/pua/methodology-alibaba.md +33 -0
  10. package/assets/pua/methodology-amazon.md +42 -0
  11. package/assets/pua/methodology-apple.md +42 -0
  12. package/assets/pua/methodology-baidu.md +33 -0
  13. package/assets/pua/methodology-bytedance.md +41 -0
  14. package/assets/pua/methodology-ding.md +75 -0
  15. package/assets/pua/methodology-huawei.md +95 -0
  16. package/assets/pua/methodology-jd.md +42 -0
  17. package/assets/pua/methodology-meituan.md +41 -0
  18. package/assets/pua/methodology-microsoft.md +138 -0
  19. package/assets/pua/methodology-netflix.md +41 -0
  20. package/assets/pua/methodology-pinduoduo.md +33 -0
  21. package/assets/pua/methodology-tencent.md +41 -0
  22. package/assets/pua/methodology-tesla.md +42 -0
  23. package/assets/pua/methodology-xiaomi.md +42 -0
  24. package/assets/pua/upstream/agents/cto-p10.md +87 -0
  25. package/assets/pua/upstream/agents/pua-action-executor.md +60 -0
  26. package/assets/pua/upstream/agents/pua-policy-guardian.md +54 -0
  27. package/assets/pua/upstream/agents/pua-self-reviewer.md +62 -0
  28. package/assets/pua/upstream/agents/pua-verifier.md +61 -0
  29. package/assets/pua/upstream/agents/senior-engineer-p7.md +116 -0
  30. package/assets/pua/upstream/agents/tech-lead-p9.md +97 -0
  31. package/assets/pua/upstream/commands/again.md +23 -0
  32. package/assets/pua/upstream/commands/cancel-pua-loop.md +62 -0
  33. package/assets/pua/upstream/commands/ding.md +25 -0
  34. package/assets/pua/upstream/commands/done-check.md +21 -0
  35. package/assets/pua/upstream/commands/evidence.md +18 -0
  36. package/assets/pua/upstream/commands/flavor.md +6 -0
  37. package/assets/pua/upstream/commands/kpi.md +5 -0
  38. package/assets/pua/upstream/commands/mama.md +5 -0
  39. package/assets/pua/upstream/commands/off.md +41 -0
  40. package/assets/pua/upstream/commands/offline.md +38 -0
  41. package/assets/pua/upstream/commands/on.md +15 -0
  42. package/assets/pua/upstream/commands/p10.md +5 -0
  43. package/assets/pua/upstream/commands/p7.md +5 -0
  44. package/assets/pua/upstream/commands/p9.md +5 -0
  45. package/assets/pua/upstream/commands/pro.md +5 -0
  46. package/assets/pua/upstream/commands/pua-loop.md +5 -0
  47. package/assets/pua/upstream/commands/pua.md +44 -0
  48. package/assets/pua/upstream/commands/reap-orphans.md +68 -0
  49. package/assets/pua/upstream/commands/survey.md +9 -0
  50. package/assets/pua/upstream/commands/team-status.md +56 -0
  51. package/assets/pua/upstream/commands/teardown-all.md +80 -0
  52. package/assets/pua/upstream/commands/yes.md +5 -0
  53. package/assets/pua/upstream/hooks/checkpoint-save.sh +56 -0
  54. package/assets/pua/upstream/hooks/failure-detector.sh +266 -0
  55. package/assets/pua/upstream/hooks/flavor-helper.sh +300 -0
  56. package/assets/pua/upstream/hooks/frustration-trigger.sh +61 -0
  57. package/assets/pua/upstream/hooks/hooks.json +114 -0
  58. package/assets/pua/upstream/hooks/integrity-guard.sh +494 -0
  59. package/assets/pua/upstream/hooks/pua-loop-hook.sh +360 -0
  60. package/assets/pua/upstream/hooks/runtime-state.py +460 -0
  61. package/assets/pua/upstream/hooks/sanitize-session.sh +165 -0
  62. package/assets/pua/upstream/hooks/session-restore.sh +189 -0
  63. package/assets/pua/upstream/hooks/stop-feedback.sh +51 -0
  64. package/assets/pua/upstream/hooks/subagent-teardown.sh +56 -0
  65. package/assets/pua/upstream/skills/ding/SKILL.md +83 -0
  66. package/assets/pua/upstream/skills/ding/references/ding-reminders.md +77 -0
  67. package/assets/pua/upstream/skills/ding/references/methodology-ding.md +75 -0
  68. package/assets/pua/upstream/skills/mama/SKILL.md +117 -0
  69. package/assets/pua/upstream/skills/p10/SKILL.md +13 -0
  70. package/assets/pua/upstream/skills/p7/SKILL.md +13 -0
  71. package/assets/pua/upstream/skills/p9/SKILL.md +15 -0
  72. package/assets/pua/upstream/skills/pro/SKILL.md +69 -0
  73. package/assets/pua/upstream/skills/pua/SKILL.md +438 -0
  74. package/assets/pua/upstream/skills/pua/references/agent-team.md +110 -0
  75. package/assets/pua/upstream/skills/pua/references/de-escalation-protocol.md +134 -0
  76. package/assets/pua/upstream/skills/pua/references/ding-reminders.md +77 -0
  77. package/assets/pua/upstream/skills/pua/references/display-protocol.md +63 -0
  78. package/assets/pua/upstream/skills/pua/references/evolution-protocol.md +187 -0
  79. package/assets/pua/upstream/skills/pua/references/flavors.md +388 -0
  80. package/assets/pua/upstream/skills/pua/references/harness-governance.md +159 -0
  81. package/assets/pua/upstream/skills/pua/references/methodology-alibaba.md +33 -0
  82. package/assets/pua/upstream/skills/pua/references/methodology-amazon.md +42 -0
  83. package/assets/pua/upstream/skills/pua/references/methodology-apple.md +42 -0
  84. package/assets/pua/upstream/skills/pua/references/methodology-baidu.md +33 -0
  85. package/assets/pua/upstream/skills/pua/references/methodology-bytedance.md +41 -0
  86. package/assets/pua/upstream/skills/pua/references/methodology-ding.md +75 -0
  87. package/assets/pua/upstream/skills/pua/references/methodology-huawei.md +95 -0
  88. package/assets/pua/upstream/skills/pua/references/methodology-jd.md +42 -0
  89. package/assets/pua/upstream/skills/pua/references/methodology-meituan.md +41 -0
  90. package/assets/pua/upstream/skills/pua/references/methodology-microsoft.md +138 -0
  91. package/assets/pua/upstream/skills/pua/references/methodology-netflix.md +41 -0
  92. package/assets/pua/upstream/skills/pua/references/methodology-pinduoduo.md +33 -0
  93. package/assets/pua/upstream/skills/pua/references/methodology-router.md +81 -0
  94. package/assets/pua/upstream/skills/pua/references/methodology-tencent.md +41 -0
  95. package/assets/pua/upstream/skills/pua/references/methodology-tesla.md +42 -0
  96. package/assets/pua/upstream/skills/pua/references/methodology-xiaomi.md +42 -0
  97. package/assets/pua/upstream/skills/pua/references/p10-protocol.md +127 -0
  98. package/assets/pua/upstream/skills/pua/references/p7-protocol.md +250 -0
  99. package/assets/pua/upstream/skills/pua/references/p9-protocol.md +266 -0
  100. package/assets/pua/upstream/skills/pua/references/platform.md +126 -0
  101. package/assets/pua/upstream/skills/pua/references/runtime-contract.md +65 -0
  102. package/assets/pua/upstream/skills/pua/references/survey.md +292 -0
  103. package/assets/pua/upstream/skills/pua/references/teardown-protocol.md +195 -0
  104. package/assets/pua/upstream/skills/pua-en/SKILL.md +344 -0
  105. package/assets/pua/upstream/skills/pua-ja/SKILL.md +378 -0
  106. package/assets/pua/upstream/skills/pua-loop/SKILL.md +162 -0
  107. package/assets/pua/upstream/skills/shot/SKILL.md +449 -0
  108. package/assets/pua/upstream/skills/yes/SKILL.md +76 -0
  109. package/assets/pua/upstream.json +637 -0
  110. package/assets/screenshots/pua-global-settings.png +0 -0
  111. package/assets/screenshots/pua-session-settings.png +0 -0
  112. package/cordis.patch.yml +5 -0
  113. package/lib/args.d.ts +34 -0
  114. package/lib/args.js +149 -0
  115. package/lib/args.js.map +1 -0
  116. package/lib/client-refresh.d.ts +6 -0
  117. package/lib/client-refresh.js +41 -0
  118. package/lib/client-refresh.js.map +1 -0
  119. package/lib/client.d.ts +30 -0
  120. package/lib/client.js +68 -0
  121. package/lib/client.js.map +7 -0
  122. package/lib/command.d.ts +18 -0
  123. package/lib/command.js +118 -0
  124. package/lib/command.js.map +1 -0
  125. package/lib/configuration.d.ts +89 -0
  126. package/lib/configuration.js +31 -0
  127. package/lib/configuration.js.map +1 -0
  128. package/lib/content.d.ts +14 -0
  129. package/lib/content.js +51 -0
  130. package/lib/content.js.map +1 -0
  131. package/lib/flavors.d.ts +82 -0
  132. package/lib/flavors.js +30 -0
  133. package/lib/flavors.js.map +1 -0
  134. package/lib/hook-content.d.ts +14 -0
  135. package/lib/hook-content.js +63 -0
  136. package/lib/hook-content.js.map +1 -0
  137. package/lib/index.d.ts +21 -0
  138. package/lib/index.js +75 -0
  139. package/lib/index.js.map +1 -0
  140. package/lib/remote-contract.d.ts +148 -0
  141. package/lib/remote-contract.js +20 -0
  142. package/lib/remote-contract.js.map +1 -0
  143. package/lib/remote.d.ts +20 -0
  144. package/lib/remote.js +133 -0
  145. package/lib/remote.js.map +1 -0
  146. package/lib/review.d.ts +4 -0
  147. package/lib/review.js +72 -0
  148. package/lib/review.js.map +1 -0
  149. package/lib/runtime.d.ts +61 -0
  150. package/lib/runtime.js +519 -0
  151. package/lib/runtime.js.map +1 -0
  152. package/lib/session-compat.d.ts +3 -0
  153. package/lib/session-compat.js +9 -0
  154. package/lib/session-compat.js.map +1 -0
  155. package/lib/settings.d.ts +46 -0
  156. package/lib/settings.js +44 -0
  157. package/lib/settings.js.map +1 -0
  158. package/lib/source.d.ts +10 -0
  159. package/lib/source.js +32 -0
  160. package/lib/source.js.map +1 -0
  161. package/lib/state.d.ts +36 -0
  162. package/lib/state.js +187 -0
  163. package/lib/state.js.map +1 -0
  164. package/lib/terminal-observation.d.ts +4 -0
  165. package/lib/terminal-observation.js +12 -0
  166. package/lib/terminal-observation.js.map +1 -0
  167. package/lib/tool-order.d.ts +9 -0
  168. package/lib/tool-order.js +82 -0
  169. package/lib/tool-order.js.map +1 -0
  170. package/package.json +172 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,152 @@
1
+ # 更新记录
2
+
3
+ ## 0.3.8
4
+
5
+ ### 中文
6
+
7
+ - 首次公开发布:将 PUA 3.5.1 的任务推进、角色风味和证据检查带到 DSH,支持显式验收 Loop。
8
+ - 在插件设置中保存全局默认,通过专家右侧的 PUA 入口调整当前会话;修复全局保存错误、会话输入校验和审批拒绝误计失败。全局默认开启,聊天操作只覆盖当前会话,子代理默认关闭。
9
+ - 支持 DSH 0.1.2-rc.1、0.1.5-rc.1 和 0.1.5-rc.2。原创代码采用 Apache-2.0,上游 PUA 素材保留 MIT 声明与署名。真实模型效果因任务和模型而异。
10
+
11
+ ### English
12
+
13
+ - First public release: bring PUA 3.5.1 task persistence, personas, styles, and evidence checks to DSH, with explicit verification loops.
14
+ - Save global defaults in plugin settings and adjust individual sessions through the PUA entry to the right of Experts. Fix global saves, session input validation, and approval denials being counted as failures. PUA is enabled globally by default; chat changes affect only the current session, and subagents are disabled by default.
15
+ - Support DSH 0.1.2-rc.1, 0.1.5-rc.1, and 0.1.5-rc.2. Original code uses Apache-2.0; upstream PUA assets retain their declared MIT license and attribution. Actual results vary by task and model.
16
+
17
+ ## 0.3.7(本地版本,未公开发布 / Local build, not publicly released)
18
+
19
+ ### 中文
20
+
21
+ - 修复未完成工具调用长期阻塞 PUA 状态同步,以及无 settings 宿主的会话配置降级问题。
22
+ - 修复 Loop 表单长度限制冲突、同值命令误报配置冲突、子会话保存反馈和输入校验;保留 Oracle 的真实非零退出码。
23
+ - 终端成功会清除连续失败观察,每轮候选提示最多四次,权限边界不计入升级;全局开关和会话覆盖规则不变。
24
+
25
+ ### English
26
+
27
+ - Fix unfinished tool calls blocking PUA state persistence and restore session-only fallback on hosts without settings.
28
+ - Fix Loop form limits, false configuration conflicts from unchanged commands, child-session save feedback, and input validation; preserve native Oracle exit codes.
29
+ - Successful terminal results reset consecutive failure observations; candidate prompts are capped at four per turn and permission errors are excluded. Global and session override rules remain unchanged.
30
+
31
+
32
+ ## 0.3.6(本地版本,未公开发布 / Local build, not publicly released)
33
+
34
+ ### 中文
35
+
36
+ - 加快新会话 PUA 入口显示:全局开启后先显示入口,会话配置就绪后即可操作;初始化失败时快速重试。
37
+
38
+ ### English
39
+
40
+ - Show the PUA entry as soon as global enablement is confirmed, enable it when session configuration is ready, and retry initialization failures sooner.
41
+
42
+ ## 0.3.5(本地版本,未公开发布 / Local build, not publicly released)
43
+
44
+ ### 中文
45
+
46
+ - 修复配置下拉菜单向右溢出:菜单右边缘对齐按钮,向左展开。
47
+
48
+ ### English
49
+
50
+ - Fix configuration dropdowns overflowing to the right by aligning menus with the right edge of their triggers.
51
+
52
+ ## 0.3.4(本地版本,未公开发布 / Local build, not publicly released)
53
+
54
+ ### 中文
55
+
56
+ - 下拉触发及表单操作改用宿主 Button,标签与下拉控件同排,不再使用另起一行的矩形按钮。
57
+ - CHAT 入口仅显示 PUA,当前会话关闭时加斜线;全局关闭仍隐藏入口。
58
+
59
+ ### English
60
+
61
+ - Dropdown triggers and form actions now use the host Button component, with labels and dropdowns on the same row.
62
+ - The chat entry displays only PUA, crossed diagonally when the session is disabled; global disablement still hides the entry.
63
+
64
+ ## 0.3.3(本地版本,未公开发布 / Local build, not publicly released)
65
+
66
+ ### 中文
67
+
68
+ - 全局关闭 PUA 时隐藏聊天入口,重新开启后恢复;仅关闭当前会话时仍保留入口。
69
+
70
+ ### English
71
+
72
+ - Hide the chat entry when PUA is globally disabled and restore it when re-enabled. Disabling only the current session keeps the entry available.
73
+
74
+ ## 0.3.2(本地版本,未公开发布 / Local build, not publicly released)
75
+
76
+ ### 中文
77
+
78
+ - 设置中的菜单、开关和图标改用宿主公共控件,卡片对齐官方插件配置的布局与主题样式。
79
+ - 聊天 PUA 入口仅显示开启或关闭,风味与自定义状态仍可在面板查看。
80
+
81
+ ### English
82
+
83
+ - Settings now use shared host menus, switches, and icons; the card follows the official plugin configuration layout and theme tokens.
84
+ - The chat PUA entry shows only enabled or disabled status; flavor and overrides remain available in the panel.
85
+
86
+ ## 0.3.1(本地版本,未公开发布 / Local build, not publicly released)
87
+
88
+ ### 中文
89
+
90
+ - PUA 全局配置移入官方“插件配置”首个 TAB 的可展开卡片,不再新增独立 TAB。
91
+ - 会话参数可直接修改,自动形成覆盖;移除配置来源下拉框和重复生效值,仅自定义项提供恢复默认。
92
+
93
+ ### English
94
+
95
+ - Moved global PUA settings into an expandable card in the official first Plugin configuration tab, removing the separate tab.
96
+ - Session fields can be edited directly to create overrides. Removed source selectors and duplicate effective values; customized fields offer a reset action.
97
+
98
+ ## 0.3.0(本地版本,未公开发布 / Local build, not publicly released)
99
+
100
+ ### 中文
101
+
102
+ - 新增「设置 → 插件 → PUA 配置」和聊天栏 PUA 入口,支持全局默认、逐项会话覆盖与恢复继承;Loop 表单可单独指定本次验收参数。
103
+ - **行为变化:** 命令仅修改当前会话,不再写全局;未覆盖项动态跟随全局,旧 profile 设置保留。Loop 省略参数时使用会话生效默认值,启动后保持快照。
104
+ - 新增对子代理启用开关,默认关闭;开启后继承父会话生效配置,父会话关闭时不能强制开启,不继承父 Loop 或失败计数。
105
+
106
+ ### English
107
+
108
+ - Added PUA configuration under Settings → Plugins and a chat toolbar entry, with global defaults, per-field session overrides, inheritance reset, and per-run Loop verification parameters.
109
+ - **Behavior change:** commands now update only the current session, never global defaults. Unmodified fields follow global changes, existing profile settings are retained, and omitted Loop arguments use effective session defaults frozen at startup.
110
+ - Added an opt-in subagent switch, disabled by default. Enabled subagents inherit effective parent configuration, cannot override a disabled parent, and do not inherit its Loop or failure count.
111
+
112
+ ## 0.2.1(本地版本,未公开发布 / Local build, not publicly released)
113
+
114
+ ### 中文
115
+
116
+ - 新增 DSH `0.1.5-rc.1`、`0.1.5-rc.2` 支持,保留 `0.1.2-rc.1`,适配 V3 会话上下文与旧历史修复。旧插件包不支持新版宿主;已迁移的 V3 日志不能直接交给旧宿主回退读取。
117
+ - 新版持久终端的疑似退出或超时文本触发一次待核验提示,不累计为确认失败或自动升级压力;显式 Loop 仍使用独立验收。
118
+ - 修复工具调用与结果被 PUA 消息打断的问题,兼容结果齐全的受影响历史;运行状态 JSON 在模型上下文中显示为简短说明,并修正 Windows 验收命令的引号传递。
119
+
120
+ ### English
121
+
122
+ - Added support for DSH `0.1.5-rc.1` and `0.1.5-rc.2`, retaining `0.1.2-rc.1`, with V3 session context support and legacy history repair. Older plugin packages do not support the newer hosts; migrated V3 logs cannot be read directly by an older host after a downgrade.
123
+ - Suspected exit or timeout text from persistent terminals now prompts verification once, without counting confirmed failures or automatically escalating pressure. Explicit Loops continue to use independent verification.
124
+ - Fixed PUA messages interrupting tool calls and results, with compatibility repair for affected history containing all results. Runtime JSON appears as a brief note in model context, and Windows verification commands preserve quotation marks.
125
+
126
+ ## 0.2.0
127
+
128
+ **升级行为变化:** 相比 0.1.1 默认关闭,宿主提供 settings 时默认开启并使用 auto 选味;已有显式会话配置仍优先。没有 settings 时仍默认关闭。
129
+
130
+ - 用 PUA 3.5.1 完整核心替换自写摘要,恢复人格、旁白、Banner、诊断、认知换框及 Owner 协议。
131
+ - 收录 85 个固定 Git 提交的原始文件,提供完整资料工具;新增角色模式和自动选味。
132
+ - 接入标准 DSH 设置页,支持默认开启、锁定风味、离线与反馈频率,保留会话显式配置优先。
133
+ - 移植终端失败候选和用户质量纠偏,保留条件门控,排除取消、拒绝和文本伪退出码。
134
+ - 实现显式 Loop、独立 PowerShell 验收、拒绝重试、上限、暂停、取消和卸载回收。
135
+ - 保留原版本地问卷和 Pro 协议,明确团队资源、权限策略及恢复方式的平台差异。
136
+
137
+ ## 0.1.1
138
+
139
+ - 修复 `/pua in` 等疑似拼错和未实现子命令被当作任务,兼容单层重复命令前缀。
140
+ - 引入原版 Again、Done Check、Evidence 输出模板,补齐开工与交付旁白、纯分析诊断及证据门槛。
141
+ - 新增 `/pua review [范围]` 和精确中文审查入口,利用可选宿主 subprocess 采集只读 Git 索引事实。
142
+ - 区分已确认发现和待验证疑点,防止把本地目录误判为提交记录;预检取消、卸载及并发关闭保持正确状态。
143
+ - 保留 0.1.0 成功命令的历史含义;素材增加固定 Git 提交对象指纹。
144
+
145
+ ## 0.1.0
146
+
147
+ - 初始化 DSH 原生 PUA 插件,提供 `/pua` 及当前任务控制、换方法和验收命令。
148
+ - 加入 15 种风味、按风味注入方法论和固定来源素材校验。
149
+ - 根据当前会话成功命令恢复配置,隔离分叉、失败命令和未完成命令。
150
+ - 提供严格 TypeScript 构建、宿主测试、本地打包和开发文档。
151
+
152
+ 当前为本地开发版本,尚未公开发布。
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 MichengAI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,38 @@
1
+ DSH PUA 是 MichengAI 开发的社区 DSH 插件,不是 DeepSeek 或 PUA 上游发布的官方产品。
2
+
3
+ 第三方内容:assets/pua 下的 flavors.md、methodology-*.md、command-*.md,
4
+ 以及 assets/pua/upstream 下收录的 skills、commands、agents、hooks 文件。
5
+ 来源:https://github.com/tanweai/pua
6
+ 作者:探微安全实验室(依据上游 plugin.json 的 author 字段)。
7
+ 来源版本:3.5.1。
8
+ 来源提交:e6e6cd237ad17750d179674bff52f8184abea8fd。
9
+ 许可声明:MIT(上游 plugin.json、.claude-plugin/plugin.json、skills/pua/SKILL.md)。
10
+
11
+ 旧版扁平 Markdown 保留本机检出的 CRLF 字节,与固定 Git 对象仅换行不同。
12
+ upstream 目录的新文件保留固定提交 Git 对象的原始字节。
13
+ 文件清单、本地字节 SHA-256 和 Git 对象字节 gitBlobSha256 见 assets/pua/upstream.json。
14
+ 本插件完整注入核心及选定模式并追加 DSH 接口映射。hooks 用作参考及模板来源,
15
+ 运行机制由 TypeScript 对接 DSH,不执行原版安装器或 shell hooks。
16
+ 当前来源快照没有独立 LICENSE 文件,GitHub license API 也未提供该文件;这里记录元数据声明,
17
+ 不声称取得了上游独立版权文件。原作者权利不因本项目 LICENSE 中的 MichengAI 署名而改变。
18
+ 本项目原创代码、构建脚本与文档采用 Apache-2.0,见 LICENSE。上述第三方素材仍按上游声明的 MIT 许可提供,不因本项目协议变更而改变。公开发布前应复核上游许可及署名要求。
19
+
20
+ MIT License(第三方素材许可标准文本;作者与来源见上文)
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining a copy
23
+ of this software and associated documentation files (the "Software"), to deal
24
+ in the Software without restriction, including without limitation the rights
25
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
+ copies of the Software, and to permit persons to whom the Software is
27
+ furnished to do so, subject to the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be included in all
30
+ copies or substantial portions of the Software.
31
+
32
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,150 @@
1
+ <div align="center">
2
+
3
+ # DSH PUA
4
+
5
+ **让 Agent 少一点敷衍,多一点尝试和验证**
6
+
7
+ [功能概览](#功能概览) · [界面预览](#界面预览) · [安装](#安装) · [使用](#使用) · [配置](#配置) · [常用命令](#常用命令) · [更新日志](CHANGELOG.md) · [Apache-2.0](LICENSE)
8
+
9
+ [![许可证:Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
10
+ [![DSH Web Plugin](https://img.shields.io/badge/DSH%20Web-Plugin-0f766e.svg)](https://github.com/deepseek-ai/deepseek-harness)
11
+ [![Node.js 22.19+](https://img.shields.io/badge/Node.js-22.19%2B-339933.svg?logo=node.js&logoColor=white)](https://nodejs.org/)
12
+
13
+ </div>
14
+
15
+ > DSH PUA 将 [原版 PUA](https://github.com/tanweai/pua) 带到 DeepSeek Harness,在 Agent 反复失败、过早放弃或草率宣告完成时,引导它换方法、查原因、拿证据。社区维护,非 DeepSeek AI 或 PUA 官方产品。
16
+
17
+ ## 功能概览
18
+
19
+ - **遇到困难换方法**:提醒 Agent 重新检查思路,避免重复无效尝试。
20
+ - **完成前检查证据**:要求核对结果,减少“说完成了,却没有验证”的情况。
21
+ - **选择你喜欢的风格**:支持 15 种大厂风味,以及 P7、P9、P10、夸夸、妈妈等角色模式。
22
+ - **在界面中调整**:插件设置保存全局默认,聊天入口可以单独调整当前会话。
23
+ - **按验收结果继续任务**:可启动 Loop,让 Agent 继续修正,直到验收通过、达到轮次上限或被取消。
24
+
25
+ 实际效果取决于所用模型和任务,插件不保证每次都能解决问题。
26
+
27
+ ## 界面预览
28
+
29
+ ### 全局配置
30
+
31
+ 在「设置 → 插件 → PUA 配置」设置默认开关、风味、角色和子代理选项,保存后供会话使用。
32
+
33
+ ![PUA 全局配置:开关、风味、角色模式和子代理选项](assets/screenshots/pua-global-settings.png)
34
+
35
+ ### 当前会话配置
36
+
37
+ 点击专家入口右侧的 **PUA**,单独调整当前会话。修改项可以恢复默认,也可以在面板中启动或取消 Loop。
38
+
39
+ ![聊天中的 PUA 入口与当前会话配置面板](assets/screenshots/pua-session-settings.png)
40
+
41
+ ## DSH 产品生态
42
+
43
+ 以下是可配合使用的同系列项目,按实际需要选择:
44
+
45
+ | 项目 | 你可以用它做什么 |
46
+ | --- | --- |
47
+ | [Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop) | 使用集成 DSH Web 的桌面工作台 |
48
+ | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | 整理项目与会话、搜索任务、跳转对话轮次 |
49
+ | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | 从消息平台下任务、收回复 |
50
+ | [Automation](https://github.com/MichengAI/dsh-automation) | 按计划执行任务,查看每次运行的结果 |
51
+ | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | 查找、启停、创建和导入本机技能 |
52
+ | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | 搜索、恢复或清理已归档会话 |
53
+ | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | 按任务选择并召唤专业角色 |
54
+ | [BTW](https://github.com/MichengAI/dsh-btw) | 在当前上下文中临时旁问,不打断主任务 |
55
+ | [Simplify](https://github.com/MichengAI/dsh-simplify) | 整理 Git 改动范围内的代码 |
56
+
57
+ ## 安装
58
+
59
+ 需要 Node.js 22.19 或更新版本,以及 DSH `0.1.2-rc.1`、`0.1.5-rc.1` 或 `0.1.5-rc.2`。使用 DSH 已有的模型配置,无需额外密钥。
60
+
61
+ 以下示例使用 `web` profile,请替换为实际使用的 profile。
62
+
63
+ ### 让 Agent 帮你安装
64
+
65
+ 把下面这段话发给能够操作本机终端的 Agent:
66
+
67
+ ```text
68
+ 请将 @michengai/dsh-pua 安装到本机 web profile,执行 dsh plugin --profile web add @michengai/dsh-pua@latest --registry=https://registry.npmjs.org/。完成后检查插件是否加载,并告诉我如何打开 PUA 配置。
69
+ ```
70
+
71
+ ### 手动安装
72
+
73
+ ```powershell
74
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
75
+ $OutputEncoding = [System.Text.Encoding]::UTF8
76
+ dsh plugin --profile web add @michengai/dsh-pua@latest --registry=https://registry.npmjs.org/
77
+ ```
78
+
79
+ 等待当前任务结束后,重新加载 DSH 或重启 Web 服务;仅刷新浏览器不够。输入 `/pua help` 可检查插件是否可用。
80
+
81
+ ## 使用
82
+
83
+ 1. 打开「设置 → 插件」,在第一个「插件配置」页签中展开「PUA 配置」。
84
+ 2. 开启 PUA,选择喜欢的风味和角色,保存设置。
85
+ 3. 回到聊天,像平时一样提交任务。
86
+
87
+ 聊天输入栏专家入口右侧会显示 **PUA**,点击即可查看或调整当前会话。当前会话关闭时,PUA 文字显示斜线;全局关闭时,聊天入口隐藏。
88
+
89
+ ## 配置
90
+
91
+ **全局默认只在插件配置页修改。聊天面板和命令只影响当前会话。**
92
+
93
+ 不修改就使用全局默认;修改某一项,只覆盖这一项。点击「恢复默认」即可重新跟随全局,也可以一次恢复全部。
94
+
95
+ | 可以调整什么 | 说明 |
96
+ | --- | --- |
97
+ | PUA 开关 | 默认开启,可单独关闭当前会话 |
98
+ | 风味与角色 | 自动选味或指定风味,选择不同角色模式 |
99
+ | 对子代理启用 | 默认关闭;需要让专家等子代理也使用 PUA 时再开启 |
100
+ | 纠偏提醒 | 调整终端核验、失败升级与质量提醒 |
101
+ | 反馈提醒 | 调整提醒频率,或关闭提醒;插件不上传反馈 |
102
+ | Loop 默认值 | 设置验收命令、超时时间和轮次上限 |
103
+
104
+ 从 `0.3.0` 起,命令不再修改全局设置。子代理是否使用 PUA 还受父会话开关控制。
105
+
106
+ ### 让任务按验收结果继续
107
+
108
+ 在聊天 PUA 面板中填写 Loop 任务、验收命令和轮次上限,再点击启动。例如,让 Agent 修复测试,使用 `npm test` 检查结果,最多执行 10 轮。
109
+
110
+ 也可以直接输入:
111
+
112
+ ```text
113
+ /pua loop "修复当前测试失败并补齐回归" --verify "npm test" --max-iterations 10
114
+ ```
115
+
116
+ 需要停止时输入 `/cancel-pua-loop`。关闭当前会话 PUA 也会取消 Loop,但不会撤回已经执行的操作。
117
+
118
+ 建议设置验收命令和轮次上限:未设置验收命令时,只依据模型报告判断完成;轮次上限为 0 表示不限轮次。
119
+
120
+ ## 常用命令
121
+
122
+ 日常开关、风味和角色都可以在界面操作,无需记住命令。
123
+
124
+ | 目标 | 命令示例 |
125
+ | --- | --- |
126
+ | 开启或关闭当前会话 PUA | `/pua on`、`/pua off` |
127
+ | 指定风味 | `/pua flavor huawei` |
128
+ | 让 Agent 换个方法 | `/pua again` |
129
+ | 检查是否真的完成 | `/pua done-check` |
130
+ | 检查交付证据 | `/pua evidence` |
131
+ | 只读审查当前改动 | `/pua review` |
132
+ | 恢复当前会话的全局默认 | `/pua reset` |
133
+ | 取消验收循环 | `/cancel-pua-loop` |
134
+ | 查看状态或完整用法 | `/pua status`、`/pua help` |
135
+
136
+ ## 卸载
137
+
138
+ ```powershell
139
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
140
+ $OutputEncoding = [System.Text.Encoding]::UTF8
141
+ dsh plugin --profile web remove @michengai/dsh-pua
142
+ ```
143
+
144
+ 重新加载 DSH 后生效,业务文件和会话记录会保留。
145
+
146
+ ## 来源与许可
147
+
148
+ 基于 [tanweai/pua](https://github.com/tanweai/pua) 3.5.1 适配。角色和协作能力以 DSH 实际支持为准。
149
+
150
+ 本项目原创代码采用 [Apache License 2.0](LICENSE)。随包提供的 PUA 素材保留上游声明的 MIT 许可及署名,详见 [NOTICE](NOTICE)。
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: "PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。"
3
+ argument-hint: "[problem-or-failure-context]"
4
+ ---
5
+
6
+ 启用 **PUA Again / 换方法模式**。这是轻量快速入口,默认不要读取额外文件,除非用户明确要求完整 PUA 方法论。
7
+
8
+ 输出结构:
9
+
10
+ ```text
11
+ 失败模式:<原地打转/证据不足/质量不够/空口完成/需求不清>
12
+ 停止动作:不要继续做什么
13
+ 路径 A:<本质不同方案>;验证:<如何知道它有效>
14
+ 路径 B:<本质不同方案>;验证:<如何知道它有效>
15
+ 下一步:<先跑哪一步>
16
+ ```
17
+
18
+ 规则:
19
+
20
+ - 不要继续微调同一方案;
21
+ - 至少给 2 个本质不同路径,不是换参数;
22
+ - 每个路径必须有验证标准;
23
+ - 可以带一句当前味道提醒,但不要长篇大作文。
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: "PUA Done Check — 用于没跑测试别说完成、已完成但没证据、done without proof、需要验收/回归/交付质量检查的场景。"
3
+ argument-hint: "[claim-or-task]"
4
+ ---
5
+
6
+ 启用 **PUA Done Check / 完成质量检查**。
7
+
8
+ 先读取:
9
+
10
+ 1. `skills/pua/references/methodology-ding.md`(如果用户提到钉味/置身钉外/老板体感/周报)
11
+
12
+ 不要默认读取完整 `skills/pua/SKILL.md`;本命令是轻量完成检查入口。
13
+
14
+ 输出必须区分:
15
+
16
+ - `claim`:用户或 agent 口头声称完成了什么;
17
+ - `evidence`:已经有的命令输出、日志、截图、测试、文件、可观察结果;
18
+ - `missing`:还缺哪个验收动作;
19
+ - `status`:`candidate` / `needs_check` / `done_with_evidence`。
20
+
21
+ 如果没有证据,不要说完成;输出下一条最小验证动作。
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: "PUA Evidence — 用于证据呢、数据在哪、验收标准是什么、怎么证明完成、需要证据链/交付物核对的场景。"
3
+ argument-hint: "[task-or-claim]"
4
+ ---
5
+
6
+ 启用 **PUA Evidence / 证据链模式**。这是轻量快速入口,默认不要读取额外文件。
7
+
8
+ 输出结构:
9
+
10
+ ```text
11
+ 目标:真实要证明的结果
12
+ 证据:已有证据;没有就写“暂无”
13
+ 缺口:还缺什么验证
14
+ 动作:下一步最小可执行验证动作
15
+ 状态:candidate / needs_check / done_with_evidence
16
+ ```
17
+
18
+ 原则:不要用口头自信替代证据;不要用周报、体感、口径替代真实验收。若用户提到无招/老板体感/周报/置身钉外,可以加一条 markdown blockquote(`> `)提醒。