@acryldev/plugin-context 0.0.0-stage → 0.1.0

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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/docs/README.md +160 -0
  3. package/docs/delivery/local-live.md +113 -0
  4. package/docs/delivery/marketplace.md +16 -0
  5. package/docs/docs.json +2836 -0
  6. package/docs/extending/agent-preset.md +37 -0
  7. package/docs/extending/chat-command.md +28 -0
  8. package/docs/extending/client-slot.md +135 -0
  9. package/docs/extending/config-schema.md +7 -0
  10. package/docs/extending/cordis-core.md +63 -0
  11. package/docs/extending/desktop-app.md +53 -0
  12. package/docs/extending/desktop-main.md +25 -0
  13. package/docs/extending/event-hook.md +14 -0
  14. package/docs/extending/host-route.md +33 -0
  15. package/docs/extending/llm-adapter.md +38 -0
  16. package/docs/extending/packaging.md +53 -0
  17. package/docs/extending/prompt-contribution.md +9 -0
  18. package/docs/extending/service.md +13 -0
  19. package/docs/extending/skill-provider.md +9 -0
  20. package/docs/extending/state-and-persistence.md +71 -0
  21. package/docs/extending/three-role-capability.md +33 -0
  22. package/docs/extending/tool-plugin.md +24 -0
  23. package/docs/extending/tui-command.md +8 -0
  24. package/docs/extending/tui-components.md +61 -0
  25. package/docs/extending/ui-branding.md +43 -0
  26. package/docs/extending/ui-components.md +56 -0
  27. package/docs/extending/ui-customization.md +41 -0
  28. package/docs/extending/ui-library.md +66 -0
  29. package/docs/extending/ui-theme.md +55 -0
  30. package/docs/extending/workspace-tab.md +50 -0
  31. package/docs/maps/events.md +108 -0
  32. package/docs/maps/mount-points.md +154 -0
  33. package/docs/maps/slot-contracts.md +3376 -0
  34. package/docs/maps/taxonomy.md +306 -0
  35. package/docs/maps/theme-tokens.md +115 -0
  36. package/docs/maps/ui-components.md +26 -0
  37. package/docs/reference/cookbook/adding-a-package.md +174 -0
  38. package/docs/reference/cookbook/adding-a-remote-api.md +199 -0
  39. package/docs/reference/cookbook/adding-a-settings-card.md +74 -0
  40. package/docs/reference/cookbook/adding-a-tool.md +103 -0
  41. package/docs/reference/cookbook/adding-an-llm-adapter.md +45 -0
  42. package/docs/reference/cookbook/extension-cookbook.md +134 -0
  43. package/docs/reference/cordis-api/context.md +366 -0
  44. package/docs/reference/cordis-api/events.md +209 -0
  45. package/docs/reference/cordis-api/fiber.md +377 -0
  46. package/docs/reference/cordis-api/inherited.md +40 -0
  47. package/docs/reference/cordis-api/registry.md +154 -0
  48. package/docs/reference/cordis-api/service.md +104 -0
  49. package/docs/reference/cordis-guides/cordis-usage-cheatsheet.md +167 -0
  50. package/docs/reference/cordis-guides/cordis_system_guide_for_coding_agents.md +4666 -0
  51. package/docs/reference/cordis-guides/development-canvas-plugin.md +109 -0
  52. package/docs/reference/cordis-guides/hello-world-plugin-guide.md +517 -0
  53. package/docs/reference/harness/agent-lifecycle.md +93 -0
  54. package/docs/reference/harness/architecture.md +168 -0
  55. package/docs/reference/harness/capability-seams.md +675 -0
  56. package/docs/reference/harness/config-catalog.md +4523 -0
  57. package/docs/reference/harness/cordis-primer.md +47 -0
  58. package/docs/reference/harness/defensive-patterns.md +35 -0
  59. package/docs/reference/harness/event-producer-consumer.md +111 -0
  60. package/docs/reference/harness/glossary.md +47 -0
  61. package/docs/reference/harness/tool-catalog.md +2721 -0
  62. package/docs/reference/harness/tool-execution-pipeline.md +67 -0
  63. package/docs/reference/subsystems/README.md +75 -0
  64. package/docs/reference/subsystems/agent-team.md +233 -0
  65. package/docs/reference/subsystems/approval.md +172 -0
  66. package/docs/reference/subsystems/attachment.md +363 -0
  67. package/docs/reference/subsystems/boot.md +324 -0
  68. package/docs/reference/subsystems/browser-use.md +69 -0
  69. package/docs/reference/subsystems/client-modules.md +186 -0
  70. package/docs/reference/subsystems/client-resources.md +94 -0
  71. package/docs/reference/subsystems/commands.md +225 -0
  72. package/docs/reference/subsystems/compaction.md +286 -0
  73. package/docs/reference/subsystems/computer-use.md +58 -0
  74. package/docs/reference/subsystems/conversation.md +287 -0
  75. package/docs/reference/subsystems/core.md +1107 -0
  76. package/docs/reference/subsystems/credentials.md +497 -0
  77. package/docs/reference/subsystems/deliverables.md +180 -0
  78. package/docs/reference/subsystems/extensions.md +386 -0
  79. package/docs/reference/subsystems/feedback.md +402 -0
  80. package/docs/reference/subsystems/filesystem.md +532 -0
  81. package/docs/reference/subsystems/goal.md +315 -0
  82. package/docs/reference/subsystems/invariants.md +90 -0
  83. package/docs/reference/subsystems/jobs.md +501 -0
  84. package/docs/reference/subsystems/llm-streaming.md +1131 -0
  85. package/docs/reference/subsystems/lsp.md +204 -0
  86. package/docs/reference/subsystems/mcp.md +141 -0
  87. package/docs/reference/subsystems/office-to-pdf.md +89 -0
  88. package/docs/reference/subsystems/otel.md +46 -0
  89. package/docs/reference/subsystems/permission-presets.md +169 -0
  90. package/docs/reference/subsystems/persistence.md +418 -0
  91. package/docs/reference/subsystems/plan.md +89 -0
  92. package/docs/reference/subsystems/product-telemetry.md +81 -0
  93. package/docs/reference/subsystems/ptc-runtime.md +234 -0
  94. package/docs/reference/subsystems/sandbox.md +223 -0
  95. package/docs/reference/subsystems/schedule.md +545 -0
  96. package/docs/reference/subsystems/scope.md +61 -0
  97. package/docs/reference/subsystems/session-projection.md +358 -0
  98. package/docs/reference/subsystems/session-query.md +511 -0
  99. package/docs/reference/subsystems/session-reference.md +226 -0
  100. package/docs/reference/subsystems/session-telemetry.md +214 -0
  101. package/docs/reference/subsystems/session-title.md +206 -0
  102. package/docs/reference/subsystems/session.md +1300 -0
  103. package/docs/reference/subsystems/settings.md +157 -0
  104. package/docs/reference/subsystems/shell.md +316 -0
  105. package/docs/reference/subsystems/sidebar-right.md +160 -0
  106. package/docs/reference/subsystems/skills.md +354 -0
  107. package/docs/reference/subsystems/slots.md +201 -0
  108. package/docs/reference/subsystems/spill.md +126 -0
  109. package/docs/reference/subsystems/ssh.md +137 -0
  110. package/docs/reference/subsystems/storage.md +262 -0
  111. package/docs/reference/subsystems/subagent.md +762 -0
  112. package/docs/reference/subsystems/subprocess.md +323 -0
  113. package/docs/reference/subsystems/system-prompt.md +226 -0
  114. package/docs/reference/subsystems/terminal.md +186 -0
  115. package/docs/reference/subsystems/todo.md +34 -0
  116. package/docs/reference/subsystems/token-meter.md +108 -0
  117. package/docs/reference/subsystems/tools.md +749 -0
  118. package/docs/reference/subsystems/typert.md +489 -0
  119. package/docs/reference/subsystems/user-questions.md +309 -0
  120. package/docs/reference/subsystems/voice-input.md +166 -0
  121. package/docs/reference/subsystems/web-client.md +102 -0
  122. package/docs/reference/subsystems/web-server.md +228 -0
  123. package/docs/reference/subsystems/web.md +208 -0
  124. package/docs/reference/subsystems/webhook.md +72 -0
  125. package/docs/reference/subsystems/workflow.md +280 -0
  126. package/docs/reference/subsystems/workspace.md +661 -0
  127. package/docs/start-here/blueprints.md +33 -0
  128. package/docs/start-here/this-runtime.md +84 -0
  129. package/docs/start-here/troubleshooting.md +29 -0
  130. package/docs/start-here/trust-and-safety.md +39 -0
  131. package/docs/start-here/verify-before-done.md +46 -0
  132. package/example-plugins/README.md +45 -0
  133. package/example-plugins/packages/agent-preset-reviewer/agent.cordis.yml +18 -0
  134. package/example-plugins/packages/agent-preset-reviewer/preset.yml +3 -0
  135. package/example-plugins/packages/capability-swap-consumer/cordis.patch.yml +3 -0
  136. package/example-plugins/packages/capability-swap-consumer/index.js +14 -0
  137. package/example-plugins/packages/capability-swap-consumer/package.json +25 -0
  138. package/example-plugins/packages/capability-swap-provider-loud/cordis.patch.yml +3 -0
  139. package/example-plugins/packages/capability-swap-provider-loud/index.js +20 -0
  140. package/example-plugins/packages/capability-swap-provider-loud/package.json +25 -0
  141. package/example-plugins/packages/capability-swap-provider-quiet/cordis.patch.yml +3 -0
  142. package/example-plugins/packages/capability-swap-provider-quiet/index.js +20 -0
  143. package/example-plugins/packages/capability-swap-provider-quiet/package.json +25 -0
  144. package/example-plugins/packages/chat-command-basic/cordis.patch.yml +3 -0
  145. package/example-plugins/packages/chat-command-basic/index.js +26 -0
  146. package/example-plugins/packages/chat-command-basic/package.json +25 -0
  147. package/example-plugins/packages/client-chat-message-action/client.js +46 -0
  148. package/example-plugins/packages/client-chat-message-action/cordis.patch.yml +3 -0
  149. package/example-plugins/packages/client-chat-message-action/index.js +9 -0
  150. package/example-plugins/packages/client-chat-message-action/package.json +31 -0
  151. package/example-plugins/packages/client-slot-header-action/client.js +57 -0
  152. package/example-plugins/packages/client-slot-header-action/cordis.patch.yml +3 -0
  153. package/example-plugins/packages/client-slot-header-action/index.js +13 -0
  154. package/example-plugins/packages/client-slot-header-action/package.json +31 -0
  155. package/example-plugins/packages/client-slot-sidebar-tab/client.js +57 -0
  156. package/example-plugins/packages/client-slot-sidebar-tab/cordis.patch.yml +3 -0
  157. package/example-plugins/packages/client-slot-sidebar-tab/index.js +9 -0
  158. package/example-plugins/packages/client-slot-sidebar-tab/package.json +32 -0
  159. package/example-plugins/packages/client-theme-override/client.js +52 -0
  160. package/example-plugins/packages/client-theme-override/cordis.patch.yml +3 -0
  161. package/example-plugins/packages/client-theme-override/index.js +9 -0
  162. package/example-plugins/packages/client-theme-override/package.json +30 -0
  163. package/example-plugins/packages/client-tool-view/client.js +47 -0
  164. package/example-plugins/packages/client-tool-view/cordis.patch.yml +3 -0
  165. package/example-plugins/packages/client-tool-view/index.js +24 -0
  166. package/example-plugins/packages/client-tool-view/package.json +34 -0
  167. package/example-plugins/packages/client-ui-components/client.js +77 -0
  168. package/example-plugins/packages/client-ui-components/cordis.patch.yml +3 -0
  169. package/example-plugins/packages/client-ui-components/index.js +9 -0
  170. package/example-plugins/packages/client-ui-components/package.json +31 -0
  171. package/example-plugins/packages/client-ui-library/client.js +715 -0
  172. package/example-plugins/packages/client-ui-library/cordis.patch.yml +3 -0
  173. package/example-plugins/packages/client-ui-library/index.js +9 -0
  174. package/example-plugins/packages/client-ui-library/package.json +37 -0
  175. package/example-plugins/packages/client-workspace-tab/client.js +72 -0
  176. package/example-plugins/packages/client-workspace-tab/cordis.patch.yml +3 -0
  177. package/example-plugins/packages/client-workspace-tab/index.js +9 -0
  178. package/example-plugins/packages/client-workspace-tab/package.json +30 -0
  179. package/example-plugins/packages/config-schema-basic/cordis.patch.yml +3 -0
  180. package/example-plugins/packages/config-schema-basic/index.js +19 -0
  181. package/example-plugins/packages/config-schema-basic/package.json +25 -0
  182. package/example-plugins/packages/desktop-main-profile-info/cordis.patch.yml +3 -0
  183. package/example-plugins/packages/desktop-main-profile-info/index.js +22 -0
  184. package/example-plugins/packages/desktop-main-profile-info/package.json +25 -0
  185. package/example-plugins/packages/event-hook-basic/cordis.patch.yml +3 -0
  186. package/example-plugins/packages/event-hook-basic/index.js +17 -0
  187. package/example-plugins/packages/event-hook-basic/package.json +22 -0
  188. package/example-plugins/packages/generated-capability-template/cordis.patch.yml +3 -0
  189. package/example-plugins/packages/generated-capability-template/index.js +16 -0
  190. package/example-plugins/packages/generated-capability-template/package.json +42 -0
  191. package/example-plugins/packages/host-route-basic/cordis.patch.yml +3 -0
  192. package/example-plugins/packages/host-route-basic/index.js +20 -0
  193. package/example-plugins/packages/host-route-basic/package.json +29 -0
  194. package/example-plugins/packages/lifecycle-function-basic/cordis.patch.yml +3 -0
  195. package/example-plugins/packages/lifecycle-function-basic/index.js +12 -0
  196. package/example-plugins/packages/lifecycle-function-basic/package.json +15 -0
  197. package/example-plugins/packages/lifecycle-function-hot-shim/cordis.patch.yml +3 -0
  198. package/example-plugins/packages/lifecycle-function-hot-shim/impl.js +5 -0
  199. package/example-plugins/packages/lifecycle-function-hot-shim/index.js +18 -0
  200. package/example-plugins/packages/lifecycle-function-hot-shim/package.json +23 -0
  201. package/example-plugins/packages/lifecycle-hooks-observer/cordis.patch.yml +3 -0
  202. package/example-plugins/packages/lifecycle-hooks-observer/index.js +23 -0
  203. package/example-plugins/packages/lifecycle-hooks-observer/package.json +22 -0
  204. package/example-plugins/packages/llm-adapter-echo/cordis.patch.yml +3 -0
  205. package/example-plugins/packages/llm-adapter-echo/index.js +42 -0
  206. package/example-plugins/packages/llm-adapter-echo/package.json +25 -0
  207. package/example-plugins/packages/prompt-assemble-hook/cordis.patch.yml +3 -0
  208. package/example-plugins/packages/prompt-assemble-hook/index.js +22 -0
  209. package/example-plugins/packages/prompt-assemble-hook/package.json +22 -0
  210. package/example-plugins/packages/prompt-contribution-basic/cordis.patch.yml +3 -0
  211. package/example-plugins/packages/prompt-contribution-basic/index.js +18 -0
  212. package/example-plugins/packages/prompt-contribution-basic/package.json +22 -0
  213. package/example-plugins/packages/service-consumer-greeter/cordis.patch.yml +3 -0
  214. package/example-plugins/packages/service-consumer-greeter/index.js +14 -0
  215. package/example-plugins/packages/service-consumer-greeter/package.json +22 -0
  216. package/example-plugins/packages/service-provider-greeter/cordis.patch.yml +3 -0
  217. package/example-plugins/packages/service-provider-greeter/index.js +22 -0
  218. package/example-plugins/packages/service-provider-greeter/package.json +25 -0
  219. package/example-plugins/packages/settings-section-basic/cordis.patch.yml +3 -0
  220. package/example-plugins/packages/settings-section-basic/index.js +34 -0
  221. package/example-plugins/packages/settings-section-basic/package.json +26 -0
  222. package/example-plugins/packages/skill-provider-basic/cordis.patch.yml +3 -0
  223. package/example-plugins/packages/skill-provider-basic/index.js +31 -0
  224. package/example-plugins/packages/skill-provider-basic/package.json +22 -0
  225. package/example-plugins/packages/state-host-store/client.js +57 -0
  226. package/example-plugins/packages/state-host-store/cordis.patch.yml +3 -0
  227. package/example-plugins/packages/state-host-store/index.js +90 -0
  228. package/example-plugins/packages/state-host-store/package.json +31 -0
  229. package/example-plugins/packages/state-workspace-file/cordis.patch.yml +3 -0
  230. package/example-plugins/packages/state-workspace-file/index.js +52 -0
  231. package/example-plugins/packages/state-workspace-file/package.json +25 -0
  232. package/example-plugins/packages/tool-basic/cordis.patch.yml +3 -0
  233. package/example-plugins/packages/tool-basic/index.js +25 -0
  234. package/example-plugins/packages/tool-basic/package.json +25 -0
  235. package/example-plugins/packages/tool-policy-hook/cordis.patch.yml +3 -0
  236. package/example-plugins/packages/tool-policy-hook/index.js +28 -0
  237. package/example-plugins/packages/tool-policy-hook/package.json +25 -0
  238. package/example-plugins/packages/tui-command-basic/cordis.patch.yml +3 -0
  239. package/example-plugins/packages/tui-command-basic/index.js +24 -0
  240. package/example-plugins/packages/tui-command-basic/package.json +22 -0
  241. package/example-plugins/packages/tui-overlay-themed/cordis.patch.yml +3 -0
  242. package/example-plugins/packages/tui-overlay-themed/index.js +65 -0
  243. package/example-plugins/packages/tui-overlay-themed/package.json +25 -0
  244. package/example-plugins/packages/tui-ui-library/cordis.patch.yml +3 -0
  245. package/example-plugins/packages/tui-ui-library/index.js +73 -0
  246. package/example-plugins/packages/tui-ui-library/package.json +29 -0
  247. package/example-plugins/packages/web-page-branding/cordis.patch.yml +3 -0
  248. package/example-plugins/packages/web-page-branding/index.js +31 -0
  249. package/example-plugins/packages/web-page-branding/package.json +22 -0
  250. package/example-plugins/scenarios.json +11 -0
  251. package/index.js +384 -0
  252. package/lib/blend-apply.js +107 -0
  253. package/lib/blend-capture.js +249 -0
  254. package/lib/blend-ledger.js +76 -0
  255. package/lib/contract.js +5 -0
  256. package/lib/install.js +516 -0
  257. package/lib/lookup.js +67 -0
  258. package/lib/manifest.js +56 -0
  259. package/lib/pack-root.js +22 -0
  260. package/lib/provenance.js +110 -0
  261. package/lib/publish.js +64 -0
  262. package/lib/reconcile.js +83 -0
  263. package/lib/router.js +55 -0
  264. package/lib/scopes.js +82 -0
  265. package/lib/skills.js +54 -0
  266. package/lib/stage.js +157 -0
  267. package/lib/verify.js +77 -0
  268. package/package.json +56 -3
  269. package/scripts/lib/indexes.mjs +45 -0
  270. package/scripts/lib/manifest.mjs +127 -0
  271. package/scripts/lib/maps.mjs +482 -0
  272. package/skills/acryl-add-provider-or-capability/SKILL.md +12 -0
  273. package/skills/acryl-add-ui/SKILL.md +18 -0
  274. package/skills/acryl-build-plugin/SKILL.md +21 -0
  275. package/skills/acryl-change-plugin/SKILL.md +16 -0
  276. package/skills/acryl-desktop-shell/SKILL.md +12 -0
  277. package/skills/acryl-diagnose-plugin/SKILL.md +10 -0
  278. package/skills/acryl-fix-plugin/SKILL.md +12 -0
  279. package/skills/acryl-improve-ui/SKILL.md +10 -0
  280. package/skills/acryl-remove-plugin/SKILL.md +11 -0
  281. package/skills/acryl-restyle-ui/SKILL.md +14 -0
  282. package/skills/acryl-share-plugin/SKILL.md +23 -0
  283. package/skills/acryl-tui-ui/SKILL.md +12 -0
  284. package/README.md +0 -3
@@ -0,0 +1,402 @@
1
+ <!-- Synced from deepseek-harness:docs/subsystems/feedback.md @ 639ed01539. Do not edit; run scripts/sync-corpus.mjs. Relative links inside may not resolve here. -->
2
+
3
+ # Message Feedback
4
+
5
+ English | [中文](feedback.zh.md)
6
+
7
+ [`@deepseek-ai/dsh-message-feedback`](../../packages/feedback/message-feedback) owns editable feedback for individual assistant messages. The canonical Session log stores `feedback/message-put` and `feedback/message-delete`; the immutable Session-level remark remains `feedback/record`, owned by [`@deepseek-ai/dsh-command-feedback`](../../packages/feedback/command-feedback) together with the `FeedbackCategory` taxonomy both kinds of feedback file under. All three are log-only events that never enter model context.
8
+
9
+ Source: [`packages/feedback/message-feedback/src/types.ts`](../../packages/feedback/message-feedback/src/types.ts)
10
+
11
+ ## Public types
12
+
13
+ ```ts type-equiv
14
+ /** Opaque compare-and-set token for one exact feedback item revision. */
15
+ type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>
16
+ ```
17
+
18
+ ```ts type-equiv
19
+ /** The human's overall judgment of one assistant message. */
20
+ type MessageFeedbackRating = 'positive' | 'negative'
21
+ ```
22
+
23
+ ```ts type-equiv
24
+ /** One current feedback value and its opaque mutation token. */
25
+ interface MessageFeedbackItem {
26
+ /** Stable identity of the assistant message inside the owning Session. */
27
+ readonly messageId: MessageId
28
+ /** Overall positive or negative judgment. */
29
+ readonly rating: MessageFeedbackRating
30
+ /** Optional explanation, preserved verbatim after validation. */
31
+ readonly note?: string
32
+ /** Category the human filed the judgment under. */
33
+ readonly category?: FeedbackCategory
34
+ /** Equality-only token replaced by every material create or update. */
35
+ readonly version: MessageFeedbackVersion
36
+ /** Host-assigned creation time in Unix epoch milliseconds. */
37
+ readonly createdAt: number
38
+ /** Host-assigned time of the most recent material update. */
39
+ readonly updatedAt: number
40
+ }
41
+ ```
42
+
43
+ ```ts type-equiv
44
+ /** A material creation or edit, retaining its complete current value. */
45
+ interface MessageFeedbackPut {
46
+ /** Owning Session; inherited feedback in a fork belongs to its parent. */
47
+ readonly sessionId: SessionId
48
+ /** Value after this mutation, including the original creation time. */
49
+ readonly item: MessageFeedbackItem
50
+ }
51
+ ```
52
+
53
+ ```ts type-equiv
54
+ /** A material deletion of one current feedback item. */
55
+ interface MessageFeedbackDelete {
56
+ /** Session that owns the deleted feedback. */
57
+ readonly sessionId: SessionId
58
+ /** Message whose feedback was removed. */
59
+ readonly messageId: MessageId
60
+ }
61
+ ```
62
+
63
+ ```ts type-equiv
64
+ /** Read all message feedback belonging to one persisted Session lifecycle. */
65
+ interface MessageFeedbackListRequest {
66
+ /** Session whose feedback events should be read. */
67
+ readonly sessionId: SessionId
68
+ }
69
+ ```
70
+
71
+ ```ts type-equiv
72
+ /** Current feedback values for one Session, in first-creation order. */
73
+ interface MessageFeedbackListValue {
74
+ /** Fresh immutable item snapshots. */
75
+ readonly items: readonly MessageFeedbackItem[]
76
+ }
77
+ ```
78
+
79
+ ```ts type-equiv
80
+ /** Create or replace feedback for one assistant message. */
81
+ interface MessageFeedbackPutRequest {
82
+ /** Persisted Session that owns the target message. */
83
+ readonly sessionId: SessionId
84
+ /** Target assistant-message identity. */
85
+ readonly messageId: MessageId
86
+ /** Desired overall judgment. */
87
+ readonly rating: MessageFeedbackRating
88
+ /** Optional non-blank explanation. */
89
+ readonly note?: string
90
+ /** Optional category; absent keeps the item uncategorized. */
91
+ readonly category?: FeedbackCategory
92
+ /** Observed item version, or `null` to require that no item exists. */
93
+ readonly ifVersion: MessageFeedbackVersion | null
94
+ }
95
+ ```
96
+
97
+ ```ts type-equiv
98
+ /** Delete feedback for one message after observing its current version. */
99
+ interface MessageFeedbackDeleteRequest {
100
+ /** Session that owns the feedback. */
101
+ readonly sessionId: SessionId
102
+ /** Message whose feedback should be absent after this operation. */
103
+ readonly messageId: MessageId
104
+ /** Observed item version; ignored when the item is already absent. */
105
+ readonly ifVersion: MessageFeedbackVersion
106
+ }
107
+ ```
108
+
109
+ ```ts type-equiv
110
+ /** Idempotent deletion acknowledgement. */
111
+ interface MessageFeedbackDeleteValue {
112
+ /** Stable postcondition shared by the first deletion and every retry. */
113
+ readonly absent: true
114
+ }
115
+ ```
116
+
117
+ ```ts type-equiv
118
+ /** No persisted Session header exists for the requested id. */
119
+ interface MessageFeedbackSessionNotFound {
120
+ readonly code: 'session-not-found'
121
+ readonly sessionId: SessionId
122
+ }
123
+ ```
124
+
125
+ ```ts type-equiv
126
+ /** The id does not name a derived, append-origin assistant message. */
127
+ interface MessageFeedbackTargetNotFound {
128
+ readonly code: 'target-not-found'
129
+ readonly sessionId: SessionId
130
+ readonly messageId: MessageId
131
+ }
132
+ ```
133
+
134
+ ```ts type-equiv
135
+ /** A material mutation did not match the addressed item's current version. */
136
+ interface MessageFeedbackVersionConflict {
137
+ readonly code: 'version-conflict'
138
+ /** Authoritative current item, or `null` when it does not exist. */
139
+ readonly current: MessageFeedbackItem | null
140
+ }
141
+ ```
142
+
143
+ ```ts type-equiv
144
+ /** A supplied note contains no non-whitespace character. */
145
+ interface MessageFeedbackNoteBlank {
146
+ readonly code: 'note-blank'
147
+ }
148
+ ```
149
+
150
+ ```ts type-equiv
151
+ /** A supplied note exceeds the configured UTF-8 byte limit. */
152
+ interface MessageFeedbackNoteTooLarge {
153
+ readonly code: 'note-too-large'
154
+ readonly maxBytes: number
155
+ readonly actualBytes: number
156
+ }
157
+ ```
158
+
159
+ ```ts type-equiv
160
+ /** Failures shared by the public message-feedback operations. */
161
+ type MessageFeedbackFailure =
162
+ | MessageFeedbackSessionNotFound
163
+ | MessageFeedbackTargetNotFound
164
+ | MessageFeedbackVersionConflict
165
+ | MessageFeedbackNoteBlank
166
+ | MessageFeedbackNoteTooLarge
167
+ ```
168
+
169
+ ```ts type-equiv
170
+ /** Successful public operation result. */
171
+ interface MessageFeedbackSuccess<T> {
172
+ readonly ok: true
173
+ readonly value: T
174
+ }
175
+ ```
176
+
177
+ ```ts type-equiv
178
+ /** Rejected public operation result with a stable business failure. */
179
+ interface MessageFeedbackRejected<E extends MessageFeedbackFailure> {
180
+ readonly ok: false
181
+ readonly error: E
182
+ }
183
+ ```
184
+
185
+ ```ts type-equiv
186
+ /** Result returned by the message-feedback `list` operation. */
187
+ type MessageFeedbackListResult =
188
+ | MessageFeedbackSuccess<MessageFeedbackListValue>
189
+ | MessageFeedbackRejected<MessageFeedbackSessionNotFound>
190
+ ```
191
+
192
+ ```ts type-equiv
193
+ /** Result returned by the message-feedback `put` operation. */
194
+ type MessageFeedbackPutResult =
195
+ | MessageFeedbackSuccess<MessageFeedbackItem>
196
+ | MessageFeedbackRejected<
197
+ | MessageFeedbackSessionNotFound
198
+ | MessageFeedbackTargetNotFound
199
+ | MessageFeedbackVersionConflict
200
+ | MessageFeedbackNoteBlank
201
+ | MessageFeedbackNoteTooLarge
202
+ >
203
+ ```
204
+
205
+ ```ts type-equiv
206
+ /** Result returned by the message-feedback `delete` operation. */
207
+ type MessageFeedbackDeleteResult =
208
+ | MessageFeedbackSuccess<MessageFeedbackDeleteValue>
209
+ | MessageFeedbackRejected<MessageFeedbackSessionNotFound | MessageFeedbackVersionConflict>
210
+ ```
211
+
212
+ ## Session feedback types
213
+
214
+ Source: [`packages/feedback/command-feedback/src/types.ts`](../../packages/feedback/command-feedback/src/types.ts)
215
+
216
+ ```ts type-equiv
217
+ /** One of the fixed feedback categories; the ids are durable log vocabulary. */
218
+ type FeedbackCategory =
219
+ | 'task-result'
220
+ | 'instruction-following'
221
+ | 'product-interaction'
222
+ | 'service-stability'
223
+ | 'resource-cost'
224
+ | 'security-privacy-permission'
225
+ | 'other'
226
+ ```
227
+
228
+ ```ts type-equiv
229
+ /**
230
+ * One recorded human remark about a Session. Both members are optional: a
231
+ * submission with neither still records that the human asked for the
232
+ * Session to be reviewed, which is what authorizes log delivery.
233
+ */
234
+ interface FeedbackRecord {
235
+ /** Free-text remark with surrounding whitespace removed; never empty when present. */
236
+ readonly text?: string
237
+ /** Category the human filed the remark under. */
238
+ readonly category?: FeedbackCategory
239
+ }
240
+ ```
241
+
242
+ ```ts type-equiv
243
+ /** Record one Session-level remark through the Host Remote. */
244
+ interface SessionFeedbackRecordRequest {
245
+ /** Live Session the remark describes. */
246
+ readonly sessionId: SessionId
247
+ /** Free-text remark; blank text is recorded as absent. */
248
+ readonly text?: string
249
+ /** Category the human filed the remark under. */
250
+ readonly category?: FeedbackCategory
251
+ }
252
+ ```
253
+
254
+ ```ts type-equiv
255
+ /** Stable postcondition of a recorded remark. */
256
+ interface SessionFeedbackRecordValue {
257
+ /** The remark is appended to the Session log; flushing follows the Session's own schedule. */
258
+ readonly recorded: true
259
+ }
260
+ ```
261
+
262
+ ```ts type-equiv
263
+ /** No live Session carries the requested id. */
264
+ interface SessionFeedbackSessionNotFound {
265
+ readonly code: 'session-not-found'
266
+ readonly sessionId: SessionId
267
+ }
268
+ ```
269
+
270
+ ```ts type-equiv
271
+ /** Result returned by the `sessionFeedback.record` operation. */
272
+ type SessionFeedbackRecordResult =
273
+ | { readonly ok: true; readonly value: SessionFeedbackRecordValue }
274
+ | { readonly ok: false; readonly error: SessionFeedbackSessionNotFound }
275
+ ```
276
+
277
+ ## Data and concurrency
278
+
279
+ Current items are folded from canonical feedback events whose payload `sessionId` matches the owning Session. Each item carries a positive or negative rating, an optional note, an optional category, Host-assigned `createdAt`/`updatedAt` timestamps, and its own opaque version. Versions are compared only for equality and only against the addressed message; callers do not order or synthesize them.
280
+
281
+ `put` uses strict optimistic concurrency: every request for an existing item must match its current `ifVersion`, including a no-op (a put repeating the stored rating, note, and category). A conflict returns the authoritative current item (or `null`), so a caller can reconcile a lost response or a concurrent edit without another read. Deleting an already absent item succeeds. A per-Session queue serializes reads and mutations; cold mutations hold a persistence write handle across read, comparison, append, and flush. Matching no-ops append no event.
282
+
283
+ ## Target and lifecycle authority
284
+
285
+ A live owner's in-memory log supplies the target Session observation directly; cold reads use a `SessionPersistence.open(id, 'read')` handle, while mutations use a write handle. Neither path constructs a Session or Agent. A `stat(id)` preflight classifies definite absence; a read failure for a Session `stat` confirmed propagates as infrastructure failure. `put` accepts only a non-empty, append-origin `assistant/message` with the requested `MessageId`; replacement-origin, usage-only empty, and non-assistant records are not feedback targets.
286
+
287
+ Fork seeds can contain parent feedback events, but their payload retains the parent `sessionId`, so they do not become current feedback for the child. Deleting an item appends a tombstone; earlier ratings and notes remain in the log.
288
+
289
+ ## Persistence and Remote contract
290
+
291
+ Successful message-feedback mutations await canonical persistence: live operations append through the owning Session and require a participating `ctx.sessions.flush` listener; cold operations append and flush through their write handle. Persistence failures propagate rather than reporting success. `maxNoteBytes` is required and bounds note text by UTF-8 bytes; the Web Host composition sets `8192`. The package publishes the Host `messageFeedback.list`, `messageFeedback.put`, and `messageFeedback.delete` unary Remote contract through `TypertRemoteService` and `@Remote`; `command-feedback` publishes `sessionFeedback.record` the same way for Session-level remarks on live Sessions. The generated Cordis API below is the method-level authority.
292
+
293
+ Plugin disposal closes operation admission and drains accepted per-Session queue work.
294
+
295
+ By default, [`session-log-deepseek`](../../packages/session/session-log-deepseek/README.md) carries feedback as part of the ordinary `dsh_session_log` suffix on subsequent eligible DeepSeek requests; a composition disables it with `enabled: false`. Recording feedback does not trigger an LLM request or a separate `dsh_feedback` upload. For non-DeepSeek routes, the [OTel backend](../../packages/session/session-telemetry-otel/README.md) can release the canonical prefix through recorded feedback. The command acknowledgement confirms recording and identifies the Session and anonymous user; it reports neither telemetry policy nor delivery.
296
+
297
+ ## Web surface
298
+
299
+ [`@deepseek-ai/dsh-client-ui-message-feedback`](../../packages/client/ui-message-feedback) is the browser consumer. `@deepseek-ai/dsh-api-remotes` mounts the generated `messageFeedback` and `sessionFeedback` contributions, so the plugin calls `ctx.remote.messageFeedback` and `ctx.remote.sessionFeedback` and never touches the transport.
300
+
301
+ The controls are the `feedback` entry (order 10) of the `conversation.chat.assistant-actions` list slot, which `ui-conversation` declares and renders inside the finalized assistant message's IconActions row. `AssistantMessageNode` carries the optional `messageId` from the `assistant/message` event. The field is absent on interruption-frozen partials, and the render site skips the slot when it is absent. The strip renders once per turn, on the closing assistant message: the Host accepts every append-origin step message as a target, but earlier steps of a multi-step turn render tool rows rather than a rateable body, so the UI exposes a narrower set than the Host contract allows.
302
+
303
+ One `MessageFeedbackController` per Session backs every message control in that Session: a single `list` read seeds the whole transcript, deferred to first hover or focus rather than fired on mount. Each mutation sends the version that controller last observed as `ifVersion`; a `version-conflict` reply carries the authoritative item, so the controller reconciles from the reply instead of refetching. Mutations serialize per Session so a queued operation compares against the committed version. The injected `retract` operation rechecks the committed rating inside that queue and becomes a no-op after a concurrent change, so stale UI cannot bypass the dialog by recording a bare rating. A `connection/reset` refreshes only Sessions already read.
304
+
305
+ Either unrecorded rating opens the Session's feedback dialog, the `feedback-dialog` entry of `conversation.input.overlay`: the shared Modal card with seven category chips and a detail box. Submit puts the selected judgment carrying the chosen category and the trimmed description, or neither; success closes the dialog and shows the acknowledgement toast, while failure keeps the dialog and draft open and shows a warning toast. The same dialog opens for the Session from a bare `/feedback` - a decoration `ui-commands` routes as an `action` - and then records through `sessionFeedback.record`; `/feedback <text>` keeps the Host command path. Clicking a recorded rating retracts it without opening the dialog.
306
+
307
+ ## Boundaries and limitations
308
+
309
+ - The operation queue is process-local; cold writer exclusion relies on the selected persistence provider.
310
+ - Deletion removes the current item, not earlier note text from the append-only log or an already delivered suffix.
311
+ - A request in the narrow interval after live detach but before the persistence catalog materializes the header can receive `session-not-found`; callers retry after retirement materialization.
312
+ - Cold requests read the complete log; the service has no item-count or aggregate-byte cap. `maxNoteBytes` bounds only each note.
313
+ - The Host contract records no authenticated actor or audit identity and therefore assumes a trusted caller boundary.
314
+ - The Web controls appear in the chat view only. The trajectory and waterfall views render no feedback entry even though their assistant nodes carry the same `messageId`.
315
+ - The Web controller does not consume feedback log events, so a second tab's rating becomes visible on reconnect or on the next conflict reply rather than immediately.
316
+ - The dialog does not pre-check `maxNoteBytes`; an oversized description for a message fails on submit with `note-too-large` rather than while typing. A Session remark has no size bound, as the `/feedback` command never had one.
317
+ - `sessionFeedback.record` serves live Sessions only and answers `session-not-found` otherwise; the dialog reports that failure when its Session retires while it is open.
318
+
319
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) - do not edit between markers -->
320
+
321
+ <a id="cordis-surface"></a>
322
+
323
+ ## Cordis API
324
+
325
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) - the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
326
+
327
+ <a id="ctxmessagefeedback--messagefeedbackservice"></a>
328
+
329
+ ### `ctx.messageFeedback` - `MessageFeedbackService`
330
+
331
+ Session-log service; cold operations never construct a Session or Agent.
332
+
333
+ ```ts cordis-catalog
334
+ /**
335
+ * Read current feedback from the canonical log.
336
+ * @param request - Session to inspect.
337
+ * @returns immutable items or a definite persistence miss.
338
+ */
339
+ @Remote('list') list(request: MessageFeedbackListRequest): Promise<MessageFeedbackListResult>
340
+
341
+ /**
342
+ * Create or replace feedback after checking its current version.
343
+ * Matching no-ops retain the version and append no event.
344
+ * @param request - Target, desired value, and observed item version.
345
+ * @returns the durable item or an explicit business failure.
346
+ */
347
+ @Remote('put') put(request: MessageFeedbackPutRequest): Promise<MessageFeedbackPutResult>
348
+
349
+ /**
350
+ * Delete one item after checking its version; absence succeeds without an event.
351
+ * @param request - Session, message, and observed item version.
352
+ * @returns the stable absent postcondition or an explicit failure.
353
+ */
354
+ @Remote('delete') delete(request: MessageFeedbackDeleteRequest): Promise<MessageFeedbackDeleteResult>
355
+ ```
356
+
357
+ Source: [`packages/feedback/message-feedback/src/index.ts`](../../packages/feedback/message-feedback/src/index.ts)
358
+
359
+ <a id="ctxsessionfeedback--sessionfeedbackservice"></a>
360
+
361
+ ### `ctx.sessionFeedback` - `SessionFeedbackService`
362
+
363
+ Host Remote through which a product surface records a Session-level remark.
364
+
365
+ ```ts cordis-catalog
366
+ /**
367
+ * Record one remark on a live Session.
368
+ * @param request - target Session plus the optional text and category.
369
+ * @returns the recorded postcondition, or `session-not-found` when no live
370
+ * Session carries the id.
371
+ */
372
+ @Remote('record') record(request: SessionFeedbackRecordRequest): Promise<SessionFeedbackRecordResult>
373
+ ```
374
+
375
+ Source: [`packages/feedback/command-feedback/src/index.ts`](../../packages/feedback/command-feedback/src/index.ts)
376
+
377
+ <a id="feedback-events"></a>
378
+
379
+ ### `feedback/*` events
380
+
381
+ <a id="feedbackcommitted--parallel"></a>
382
+
383
+ #### `feedback/committed` - parallel
384
+
385
+ Observe a durable cold feedback mutation without publishing a live Session. Observers run before write ownership is released and must not await another message-feedback operation for this Session. The payload is borrowed read-only; deep-clone it before transferring ownership (for example, to Session.fromRestore).
386
+
387
+ ```ts cordis-catalog
388
+ /**
389
+ * Observe a durable cold feedback mutation without publishing a live Session.
390
+ * Observers run before write ownership is released and must not await
391
+ * another message-feedback operation for this Session. The payload is borrowed
392
+ * read-only; deep-clone it before transferring ownership (for example, to Session.fromRestore).
393
+ * @param inspection - committed canonical prefix, including the feedback as its last event.
394
+ * @mode parallel
395
+ */
396
+ 'feedback/committed'(inspection: SessionInspection): void
397
+ ```
398
+
399
+ Types: [SessionInspection](persistence.md)
400
+
401
+ Source: [`packages/feedback/message-feedback/src/index.ts`](../../packages/feedback/message-feedback/src/index.ts)
402
+ <!-- END GENERATED cordis-surface -->