@khorsheed/dsh-message-timeline 0.1.0 → 0.2.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.
- package/CHANGELOG.md +8 -0
- package/README.en.md +18 -10
- package/README.i18n.yaml +2 -2
- package/README.md +34 -26
- package/lib/client.js +175 -39
- package/lib/client.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/client/TimelineRail.d.ts +1 -1
- package/lib/types/client/TimelineRail.d.ts.map +1 -1
- package/lib/types/client/TimelineRail.js +69 -5
- package/lib/types/client/chat-hook.d.ts +35 -0
- package/lib/types/client/chat-hook.d.ts.map +1 -0
- package/lib/types/client/chat-hook.js +15 -0
- package/lib/types/client/hidden-spans.d.ts +40 -0
- package/lib/types/client/hidden-spans.d.ts.map +1 -0
- package/lib/types/client/hidden-spans.js +40 -0
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/rail-tracker.d.ts +23 -11
- package/lib/types/client/rail-tracker.d.ts.map +1 -1
- package/lib/types/client/rail-tracker.js +98 -32
- package/lib/types/client/slots.d.ts +6 -2
- package/lib/types/client/slots.d.ts.map +1 -1
- package/lib/types/client/timeline-kinds.d.ts +32 -0
- package/lib/types/client/timeline-kinds.d.ts.map +1 -0
- package/lib/types/client/timeline-kinds.js +36 -0
- package/package.json +17 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-kinds.d.ts","sourceRoot":"","sources":["../../../src/client/timeline-kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wEAAwE;AACxE,eAAO,MAAM,SAAS,yBAAyB,CAAA;AAC/C,+EAA+E;AAC/E,eAAO,MAAM,aAAa,2BAA2B,CAAA;AAErD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,OAAO,CAGjF;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline node-kind classification. The rail's projection (which store nodes
|
|
3
|
+
* become rows) and its DOM tracking (which flow rows read as the reading
|
|
4
|
+
* position) must agree on the set of "timeline row" kinds, and the hidden-
|
|
5
|
+
* span fold must agree on the set of "span carrier" kinds. Rather than repeat
|
|
6
|
+
* these inline predicates at every site — where a future kind could be added
|
|
7
|
+
* to one place and silently missed in another — they live here as the single
|
|
8
|
+
* source of truth. Both are pure and read only the `kind` string, so they hold
|
|
9
|
+
* no dependency on the message-tools package and work for any session.
|
|
10
|
+
*/
|
|
11
|
+
/** A message-tools edited-bubble row (an in-place edit replacement). */
|
|
12
|
+
export const EDIT_KIND = 'message-tools-edited';
|
|
13
|
+
/** A message-tools restored row (a withdrawn message replayed at the tail). */
|
|
14
|
+
export const RESTORED_KIND = 'message-tools-restored';
|
|
15
|
+
/**
|
|
16
|
+
* Whether a node kind renders as a timeline row. The rail lists user messages
|
|
17
|
+
* (and optionally steering), plus the message-tools edited/restored bubbles
|
|
18
|
+
* that the host `order` does not always surface.
|
|
19
|
+
* @param kind - the node's kind string.
|
|
20
|
+
* @param includeSteering - whether steering rows count as user messages.
|
|
21
|
+
* @returns true when the kind belongs on the timeline.
|
|
22
|
+
*/
|
|
23
|
+
export function isTimelineRowKind(kind, includeSteering) {
|
|
24
|
+
return kind === 'user' || (includeSteering && kind === 'steering')
|
|
25
|
+
|| kind === EDIT_KIND || kind === RESTORED_KIND;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether a node kind carries a hidden span (`{ hiddenStartSeq, seq }`) that
|
|
29
|
+
* the rail must fold to drop the covered originals. The withdrawal divider and
|
|
30
|
+
* the edited bubble both declare the span they shadow.
|
|
31
|
+
* @param kind - the node's kind string.
|
|
32
|
+
* @returns true when the kind declares a hidden span.
|
|
33
|
+
*/
|
|
34
|
+
export function isHiddenSpanCarrierKind(kind) {
|
|
35
|
+
return kind === 'message-tools-withdrawn' || kind === EDIT_KIND;
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khorsheed/dsh-message-timeline",
|
|
3
3
|
"description": "Message timeline: a flat floating list over the conversation scrollport that jumps to any user message, with a tick-only rest state",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -27,22 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"client": {
|
|
29
29
|
"inject": [
|
|
30
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
31
30
|
"@deepseek-ai/dsh-client-locale",
|
|
32
31
|
"@deepseek-ai/dsh-client-ui-conversation"
|
|
33
32
|
],
|
|
34
|
-
"platform": "web"
|
|
33
|
+
"platform": "web",
|
|
34
|
+
"immediately": false
|
|
35
35
|
},
|
|
36
36
|
"compat": {
|
|
37
|
-
"minHost": "0.1.
|
|
38
|
-
"verifiedHost": "0.1.
|
|
37
|
+
"minHost": "0.1.2-rc.1",
|
|
38
|
+
"verifiedHost": "0.1.2-rc.1"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
44
44
|
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
|
|
45
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
46
45
|
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
|
|
47
46
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
48
47
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
@@ -51,13 +50,18 @@
|
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
52
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-client-
|
|
57
|
-
"@deepseek-ai/dsh-client-
|
|
58
|
-
"@deepseek-ai/dsh-client-
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
53
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.2-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.2-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-chat": "^0.1.2-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.2-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
|
|
61
65
|
"@testing-library/react": "^16.1.0",
|
|
62
66
|
"@types/node": "^26.2.0",
|
|
63
67
|
"@types/react": "~18.3.1",
|