@deepseek-ai/dsh-client-ui-message-feedback 0.1.5-rc.2 → 0.1.6-alpha.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.
package/README.i18n.yaml CHANGED
@@ -3,4 +3,4 @@
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/client/ui-message-feedback/README.md
5
5
  README.md: b37278e8d115a2ad61bb17ef8d884b0d888cd6a7
6
- README.zh.md: 89183cfa8f3321ec591594ea7e4f091cdf3ff903
6
+ README.zh.md: cd233061640f5e52ea9ca54ffe973bff3b957197
package/README.zh.md CHANGED
@@ -90,4 +90,4 @@ kind: "package-reference"
90
90
 
91
91
  </details>
92
92
 
93
- **运行时不变式:** 不发布伴生入口。插件持有两个 slot 注册、一个命令装饰和一个按 Session 的控制器对 map,全部由插件 fiber 的 effect disposer 释放;生命周期测试已直接观察注册被撤销、每对控制器被丢弃,因此运行时没有第二个可核对的权威。
93
+ **运行时不变式:** 不发布伴生入口。插件持有两个 slot 注册、一个命令装饰,以及一个按 Session 划分的控制器对 map;它们都由插件 fiber 的同一个 effect disposer 释放。生命周期规格测试证明,所属 fiber 释放时会撤销所有注册并丢弃所有控制器,因此不存在需要在运行时检查的第二权威来源。
package/lib/client.js CHANGED
@@ -320,7 +320,7 @@ window.__ModuleLoader__.load({
320
320
  * control in that Session, so a single list read seeds them all.
321
321
  */
322
322
  var MessageFeedbackController = class {
323
- ctx;
323
+ remote;
324
324
  sessionId;
325
325
  view = INITIAL_VIEW;
326
326
  listeners = /* @__PURE__ */ new Set();
@@ -328,11 +328,11 @@ window.__ModuleLoader__.load({
328
328
  operationTail = Promise.resolve();
329
329
  disposed = false;
330
330
  /**
331
- * @param ctx - the browser plugin context carrying the messageFeedback Remote namespace.
331
+ * @param remote - the messageFeedback Remote namespace.
332
332
  * @param sessionId - Session owning every addressed assistant message.
333
333
  */
334
- constructor(ctx, sessionId) {
335
- this.ctx = ctx;
334
+ constructor(remote, sessionId) {
335
+ this.remote = remote;
336
336
  this.sessionId = sessionId;
337
337
  }
338
338
  /** Return the cached immutable view. */
@@ -414,7 +414,7 @@ window.__ModuleLoader__.load({
414
414
  }
415
415
  /** Commit one put against the observed version and reconcile a conflict. */
416
416
  async putCommitted(messageId, rating, entry, observed) {
417
- const carried = await this.ctx.remote.messageFeedback.put({
417
+ const carried = await this.remote.put({
418
418
  sessionId: this.sessionId,
419
419
  messageId,
420
420
  rating,
@@ -433,7 +433,7 @@ window.__ModuleLoader__.load({
433
433
  }
434
434
  /** Commit one delete against the observed version and reconcile a conflict. */
435
435
  async deleteCommitted(messageId, observed) {
436
- const carried = await this.ctx.remote.messageFeedback.delete({
436
+ const carried = await this.remote.delete({
437
437
  sessionId: this.sessionId,
438
438
  messageId,
439
439
  ifVersion: observed.version
@@ -454,7 +454,7 @@ window.__ModuleLoader__.load({
454
454
  }
455
455
  /** Fetch the whole sidecar and publish it as the seeded view. */
456
456
  async load() {
457
- const carried = await this.ctx.remote.messageFeedback.list({ sessionId: this.sessionId });
457
+ const carried = await this.remote.list({ sessionId: this.sessionId });
458
458
  if (this.disposed) return OK;
459
459
  if (!carried.ok) {
460
460
  this.publish({
@@ -684,7 +684,7 @@ window.__ModuleLoader__.load({
684
684
  constructor(ctx, sessionId) {
685
685
  this.ctx = ctx;
686
686
  this.sessionId = sessionId;
687
- this.feedback = new MessageFeedbackController(ctx, sessionId);
687
+ this.feedback = new MessageFeedbackController(ctx.remote.messageFeedback, sessionId);
688
688
  this.dialog = new FeedbackDialogController((target, entry) => target.kind === "message" ? this.feedback.rate(target.messageId, target.rating, entry) : this.recordSession(entry));
689
689
  }
690
690
  /** Record one Session-level remark through the sessionFeedback Remote. */
@@ -6,9 +6,8 @@
6
6
  * instead of refetching the whole Session.
7
7
  * @module @deepseek-ai/dsh-client-ui-message-feedback/client/controller
8
8
  */
9
- import type { Context as ClientContext } from '@deepseek-ai/cordis';
10
9
  import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots';
11
- import type { MessageId } from '@deepseek-ai/dsh-api-remotes/client';
10
+ import type { ClientRemote, MessageId } from '@deepseek-ai/dsh-api-remotes/client';
12
11
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
13
12
  import type { FeedbackRecord } from '@deepseek-ai/dsh-command-feedback/types';
14
13
  import type { MessageFeedbackItem, MessageFeedbackRating } from '@deepseek-ai/dsh-message-feedback/types';
@@ -45,7 +44,7 @@ export declare function describe(code: string): string;
45
44
  * control in that Session, so a single list read seeds them all.
46
45
  */
47
46
  export declare class MessageFeedbackController implements HostObservable<MessageFeedbackView> {
48
- private readonly ctx;
47
+ private readonly remote;
49
48
  private readonly sessionId;
50
49
  private view;
51
50
  private readonly listeners;
@@ -53,10 +52,10 @@ export declare class MessageFeedbackController implements HostObservable<Message
53
52
  private operationTail;
54
53
  private disposed;
55
54
  /**
56
- * @param ctx - the browser plugin context carrying the messageFeedback Remote namespace.
55
+ * @param remote - the messageFeedback Remote namespace.
57
56
  * @param sessionId - Session owning every addressed assistant message.
58
57
  */
59
- constructor(ctx: ClientContext, sessionId: SessionId);
58
+ constructor(remote: ClientRemote['messageFeedback'], sessionId: SessionId);
60
59
  /** Return the cached immutable view. */
61
60
  getSnapshot: () => MessageFeedbackView;
62
61
  /** Subscribe to view replacement. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-message-feedback",
3
3
  "description": "The Web feedback surface: per-message Like/Dislike in the assistant-message action strip and the feedback dialog behind both ratings and /feedback, backed by the messageFeedback and sessionFeedback Host Remotes",
4
- "version": "0.1.5-rc.2",
4
+ "version": "0.1.6-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -47,23 +47,24 @@
47
47
  "@types/react-dom": "~18.3.0",
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0",
50
- "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.2",
51
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.2",
52
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.2",
53
- "@deepseek-ai/dsh-api-remotes": "^0.1.5-rc.2",
54
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.5-rc.2",
55
- "@deepseek-ai/dsh-client-connection": "^0.1.5-rc.2",
56
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.2",
57
- "@deepseek-ai/dsh-message-feedback": "^0.1.5-rc.2",
58
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
59
- "@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.2",
50
+ "@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.1",
51
+ "@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.1",
52
+ "@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.1",
53
+ "@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.1",
54
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.6-alpha.1",
55
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.1",
56
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.1",
57
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.1",
58
+ "@deepseek-ai/dsh-remote-mock": "^0.1.6-alpha.1",
59
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
60
+ "@deepseek-ai/dsh-message-feedback": "^0.1.6-alpha.1",
61
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.1",
60
62
  "@deepseek-ai/cordis": "^4.0.2",
61
- "@deepseek-ai/dsh-client-ui-session": "^0.1.5-rc.2",
62
- "@deepseek-ai/dsh-client-ui-commands": "^0.1.5-rc.2",
63
- "@deepseek-ai/dsh-command-feedback": "^0.1.5-rc.2",
64
- "@deepseek-ai/dsh-client-store": "^0.1.5-rc.2",
65
- "@deepseek-ai/dsh-client-ui-chat": "^0.1.5-rc.2",
66
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.2"
63
+ "@deepseek-ai/dsh-client-ui-chat": "^0.1.6-alpha.1",
64
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.6-alpha.1",
65
+ "@deepseek-ai/dsh-client-ui-commands": "^0.1.6-alpha.1",
66
+ "@deepseek-ai/dsh-command-feedback": "^0.1.6-alpha.1",
67
+ "@deepseek-ai/dsh-client-store": "^0.1.6-alpha.1"
67
68
  },
68
69
  "files": [
69
70
  "lib/index.js",