@khorsheed/dsh-client-message-tools 0.2.0 → 0.3.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 (55) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.en.md +10 -10
  3. package/README.i18n.yaml +2 -2
  4. package/README.md +9 -9
  5. package/lib/client.js +285 -112
  6. package/lib/index.js +238 -102
  7. package/lib/typert.host.js +40 -28
  8. package/lib/typert.remote-client.js +33 -21
  9. package/lib/types/client/ModelChip.js +4 -4
  10. package/lib/types/client/RestoredMessageView.js +2 -2
  11. package/lib/types/client/UserMessageView.js +11 -7
  12. package/lib/types/client/WithdrawnDividerView.d.ts +3 -2
  13. package/lib/types/client/WithdrawnDividerView.js +11 -5
  14. package/lib/types/client/chat-hook.js +1 -0
  15. package/lib/types/client/dom-hider.js +11 -4
  16. package/lib/types/client/icons-local.d.ts +23 -0
  17. package/lib/types/client/icons-local.js +11 -0
  18. package/lib/types/client/icons.d.ts +18 -19
  19. package/lib/types/client/icons.js +5 -10
  20. package/lib/types/client/index.js +6 -1
  21. package/lib/types/client/withdrawn-node.d.ts +17 -10
  22. package/lib/types/client/withdrawn-node.js +40 -22
  23. package/lib/types/index.d.ts +11 -11
  24. package/lib/types/index.js +21 -16
  25. package/lib/types/marker.d.ts +47 -15
  26. package/lib/types/marker.js +57 -30
  27. package/lib/types/restore-projection.d.ts +55 -0
  28. package/lib/types/restore-projection.js +123 -0
  29. package/lib/types/withdraw.js +67 -75
  30. package/locale/en.json +6 -0
  31. package/locale/zh.json +6 -0
  32. package/package.json +9 -28
  33. package/lib/client.js.map +0 -1
  34. package/lib/tsconfig.client.tsbuildinfo +0 -1
  35. package/lib/tsconfig.host.tsbuildinfo +0 -1
  36. package/lib/typert.remote-client.d.ts.map +0 -1
  37. package/lib/types/client/ModelChip.d.ts.map +0 -1
  38. package/lib/types/client/RestoredMessageView.d.ts.map +0 -1
  39. package/lib/types/client/UserMessageView.d.ts.map +0 -1
  40. package/lib/types/client/WithdrawnDividerView.d.ts.map +0 -1
  41. package/lib/types/client/backfill.d.ts.map +0 -1
  42. package/lib/types/client/chat-hook.d.ts.map +0 -1
  43. package/lib/types/client/dom-hider.d.ts.map +0 -1
  44. package/lib/types/client/edit-in-place.d.ts.map +0 -1
  45. package/lib/types/client/icons.d.ts.map +0 -1
  46. package/lib/types/client/index.d.ts.map +0 -1
  47. package/lib/types/client/locales.d.ts.map +0 -1
  48. package/lib/types/client/slots.d.ts.map +0 -1
  49. package/lib/types/client/withdraw-backfill.d.ts.map +0 -1
  50. package/lib/types/client/withdrawn-node.d.ts.map +0 -1
  51. package/lib/types/index.d.ts.map +0 -1
  52. package/lib/types/invariant.d.ts.map +0 -1
  53. package/lib/types/marker.d.ts.map +0 -1
  54. package/lib/types/types.d.ts.map +0 -1
  55. package/lib/types/withdraw.d.ts.map +0 -1
@@ -1,12 +1,14 @@
1
1
  /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
2
  import { z } from 'zod'
3
3
 
4
- const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = z.object({
4
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value
5
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value ??= z.object({
5
6
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
6
7
  'targetSeq': z.number().readonly(),
7
8
  'text': z.string().readonly(),
8
- })
9
- const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = z.union([z.object({
9
+ }))
10
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value
11
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value ??= z.union([z.object({
10
12
  'ok': z.literal(true).readonly(),
11
13
  'value': z.object({
12
14
  'replacementSeq': z.number().readonly(),
@@ -25,12 +27,14 @@ const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = z.un
25
27
  }), z.object({
26
28
  'code': z.literal("empty-text").readonly(),
27
29
  })]).readonly(),
28
- })])
29
- const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = z.object({
30
+ })]))
31
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value
32
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value ??= z.object({
30
33
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
31
34
  'targetSeq': z.number().readonly(),
32
- })
33
- const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = z.union([z.object({
35
+ }))
36
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value
37
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value ??= z.union([z.object({
34
38
  'ok': z.literal(true).readonly(),
35
39
  'value': z.object({
36
40
  'restoredSeq': z.number().readonly(),
@@ -46,12 +50,14 @@ const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = z
46
50
  }), z.object({
47
51
  'code': z.literal("not-withdrawn").readonly(),
48
52
  })]).readonly(),
49
- })])
50
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = z.object({
53
+ })]))
54
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value
55
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value ??= z.object({
51
56
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
52
57
  'targetSeq': z.number().readonly(),
53
- })
54
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = z.union([z.object({
58
+ }))
59
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value
60
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value ??= z.union([z.object({
55
61
  'ok': z.literal(true).readonly(),
56
62
  'value': z.object({
57
63
  'replacementSeq': z.number().readonly(),
@@ -68,7 +74,7 @@ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema =
68
74
  }), z.object({
69
75
  'code': z.literal("already-withdrawn").readonly(),
70
76
  })]).readonly(),
71
- })])
77
+ })]))
72
78
 
73
79
  export const TYPERT = {
74
80
  package: '@khorsheed/dsh-client-message-tools',
@@ -90,16 +96,18 @@ export const TYPERT = {
90
96
  codec: {
91
97
  mode: 'strict',
92
98
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsEditRequest',
93
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema,
99
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema,
100
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema(),
94
101
  },
95
102
  },
96
103
  ],
97
104
  result: {
98
105
  mode: 'strict',
99
106
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsEditResult',
100
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema,
107
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema,
108
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema(),
101
109
  },
102
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":135,"column":9},
110
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":140,"column":9},
103
111
  },
104
112
  {
105
113
  id: '@khorsheed/dsh-client-message-tools#messageTools/restore',
@@ -115,16 +123,18 @@ export const TYPERT = {
115
123
  codec: {
116
124
  mode: 'strict',
117
125
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreRequest',
118
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema,
126
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema,
127
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema(),
119
128
  },
120
129
  },
121
130
  ],
122
131
  result: {
123
132
  mode: 'strict',
124
133
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreResult',
125
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema,
134
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema,
135
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema(),
126
136
  },
127
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":97,"column":9},
137
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":102,"column":9},
128
138
  },
129
139
  {
130
140
  id: '@khorsheed/dsh-client-message-tools#messageTools/withdraw',
@@ -140,25 +150,27 @@ export const TYPERT = {
140
150
  codec: {
141
151
  mode: 'strict',
142
152
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawRequest',
143
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema,
153
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema,
154
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema(),
144
155
  },
145
156
  },
146
157
  ],
147
158
  result: {
148
159
  mode: 'strict',
149
160
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawResult',
150
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema,
161
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema,
162
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema(),
151
163
  },
152
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":63,"column":9},
164
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":68,"column":9},
153
165
  },
154
166
  ],
155
167
  model: {
156
168
  "services": [
157
169
  {
158
- "description": "messageTools Remote service: appends the withdrawal replacement to the owning Session and flushes it durable. The replacement event's plugin-tagged source is the audit trail; no new session event type is introduced, so session reload stays safe for harnesses without this plugin.",
170
+ "description": "messageTools Remote service: appends the withdrawal replacement to the owning Session and flushes it durable. The replacement event's producer-owned source is the audit trail; no new session event type is introduced, so session reload stays safe for harnesses without this plugin.",
159
171
  "summary": "messageTools Remote service: appends the withdrawal replacement to the owning Session and flushes it durable.",
160
172
  "tags": [],
161
- "jsDoc": "/**\n * messageTools Remote service: appends the withdrawal replacement to the\n * owning Session and flushes it durable. The replacement event's\n * plugin-tagged source is the audit trail; no new session event type is\n * introduced, so session reload stays safe for harnesses without this plugin.\n */",
173
+ "jsDoc": "/**\n * messageTools Remote service: appends the withdrawal replacement to the\n * owning Session and flushes it durable. The replacement event's\n * producer-owned source is the audit trail; no new session event type is\n * introduced, so session reload stays safe for harnesses without this plugin.\n */",
162
174
  "key": "messageTools",
163
175
  "exportName": "MessageToolsService",
164
176
  "members": [
@@ -166,22 +178,22 @@ export const TYPERT = {
166
178
  "kind": "method",
167
179
  "name": "withdraw",
168
180
  "signature": "@Remote('withdraw') async withdraw(request: MessageToolsWithdrawRequest): Promise<MessageToolsWithdrawResult>",
169
- "summary": "Withdraw a user message: replace it and every surface node after it with a minimal plugin-sourced placeholder, hiding the span from the model.",
170
- "jsDoc": "/**\n * Withdraw a user message: replace it and every surface node after it with\n * a minimal plugin-sourced placeholder, hiding the span from the model.\n * @param request - session identity and target message seq.\n * @returns the replacement receipt, or a rejection from the closed failure union.\n */"
181
+ "summary": "Withdraw a user message: replace it and every surface node after it with a minimal producer-sourced placeholder, hiding the span from the model.",
182
+ "jsDoc": "/**\n * Withdraw a user message: replace it and every surface node after it with\n * a minimal producer-sourced placeholder, hiding the span from the model.\n * @param request - session identity and target message seq.\n * @returns the replacement receipt, or a rejection from the closed failure union.\n */"
171
183
  },
172
184
  {
173
185
  "kind": "method",
174
186
  "name": "restore",
175
187
  "signature": "@Remote('restore') async restore(request: MessageToolsRestoreRequest): Promise<MessageToolsRestoreResult>",
176
- "summary": "Restore a withdrawn span: replay every replayable entry of it (user messages verbatim — including the last edit's new text — and framed assistant text; tool calls/results never replay) as fresh plugin-tagged `user/message` appends at the conversation tail, in original order, each citing its original event in `sourceEventSeqs`.",
177
- "jsDoc": "/**\n * Restore a withdrawn span: replay every replayable entry of it (user\n * messages verbatim — including the last edit's new text — and framed\n * assistant text; tool calls/results never replay) as fresh plugin-tagged\n * `user/message` appends at the conversation tail, in original order, each\n * citing its original event in `sourceEventSeqs`. The surface replace model\n * is positional — a replaced span folds into one node — so the span cannot\n * be restored in place; the replayed entries are simply the newest messages\n * the model sees. Assistant text replays as framed user-role messages:\n * `assistant/message` cannot carry a plugin source and the turn/step trace\n * forbids assistant appends outside a step.\n * @param request - session identity and withdrawn message seq.\n * @returns the restore receipt, or a rejection from the closed failure union.\n */"
188
+ "summary": "Restore a withdrawn span: replay every replayable entry of it (user messages verbatim — including the last edit's new text — and framed assistant text; tool calls/results never replay) as fresh producer-sourced `user/message` appends at the conversation tail, in original order, each citing its original event in `sourceEventSeqs`.",
189
+ "jsDoc": "/**\n * Restore a withdrawn span: replay every replayable entry of it (user\n * messages verbatim — including the last edit's new text — and framed\n * assistant text; tool calls/results never replay) as fresh\n * producer-sourced `user/message` appends at the conversation tail, in\n * original order, each citing its original event in `sourceEventSeqs`. The\n * surface replace model is positional — a replaced span folds into one\n * node — so the span cannot be restored in place; the replayed entries are\n * simply the newest messages the model sees. Assistant text replays as\n * framed user-role messages: `assistant/message` requires the model source\n * and the turn/step trace forbids assistant appends outside a step.\n * @param request - session identity and withdrawn message seq.\n * @returns the restore receipt, or a rejection from the closed failure union.\n */"
178
190
  },
179
191
  {
180
192
  "kind": "method",
181
193
  "name": "edit",
182
194
  "signature": "@Remote('edit') async edit(request: MessageToolsEditRequest): Promise<MessageToolsEditResult>",
183
195
  "summary": "Edit a user message in place: replace it and every surface node after it with the edited text itself (no placeholder, no tail duplicate — the edited text appears exactly once, in the replacement event), then start a regeneration turn.",
184
- "jsDoc": "/**\n * Edit a user message in place: replace it and every surface node after it\n * with the edited text itself (no placeholder, no tail duplicate — the\n * edited text appears exactly once, in the replacement event), then start a\n * regeneration turn. The harness has no wake-without-append path, so the\n * turn is started by `agent.followup` carrying a minimal plugin-sourced\n * trigger message (the ankh-guard/schedule pattern); the trigger is not the\n * edited text and lands once, as itself.\n * @param request - session identity, target seq, edited text.\n * @returns the replacement receipt and whether the turn was triggered, or a rejection.\n */"
196
+ "jsDoc": "/**\n * Edit a user message in place: replace it and every surface node after it\n * with the edited text itself (no placeholder, no tail duplicate — the\n * edited text appears exactly once, in the replacement event), then start a\n * regeneration turn. The harness has no wake-without-append path, so the\n * turn is started by `agent.followup` carrying a minimal producer-sourced\n * trigger message (the ankh-guard/schedule pattern); the trigger is not the\n * edited text and lands once, as itself.\n * @param request - session identity, target seq, edited text.\n * @returns the replacement receipt and whether the turn was triggered, or a rejection.\n */"
185
197
  }
186
198
  ],
187
199
  "types": [
@@ -1,12 +1,14 @@
1
1
  /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
2
  import { z } from 'zod'
3
3
 
4
- const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = z.object({
4
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value
5
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema$value ??= z.object({
5
6
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
6
7
  'targetSeq': z.number().readonly(),
7
8
  'text': z.string().readonly(),
8
- })
9
- const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = z.union([z.object({
9
+ }))
10
+ let _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value
11
+ const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_edit_result$schema$value ??= z.union([z.object({
10
12
  'ok': z.literal(true).readonly(),
11
13
  'value': z.object({
12
14
  'replacementSeq': z.number().readonly(),
@@ -25,12 +27,14 @@ const _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema = z.un
25
27
  }), z.object({
26
28
  'code': z.literal("empty-text").readonly(),
27
29
  })]).readonly(),
28
- })])
29
- const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = z.object({
30
+ })]))
31
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value
32
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema$value ??= z.object({
30
33
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
31
34
  'targetSeq': z.number().readonly(),
32
- })
33
- const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = z.union([z.object({
35
+ }))
36
+ let _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value
37
+ const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_restore_result$schema$value ??= z.union([z.object({
34
38
  'ok': z.literal(true).readonly(),
35
39
  'value': z.object({
36
40
  'restoredSeq': z.number().readonly(),
@@ -46,12 +50,14 @@ const _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema = z
46
50
  }), z.object({
47
51
  'code': z.literal("not-withdrawn").readonly(),
48
52
  })]).readonly(),
49
- })])
50
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = z.object({
53
+ })]))
54
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value
55
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema$value ??= z.object({
51
56
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
52
57
  'targetSeq': z.number().readonly(),
53
- })
54
- const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = z.union([z.object({
58
+ }))
59
+ let _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value
60
+ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema = () => (_khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema$value ??= z.union([z.object({
55
61
  'ok': z.literal(true).readonly(),
56
62
  'value': z.object({
57
63
  'replacementSeq': z.number().readonly(),
@@ -68,7 +74,7 @@ const _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema =
68
74
  }), z.object({
69
75
  'code': z.literal("already-withdrawn").readonly(),
70
76
  })]).readonly(),
71
- })])
77
+ })]))
72
78
 
73
79
  export const TYPERT_REMOTE = {
74
80
  package: '@khorsheed/dsh-client-message-tools',
@@ -87,16 +93,18 @@ export const TYPERT_REMOTE = {
87
93
  codec: {
88
94
  mode: 'strict',
89
95
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsEditRequest',
90
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema,
96
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema,
97
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_parameter_0$schema(),
91
98
  },
92
99
  },
93
100
  ],
94
101
  result: {
95
102
  mode: 'strict',
96
103
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsEditResult',
97
- schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema,
104
+ create: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema,
105
+ schema: _khorsheed_dsh_client_message_tools_messageTools_edit_result$schema(),
98
106
  },
99
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":135,"column":9},
107
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":140,"column":9},
100
108
  },
101
109
  {
102
110
  id: '@khorsheed/dsh-client-message-tools#messageTools/restore',
@@ -112,16 +120,18 @@ export const TYPERT_REMOTE = {
112
120
  codec: {
113
121
  mode: 'strict',
114
122
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreRequest',
115
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema,
123
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema,
124
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_parameter_0$schema(),
116
125
  },
117
126
  },
118
127
  ],
119
128
  result: {
120
129
  mode: 'strict',
121
130
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsRestoreResult',
122
- schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema,
131
+ create: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema,
132
+ schema: _khorsheed_dsh_client_message_tools_messageTools_restore_result$schema(),
123
133
  },
124
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":97,"column":9},
134
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":102,"column":9},
125
135
  },
126
136
  {
127
137
  id: '@khorsheed/dsh-client-message-tools#messageTools/withdraw',
@@ -137,16 +147,18 @@ export const TYPERT_REMOTE = {
137
147
  codec: {
138
148
  mode: 'strict',
139
149
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawRequest',
140
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema,
150
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema,
151
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_parameter_0$schema(),
141
152
  },
142
153
  },
143
154
  ],
144
155
  result: {
145
156
  mode: 'strict',
146
157
  typeSymbol: '@khorsheed/dsh-client-message-tools/types#MessageToolsWithdrawResult',
147
- schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema,
158
+ create: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema,
159
+ schema: _khorsheed_dsh_client_message_tools_messageTools_withdraw_result$schema(),
148
160
  },
149
- sourceLocation: {"file":"packages/message-tools/src/index.ts","line":63,"column":9},
161
+ sourceLocation: {"file":"packages/message-tools/src/index.ts","line":68,"column":9},
150
162
  },
151
163
  ],
152
164
  }
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  * seat (ModelSelect), simplified to one scrollable menu.
9
9
  */
10
10
  import { useEffect, useRef, useState } from 'react';
11
- import { IconCheckOutline16, IconChevronDownOutline14 } from '@deepseek-ai/dsh-client-ui-primitives';
11
+ import { IconCheckOutlineMedium, IconChevronDownOutlineMedium } from './icons.js';
12
12
  import css from './ModelChip.module.css';
13
13
  /** The editor's model chip: trigger with current model/effort plus the switch menu. */
14
14
  export function ModelChip({ useModelDirectory, loadModels, selectModel, t }) {
@@ -74,13 +74,13 @@ export function ModelChip({ useModelDirectory, loadModels, selectModel, t }) {
74
74
  });
75
75
  };
76
76
  return (_jsxs("div", { ref: rootRef, className: css.chip, children: [_jsxs("button", { type: "button", className: css.trigger, "aria-label": t('model.aria', { model: modelLabel }), "aria-haspopup": "menu", "aria-expanded": open, title: effortLabel === undefined ? modelLabel : `${modelLabel} · ${effortLabel}`, disabled: busy, onClick: () => { setOpen(!open); if (!open)
77
- loadModels(); }, children: [_jsx("span", { className: css.triggerLabel, children: modelLabel }), effortLabel !== undefined && _jsx("span", { className: css.triggerEffort, children: effortLabel }), _jsx(IconChevronDownOutline14, {})] }), open && (_jsxs("div", { className: css.menu, role: "menu", "aria-label": t('model.menuAria'), "aria-busy": state.status === 'loading', children: [reasoning !== undefined && current !== null && (_jsxs("section", { className: css.group, children: [_jsx("div", { className: css.groupTitle, children: t('model.effort') }), [
77
+ loadModels(); }, children: [_jsx("span", { className: css.triggerLabel, children: modelLabel }), effortLabel !== undefined && _jsx("span", { className: css.triggerEffort, children: effortLabel }), _jsx(IconChevronDownOutlineMedium, {})] }), open && (_jsxs("div", { className: css.menu, role: "menu", "aria-label": t('model.menuAria'), "aria-busy": state.status === 'loading', children: [reasoning !== undefined && current !== null && (_jsxs("section", { className: css.group, children: [_jsx("div", { className: css.groupTitle, children: t('model.effort') }), [
78
78
  ...reasoning.defaultEffort === undefined
79
79
  ? [{ key: 'provider-default', effort: undefined, label: t('model.providerDefault') }]
80
80
  : [],
81
81
  ...reasoning.efforts.map(level => ({ key: level.id, effort: level.id, label: level.name })),
82
- ].map(level => (_jsxs("button", { type: "button", role: "menuitemradio", "aria-checked": effectiveEffort === level.effort, className: css.option, disabled: busy, onClick: () => { chooseEffort(level.effort); }, children: [_jsx("span", { className: css.optionLabel, children: level.label }), _jsx("span", { className: css.check, children: effectiveEffort === level.effort ? _jsx(IconCheckOutline16, {}) : null })] }, level.key)))] })), state.groups.map(group => (_jsxs("section", { className: css.group, children: [_jsx("div", { className: css.groupTitle, children: group.name }), group.models.map((model) => {
82
+ ].map(level => (_jsxs("button", { type: "button", role: "menuitemradio", "aria-checked": effectiveEffort === level.effort, className: css.option, disabled: busy, onClick: () => { chooseEffort(level.effort); }, children: [_jsx("span", { className: css.optionLabel, children: level.label }), _jsx("span", { className: css.check, children: effectiveEffort === level.effort ? _jsx(IconCheckOutlineMedium, {}) : null })] }, level.key)))] })), state.groups.map(group => (_jsxs("section", { className: css.group, children: [_jsx("div", { className: css.groupTitle, children: group.name }), group.models.map((model) => {
83
83
  const selected = current?.provider === group.id && current.model === model.id;
84
- return (_jsxs("button", { type: "button", role: "menuitemradio", "aria-checked": selected, className: css.option, disabled: busy, onClick: () => { chooseModel(group.id, model.id, model.reasoning?.defaultEffort); }, children: [_jsx("span", { className: css.optionLabel, children: model.name }), _jsx("span", { className: css.check, children: selected ? _jsx(IconCheckOutline16, {}) : null })] }, model.id));
84
+ return (_jsxs("button", { type: "button", role: "menuitemradio", "aria-checked": selected, className: css.option, disabled: busy, onClick: () => { chooseModel(group.id, model.id, model.reasoning?.defaultEffort); }, children: [_jsx("span", { className: css.optionLabel, children: model.name }), _jsx("span", { className: css.check, children: selected ? _jsx(IconCheckOutlineMedium, {}) : null })] }, model.id));
85
85
  })] }, group.id))), state.status === 'ready' && state.groups.length === 0 && (_jsx("div", { className: css.empty, children: t('model.empty') }))] })), failed && _jsx("span", { className: css.selectFailed, role: "status", children: t('model.selectFailed') })] }));
86
86
  }
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  */
12
12
  import { useMemo } from 'react';
13
13
  import { MarkdownText } from '@deepseek-ai/dsh-client-ui-primitives';
14
- import { IconUndoOutline16 } from './icons.js';
14
+ import { IconUndoOutlineMedium } from './icons-local.js';
15
15
  import css from './RestoredMessageView.module.css';
16
16
  /** Localized Markdown chrome (code-fence copy buttons, footnotes) over the message-tools namespace. */
17
17
  function markdownLabels(t) {
@@ -24,5 +24,5 @@ function markdownLabels(t) {
24
24
  export function RestoredMessageView({ node, t }) {
25
25
  const data = node.data;
26
26
  const labels = useMemo(() => markdownLabels(t), [t]);
27
- return (_jsxs("div", { className: css.restoredAssistantRow, children: [_jsxs("div", { className: css.restoredLabel, children: [_jsx(IconUndoOutline16, {}), _jsx("span", { children: t('restored.assistant') })] }), _jsx(MarkdownText, { text: data.text, labels: labels })] }));
27
+ return (_jsxs("div", { className: css.restoredAssistantRow, children: [_jsxs("div", { className: css.restoredLabel, children: [_jsx(IconUndoOutlineMedium, {}), _jsx("span", { children: t('restored.assistant') })] }), _jsx(MarkdownText, { text: data.text, labels: labels })] }));
28
28
  }
@@ -12,8 +12,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
12
12
  */
13
13
  import { memo, useEffect, useRef, useState } from 'react';
14
14
  import { shallowEqual } from '@deepseek-ai/dsh-client-store';
15
- import { Button, IconCheckOutline16, IconCopyOutline16, IconEditOutline16, JsonBlock, MessageText, RiskConfirmation, Tooltip, writeClipboard, } from '@deepseek-ai/dsh-client-ui-primitives';
16
- import { IconUndoOutline16 } from './icons.js';
15
+ import { Button, JsonBlock, RiskConfirmation, Tooltip, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives';
16
+ import { IconCheckOutlineMedium, IconCopyOutlineMedium, IconEditOutlineMedium } from './icons.js';
17
+ import { IconUndoOutlineMedium } from './icons-local.js';
17
18
  import { foldHiddenRanges, isSeqHidden } from './withdrawn-node.js';
18
19
  import { chatHookOf } from './chat-hook.js';
19
20
  import { withdrawAndBackfill } from './withdraw-backfill.js';
@@ -51,15 +52,18 @@ function projectUserText(text) {
51
52
  const tokenStart = m.index + (m[1]?.length ?? 0);
52
53
  /* v8 ignore next -- the token group always participates in a match, so m[2] is never undefined. */
53
54
  const label = m[2] ?? '';
55
+ // Plain runs render through the local text-run block (the official
56
+ // `MessageText` primitive was retired in host 0.1.5; `.textRun` keeps its
57
+ // exact metrics).
54
58
  if (tokenStart > cursor)
55
- parts.push(_jsx(MessageText, { text: text.slice(cursor, tokenStart) }, cursor));
59
+ parts.push(_jsx("div", { className: css.textRun, children: text.slice(cursor, tokenStart) }, cursor));
56
60
  parts.push(_jsx("span", { className: css.refChip, "data-ref-chip": label.startsWith('@') ? 'subagent' : 'skill', children: label }, tokenStart));
57
61
  cursor = tokenStart + label.length;
58
62
  }
59
63
  if (parts.length === 0)
60
- return _jsx(MessageText, { text: text });
64
+ return _jsx("div", { className: css.textRun, children: text });
61
65
  if (cursor < text.length)
62
- parts.push(_jsx(MessageText, { text: text.slice(cursor) }, cursor));
66
+ parts.push(_jsx("div", { className: css.textRun, children: text.slice(cursor) }, cursor));
63
67
  return _jsx(_Fragment, { children: parts });
64
68
  }
65
69
  /** Copy action: the copy icon swaps to a short-lived check after a successful write. */
@@ -92,7 +96,7 @@ function CopyButton({ text, t }) {
92
96
  }, 1000);
93
97
  });
94
98
  };
95
- return (_jsx(Tooltip, { label: copied ? t('copied') : t('copy'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": copied ? t('copied') : t('copy'), onClick: onCopy, children: copied ? _jsx(IconCheckOutline16, {}) : _jsx(IconCopyOutline16, {}) }) }));
99
+ return (_jsx(Tooltip, { label: copied ? t('copied') : t('copy'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": copied ? t('copied') : t('copy'), onClick: onCopy, children: copied ? _jsx(IconCheckOutlineMedium, {}) : _jsx(IconCopyOutlineMedium, {}) }) }));
96
100
  }
97
101
  /** Cap for the auto-grown edit box height; longer text scrolls inside it. */
98
102
  const EDITOR_MAX_HEIGHT = 240;
@@ -171,5 +175,5 @@ export const UserMessageView = memo(function UserMessageView({ node, renderMessa
171
175
  ? { useModelDirectory, loadModels, selectModel, t }
172
176
  : undefined }), failed === 'edit' && _jsx("div", { className: css.actionError, role: "status", children: t('error.edit') })] }) }));
173
177
  }
174
- return (_jsxs("div", { className: css.userRow, "data-time-hover-root": true, children: [_jsxs("div", { className: css.userStack, children: [node.kind === 'message-tools-edited' && (_jsx("div", { className: css.editedLabel, children: t('edited.badge') })), node.kind === 'message-tools-restored' && (_jsx("div", { className: css.editedLabel, children: t('withdrawn.restored') })), images.length > 0 ? renderMessageImages({ images, align: 'end' }) : null, showBubble && (_jsxs("div", { className: css.bubble, children: [projectUserText(text), rest.map((block, index) => (_jsx(JsonBlock, { label: t('message.extraBlock'), payload: block, truncatedLabel: truncated }, index)))] }))] }), _jsxs("div", { className: css.actions, children: [_jsx(CopyButton, { text: text, t: t }), _jsx(Tooltip, { label: t('edit'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": t('edit'), onClick: () => { setFailed(null); setEditing(true); }, children: _jsx(IconEditOutline16, {}) }) }), _jsx(Tooltip, { label: t('action.withdraw'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": t('action.withdraw'), onClick: () => { setFailed(null); setAcknowledged(false); setConfirming(true); }, children: _jsx(IconUndoOutline16, {}) }) })] }), failed === 'withdraw' && _jsx("div", { className: css.actionError, role: "status", children: t('error.withdraw') }), confirming && (_jsx(RiskConfirmation, { open: true, title: t('withdraw.title'), description: t('withdraw.description'), acknowledgeLabel: t('withdraw.acknowledge'), cancelLabel: t('cancel'), closeLabel: t('close'), confirmLabel: t('withdraw.confirm'), acknowledged: acknowledged, disabled: busy, onAcknowledgedChange: setAcknowledged, onCancel: () => { setConfirming(false); setAcknowledged(false); }, onConfirm: confirmWithdraw }))] }));
178
+ return (_jsxs("div", { className: css.userRow, "data-time-hover-root": true, children: [_jsxs("div", { className: css.userStack, children: [node.kind === 'message-tools-edited' && (_jsx("div", { className: css.editedLabel, children: t('edited.badge') })), node.kind === 'message-tools-restored' && (_jsx("div", { className: css.editedLabel, children: t('withdrawn.restored') })), images.length > 0 ? renderMessageImages({ images, align: 'end' }) : null, showBubble && (_jsxs("div", { className: css.bubble, children: [projectUserText(text), rest.map((block, index) => (_jsx(JsonBlock, { label: t('message.extraBlock'), payload: block, truncatedLabel: truncated }, index)))] }))] }), _jsxs("div", { className: css.actions, children: [_jsx(CopyButton, { text: text, t: t }), _jsx(Tooltip, { label: t('edit'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": t('edit'), onClick: () => { setFailed(null); setEditing(true); }, children: _jsx(IconEditOutlineMedium, {}) }) }), _jsx(Tooltip, { label: t('action.withdraw'), side: "bottom", children: _jsx("button", { type: "button", className: css.action, "aria-label": t('action.withdraw'), onClick: () => { setFailed(null); setAcknowledged(false); setConfirming(true); }, children: _jsx(IconUndoOutlineMedium, {}) }) })] }), failed === 'withdraw' && _jsx("div", { className: css.actionError, role: "status", children: t('error.withdraw') }), confirming && (_jsx(RiskConfirmation, { open: true, title: t('withdraw.title'), description: t('withdraw.description'), acknowledgeLabel: t('withdraw.acknowledge'), cancelLabel: t('cancel'), closeLabel: t('close'), confirmLabel: t('withdraw.confirm'), acknowledged: acknowledged, disabled: busy, onAcknowledgedChange: setAcknowledged, onCancel: () => { setConfirming(false); setAcknowledged(false); }, onConfirm: confirmWithdraw }))] }));
175
179
  });
@@ -2,7 +2,8 @@
2
2
  * Withdrawal divider row ('message-tools-withdrawn' keyed renderer), redone
3
3
  * in the official compaction-marker visual language: one dim clickable row
4
4
  * (chevron +「已撤回 N 条消息」), expanding in place to a read-only replay of
5
- * the withdrawn span (user originals + assistant text) with a「恢复到对话
5
+ * the withdrawn span (user originals — text and attached images — plus
6
+ * assistant text) with a「恢复到对话
6
7
  * 末尾」action. The restore tail-replays the span's replayable entries (user
7
8
  * messages + assistant text) — the surface fold is positional, so in-place
8
9
  * restoration is impossible — and the divider carries a「已恢复」badge while
@@ -13,5 +14,5 @@
13
14
  import { type ReactNode } from 'react';
14
15
  import type { WithdrawnDividerViewProps } from './slots.ts';
15
16
  /** The withdrawal divider: collapsed marker row plus the expandable replay. */
16
- export declare function WithdrawnDividerView({ node, t, restoreMessage, ...standard }: WithdrawnDividerViewProps): ReactNode;
17
+ export declare function WithdrawnDividerView({ node, t, restoreMessage, renderMessageImages, ...standard }: WithdrawnDividerViewProps): ReactNode;
17
18
  //# sourceMappingURL=WithdrawnDividerView.d.ts.map
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Withdrawal divider row ('message-tools-withdrawn' keyed renderer), redone
4
4
  * in the official compaction-marker visual language: one dim clickable row
5
5
  * (chevron +「已撤回 N 条消息」), expanding in place to a read-only replay of
6
- * the withdrawn span (user originals + assistant text) with a「恢复到对话
6
+ * the withdrawn span (user originals — text and attached images — plus
7
+ * assistant text) with a「恢复到对话
7
8
  * 末尾」action. The restore tail-replays the span's replayable entries (user
8
9
  * messages + assistant text) — the surface fold is positional, so in-place
9
10
  * restoration is impossible — and the divider carries a「已恢复」badge while
@@ -12,14 +13,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  * once withdrawals backfill the draft automatically.
13
14
  */
14
15
  import { useState } from 'react';
15
- import { Button, IconChevronDownOutline14, IconChevronRightOutline14, MessageText } from '@deepseek-ai/dsh-client-ui-primitives';
16
- import { IconUndoOutline16 } from './icons.js';
16
+ import { Button } from '@deepseek-ai/dsh-client-ui-primitives';
17
+ import { IconChevronDownOutlineMedium, IconChevronRightOutlineMedium } from './icons.js';
18
+ import { IconUndoOutlineMedium } from './icons-local.js';
17
19
  import { collectWithdrawnEntries, countHiddenInSpan, foldHiddenRanges, hasRestoreForSpan, isRestoreSuperseded, } from './withdrawn-node.js';
18
20
  import { chatHookOf } from './chat-hook.js';
19
21
  import css from './WithdrawnDividerView.module.css';
20
22
  /** The withdrawal divider: collapsed marker row plus the expandable replay. */
21
- export function WithdrawnDividerView({ node, t, restoreMessage, ...standard }) {
23
+ export function WithdrawnDividerView({ node, t, restoreMessage, renderMessageImages, ...standard }) {
22
24
  const data = node.data;
25
+ // The gallery closure is a required owner prop of every `conversation.chat.node`
26
+ // renderer; widening it to `| undefined` keeps the degrade path explicit — a
27
+ // composition without the attachment UI replays text only instead of throwing.
28
+ const renderImages = renderMessageImages;
23
29
  const [expanded, setExpanded] = useState(false);
24
30
  const [entries, setEntries] = useState(null);
25
31
  const [busy, setBusy] = useState(false);
@@ -59,5 +65,5 @@ export function WithdrawnDividerView({ node, t, restoreMessage, ...standard }) {
59
65
  .catch(() => { setFailed(true); })
60
66
  .finally(() => { setBusy(false); });
61
67
  };
62
- return (_jsxs("div", { className: css.row, children: [_jsxs("button", { type: "button", className: css.marker, "aria-expanded": expanded, "aria-label": t('withdrawn.expand'), onClick: toggle, children: [_jsx("span", { className: css.leading, "aria-hidden": true, children: expanded ? _jsx(IconChevronDownOutline14, {}) : _jsx(IconChevronRightOutline14, {}) }), _jsx("span", { className: css.title, children: t('withdrawn.divider', { count }) }), restored && (_jsxs("span", { className: css.badge, children: [_jsx(IconUndoOutline16, {}), t('withdrawn.restored')] }))] }), expanded && (_jsxs("div", { className: css.body, children: [entries === null || entries.length === 0 ? (_jsx("div", { className: css.empty, children: t('withdrawn.empty') })) : (entries.map((entry, index) => (_jsxs("div", { className: entry.kind === 'user' ? css.entryUser : css.entryAssistant, children: [_jsx("div", { className: css.entryKind, children: entry.kind === 'user' ? t('withdrawn.entryUser') : t('withdrawn.entryAssistant') }), _jsx(MessageText, { text: entry.text })] }, index)))), _jsxs("div", { className: css.restoreRow, children: [_jsx(Button, { variant: "outline", disabled: busy || restored || superseded, onClick: restore, children: t('withdrawn.restore') }), failed && _jsx("span", { className: css.restoreFailed, role: "status", children: t('withdrawn.restoreFailed') })] })] }))] }));
68
+ return (_jsxs("div", { className: css.row, children: [_jsxs("button", { type: "button", className: css.marker, "aria-expanded": expanded, "aria-label": t('withdrawn.expand'), onClick: toggle, children: [_jsx("span", { className: css.leading, "aria-hidden": true, children: expanded ? _jsx(IconChevronDownOutlineMedium, {}) : _jsx(IconChevronRightOutlineMedium, {}) }), _jsx("span", { className: css.title, children: t('withdrawn.divider', { count }) }), restored && (_jsxs("span", { className: css.badge, children: [_jsx(IconUndoOutlineMedium, {}), t('withdrawn.restored')] }))] }), expanded && (_jsxs("div", { className: css.body, children: [entries === null || entries.length === 0 ? (_jsx("div", { className: css.empty, children: t('withdrawn.empty') })) : (entries.map((entry, index) => (_jsxs("div", { className: entry.kind === 'user' ? css.entryUser : css.entryAssistant, children: [_jsx("div", { className: css.entryKind, children: entry.kind === 'user' ? t('withdrawn.entryUser') : t('withdrawn.entryAssistant') }), entry.text !== '' && _jsx("div", { className: css.textRun, children: entry.text }), renderImages !== undefined && entry.images.length > 0 && (_jsx("div", { className: css.entryImages, children: renderImages({ images: entry.images, align: 'end' }) }))] }, index)))), _jsxs("div", { className: css.restoreRow, children: [_jsx(Button, { variant: "outline", disabled: busy || restored || superseded, onClick: restore, children: t('withdrawn.restore') }), failed && _jsx("span", { className: css.restoreFailed, role: "status", children: t('withdrawn.restoreFailed') })] })] }))] }));
63
69
  }
@@ -9,6 +9,7 @@ const EMPTY_CHAT = {
9
9
  nodes: {
10
10
  get: () => undefined,
11
11
  source: () => ({ getSnapshot: () => undefined, subscribe: () => () => { } }),
12
+ turnDataSource: () => ({ getSnapshot: () => [], subscribe: () => () => { } }),
12
13
  processSource: () => ({ getSnapshot: () => undefined, subscribe: () => () => { } }),
13
14
  values: () => [],
14
15
  },
@@ -1,6 +1,14 @@
1
1
  import { chatSourceOf } from './chat-hook.js';
2
- import { MESSAGE_TOOLS_PLUGIN, messageToolsOp } from '../marker.js';
2
+ import { isMessageToolsSource, messageToolsOp } from '../marker.js';
3
3
  import { foldHiddenRanges, isSeqHidden } from './withdrawn-node.js';
4
+ /**
5
+ * The main-view session: host 0.1.6-alpha.2 dropped SessionListState.current
6
+ * for the retainedBy.mainView count on each summary (the label is ui-session's
7
+ * declaration merge, read here as a plain duck-typed count so this package
8
+ * needs no ui-session edge), with the legacy field as the older-host fallback.
9
+ */
10
+ const mainSessionId = (list) => Object.values(list.byId ?? {}).find(session => (session.retainedBy?.mainView ?? 0) > 0)?.id
11
+ ?? list.current;
4
12
  /**
5
13
  * Flow keys of every chat node inside a hidden span. The withdrawal divider
6
14
  * itself (`message-tools-withdrawn`, anchored at the span's exclusive end) is
@@ -25,12 +33,11 @@ export function hiddenFlowKeys(nodes, ranges) {
25
33
  continue;
26
34
  if (node.kind === 'context') {
27
35
  const data = node.data;
28
- const source = data.source;
29
36
  // Every message-tools context row is a presentation duplicate or a
30
37
  // wake-only trigger: restore replays are rendered by the plugin's own
31
38
  // rows, edit triggers are never transcript content, and withdrawal /
32
39
  // edit replacements are not append-surface context rows at all.
33
- if (source?.kind === 'plugin' && source.plugin === MESSAGE_TOOLS_PLUGIN
40
+ if (isMessageToolsSource(data.source)
34
41
  || restoredSeqs.has(data.seq ?? -1)
35
42
  || messageToolsOp(data.source) === 'edit-trigger') {
36
43
  keys.push(node.key);
@@ -167,7 +174,7 @@ export function installDomHider(ctx, options = {}) {
167
174
  });
168
175
  };
169
176
  const bindCurrent = () => {
170
- const current = ctx.sessions.list.getSnapshot().current;
177
+ const current = mainSessionId(ctx.sessions.list.getSnapshot());
171
178
  if (current === activeSession && stopSession !== undefined)
172
179
  return;
173
180
  stopSession?.();
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Package-owned icons matching the official outline-icon conventions (16×16
3
+ * viewBox, `fill="currentColor"` path geometry) for glyphs ui-primitives
4
+ * does not ship.
5
+ */
6
+ /** Props of one package-owned icon. */
7
+ export interface LocalIconProps {
8
+ /** Rendered edge length in px (icons are authored at 16). */
9
+ size?: number;
10
+ /** Optional composed class. */
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Undo arrow (withdraw/restore), rotate-ccw style: a near-full circle arc
15
+ * (~290°, opening at the top) with a corner arrowhead at its left end
16
+ * pointing the counterclockwise direction. ui-primitives ships no undo/revert
17
+ * glyph, and its refresh glyph carries reload semantics, so this package
18
+ * draws its own.
19
+ * @param props - size and className.
20
+ * @returns the icon element.
21
+ */
22
+ export declare const IconUndoOutlineMedium: ({ size, className }: LocalIconProps) => import("react").JSX.Element;
23
+ //# sourceMappingURL=icons-local.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Undo arrow (withdraw/restore), rotate-ccw style: a near-full circle arc
4
+ * (~290°, opening at the top) with a corner arrowhead at its left end
5
+ * pointing the counterclockwise direction. ui-primitives ships no undo/revert
6
+ * glyph, and its refresh glyph carries reload semantics, so this package
7
+ * draws its own.
8
+ * @param props - size and className.
9
+ * @returns the icon element.
10
+ */
11
+ export const IconUndoOutlineMedium = ({ size = 16, className }) => (_jsxs("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.4, strokeLinecap: "round", strokeLinejoin: "round", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M2.2 8.7 A5.8 5.8 0 1 0 5.9 3.3 L2.6 6.6" }), _jsx("path", { d: "M2.6 2.4 V6.6 H6.2", fill: "none" })] }));
@@ -1,23 +1,22 @@
1
1
  /**
2
- * Package-owned icons matching the official outline-icon conventions (16×16
3
- * viewBox, `fill="currentColor"` path geometry) for glyphs ui-primitives
4
- * does not ship.
2
+ * Generated by scripts/sync-icon-artwork.mts from @deepseek-ai/dsh-client-ui-primitives
3
+ * (v0.1.7-rc.1, harness 46a7f68b09) — do not edit by hand. The 0.1.5 and rc.1 host lines
4
+ * share no icon export name, so the rc.1 artwork is inlined here: pure SVG,
5
+ * no host runtime identity, identical on every line. Re-run the generator
6
+ * after adding an icon import or bumping the harness checkout.
7
+ *
8
+ * @module @khorsheed/dsh-client-message-tools/client
5
9
  */
6
- /** Props of one package-owned icon. */
7
- export interface LocalIconProps {
8
- /** Rendered edge length in px (icons are authored at 16). */
9
- size?: number;
10
- /** Optional composed class. */
11
- className?: string;
10
+ /** Shared props for every product icon component (mirrors the upstream IconProps). */
11
+ export interface IconProps {
12
+ /** Square edge in px; defaults to the glyph's own drawn size. */
13
+ size?: number | undefined;
14
+ /** Extra class for layout placement; color rides currentColor. */
15
+ className?: string | undefined;
12
16
  }
13
- /**
14
- * Undo arrow (withdraw/restore), rotate-ccw style: a near-full circle arc
15
- * (~290°, opening at the top) with a corner arrowhead at its left end
16
- * pointing the counterclockwise direction. ui-primitives ships no undo/revert
17
- * glyph, and its refresh glyph carries reload semantics, so this package
18
- * draws its own.
19
- * @param props - size and className.
20
- * @returns the icon element.
21
- */
22
- export declare const IconUndoOutline16: ({ size, className }: LocalIconProps) => import("react").JSX.Element;
17
+ export declare const IconCheckOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
18
+ export declare const IconChevronDownOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
19
+ export declare const IconChevronRightOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
20
+ export declare const IconCopyOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
21
+ export declare const IconEditOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
23
22
  //# sourceMappingURL=icons.d.ts.map