dsh-working-activity 0.2.0 → 0.2.2
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/LICENSE +28 -28
- package/README.md +122 -120
- package/README.zh.md +3 -1
- package/cordis.patch.yml +19 -19
- package/lib/client.js +7 -7
- package/lib/client.js.map +1 -1
- package/lib/types/index.d.ts +7 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +2 -2
- package/package.json +106 -92
- package/src/client/WorkingLine.module.css +74 -74
- package/src/client/WorkingLine.tsx +37 -37
- package/src/client/activity.ts +50 -50
- package/src/client/css-modules.d.ts +6 -6
- package/src/client/index.ts +42 -42
- package/src/events.ts +45 -45
- package/src/index.ts +217 -211
- package/src/invariant.ts +69 -69
- package/src/status.ts +501 -501
package/package.json
CHANGED
|
@@ -1,92 +1,106 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-working-activity",
|
|
3
|
-
"description": "Live model working-status line: playful copy, running tool, turn elapsed — for TUI prompt and Web UI",
|
|
4
|
-
"version": "0.2.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/types/index.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/types/index.d.ts",
|
|
11
|
-
"default": "./lib/types/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client": {
|
|
14
|
-
"types": "./lib/types/client/index.d.ts",
|
|
15
|
-
"default": "./lib/client.js"
|
|
16
|
-
},
|
|
17
|
-
"./events": {
|
|
18
|
-
"types": "./lib/types/events.d.ts",
|
|
19
|
-
"default": "./lib/types/events.js"
|
|
20
|
-
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/types/invariant.js"
|
|
24
|
-
},
|
|
25
|
-
"./status": {
|
|
26
|
-
"types": "./lib/types/status.d.ts",
|
|
27
|
-
"default": "./lib/types/status.js"
|
|
28
|
-
},
|
|
29
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
30
|
-
"./src/*": "./src/*",
|
|
31
|
-
"./package.json": "./package.json"
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"lib",
|
|
35
|
-
"src",
|
|
36
|
-
"cordis.patch.yml"
|
|
37
|
-
],
|
|
38
|
-
"engines": {
|
|
39
|
-
"node": "^22.19 || >=24"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
|
|
43
|
-
"build:client": "tsdown -c tsdown.config.ts"
|
|
44
|
-
},
|
|
45
|
-
"license": "BSD-3-Clause",
|
|
46
|
-
"dsh": {
|
|
47
|
-
"bundle": {
|
|
48
|
-
"patch": "./cordis.patch.yml"
|
|
49
|
-
},
|
|
50
|
-
"client": {
|
|
51
|
-
"platform": "web",
|
|
52
|
-
"inject": [
|
|
53
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-conversation",
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-slots"
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@deepseek-ai/schemastery": "^3.18.1"
|
|
61
|
-
},
|
|
62
|
-
"peerDependencies": {
|
|
63
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
64
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
65
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
66
|
-
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
67
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
|
|
68
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
71
|
-
"react": "^18.2.0"
|
|
72
|
-
},
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
75
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
76
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.0-rc.6",
|
|
77
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.0-rc.6",
|
|
78
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
79
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
80
|
-
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
81
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
|
|
82
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
83
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
|
|
84
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
85
|
-
"@types/node": "^22.0.0",
|
|
86
|
-
"@types/react": "~18.3.1",
|
|
87
|
-
"lightningcss": "^1.32.0",
|
|
88
|
-
"react": "^18.2.0",
|
|
89
|
-
"tsdown": "^0.22.2",
|
|
90
|
-
"typescript": "^6.0.3"
|
|
91
|
-
}
|
|
92
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-working-activity",
|
|
3
|
+
"description": "Live model working-status line: playful copy, running tool, turn elapsed — for TUI prompt and Web UI",
|
|
4
|
+
"version": "0.2.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/types/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/types/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": {
|
|
14
|
+
"types": "./lib/types/client/index.d.ts",
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./events": {
|
|
18
|
+
"types": "./lib/types/events.d.ts",
|
|
19
|
+
"default": "./lib/types/events.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/types/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./status": {
|
|
26
|
+
"types": "./lib/types/status.d.ts",
|
|
27
|
+
"default": "./lib/types/status.js"
|
|
28
|
+
},
|
|
29
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
30
|
+
"./src/*": "./src/*",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"lib",
|
|
35
|
+
"src",
|
|
36
|
+
"cordis.patch.yml"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": "^22.19 || >=24"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
|
|
43
|
+
"build:client": "tsdown -c tsdown.config.ts"
|
|
44
|
+
},
|
|
45
|
+
"license": "BSD-3-Clause",
|
|
46
|
+
"dsh": {
|
|
47
|
+
"bundle": {
|
|
48
|
+
"patch": "./cordis.patch.yml"
|
|
49
|
+
},
|
|
50
|
+
"client": {
|
|
51
|
+
"platform": "web",
|
|
52
|
+
"inject": [
|
|
53
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-slots"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
64
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
65
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
66
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
67
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
|
|
68
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
71
|
+
"react": "^18.2.0"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
75
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
76
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.0-rc.6",
|
|
77
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.0-rc.6",
|
|
78
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
79
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
80
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
81
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
|
|
82
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
83
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6",
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
85
|
+
"@types/node": "^22.0.0",
|
|
86
|
+
"@types/react": "~18.3.1",
|
|
87
|
+
"lightningcss": "^1.32.0",
|
|
88
|
+
"react": "^18.2.0",
|
|
89
|
+
"tsdown": "^0.22.2",
|
|
90
|
+
"typescript": "^6.0.3"
|
|
91
|
+
},
|
|
92
|
+
"peerDependenciesMeta": {
|
|
93
|
+
"@deepseek-ai/dsh-client-runtime": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-conversation": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"react": {
|
|
103
|
+
"optional": true
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
/* Working line row: one dim line with a phase-colored breathing marker and
|
|
2
|
-
the turn's tool-count badge, sized to the composer dock inset like the
|
|
3
|
-
queue strip. Mirrors the pre-slots patch's WorkingLine visuals, re-targeted
|
|
4
|
-
at the rc.6 design tokens. */
|
|
5
|
-
|
|
6
|
-
.line {
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
gap: 8px;
|
|
11
|
-
width: 100%;
|
|
12
|
-
max-width: var(--dsh-composer-card-max-width);
|
|
13
|
-
margin: 0 auto;
|
|
14
|
-
padding: 4px 16px 0;
|
|
15
|
-
font-family: var(--dsw-font-family);
|
|
16
|
-
font-size: 13px;
|
|
17
|
-
line-height: 18px;
|
|
18
|
-
color: var(--dsw-alias-label-secondary);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.marker {
|
|
22
|
-
flex: none;
|
|
23
|
-
width: 7px;
|
|
24
|
-
height: 7px;
|
|
25
|
-
border-radius: 50%;
|
|
26
|
-
background: var(--dsw-alias-label-tertiary);
|
|
27
|
-
animation: working-pulse 1.6s ease-in-out infinite;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* The model's turn is done: steady marker in the brand tone, no pulse. */
|
|
31
|
-
.line[data-activity-phase='done'] .marker {
|
|
32
|
-
background: var(--dsw-alias-state-business-primary);
|
|
33
|
-
animation: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* A tool is actually executing: brand-tone pulse. */
|
|
37
|
-
.line[data-activity-phase='tool'] .marker {
|
|
38
|
-
background: var(--dsw-alias-state-business-primary);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* Waiting for the first token: muted pulse. */
|
|
42
|
-
.line[data-activity-phase='waiting'] .marker {
|
|
43
|
-
background: var(--dsw-alias-label-tertiary);
|
|
44
|
-
opacity: 0.6;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.text {
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
white-space: nowrap;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.tools {
|
|
54
|
-
flex: none;
|
|
55
|
-
min-width: 18px;
|
|
56
|
-
padding: 0 5px;
|
|
57
|
-
border-radius: 9px;
|
|
58
|
-
background: var(--dsw-alias-surface-tertiary);
|
|
59
|
-
color: var(--dsw-alias-label-secondary);
|
|
60
|
-
font-size: 11px;
|
|
61
|
-
line-height: 18px;
|
|
62
|
-
text-align: center;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@keyframes working-pulse {
|
|
66
|
-
0%,
|
|
67
|
-
100% {
|
|
68
|
-
opacity: 1;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
50% {
|
|
72
|
-
opacity: 0.35;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
/* Working line row: one dim line with a phase-colored breathing marker and
|
|
2
|
+
the turn's tool-count badge, sized to the composer dock inset like the
|
|
3
|
+
queue strip. Mirrors the pre-slots patch's WorkingLine visuals, re-targeted
|
|
4
|
+
at the rc.6 design tokens. */
|
|
5
|
+
|
|
6
|
+
.line {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
max-width: var(--dsh-composer-card-max-width);
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
padding: 4px 16px 0;
|
|
15
|
+
font-family: var(--dsw-font-family);
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
line-height: 18px;
|
|
18
|
+
color: var(--dsw-alias-label-secondary);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.marker {
|
|
22
|
+
flex: none;
|
|
23
|
+
width: 7px;
|
|
24
|
+
height: 7px;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
background: var(--dsw-alias-label-tertiary);
|
|
27
|
+
animation: working-pulse 1.6s ease-in-out infinite;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* The model's turn is done: steady marker in the brand tone, no pulse. */
|
|
31
|
+
.line[data-activity-phase='done'] .marker {
|
|
32
|
+
background: var(--dsw-alias-state-business-primary);
|
|
33
|
+
animation: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* A tool is actually executing: brand-tone pulse. */
|
|
37
|
+
.line[data-activity-phase='tool'] .marker {
|
|
38
|
+
background: var(--dsw-alias-state-business-primary);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Waiting for the first token: muted pulse. */
|
|
42
|
+
.line[data-activity-phase='waiting'] .marker {
|
|
43
|
+
background: var(--dsw-alias-label-tertiary);
|
|
44
|
+
opacity: 0.6;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.text {
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tools {
|
|
54
|
+
flex: none;
|
|
55
|
+
min-width: 18px;
|
|
56
|
+
padding: 0 5px;
|
|
57
|
+
border-radius: 9px;
|
|
58
|
+
background: var(--dsw-alias-surface-tertiary);
|
|
59
|
+
color: var(--dsw-alias-label-secondary);
|
|
60
|
+
font-size: 11px;
|
|
61
|
+
line-height: 18px;
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes working-pulse {
|
|
66
|
+
0%,
|
|
67
|
+
100% {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
50% {
|
|
72
|
+
opacity: 0.35;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
// Working-line dock entry: one dim full-width row above the composer card
|
|
2
|
-
// showing the live working-activity snapshot — phase-colored breathing
|
|
3
|
-
// marker, the host-composed status line, and the turn's tool count badge.
|
|
4
|
-
// Renders for every live phase (waiting/thinking/tool) and the done summary;
|
|
5
|
-
// hides while idle or before the first publish.
|
|
6
|
-
//
|
|
7
|
-
// The 'conversation.input.dock' SlotMap declaration lives in
|
|
8
|
-
// @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts); this
|
|
9
|
-
// entry contributes into it without owning it.
|
|
10
|
-
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
11
|
-
import css from './WorkingLine.module.css'
|
|
12
|
-
|
|
13
|
-
/** Full props of the dock entry: the input-zone runtime share (session standard kit). */
|
|
14
|
-
export type WorkingLineProps = PropsRuntime<'conversation.input.dock'>
|
|
15
|
-
|
|
16
|
-
/** Tool-count badge copy (no locale seat: the line text itself is host-composed). */
|
|
17
|
-
const TOOLS_LABEL = 'tools this turn'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Working-line dock entry: reads the latest activity snapshot off the
|
|
21
|
-
* conversation snapshot and renders the row, or nothing when idle/absent.
|
|
22
|
-
*/
|
|
23
|
-
export function WorkingLine({ useSession }: WorkingLineProps) {
|
|
24
|
-
const activity = useSession(s => s.activity)
|
|
25
|
-
if (activity === null || activity.phase === 'idle' || activity.line === '') return null
|
|
26
|
-
return (
|
|
27
|
-
<div className={css.line} data-activity-phase={activity.phase}>
|
|
28
|
-
<span className={css.marker} aria-hidden="true" />
|
|
29
|
-
<span className={css.text}>{activity.line}</span>
|
|
30
|
-
{activity.toolCount > 0 && (
|
|
31
|
-
<span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>
|
|
32
|
-
{activity.toolCount}
|
|
33
|
-
</span>
|
|
34
|
-
)}
|
|
35
|
-
</div>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
1
|
+
// Working-line dock entry: one dim full-width row above the composer card
|
|
2
|
+
// showing the live working-activity snapshot — phase-colored breathing
|
|
3
|
+
// marker, the host-composed status line, and the turn's tool count badge.
|
|
4
|
+
// Renders for every live phase (waiting/thinking/tool) and the done summary;
|
|
5
|
+
// hides while idle or before the first publish.
|
|
6
|
+
//
|
|
7
|
+
// The 'conversation.input.dock' SlotMap declaration lives in
|
|
8
|
+
// @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts); this
|
|
9
|
+
// entry contributes into it without owning it.
|
|
10
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
11
|
+
import css from './WorkingLine.module.css'
|
|
12
|
+
|
|
13
|
+
/** Full props of the dock entry: the input-zone runtime share (session standard kit). */
|
|
14
|
+
export type WorkingLineProps = PropsRuntime<'conversation.input.dock'>
|
|
15
|
+
|
|
16
|
+
/** Tool-count badge copy (no locale seat: the line text itself is host-composed). */
|
|
17
|
+
const TOOLS_LABEL = 'tools this turn'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Working-line dock entry: reads the latest activity snapshot off the
|
|
21
|
+
* conversation snapshot and renders the row, or nothing when idle/absent.
|
|
22
|
+
*/
|
|
23
|
+
export function WorkingLine({ useSession }: WorkingLineProps) {
|
|
24
|
+
const activity = useSession(s => s.activity)
|
|
25
|
+
if (activity === null || activity.phase === 'idle' || activity.line === '') return null
|
|
26
|
+
return (
|
|
27
|
+
<div className={css.line} data-activity-phase={activity.phase}>
|
|
28
|
+
<span className={css.marker} aria-hidden="true" />
|
|
29
|
+
<span className={css.text}>{activity.line}</span>
|
|
30
|
+
{activity.toolCount > 0 && (
|
|
31
|
+
<span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>
|
|
32
|
+
{activity.toolCount}
|
|
33
|
+
</span>
|
|
34
|
+
)}
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
package/src/client/activity.ts
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side activity snapshot type + the ConversationSnapshot merge that
|
|
3
|
-
* carries it.
|
|
4
|
-
*
|
|
5
|
-
* The host half (@deepseek-ai/dsh-working-activity's node side) publishes
|
|
6
|
-
* `activity/status` session events; the web runtime patch (dsh-client-runtime
|
|
7
|
-
* activity field, shipping separately) narrows those frames into the
|
|
8
|
-
* conversation snapshot's `activity` member. Until that runtime release lands
|
|
9
|
-
* on npm, this module re-declares the field via declaration merging so the
|
|
10
|
-
* dock component type-checks against the published rc.6 types.
|
|
11
|
-
*
|
|
12
|
-
* REMOVE the `declare module` block below once
|
|
13
|
-
* `@deepseek-ai/dsh-client-runtime/client` ships `ConversationSnapshot.activity`
|
|
14
|
-
* natively (the runtime's own `ActivityStatusView` is structurally identical
|
|
15
|
-
* to {@link ActivitySnapshot}; the two then agree by construction).
|
|
16
|
-
* @module @deepseek-ai/dsh-working-activity/client/activity
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/** The `activity/status` phase vocabulary, mirroring the host's ActivityPhase. */
|
|
20
|
-
export type ActivityPhase = 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'
|
|
21
|
-
|
|
22
|
-
/** One `activity/status` snapshot as rendered by the dock line. */
|
|
23
|
-
export interface ActivitySnapshot {
|
|
24
|
-
/** Which activity phase the model is in right now. */
|
|
25
|
-
readonly phase: ActivityPhase
|
|
26
|
-
/** Full human-readable status line (plain text, no ANSI). */
|
|
27
|
-
readonly line: string
|
|
28
|
-
/** Short label of the current work (tool action or stage), when any. */
|
|
29
|
-
readonly label?: string
|
|
30
|
-
/** Detail fragment (path / command / search pattern), when any. */
|
|
31
|
-
readonly detail?: string
|
|
32
|
-
/** The playful phrase currently shown, when any. */
|
|
33
|
-
readonly phrase?: string
|
|
34
|
-
/** Tools completed in the current turn. */
|
|
35
|
-
readonly toolCount: number
|
|
36
|
-
/** Wall-clock milliseconds since the current turn started (0 when idle). */
|
|
37
|
-
readonly turnElapsedMs: number
|
|
38
|
-
/** Wall-clock time the current phase started, for animations. */
|
|
39
|
-
readonly phaseStartedAt: number
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
declare module '@deepseek-ai/dsh-client-runtime/client' {
|
|
43
|
-
interface ConversationSnapshot {
|
|
44
|
-
/**
|
|
45
|
-
* Latest validated `activity/status` snapshot (the working-activity
|
|
46
|
-
* plugin's live working line), or null before the first publish.
|
|
47
|
-
*/
|
|
48
|
-
activity: ActivitySnapshot | null
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Client-side activity snapshot type + the ConversationSnapshot merge that
|
|
3
|
+
* carries it.
|
|
4
|
+
*
|
|
5
|
+
* The host half (@deepseek-ai/dsh-working-activity's node side) publishes
|
|
6
|
+
* `activity/status` session events; the web runtime patch (dsh-client-runtime
|
|
7
|
+
* activity field, shipping separately) narrows those frames into the
|
|
8
|
+
* conversation snapshot's `activity` member. Until that runtime release lands
|
|
9
|
+
* on npm, this module re-declares the field via declaration merging so the
|
|
10
|
+
* dock component type-checks against the published rc.6 types.
|
|
11
|
+
*
|
|
12
|
+
* REMOVE the `declare module` block below once
|
|
13
|
+
* `@deepseek-ai/dsh-client-runtime/client` ships `ConversationSnapshot.activity`
|
|
14
|
+
* natively (the runtime's own `ActivityStatusView` is structurally identical
|
|
15
|
+
* to {@link ActivitySnapshot}; the two then agree by construction).
|
|
16
|
+
* @module @deepseek-ai/dsh-working-activity/client/activity
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** The `activity/status` phase vocabulary, mirroring the host's ActivityPhase. */
|
|
20
|
+
export type ActivityPhase = 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'
|
|
21
|
+
|
|
22
|
+
/** One `activity/status` snapshot as rendered by the dock line. */
|
|
23
|
+
export interface ActivitySnapshot {
|
|
24
|
+
/** Which activity phase the model is in right now. */
|
|
25
|
+
readonly phase: ActivityPhase
|
|
26
|
+
/** Full human-readable status line (plain text, no ANSI). */
|
|
27
|
+
readonly line: string
|
|
28
|
+
/** Short label of the current work (tool action or stage), when any. */
|
|
29
|
+
readonly label?: string
|
|
30
|
+
/** Detail fragment (path / command / search pattern), when any. */
|
|
31
|
+
readonly detail?: string
|
|
32
|
+
/** The playful phrase currently shown, when any. */
|
|
33
|
+
readonly phrase?: string
|
|
34
|
+
/** Tools completed in the current turn. */
|
|
35
|
+
readonly toolCount: number
|
|
36
|
+
/** Wall-clock milliseconds since the current turn started (0 when idle). */
|
|
37
|
+
readonly turnElapsedMs: number
|
|
38
|
+
/** Wall-clock time the current phase started, for animations. */
|
|
39
|
+
readonly phaseStartedAt: number
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module '@deepseek-ai/dsh-client-runtime/client' {
|
|
43
|
+
interface ConversationSnapshot {
|
|
44
|
+
/**
|
|
45
|
+
* Latest validated `activity/status` snapshot (the working-activity
|
|
46
|
+
* plugin's live working line), or null before the first publish.
|
|
47
|
+
*/
|
|
48
|
+
activity: ActivitySnapshot | null
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* CSS Modules ambient declaration for the client half (tsc only; the tsdown
|
|
2
|
-
bundle inlines compiled class maps). */
|
|
3
|
-
declare module '*.module.css' {
|
|
4
|
-
const classes: Readonly<Record<string, string>>
|
|
5
|
-
export default classes
|
|
6
|
-
}
|
|
1
|
+
/* CSS Modules ambient declaration for the client half (tsc only; the tsdown
|
|
2
|
+
bundle inlines compiled class maps). */
|
|
3
|
+
declare module '*.module.css' {
|
|
4
|
+
const classes: Readonly<Record<string, string>>
|
|
5
|
+
export default classes
|
|
6
|
+
}
|
package/src/client/index.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Working-activity surface plugin, browser half: the working-line entry in
|
|
3
|
-
* the conversation.input.dock strip. This package's node half emits
|
|
4
|
-
* `activity/status` session events; the web runtime patch narrows them into
|
|
5
|
-
* the conversation snapshot's `activity` member, so this dock entry reads
|
|
6
|
-
* the live frame through the standard session kit and owns no store, no
|
|
7
|
-
* refresh chain, and no event listener.
|
|
8
|
-
*
|
|
9
|
-
* Mount contract (see the root README's "Web UI 集成" section): the web
|
|
10
|
-
* client's client-modules host scans loader entries for `dsh.client`
|
|
11
|
-
* declarations and serves this package's `./client` bundle at
|
|
12
|
-
* /plugins/dsh-working-activity/client.js. The entry contributes into the
|
|
13
|
-
* input dock — no official-source patch is involved.
|
|
14
|
-
*/
|
|
15
|
-
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'
|
|
16
|
-
// Type-only: pulls the ui-conversation SlotMap merge (the input.dock entry)
|
|
17
|
-
// through the Client assembly boundary.
|
|
18
|
-
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
19
|
-
import { WorkingLine } from './WorkingLine.tsx'
|
|
20
|
-
import type { ActivityPhase, ActivitySnapshot } from './activity.ts'
|
|
21
|
-
|
|
22
|
-
export { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'
|
|
23
|
-
export type { ActivityPhase, ActivitySnapshot } from './activity.ts'
|
|
24
|
-
|
|
25
|
-
/** Required services for the dock registration. */
|
|
26
|
-
export const inject = ['slots']
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Client plugin body: the working-line dock entry.
|
|
30
|
-
* @param ctx - client root context.
|
|
31
|
-
*/
|
|
32
|
-
export function apply(ctx: ClientContext): void {
|
|
33
|
-
ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({
|
|
34
|
-
name: 'conversation.input.dock',
|
|
35
|
-
// The pre-slots patch used the same id in ui-conversation; entries with
|
|
36
|
-
// equal order render in registration order, and goal (10) / queue (20)
|
|
37
|
-
// keep their seats — this row sits between them.
|
|
38
|
-
id: 'activity',
|
|
39
|
-
order: 15,
|
|
40
|
-
registrant: 'dsh-working-activity',
|
|
41
|
-
}, WorkingLine))
|
|
42
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Working-activity surface plugin, browser half: the working-line entry in
|
|
3
|
+
* the conversation.input.dock strip. This package's node half emits
|
|
4
|
+
* `activity/status` session events; the web runtime patch narrows them into
|
|
5
|
+
* the conversation snapshot's `activity` member, so this dock entry reads
|
|
6
|
+
* the live frame through the standard session kit and owns no store, no
|
|
7
|
+
* refresh chain, and no event listener.
|
|
8
|
+
*
|
|
9
|
+
* Mount contract (see the root README's "Web UI 集成" section): the web
|
|
10
|
+
* client's client-modules host scans loader entries for `dsh.client`
|
|
11
|
+
* declarations and serves this package's `./client` bundle at
|
|
12
|
+
* /plugins/dsh-working-activity/client.js. The entry contributes into the
|
|
13
|
+
* input dock — no official-source patch is involved.
|
|
14
|
+
*/
|
|
15
|
+
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'
|
|
16
|
+
// Type-only: pulls the ui-conversation SlotMap merge (the input.dock entry)
|
|
17
|
+
// through the Client assembly boundary.
|
|
18
|
+
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
19
|
+
import { WorkingLine } from './WorkingLine.tsx'
|
|
20
|
+
import type { ActivityPhase, ActivitySnapshot } from './activity.ts'
|
|
21
|
+
|
|
22
|
+
export { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'
|
|
23
|
+
export type { ActivityPhase, ActivitySnapshot } from './activity.ts'
|
|
24
|
+
|
|
25
|
+
/** Required services for the dock registration. */
|
|
26
|
+
export const inject = ['slots']
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Client plugin body: the working-line dock entry.
|
|
30
|
+
* @param ctx - client root context.
|
|
31
|
+
*/
|
|
32
|
+
export function apply(ctx: ClientContext): void {
|
|
33
|
+
ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({
|
|
34
|
+
name: 'conversation.input.dock',
|
|
35
|
+
// The pre-slots patch used the same id in ui-conversation; entries with
|
|
36
|
+
// equal order render in registration order, and goal (10) / queue (20)
|
|
37
|
+
// keep their seats — this row sits between them.
|
|
38
|
+
id: 'activity',
|
|
39
|
+
order: 15,
|
|
40
|
+
registrant: 'dsh-working-activity',
|
|
41
|
+
}, WorkingLine))
|
|
42
|
+
}
|