@lincyaw/dsh 0.2.0-rc.10 → 0.2.0-rc.100
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/build/client.mjs +0 -2
- package/build/dist/client.js +300 -299
- package/build/dist/client.json +69 -40
- package/cordis.patch.yml +1 -0
- package/package.json +10 -9
- package/src/client/RootLayout.tsx +7 -6
- package/src/client/agent-requests.ts +47 -0
- package/src/client/contract.ts +0 -6
- package/src/client/dsh.d.ts +12 -0
- package/src/client/fallback.tsx +4 -4
- package/src/client/frame.css +0 -10
- package/src/client/index.tsx +3 -3
- package/src/client/layout.ts +9 -6
- package/src/client/messages.ts +2 -10
- package/src/client/navigation-shell.tsx +2 -2
- package/src/client/styles.css +0 -42
- package/src/client/workspace-events.ts +10 -8
- package/src/node/bindings.ts +100 -8
- package/src/node/context.ts +16 -26
- package/src/node/dsh-types.ts +31 -1
- package/src/node/launch.ts +10 -5
- package/src/node/policy.ts +13 -3
- package/src/node/routes.ts +7 -1
- package/src/node/service.ts +7 -1
- package/src/node/tools.ts +118 -6
- package/src/node/turns.ts +12 -8
- package/src/node/workspace-events.ts +7 -4
- package/src/workspace-events.ts +3 -2
- package/src/client/mascot.tsx +0 -37
package/build/dist/client.json
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": [
|
|
3
|
-
"../design/src/assets/mascot/cat.png",
|
|
4
|
-
"../design/src/assets/mascot/cat-light.png",
|
|
5
|
-
"../design/src/assets/mascot/sheet.ts",
|
|
6
|
-
"../design/src/assets/mascot.ts",
|
|
7
|
-
"../design/src/icons.ts",
|
|
8
|
-
"../design/src/tokens.ts",
|
|
9
|
-
"../design/src/assets/brand.ts",
|
|
10
|
-
"../design/src/index.ts",
|
|
11
|
-
"../workbench/src/base-controls.tsx",
|
|
12
|
-
"../workbench/src/mascot-preference.ts",
|
|
13
|
-
"../workbench/src/sortable-list.tsx",
|
|
14
|
-
"../workbench/src/components.tsx",
|
|
15
3
|
"../kernel/src/contracts/service.ts",
|
|
16
4
|
"../kernel/src/contracts/agent.ts",
|
|
5
|
+
"../kernel/src/contracts/agent-activity.ts",
|
|
17
6
|
"../kernel/src/contracts/authoring.ts",
|
|
7
|
+
"../kernel/src/contracts/capture.ts",
|
|
18
8
|
"../kernel/src/contracts/document-reads.ts",
|
|
19
9
|
"../kernel/src/contracts/anchors.ts",
|
|
20
10
|
"../kernel/src/contracts/checks.ts",
|
|
@@ -28,6 +18,7 @@
|
|
|
28
18
|
"../kernel/src/contracts/presenter-panels.ts",
|
|
29
19
|
"../kernel/src/contracts/production.ts",
|
|
30
20
|
"../kernel/src/contracts/production-assets.ts",
|
|
21
|
+
"../kernel/src/contracts/media-uploads.ts",
|
|
31
22
|
"../kernel/src/contracts/document-audio.ts",
|
|
32
23
|
"../kernel/src/contracts/document-voice.ts",
|
|
33
24
|
"../kernel/src/contracts/voiceover-execution.ts",
|
|
@@ -37,6 +28,9 @@
|
|
|
37
28
|
"../kernel/src/contracts/server.ts",
|
|
38
29
|
"../kernel/src/contracts/speech.ts",
|
|
39
30
|
"../kernel/src/contracts/speech-settings.ts",
|
|
31
|
+
"../kernel/src/contracts/workspace-review.ts",
|
|
32
|
+
"../kernel/src/contracts/workspace-source.ts",
|
|
33
|
+
"../kernel/src/contracts/workspace-changes.ts",
|
|
40
34
|
"../kernel/src/contracts/transcription.ts",
|
|
41
35
|
"../kernel/src/contracts/transcription-adoption.ts",
|
|
42
36
|
"../kernel/src/contracts/voice.ts",
|
|
@@ -46,26 +40,32 @@
|
|
|
46
40
|
"../kernel/src/contracts/authoring-actions.ts",
|
|
47
41
|
"../kernel/src/contracts/document-history.ts",
|
|
48
42
|
"../kernel/src/contracts/authoring-clients.ts",
|
|
43
|
+
"../kernel/src/contracts/authoring-windows.ts",
|
|
49
44
|
"../kernel/src/contracts/projects.ts",
|
|
50
45
|
"../kernel/src/contracts/document-image.ts",
|
|
51
46
|
"../kernel/src/contracts.ts",
|
|
52
|
-
"../kernel/src/
|
|
47
|
+
"../kernel/src/random-uuid.ts",
|
|
48
|
+
"../kernel/src/access.ts",
|
|
49
|
+
"../kernel/src/document-places.ts",
|
|
50
|
+
"../kernel/src/document-comments.ts",
|
|
53
51
|
"../kernel/src/document-schema.ts",
|
|
52
|
+
"../kernel/src/document-narrations.ts",
|
|
53
|
+
"../kernel/src/document-operations.ts",
|
|
54
54
|
"../kernel/src/authoring.ts",
|
|
55
55
|
"../kernel/src/document-pages.ts",
|
|
56
56
|
"../kernel/src/fingerprint.ts",
|
|
57
57
|
"../kernel/src/document-reads.ts",
|
|
58
58
|
"../kernel/src/document-voices.ts",
|
|
59
59
|
"../kernel/src/document-colors.ts",
|
|
60
|
-
"../kernel/src/access.ts",
|
|
61
|
-
"../kernel/src/document-comments.ts",
|
|
62
60
|
"../kernel/src/document-caption-timings.ts",
|
|
61
|
+
"../kernel/src/document-caption-scale.ts",
|
|
63
62
|
"../kernel/src/parameters.ts",
|
|
64
63
|
"../kernel/src/document.ts",
|
|
65
64
|
"../kernel/src/document-components.ts",
|
|
66
65
|
"../kernel/src/document-authoring-actions.ts",
|
|
67
66
|
"../kernel/src/transcription-adoption.ts",
|
|
68
67
|
"../kernel/src/recording.ts",
|
|
68
|
+
"../kernel/src/production-captions.ts",
|
|
69
69
|
"../kernel/src/ir.ts",
|
|
70
70
|
"../kernel/src/anchors.ts",
|
|
71
71
|
"../kernel/src/diagnostics.ts",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"../kernel/src/events.ts",
|
|
75
75
|
"../kernel/src/execution.ts",
|
|
76
76
|
"../kernel/src/git.ts",
|
|
77
|
+
"../kernel/src/escape-html.ts",
|
|
77
78
|
"../kernel/src/html.ts",
|
|
78
79
|
"../kernel/src/requests.ts",
|
|
79
80
|
"../kernel/src/step-keys.ts",
|
|
@@ -83,9 +84,13 @@
|
|
|
83
84
|
"../kernel/src/kernel.ts",
|
|
84
85
|
"../kernel/src/locale.ts",
|
|
85
86
|
"../kernel/src/lock.ts",
|
|
87
|
+
"../kernel/src/myst-marks.ts",
|
|
86
88
|
"../kernel/src/lower-myst.ts",
|
|
87
|
-
"../kernel/src/keyboard.ts",
|
|
88
89
|
"../kernel/src/preview-frame.ts",
|
|
90
|
+
"../kernel/src/keyboard.ts",
|
|
91
|
+
"../kernel/src/preview-frame-connect.ts",
|
|
92
|
+
"../kernel/src/stale-module.ts",
|
|
93
|
+
"../kernel/src/embed.ts",
|
|
89
94
|
"../kernel/src/preview-edit.ts",
|
|
90
95
|
"../kernel/src/props.ts",
|
|
91
96
|
"../kernel/src/reading.ts",
|
|
@@ -108,44 +113,61 @@
|
|
|
108
113
|
"../kernel/src/jupyter-kernel.ts",
|
|
109
114
|
"../kernel/src/preview-events.ts",
|
|
110
115
|
"../kernel/src/index.ts",
|
|
116
|
+
"../workbench/src/workbench-state.ts",
|
|
117
|
+
"../workbench/src/document-return-point.ts",
|
|
118
|
+
"../workbench/src/document-editor/table-identities.ts",
|
|
119
|
+
"../workbench/src/document-editor/selection.ts",
|
|
120
|
+
"../workbench/src/shortcuts.ts",
|
|
121
|
+
"../workbench/src/messages.ts",
|
|
122
|
+
"../workbench/src/document-editing.ts",
|
|
123
|
+
"../workbench/src/workspace-client.ts",
|
|
124
|
+
"../workbench/src/sha256.ts",
|
|
125
|
+
"../workbench/src/recording-adoption.ts",
|
|
126
|
+
"../workbench/src/document-voices.ts",
|
|
127
|
+
"../workbench/src/component-properties.ts",
|
|
128
|
+
"../workbench/src/caption-timing.ts",
|
|
129
|
+
"../workbench/src/step-production.ts",
|
|
130
|
+
"../workbench/src/document-timing-drafts.ts",
|
|
131
|
+
"../workbench/src/caption-timing-drafts.ts",
|
|
132
|
+
"../workbench/src/voice-drafts.ts",
|
|
133
|
+
"../workbench/src/media-drafts.ts",
|
|
134
|
+
"../workbench/src/transcription-drafts.ts",
|
|
135
|
+
"../workbench/src/document-production.ts",
|
|
136
|
+
"../design/src/icons.ts",
|
|
137
|
+
"../design/src/tokens.ts",
|
|
138
|
+
"../design/src/assets/brand.ts",
|
|
139
|
+
"../design/src/length.ts",
|
|
140
|
+
"../design/src/index.ts",
|
|
141
|
+
"../workbench/src/base-controls.tsx",
|
|
142
|
+
"../workbench/src/sortable-list.tsx",
|
|
143
|
+
"../workbench/src/components.tsx",
|
|
111
144
|
"../workbench/src/schema-form/context.ts",
|
|
112
145
|
"../workbench/src/schema-form/fields.tsx",
|
|
113
146
|
"../workbench/src/schema-form/templates.tsx",
|
|
114
147
|
"../workbench/src/schema-form/widgets.tsx",
|
|
115
148
|
"../workbench/src/schema-form/validator.ts",
|
|
116
149
|
"../workbench/src/schema-form/PmSchemaForm.tsx",
|
|
117
|
-
"../workbench/src/step-production.ts",
|
|
118
150
|
"../workbench/src/StepProductionEditor.tsx",
|
|
119
151
|
"../workbench/src/media-messages.ts",
|
|
120
152
|
"../workbench/src/media-time.ts",
|
|
121
153
|
"../workbench/src/MediaClipEditor.tsx",
|
|
122
|
-
"../workbench/src/shortcuts.ts",
|
|
123
|
-
"../workbench/src/messages.ts",
|
|
124
154
|
"../workbench/src/context.tsx",
|
|
125
155
|
"../workbench/src/places.ts",
|
|
126
156
|
"../workbench/src/preview.ts",
|
|
127
|
-
"../workbench/src/caption-timing.ts",
|
|
128
157
|
"../workbench/src/document-draft-store.ts",
|
|
129
158
|
"../workbench/src/document-editor/comment-drafts.ts",
|
|
130
159
|
"../workbench/src/component-property-drafts.ts",
|
|
131
|
-
"../workbench/src/component-properties.ts",
|
|
132
160
|
"../workbench/src/authoring-draft-fragment.ts",
|
|
133
161
|
"../workbench/src/document-editor/comment-draft-inspection.ts",
|
|
134
162
|
"../workbench/src/document-editor/comment-draft-actions.ts",
|
|
163
|
+
"../workbench/src/body-draft-actions.ts",
|
|
164
|
+
"../workbench/src/production-draft-actions.ts",
|
|
135
165
|
"../workbench/src/component-draft-inspection.ts",
|
|
136
166
|
"../workbench/src/component-draft-actions.ts",
|
|
137
|
-
"../workbench/src/workspace-client.ts",
|
|
138
167
|
"../workbench/src/document-drafts.ts",
|
|
139
168
|
"../workbench/src/document-session.ts",
|
|
140
|
-
"../workbench/src/recording-adoption.ts",
|
|
141
169
|
"../workbench/src/transcription-session.ts",
|
|
142
170
|
"../workbench/src/audio-recording.ts",
|
|
143
|
-
"../workbench/src/document-return-point.ts",
|
|
144
|
-
"../workbench/src/document-editor/table-identities.ts",
|
|
145
|
-
"../workbench/src/document-editor/selection.ts",
|
|
146
|
-
"../workbench/src/document-voices.ts",
|
|
147
|
-
"../workbench/src/document-timing-drafts.ts",
|
|
148
|
-
"../workbench/src/caption-timing-drafts.ts",
|
|
149
171
|
"../workbench/src/document-preview.ts",
|
|
150
172
|
"../workbench/src/diagnostics.ts",
|
|
151
173
|
"../workbench/src/history.ts",
|
|
@@ -155,15 +177,13 @@
|
|
|
155
177
|
"../workbench/src/preview-playback.ts",
|
|
156
178
|
"../workbench/src/production-playback.ts",
|
|
157
179
|
"../workbench/src/workbench.ts",
|
|
180
|
+
"../workbench/src/container-layout.ts",
|
|
158
181
|
"../workbench/src/outline.ts",
|
|
159
182
|
"../workbench/src/panels/ExportPanel.tsx",
|
|
160
183
|
"../workbench/src/panels/HistoryPanel.tsx",
|
|
161
184
|
"../workbench/src/preview-pool.ts",
|
|
162
|
-
"../workbench/src/document-editor/inline.ts",
|
|
163
|
-
"../workbench/src/document-editor/rich-text.ts",
|
|
164
|
-
"../workbench/src/document-editor/projection.ts",
|
|
165
|
-
"../workbench/src/panels/ChangeTrail.tsx",
|
|
166
185
|
"../workbench/src/panels/PreviewPanel.tsx",
|
|
186
|
+
"../workbench/src/agent-activity.ts",
|
|
167
187
|
"../workbench/src/document-editor/blocknote-messages.ts",
|
|
168
188
|
"../workbench/src/document-editor/colors.ts",
|
|
169
189
|
"../workbench/src/document-editor/messages.ts",
|
|
@@ -172,18 +192,23 @@
|
|
|
172
192
|
"../workbench/src/document-editor/schema.tsx",
|
|
173
193
|
"../workbench/src/document-editor/file-input.ts",
|
|
174
194
|
"../workbench/src/document-editor/clipboard.ts",
|
|
195
|
+
"../workbench/src/document-editor/page-body.ts",
|
|
175
196
|
"../workbench/src/document-editor/authoring.tsx",
|
|
197
|
+
"../workbench/src/document-editor/inline.ts",
|
|
198
|
+
"../workbench/src/document-editor/rich-text.ts",
|
|
176
199
|
"../workbench/src/document-editor/comments.ts",
|
|
200
|
+
"../workbench/src/approvals.tsx",
|
|
201
|
+
"../workbench/src/document-editor/component-label.ts",
|
|
177
202
|
"../workbench/src/document-editor/DocumentComments.tsx",
|
|
203
|
+
"../workbench/src/document-editor/CommentComposer.tsx",
|
|
178
204
|
"../workbench/src/document-editor/NewCommentDrafts.tsx",
|
|
179
205
|
"../workbench/src/document-editor/BlockNoteSurface.tsx",
|
|
180
|
-
"../workbench/src/document-editor/focus.ts",
|
|
181
|
-
"../workbench/src/document-editor/narration.ts",
|
|
182
206
|
"../workbench/src/document-editor/narration-schema.tsx",
|
|
183
207
|
"../workbench/src/document-editor/NarrationEditor.tsx",
|
|
208
|
+
"../workbench/src/document-editor/focus.ts",
|
|
209
|
+
"../workbench/src/document-editor/narration.ts",
|
|
184
210
|
"../workbench/src/document-editor/DocumentStepNarration.tsx",
|
|
185
211
|
"../workbench/src/production-messages.ts",
|
|
186
|
-
"../workbench/src/voice-drafts.ts",
|
|
187
212
|
"../workbench/src/voice-clone-messages.ts",
|
|
188
213
|
"../workbench/src/voice-messages.ts",
|
|
189
214
|
"../workbench/src/voice-snapshot.ts",
|
|
@@ -196,11 +221,11 @@
|
|
|
196
221
|
"../workbench/src/panels/DocumentVoiceDialog.tsx",
|
|
197
222
|
"../workbench/src/panels/DocumentVoiceField.tsx",
|
|
198
223
|
"../workbench/src/panels/VoiceoverDialog.tsx",
|
|
224
|
+
"../workbench/src/panels/ProductionCaptionSize.tsx",
|
|
199
225
|
"../workbench/src/caption-timing-messages.ts",
|
|
200
226
|
"../workbench/src/panels/ProductionCaptionTiming.tsx",
|
|
201
227
|
"../workbench/src/audio-waveform.ts",
|
|
202
228
|
"../workbench/src/panels/ProductionTimeline.tsx",
|
|
203
|
-
"../workbench/src/media-drafts.ts",
|
|
204
229
|
"../workbench/src/panels/ProductionMediaClips.tsx",
|
|
205
230
|
"../workbench/src/use-recording-adoption.ts",
|
|
206
231
|
"../workbench/src/panels/ProductionRecordingRange.tsx",
|
|
@@ -212,6 +237,9 @@
|
|
|
212
237
|
"../workbench/src/panels/ProductionPanel.tsx",
|
|
213
238
|
"../workbench/src/panels/PageRenameDialog.tsx",
|
|
214
239
|
"../workbench/src/panels/PageDeleteDialog.tsx",
|
|
240
|
+
"../workbench/src/document-editor/agent-targets.ts",
|
|
241
|
+
"../workbench/src/document-editor/projection.ts",
|
|
242
|
+
"../workbench/src/document-editor/insertion-place.ts",
|
|
215
243
|
"../workbench/src/document-editor/DocumentEditor.tsx",
|
|
216
244
|
"../workbench/src/document-editor/block-preview-messages.ts",
|
|
217
245
|
"../workbench/src/document-editor/DocumentBlockFallback.tsx",
|
|
@@ -219,16 +247,18 @@
|
|
|
219
247
|
"../workbench/src/component-property-messages.ts",
|
|
220
248
|
"../workbench/src/document-editor/ComponentMaterials.tsx",
|
|
221
249
|
"../workbench/src/document-editor/ComponentPropertiesDialog.tsx",
|
|
250
|
+
"../workbench/src/document-editor/PlaceComment.tsx",
|
|
222
251
|
"../workbench/src/document-editor/DocumentBlockPreview.tsx",
|
|
223
252
|
"../workbench/src/panels/SourceDocumentPanel.tsx",
|
|
224
253
|
"../workbench/src/panels/DocumentNarrationPanel.tsx",
|
|
225
254
|
"../workbench/src/panels/DocumentView.tsx",
|
|
226
255
|
"../workbench/src/panels/HomePanel.tsx",
|
|
227
|
-
"../workbench/src/approvals.tsx",
|
|
228
|
-
"../workbench/src/assistant-mascot.ts",
|
|
229
256
|
"../workbench/src/speech-settings-messages.ts",
|
|
230
257
|
"../workbench/src/panels/SpeechSettingsPanel.tsx",
|
|
231
258
|
"../workbench/src/authoring-client.ts",
|
|
259
|
+
"../workbench/src/authoring-window.ts",
|
|
260
|
+
"../workbench/src/agent-activity-messages.ts",
|
|
261
|
+
"../workbench/src/AgentActivityBar.tsx",
|
|
232
262
|
"../workbench/src/index.ts",
|
|
233
263
|
"src/workspace-events.ts",
|
|
234
264
|
"src/client/workspace-events.ts",
|
|
@@ -238,7 +268,6 @@
|
|
|
238
268
|
"src/client/settings-opener.ts",
|
|
239
269
|
"src/client/messages.ts",
|
|
240
270
|
"src/client/brand.tsx",
|
|
241
|
-
"src/client/mascot.tsx",
|
|
242
271
|
"src/client/document-context.ts",
|
|
243
272
|
"src/client/observable.ts",
|
|
244
273
|
"src/client/runtime-diagnostics.tsx",
|
package/cordis.patch.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/dsh",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.100",
|
|
4
4
|
"description": "Presmium's bundle for DeepSeek Harness: the workbench of presmium studio, its host side (Presmium's tools, approvals, document context, skills and routes) and its client side (the root layout and the workbench's panels, precompiled) (experimental)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"skills": [
|
|
74
74
|
"presmium-animate",
|
|
75
75
|
"presmium-author",
|
|
76
|
-
"presmium-
|
|
77
|
-
"presmium-
|
|
76
|
+
"presmium-develop",
|
|
77
|
+
"presmium-paper-to-xiaohongshu"
|
|
78
78
|
],
|
|
79
79
|
"generated": [
|
|
80
80
|
"build/dist"
|
|
@@ -83,12 +83,13 @@
|
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"eventsource": "3.0.7",
|
|
85
85
|
"jiti": "^2.7.0",
|
|
86
|
+
"node-addon-require-builtin": "0.1.9",
|
|
86
87
|
"ws": "8.22.0",
|
|
87
88
|
"zod": "4.4.3",
|
|
88
|
-
"@lincyaw/
|
|
89
|
-
"@lincyaw/
|
|
90
|
-
"@lincyaw/
|
|
91
|
-
"@lincyaw/skills": "1.0.0-rc.
|
|
89
|
+
"@lincyaw/cli": "1.0.0-rc.101",
|
|
90
|
+
"@lincyaw/mcp": "1.0.0-rc.101",
|
|
91
|
+
"@lincyaw/kernel": "1.0.0-rc.101",
|
|
92
|
+
"@lincyaw/skills": "1.0.0-rc.101"
|
|
92
93
|
},
|
|
93
94
|
"peerDependencies": {
|
|
94
95
|
"@deepseek-ai/dsh": "0.2.1-alpha.4"
|
|
@@ -104,8 +105,8 @@
|
|
|
104
105
|
"react": "18.3.1",
|
|
105
106
|
"react-dom": "18.3.1",
|
|
106
107
|
"react-resizable-panels": "^4.14.5",
|
|
107
|
-
"@lincyaw/design": "1.0.0-rc.
|
|
108
|
-
"@lincyaw/workbench": "0.2.0-rc.
|
|
108
|
+
"@lincyaw/design": "1.0.0-rc.101",
|
|
109
|
+
"@lincyaw/workbench": "0.2.0-rc.101"
|
|
109
110
|
},
|
|
110
111
|
"scripts": {}
|
|
111
112
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Group, Panel, Separator, usePanelRef } from 'react-resizable-panels'
|
|
2
|
-
import { DocumentView, HomePanel, PmDialog, PmIcon, PmMenu, SHORTCUTS, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider } from '@lincyaw/workbench'
|
|
2
|
+
import { AgentActivityBar, DocumentView, HomePanel, PmDialog, PmIcon, PmMenu, SHORTCUTS, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider } from '@lincyaw/workbench'
|
|
3
3
|
import type { Workbench } from '@lincyaw/workbench'
|
|
4
4
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'
|
|
5
5
|
import type { ReactNode, RefObject } from 'react'
|
|
6
6
|
import { Logo } from './brand.tsx'
|
|
7
7
|
import { mainViewAgentSession } from './document-context.ts'
|
|
8
|
-
import { clamp, CONVERSATION_MAX, CONVERSATION_MIN,
|
|
8
|
+
import { centreMinWidth, clamp, CONVERSATION_MAX, CONVERSATION_MIN, singlePaneWidth, RIGHTBAR_MAX_RATIO, RIGHTBAR_MIN, rightbarRoom, SIDE_COLLAPSE, SIDE_MAX, SIDE_MIN } from './layout.ts'
|
|
9
9
|
import type { LayoutActions, LayoutState, NarrowPane } from './layout.ts'
|
|
10
10
|
import { useClientMessages } from './messages.ts'
|
|
11
11
|
import { isSamePath } from './paths.ts'
|
|
@@ -35,7 +35,7 @@ type Box = { left: number, top: number, width: number, height: number }
|
|
|
35
35
|
export function rootLayoutFor(options: RootLayoutOptions) {
|
|
36
36
|
return function PresmiumRootLayout(props: RootSlotProps) {
|
|
37
37
|
return (
|
|
38
|
-
<WorkbenchProvider workbench={options.workbench}>
|
|
38
|
+
<WorkbenchProvider workbench={options.workbench} dialogActions={<WorkbenchApprovals />}>
|
|
39
39
|
<WorkbenchRuntimeBoundary workbench={options.workbench}><RootLayout {...props} {...options} /></WorkbenchRuntimeBoundary>
|
|
40
40
|
</WorkbenchProvider>
|
|
41
41
|
)
|
|
@@ -45,7 +45,7 @@ export function rootLayoutFor(options: RootLayoutOptions) {
|
|
|
45
45
|
/** The columns' widths for the viewport: 0 for a column that is not shown. */
|
|
46
46
|
function solveGeometry(info: LayoutState['layoutInfo']) {
|
|
47
47
|
const viewport = info.viewportWidth
|
|
48
|
-
const narrow = viewport <
|
|
48
|
+
const narrow = viewport < singlePaneWidth()
|
|
49
49
|
const collapsed = viewport < SIDE_COLLAPSE
|
|
50
50
|
const side = narrow ? 0 : (collapsed ? info.isSideExpanded : info.isSideOpen) ? info.sideWidth : 0
|
|
51
51
|
const conversation = narrow || !info.isConversationOpen ? 0 : collapsed ? Math.min(info.conversationWidth, Math.max(300, Math.round(viewport * 0.4))) : info.conversationWidth
|
|
@@ -221,7 +221,7 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
221
221
|
<div className="pmw-frame__sidebar" data-pmw-slot="sidebar" data-shown={(narrow ? pane === 'sessions' : sideShown) || undefined}>{sidebar}</div>
|
|
222
222
|
</Panel>
|
|
223
223
|
{sideShown && <Separator className="pmw-frame__handle" data-side="side" aria-label={t.resize} />}
|
|
224
|
-
<Panel id="centre" minSize={narrow ? 0 :
|
|
224
|
+
<Panel id="centre" minSize={narrow ? 0 : centreMinWidth()} className="pmw-frame__centre-panel" hidden={narrow && (pane === 'sessions' || pane === 'conversation') && panel === null}>
|
|
225
225
|
<main id="pmw-centre" className="pmw-frame__centre" aria-label={documentTitle ?? t.centre}>{centre}</main>
|
|
226
226
|
</Panel>
|
|
227
227
|
{!narrow && info.isRightbarOpen && !info.isRightbarFullscreen && geometry.track > 0 && (
|
|
@@ -293,7 +293,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
return (
|
|
296
|
-
<nav className="pmw-appbar" aria-label={t.activity}>
|
|
296
|
+
<nav className="pm-ui-appbar pmw-appbar" aria-label={t.activity}>
|
|
297
297
|
<span className="pmw-appbar__brand"><Logo /><span className="pmw-brand-name">{t.product}</span></span>
|
|
298
298
|
<ol className="pmw-appbar__places">
|
|
299
299
|
<li>
|
|
@@ -311,6 +311,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
311
311
|
{panelLabel && <li><span className="pmw-appbar__place" aria-current="page"><span className="pmw-appbar__label">{panelLabel}</span></span></li>}
|
|
312
312
|
</ol>
|
|
313
313
|
<span className="pmw-spacer" />
|
|
314
|
+
<AgentActivityBar />
|
|
314
315
|
<span className="pmw-appbar__approvals" data-activity="approvals"><WorkbenchApprovals density={narrow ? 'touch' : 'compact'} /></span>
|
|
315
316
|
<button type="button" className="pmw-appbar__button pmw-appbar__assistant" data-activity="assistant" title={t.assistant} aria-pressed={chatShown} onClick={toggleAssistant}>
|
|
316
317
|
<PmIcon name="sparkle" /><span className="pmw-appbar__label">{t.assistant}</span>
|
|
@@ -9,6 +9,9 @@ import { CLIENT_MESSAGES } from './messages.ts'
|
|
|
9
9
|
* the repair of the selected document's diagnostics. Each is prompted on the session after its document context is
|
|
10
10
|
* set, and the conversation is shown. Without a usable model nothing is sent: the conversation is shown, where the
|
|
11
11
|
* composer offers to set one up, and the request answers with that in the author's terms.
|
|
12
|
+
*
|
|
13
|
+
* Drafts (the slash menu's animation request) go into the session's composer instead, for the author to finish and
|
|
14
|
+
* send. Without a model the composer's takeover shows over the draft, which waits beneath it.
|
|
12
15
|
*/
|
|
13
16
|
export function registerAgentRequests(ctx: DshClientContext, workbench: Workbench, setup: AssistantSetup): void {
|
|
14
17
|
ctx.inject(['sessions', 'layout'], inner => inner.effect(() => {
|
|
@@ -61,4 +64,48 @@ export function registerAgentRequests(ctx: DshClientContext, workbench: Workbenc
|
|
|
61
64
|
update()
|
|
62
65
|
return () => { off(); offRequests?.() }
|
|
63
66
|
}, 'presmium: hand the author\'s requests to the current session'))
|
|
67
|
+
|
|
68
|
+
ctx.inject(['sessions', 'layout', 'conversation'], inner => inner.effect(() => {
|
|
69
|
+
let offDrafts: (() => void) | undefined
|
|
70
|
+
let active: DshSessionBinding | undefined
|
|
71
|
+
const update = () => {
|
|
72
|
+
const row = mainViewAgentSession(inner.sessions.list.getSnapshot().byId)
|
|
73
|
+
const binding = row && inner.sessions.binding(row.id)
|
|
74
|
+
if (binding === active) return
|
|
75
|
+
offDrafts?.()
|
|
76
|
+
offDrafts = undefined
|
|
77
|
+
active = binding
|
|
78
|
+
if (!row || !binding) return
|
|
79
|
+
// Whatever the author wrote stays above the draft; a draft put here and not changed since is replaced by the next.
|
|
80
|
+
let last: { kept: string, text: string } | undefined
|
|
81
|
+
offDrafts = workbench.onAgentDraft(draft => {
|
|
82
|
+
if (active !== binding || inner.sessions.binding(row.id) !== binding) throw new Error('no-conversation')
|
|
83
|
+
const input = inner.conversation.input.for(binding.ctx)
|
|
84
|
+
const { draft: current, phase } = input.state.getSnapshot()
|
|
85
|
+
if (phase !== 'plain') throw new Error('no-conversation')
|
|
86
|
+
const kept = last && current.trim() === (last.kept + last.text).trim() ? last.kept : current.trim() ? `${current.trimEnd()}\n` : ''
|
|
87
|
+
const text = kept + draft.text
|
|
88
|
+
last = { kept, text: draft.text }
|
|
89
|
+
input.setDraft(text)
|
|
90
|
+
inner.layout.selectPanel(null)
|
|
91
|
+
// The composer takes the keyboard once the conversation is shown (under the takeover it stays where it was).
|
|
92
|
+
// Focus brings back the caret the composer last held, which the draft does not move: the browser's selection
|
|
93
|
+
// goes to the end of the focused editor, and the composer's editor follows it.
|
|
94
|
+
const frame = (then: () => void) => requestAnimationFrame(() => requestAnimationFrame(then))
|
|
95
|
+
if (setup.readiness.getSnapshot() !== 'missing') frame(() => {
|
|
96
|
+
input.focus()
|
|
97
|
+
frame(() => {
|
|
98
|
+
const editor = document.activeElement
|
|
99
|
+
if (!(editor instanceof HTMLElement) || !editor.isContentEditable || input.state.getSnapshot().draft !== text) return
|
|
100
|
+
const selection = getSelection()
|
|
101
|
+
selection?.selectAllChildren(editor)
|
|
102
|
+
selection?.collapseToEnd()
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
const off = inner.sessions.list.subscribe(update)
|
|
108
|
+
update()
|
|
109
|
+
return () => { off(); offDrafts?.() }
|
|
110
|
+
}, 'presmium: put the author\'s drafts in the current session\'s composer'))
|
|
64
111
|
}
|
package/src/client/contract.ts
CHANGED
|
@@ -23,12 +23,6 @@ export const ONBOARDING = { slot: 'settings.onboarding', steps: ['welcome-notice
|
|
|
23
23
|
*/
|
|
24
24
|
export const ASSISTANT_SLOTS = ['conversation.composer', { name: 'conversation.chat.node', key: 'turn-error' }] as const
|
|
25
25
|
|
|
26
|
-
/** Where the kitten sits beside the conversation: an added entry (its own id) among the session header's actions. */
|
|
27
|
-
export const MASCOT_SLOT = { name: 'conversation.session.header.actions', id: 'presmium-mascot' } as const
|
|
28
|
-
|
|
29
|
-
/** Where the author turns the kitten on or off: an added row (its own id) in Settings → General. */
|
|
30
|
-
export const MASCOT_SETTING = { name: 'settings.general.item', id: 'presmium-mascot' } as const
|
|
31
|
-
|
|
32
26
|
/**
|
|
33
27
|
* Settings → Models, and when the model catalog is read again: on the Host's events that change what can be routed,
|
|
34
28
|
* whenever the window regains focus, and on a slow poll while no model is usable (Settings is a modal over this page,
|
package/src/client/dsh.d.ts
CHANGED
|
@@ -125,6 +125,17 @@ interface DshSessionBinding {
|
|
|
125
125
|
beginSubmission(input: { mode: 'queue', text: string, attachments: [] }): { requestId: string, abandon(): void }
|
|
126
126
|
prompt(content: { type: 'text', text: string }[], mode: 'queue', signal: AbortSignal | undefined, requestId: string): Promise<{ ok: true, value: { accepted: true } } | { ok: false, error: { code: string, message: string } }>
|
|
127
127
|
}
|
|
128
|
+
/** The session's scope, which addresses its composer through `conversation.input`. */
|
|
129
|
+
ctx: unknown
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A session's composer (`SessionInput` of `@deepseek-ai/dsh-client-ui-conversation`), as far as it is used here. */
|
|
133
|
+
interface DshSessionInput {
|
|
134
|
+
/** Replaces the whole draft with plain text; the caret lands at its end. */
|
|
135
|
+
setDraft(text: string): void
|
|
136
|
+
/** Gives the keyboard back to the composer, with the caret it last held. */
|
|
137
|
+
focus(): void
|
|
138
|
+
readonly state: DshObservable<{ draft: string, phase: 'plain' | 'adjudicating' | 'claimed' | 'submitting' }>
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
interface DshClientContext {
|
|
@@ -141,6 +152,7 @@ interface DshClientContext {
|
|
|
141
152
|
sidebarRight: { active(): { id: string, kind: string, contentId: string } | undefined, close(id: string): void, isExpanded(): boolean, toggleExpanded(): void }
|
|
142
153
|
layout: { selectPanel(id: string | null): void }
|
|
143
154
|
sessions: { list: DshObservable<{ byId: Record<string, { id: string, cwd?: string, retainedBy: { mainView?: number } }> }>, binding(id: string): DshSessionBinding | undefined }
|
|
155
|
+
conversation: { input: { for(scope: unknown): DshSessionInput } }
|
|
144
156
|
uiWorkspace: { openWorkspace(id: string, beforeOpen?: (sessionId: string) => void): Promise<void>, startSession(id?: string): void }
|
|
145
157
|
workspaces: { list: DshObservable<{ items: readonly { workspaceId: string, path: string }[] }> }
|
|
146
158
|
configForms: {
|
package/src/client/fallback.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentView, HistoryPanel, HomePanel, PreviewPanel, useWorkbench, useWorkbenchState, WorkbenchProvider } from '@lincyaw/workbench'
|
|
1
|
+
import { AgentActivityBar, DocumentView, HistoryPanel, HomePanel, PreviewPanel, useWorkbench, useWorkbenchState, WorkbenchProvider, WorkbenchApprovals } from '@lincyaw/workbench'
|
|
2
2
|
import type { Workbench } from '@lincyaw/workbench'
|
|
3
3
|
import { useRef } from 'react'
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
@@ -17,9 +17,9 @@ function Centre() {
|
|
|
17
17
|
return (
|
|
18
18
|
<div className="pmw-fallback pm-ui" data-pmw-fallback="">
|
|
19
19
|
<RuntimeDiagnosticsNotice workbench={workbench} />
|
|
20
|
-
{document_ === undefined && <HomePanel />}
|
|
20
|
+
{document_ === undefined && <HomePanel actions={<AgentActivityBar />} />}
|
|
21
21
|
{retainedDocument.current && <div className="pmw-fallback__doc" hidden={document_ === undefined}>
|
|
22
|
-
<DocumentView active={document_ !== undefined} />
|
|
22
|
+
<DocumentView active={document_ !== undefined} actions={<AgentActivityBar />} />
|
|
23
23
|
</div>}
|
|
24
24
|
</div>
|
|
25
25
|
)
|
|
@@ -30,7 +30,7 @@ export function registerFallbackLayout(ctx: DshClientContext, workbench: Workben
|
|
|
30
30
|
const t = () => CLIENT_MESSAGES[workbench.state.locale]
|
|
31
31
|
const provided = (Component: ComponentType, className?: string) => function PresmiumPanel() {
|
|
32
32
|
return (
|
|
33
|
-
<WorkbenchProvider workbench={workbench}>
|
|
33
|
+
<WorkbenchProvider workbench={workbench} dialogActions={<WorkbenchApprovals />}>
|
|
34
34
|
<WorkbenchRuntimeBoundary workbench={workbench}>{className ? <div className={className}><Component /></div> : <Component />}</WorkbenchRuntimeBoundary>
|
|
35
35
|
</WorkbenchProvider>
|
|
36
36
|
)
|
package/src/client/frame.css
CHANGED
|
@@ -43,11 +43,7 @@ body,
|
|
|
43
43
|
align-items: center;
|
|
44
44
|
gap: var(--pm-space-px);
|
|
45
45
|
min-width: 0;
|
|
46
|
-
height: var(--pm-appbar-height);
|
|
47
46
|
padding: 0 var(--pm-space-2) 0 var(--pm-space-3);
|
|
48
|
-
border-bottom: var(--pm-size-hairline) solid var(--pm-color-line);
|
|
49
|
-
background: var(--pm-color-chrome);
|
|
50
|
-
font-size: var(--pm-text-sm);
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
.pmw-appbar__brand {
|
|
@@ -172,12 +168,6 @@ span.pmw-appbar__place {
|
|
|
172
168
|
height: var(--pm-size-logo);
|
|
173
169
|
}
|
|
174
170
|
|
|
175
|
-
.pmw-appbar__more > .pm-ui-icon-button {
|
|
176
|
-
width: var(--pm-size-tool);
|
|
177
|
-
height: var(--pm-size-tool);
|
|
178
|
-
border-radius: var(--pm-radius-tool);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
171
|
.pmw-appbar__busy {
|
|
182
172
|
position: absolute;
|
|
183
173
|
top: var(--pm-space-1);
|
package/src/client/index.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { connectAuthoringClient, localeOf, Workbench, workspaceClient } from '@lincyaw/workbench'
|
|
1
|
+
import { connectAgentActivity, connectAuthoringClient, connectAuthoringWindow, localeOf, Workbench, workspaceClient } from '@lincyaw/workbench'
|
|
2
2
|
import type { Locale } from '@lincyaw/workbench'
|
|
3
3
|
import { workspaceSubscriptions } from './workspace-events.ts'
|
|
4
4
|
import { registerAuthorSettings } from './author-settings.ts'
|
|
5
5
|
import { registerSpeechSettings } from './speech-settings.tsx'
|
|
6
6
|
import { openSpeechSettings } from './settings-opener.ts'
|
|
7
7
|
import { registerBrand } from './brand.tsx'
|
|
8
|
-
import { registerMascot } from './mascot.tsx'
|
|
9
8
|
import { CLIENT_ID, isBootEntryLoaded, ROOT_CHILDREN, UI_LAYOUT, UI_SIDEBAR } from './contract.ts'
|
|
10
9
|
import { syncDocumentContext } from './document-context.ts'
|
|
11
10
|
import { FALLBACK_PANEL, registerFallbackLayout } from './fallback.tsx'
|
|
@@ -56,6 +55,8 @@ export function apply(ctx: DshClientContext): void {
|
|
|
56
55
|
const workbench = new Workbench({ client: workspaceClient('api/presmium/', workspaceSubscriptions(ctx)), locale: workbenchLocale(ctx.locale.getLocale().active) })
|
|
57
56
|
workbench.client.openSpeechSettings = openSpeechSettings
|
|
58
57
|
ctx.effect(() => connectAuthoringClient(workbench), 'presmium: authoring client control')
|
|
58
|
+
ctx.effect(() => connectAuthoringWindow(workbench), 'presmium: authoring window control')
|
|
59
|
+
ctx.effect(() => connectAgentActivity(workbench), 'presmium: agent activity')
|
|
59
60
|
ctx.effect(() => runtimeDiagnostics(workbench).start(), 'presmium: runtime diagnostics')
|
|
60
61
|
let showEditor = (layout: DshClientContext['layout']) => layout.selectPanel(FALLBACK_PANEL)
|
|
61
62
|
registerSourceLinks(ctx, workbench, layout => showEditor(layout))
|
|
@@ -148,7 +149,6 @@ export function apply(ctx: DshClientContext): void {
|
|
|
148
149
|
}, 'presmium: the root layout and ctx.layout')
|
|
149
150
|
}
|
|
150
151
|
registerBrand(ctx, workbench)
|
|
151
|
-
registerMascot(ctx, workbench)
|
|
152
152
|
registerAuthorSettings(ctx)
|
|
153
153
|
registerSpeechSettings(ctx, workbench)
|
|
154
154
|
ctx.inject(['layout'], inner => inner.effect(() => connectLaunchTarget(workbench,
|
package/src/client/layout.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineStore } from '@deepseek-ai/dsh-client-store'
|
|
2
|
+
import { designLength } from '@lincyaw/design'
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
+
export const centreMinWidth = () => designLength('--pm-canvas-min-width')
|
|
4
5
|
export const RIGHTBAR_MIN = 300
|
|
5
6
|
export const RIGHTBAR_MAX_RATIO = 0.7
|
|
6
7
|
export const RIGHTBAR_DEFAULT_RATIO = 0.45
|
|
7
8
|
export const SIDE_COLLAPSE = 1024
|
|
8
|
-
export const NARROW = 768
|
|
9
9
|
export const SIDE_DEFAULT = 264
|
|
10
10
|
export const SIDE_MIN = 200
|
|
11
11
|
export const SIDE_MAX = 420
|
|
@@ -15,11 +15,14 @@ export const CONVERSATION_MAX = 640
|
|
|
15
15
|
/** The width of one resize handle between two columns: a hairline, with a wider area to grab. */
|
|
16
16
|
export const HANDLE = 1
|
|
17
17
|
|
|
18
|
+
/** A split view needs both panes and its divider; use one pane before constraints become impossible. */
|
|
19
|
+
export const singlePaneWidth = () => Math.max(designLength('--pm-layout-narrow-width'), centreMinWidth() + CONVERSATION_MIN + HANDLE)
|
|
20
|
+
|
|
18
21
|
export const clamp = (px: number, min: number, max: number) => Math.min(max, Math.max(min, Math.round(px)))
|
|
19
22
|
|
|
20
23
|
/** The width left for the rightbar column: the viewport less the side panel, the conversation, the centre's minimum and `handles` resize handles. */
|
|
21
24
|
export function rightbarRoom(viewport: number, side: number, conversation: number, handles: number): number {
|
|
22
|
-
return viewport - side - conversation -
|
|
25
|
+
return viewport - side - conversation - centreMinWidth() - handles * HANDLE
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
/** What the side panel shows: the chat history (DeepSeek Harness's sessions). */
|
|
@@ -61,7 +64,7 @@ function showHistory(d: LayoutState): void {
|
|
|
61
64
|
d.layoutInfo.isSideOpen = true
|
|
62
65
|
d.layoutInfo.narrowPane = 'sessions'
|
|
63
66
|
if (d.layoutInfo.viewportWidth < SIDE_COLLAPSE) {
|
|
64
|
-
d.layoutInfo.isSideExpanded = d.layoutInfo.viewportWidth >=
|
|
67
|
+
d.layoutInfo.isSideExpanded = d.layoutInfo.viewportWidth >= singlePaneWidth()
|
|
65
68
|
d.layoutInfo.isConversationOpen = false
|
|
66
69
|
} else d.layoutInfo.isConversationOpen = true
|
|
67
70
|
}
|
|
@@ -121,7 +124,7 @@ export function createLayoutStore() {
|
|
|
121
124
|
showHistory,
|
|
122
125
|
toggleConversations: (d: LayoutState) => {
|
|
123
126
|
const info = d.layoutInfo
|
|
124
|
-
if (info.viewportWidth <
|
|
127
|
+
if (info.viewportWidth < singlePaneWidth()) {
|
|
125
128
|
if (info.narrowPane === 'conversation') showHistory(d)
|
|
126
129
|
else revealConversation(d)
|
|
127
130
|
} else {
|
|
@@ -157,7 +160,7 @@ export function createLayoutStore() {
|
|
|
157
160
|
else d.layoutInfo.isSideOpen = true
|
|
158
161
|
d.layoutInfo.activity = activity
|
|
159
162
|
if (d.layoutInfo.viewportWidth < SIDE_COLLAPSE) {
|
|
160
|
-
d.layoutInfo.isSideExpanded = d.layoutInfo.viewportWidth >=
|
|
163
|
+
d.layoutInfo.isSideExpanded = d.layoutInfo.viewportWidth >= singlePaneWidth()
|
|
161
164
|
if (d.layoutInfo.isSideExpanded) d.layoutInfo.isConversationOpen = false
|
|
162
165
|
}
|
|
163
166
|
d.layoutInfo.narrowPane = activity
|