@lincyaw/dsh 0.2.0-rc.10 → 0.2.0-rc.101
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 +302 -299
- package/build/dist/client.json +74 -41
- package/cordis.patch.yml +1 -0
- package/package.json +10 -9
- package/src/client/RootLayout.tsx +18 -15
- 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 +6 -4
- package/src/client/frame.css +0 -10
- package/src/client/index.tsx +8 -7
- package/src/client/layout.ts +9 -6
- package/src/client/messages.ts +6 -10
- package/src/client/navigation-shell.tsx +2 -2
- package/src/client/runtime-diagnostics.tsx +1 -1
- package/src/client/settings-launcher.tsx +19 -0
- package/src/client/settings-opener.ts +6 -0
- package/src/client/speech-settings.tsx +2 -1
- package/src/client/startup.css +47 -0
- package/src/client/startup.ts +17 -0
- 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 +32 -11
- package/src/node/policy.ts +13 -3
- package/src/node/routes.ts +8 -1
- package/src/node/service.ts +7 -1
- package/src/node/startup.ts +73 -0
- package/src/node/tools.ts +118 -6
- package/src/node/turns.ts +12 -8
- package/src/node/workbench.ts +9 -2
- package/src/node/workspace-events.ts +7 -4
- package/src/startup-messages.ts +15 -0
- package/src/workspace-events.ts +3 -2
- package/src/client/mascot.tsx +0 -37
package/build/dist/client.json
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": [
|
|
3
|
-
"
|
|
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",
|
|
3
|
+
"src/client/startup.ts",
|
|
15
4
|
"../kernel/src/contracts/service.ts",
|
|
16
5
|
"../kernel/src/contracts/agent.ts",
|
|
6
|
+
"../kernel/src/contracts/agent-activity.ts",
|
|
17
7
|
"../kernel/src/contracts/authoring.ts",
|
|
8
|
+
"../kernel/src/contracts/capture.ts",
|
|
18
9
|
"../kernel/src/contracts/document-reads.ts",
|
|
19
10
|
"../kernel/src/contracts/anchors.ts",
|
|
20
11
|
"../kernel/src/contracts/checks.ts",
|
|
@@ -28,6 +19,7 @@
|
|
|
28
19
|
"../kernel/src/contracts/presenter-panels.ts",
|
|
29
20
|
"../kernel/src/contracts/production.ts",
|
|
30
21
|
"../kernel/src/contracts/production-assets.ts",
|
|
22
|
+
"../kernel/src/contracts/media-uploads.ts",
|
|
31
23
|
"../kernel/src/contracts/document-audio.ts",
|
|
32
24
|
"../kernel/src/contracts/document-voice.ts",
|
|
33
25
|
"../kernel/src/contracts/voiceover-execution.ts",
|
|
@@ -37,6 +29,9 @@
|
|
|
37
29
|
"../kernel/src/contracts/server.ts",
|
|
38
30
|
"../kernel/src/contracts/speech.ts",
|
|
39
31
|
"../kernel/src/contracts/speech-settings.ts",
|
|
32
|
+
"../kernel/src/contracts/workspace-review.ts",
|
|
33
|
+
"../kernel/src/contracts/workspace-source.ts",
|
|
34
|
+
"../kernel/src/contracts/workspace-changes.ts",
|
|
40
35
|
"../kernel/src/contracts/transcription.ts",
|
|
41
36
|
"../kernel/src/contracts/transcription-adoption.ts",
|
|
42
37
|
"../kernel/src/contracts/voice.ts",
|
|
@@ -46,26 +41,32 @@
|
|
|
46
41
|
"../kernel/src/contracts/authoring-actions.ts",
|
|
47
42
|
"../kernel/src/contracts/document-history.ts",
|
|
48
43
|
"../kernel/src/contracts/authoring-clients.ts",
|
|
44
|
+
"../kernel/src/contracts/authoring-windows.ts",
|
|
49
45
|
"../kernel/src/contracts/projects.ts",
|
|
50
46
|
"../kernel/src/contracts/document-image.ts",
|
|
51
47
|
"../kernel/src/contracts.ts",
|
|
52
|
-
"../kernel/src/
|
|
48
|
+
"../kernel/src/random-uuid.ts",
|
|
49
|
+
"../kernel/src/access.ts",
|
|
50
|
+
"../kernel/src/document-places.ts",
|
|
51
|
+
"../kernel/src/document-comments.ts",
|
|
53
52
|
"../kernel/src/document-schema.ts",
|
|
53
|
+
"../kernel/src/document-narrations.ts",
|
|
54
|
+
"../kernel/src/document-operations.ts",
|
|
54
55
|
"../kernel/src/authoring.ts",
|
|
55
56
|
"../kernel/src/document-pages.ts",
|
|
56
57
|
"../kernel/src/fingerprint.ts",
|
|
57
58
|
"../kernel/src/document-reads.ts",
|
|
58
59
|
"../kernel/src/document-voices.ts",
|
|
59
60
|
"../kernel/src/document-colors.ts",
|
|
60
|
-
"../kernel/src/access.ts",
|
|
61
|
-
"../kernel/src/document-comments.ts",
|
|
62
61
|
"../kernel/src/document-caption-timings.ts",
|
|
62
|
+
"../kernel/src/document-caption-scale.ts",
|
|
63
63
|
"../kernel/src/parameters.ts",
|
|
64
64
|
"../kernel/src/document.ts",
|
|
65
65
|
"../kernel/src/document-components.ts",
|
|
66
66
|
"../kernel/src/document-authoring-actions.ts",
|
|
67
67
|
"../kernel/src/transcription-adoption.ts",
|
|
68
68
|
"../kernel/src/recording.ts",
|
|
69
|
+
"../kernel/src/production-captions.ts",
|
|
69
70
|
"../kernel/src/ir.ts",
|
|
70
71
|
"../kernel/src/anchors.ts",
|
|
71
72
|
"../kernel/src/diagnostics.ts",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"../kernel/src/events.ts",
|
|
75
76
|
"../kernel/src/execution.ts",
|
|
76
77
|
"../kernel/src/git.ts",
|
|
78
|
+
"../kernel/src/escape-html.ts",
|
|
77
79
|
"../kernel/src/html.ts",
|
|
78
80
|
"../kernel/src/requests.ts",
|
|
79
81
|
"../kernel/src/step-keys.ts",
|
|
@@ -83,9 +85,13 @@
|
|
|
83
85
|
"../kernel/src/kernel.ts",
|
|
84
86
|
"../kernel/src/locale.ts",
|
|
85
87
|
"../kernel/src/lock.ts",
|
|
88
|
+
"../kernel/src/myst-marks.ts",
|
|
86
89
|
"../kernel/src/lower-myst.ts",
|
|
87
|
-
"../kernel/src/keyboard.ts",
|
|
88
90
|
"../kernel/src/preview-frame.ts",
|
|
91
|
+
"../kernel/src/keyboard.ts",
|
|
92
|
+
"../kernel/src/preview-frame-connect.ts",
|
|
93
|
+
"../kernel/src/stale-module.ts",
|
|
94
|
+
"../kernel/src/embed.ts",
|
|
89
95
|
"../kernel/src/preview-edit.ts",
|
|
90
96
|
"../kernel/src/props.ts",
|
|
91
97
|
"../kernel/src/reading.ts",
|
|
@@ -108,44 +114,61 @@
|
|
|
108
114
|
"../kernel/src/jupyter-kernel.ts",
|
|
109
115
|
"../kernel/src/preview-events.ts",
|
|
110
116
|
"../kernel/src/index.ts",
|
|
117
|
+
"../workbench/src/workbench-state.ts",
|
|
118
|
+
"../workbench/src/document-return-point.ts",
|
|
119
|
+
"../workbench/src/document-editor/table-identities.ts",
|
|
120
|
+
"../workbench/src/document-editor/selection.ts",
|
|
121
|
+
"../workbench/src/shortcuts.ts",
|
|
122
|
+
"../workbench/src/messages.ts",
|
|
123
|
+
"../workbench/src/document-editing.ts",
|
|
124
|
+
"../workbench/src/workspace-client.ts",
|
|
125
|
+
"../workbench/src/sha256.ts",
|
|
126
|
+
"../workbench/src/recording-adoption.ts",
|
|
127
|
+
"../workbench/src/document-voices.ts",
|
|
128
|
+
"../workbench/src/component-properties.ts",
|
|
129
|
+
"../workbench/src/caption-timing.ts",
|
|
130
|
+
"../workbench/src/step-production.ts",
|
|
131
|
+
"../workbench/src/document-timing-drafts.ts",
|
|
132
|
+
"../workbench/src/caption-timing-drafts.ts",
|
|
133
|
+
"../workbench/src/voice-drafts.ts",
|
|
134
|
+
"../workbench/src/media-drafts.ts",
|
|
135
|
+
"../workbench/src/transcription-drafts.ts",
|
|
136
|
+
"../workbench/src/document-production.ts",
|
|
137
|
+
"../design/src/icons.ts",
|
|
138
|
+
"../design/src/tokens.ts",
|
|
139
|
+
"../design/src/assets/brand.ts",
|
|
140
|
+
"../design/src/length.ts",
|
|
141
|
+
"../design/src/index.ts",
|
|
142
|
+
"../workbench/src/base-controls.tsx",
|
|
143
|
+
"../workbench/src/sortable-list.tsx",
|
|
144
|
+
"../workbench/src/components.tsx",
|
|
111
145
|
"../workbench/src/schema-form/context.ts",
|
|
112
146
|
"../workbench/src/schema-form/fields.tsx",
|
|
113
147
|
"../workbench/src/schema-form/templates.tsx",
|
|
114
148
|
"../workbench/src/schema-form/widgets.tsx",
|
|
115
149
|
"../workbench/src/schema-form/validator.ts",
|
|
116
150
|
"../workbench/src/schema-form/PmSchemaForm.tsx",
|
|
117
|
-
"../workbench/src/step-production.ts",
|
|
118
151
|
"../workbench/src/StepProductionEditor.tsx",
|
|
119
152
|
"../workbench/src/media-messages.ts",
|
|
120
153
|
"../workbench/src/media-time.ts",
|
|
121
154
|
"../workbench/src/MediaClipEditor.tsx",
|
|
122
|
-
"../workbench/src/shortcuts.ts",
|
|
123
|
-
"../workbench/src/messages.ts",
|
|
124
155
|
"../workbench/src/context.tsx",
|
|
125
156
|
"../workbench/src/places.ts",
|
|
126
157
|
"../workbench/src/preview.ts",
|
|
127
|
-
"../workbench/src/caption-timing.ts",
|
|
128
158
|
"../workbench/src/document-draft-store.ts",
|
|
129
159
|
"../workbench/src/document-editor/comment-drafts.ts",
|
|
130
160
|
"../workbench/src/component-property-drafts.ts",
|
|
131
|
-
"../workbench/src/component-properties.ts",
|
|
132
161
|
"../workbench/src/authoring-draft-fragment.ts",
|
|
133
162
|
"../workbench/src/document-editor/comment-draft-inspection.ts",
|
|
134
163
|
"../workbench/src/document-editor/comment-draft-actions.ts",
|
|
164
|
+
"../workbench/src/body-draft-actions.ts",
|
|
165
|
+
"../workbench/src/production-draft-actions.ts",
|
|
135
166
|
"../workbench/src/component-draft-inspection.ts",
|
|
136
167
|
"../workbench/src/component-draft-actions.ts",
|
|
137
|
-
"../workbench/src/workspace-client.ts",
|
|
138
168
|
"../workbench/src/document-drafts.ts",
|
|
139
169
|
"../workbench/src/document-session.ts",
|
|
140
|
-
"../workbench/src/recording-adoption.ts",
|
|
141
170
|
"../workbench/src/transcription-session.ts",
|
|
142
171
|
"../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
172
|
"../workbench/src/document-preview.ts",
|
|
150
173
|
"../workbench/src/diagnostics.ts",
|
|
151
174
|
"../workbench/src/history.ts",
|
|
@@ -155,15 +178,13 @@
|
|
|
155
178
|
"../workbench/src/preview-playback.ts",
|
|
156
179
|
"../workbench/src/production-playback.ts",
|
|
157
180
|
"../workbench/src/workbench.ts",
|
|
181
|
+
"../workbench/src/container-layout.ts",
|
|
158
182
|
"../workbench/src/outline.ts",
|
|
159
183
|
"../workbench/src/panels/ExportPanel.tsx",
|
|
160
184
|
"../workbench/src/panels/HistoryPanel.tsx",
|
|
161
185
|
"../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
186
|
"../workbench/src/panels/PreviewPanel.tsx",
|
|
187
|
+
"../workbench/src/agent-activity.ts",
|
|
167
188
|
"../workbench/src/document-editor/blocknote-messages.ts",
|
|
168
189
|
"../workbench/src/document-editor/colors.ts",
|
|
169
190
|
"../workbench/src/document-editor/messages.ts",
|
|
@@ -172,18 +193,23 @@
|
|
|
172
193
|
"../workbench/src/document-editor/schema.tsx",
|
|
173
194
|
"../workbench/src/document-editor/file-input.ts",
|
|
174
195
|
"../workbench/src/document-editor/clipboard.ts",
|
|
196
|
+
"../workbench/src/document-editor/page-body.ts",
|
|
175
197
|
"../workbench/src/document-editor/authoring.tsx",
|
|
198
|
+
"../workbench/src/document-editor/inline.ts",
|
|
199
|
+
"../workbench/src/document-editor/rich-text.ts",
|
|
176
200
|
"../workbench/src/document-editor/comments.ts",
|
|
201
|
+
"../workbench/src/approvals.tsx",
|
|
202
|
+
"../workbench/src/document-editor/component-label.ts",
|
|
177
203
|
"../workbench/src/document-editor/DocumentComments.tsx",
|
|
204
|
+
"../workbench/src/document-editor/CommentComposer.tsx",
|
|
178
205
|
"../workbench/src/document-editor/NewCommentDrafts.tsx",
|
|
179
206
|
"../workbench/src/document-editor/BlockNoteSurface.tsx",
|
|
180
|
-
"../workbench/src/document-editor/focus.ts",
|
|
181
|
-
"../workbench/src/document-editor/narration.ts",
|
|
182
207
|
"../workbench/src/document-editor/narration-schema.tsx",
|
|
183
208
|
"../workbench/src/document-editor/NarrationEditor.tsx",
|
|
209
|
+
"../workbench/src/document-editor/focus.ts",
|
|
210
|
+
"../workbench/src/document-editor/narration.ts",
|
|
184
211
|
"../workbench/src/document-editor/DocumentStepNarration.tsx",
|
|
185
212
|
"../workbench/src/production-messages.ts",
|
|
186
|
-
"../workbench/src/voice-drafts.ts",
|
|
187
213
|
"../workbench/src/voice-clone-messages.ts",
|
|
188
214
|
"../workbench/src/voice-messages.ts",
|
|
189
215
|
"../workbench/src/voice-snapshot.ts",
|
|
@@ -196,11 +222,11 @@
|
|
|
196
222
|
"../workbench/src/panels/DocumentVoiceDialog.tsx",
|
|
197
223
|
"../workbench/src/panels/DocumentVoiceField.tsx",
|
|
198
224
|
"../workbench/src/panels/VoiceoverDialog.tsx",
|
|
225
|
+
"../workbench/src/panels/ProductionCaptionSize.tsx",
|
|
199
226
|
"../workbench/src/caption-timing-messages.ts",
|
|
200
227
|
"../workbench/src/panels/ProductionCaptionTiming.tsx",
|
|
201
228
|
"../workbench/src/audio-waveform.ts",
|
|
202
229
|
"../workbench/src/panels/ProductionTimeline.tsx",
|
|
203
|
-
"../workbench/src/media-drafts.ts",
|
|
204
230
|
"../workbench/src/panels/ProductionMediaClips.tsx",
|
|
205
231
|
"../workbench/src/use-recording-adoption.ts",
|
|
206
232
|
"../workbench/src/panels/ProductionRecordingRange.tsx",
|
|
@@ -212,6 +238,9 @@
|
|
|
212
238
|
"../workbench/src/panels/ProductionPanel.tsx",
|
|
213
239
|
"../workbench/src/panels/PageRenameDialog.tsx",
|
|
214
240
|
"../workbench/src/panels/PageDeleteDialog.tsx",
|
|
241
|
+
"../workbench/src/document-editor/agent-targets.ts",
|
|
242
|
+
"../workbench/src/document-editor/projection.ts",
|
|
243
|
+
"../workbench/src/document-editor/insertion-place.ts",
|
|
215
244
|
"../workbench/src/document-editor/DocumentEditor.tsx",
|
|
216
245
|
"../workbench/src/document-editor/block-preview-messages.ts",
|
|
217
246
|
"../workbench/src/document-editor/DocumentBlockFallback.tsx",
|
|
@@ -219,26 +248,30 @@
|
|
|
219
248
|
"../workbench/src/component-property-messages.ts",
|
|
220
249
|
"../workbench/src/document-editor/ComponentMaterials.tsx",
|
|
221
250
|
"../workbench/src/document-editor/ComponentPropertiesDialog.tsx",
|
|
251
|
+
"../workbench/src/document-editor/PlaceComment.tsx",
|
|
222
252
|
"../workbench/src/document-editor/DocumentBlockPreview.tsx",
|
|
223
253
|
"../workbench/src/panels/SourceDocumentPanel.tsx",
|
|
224
254
|
"../workbench/src/panels/DocumentNarrationPanel.tsx",
|
|
225
255
|
"../workbench/src/panels/DocumentView.tsx",
|
|
226
256
|
"../workbench/src/panels/HomePanel.tsx",
|
|
227
|
-
"../workbench/src/approvals.tsx",
|
|
228
|
-
"../workbench/src/assistant-mascot.ts",
|
|
229
257
|
"../workbench/src/speech-settings-messages.ts",
|
|
230
258
|
"../workbench/src/panels/SpeechSettingsPanel.tsx",
|
|
231
259
|
"../workbench/src/authoring-client.ts",
|
|
260
|
+
"../workbench/src/authoring-window.ts",
|
|
261
|
+
"../workbench/src/agent-activity-messages.ts",
|
|
262
|
+
"../workbench/src/AgentActivityBar.tsx",
|
|
263
|
+
"../workbench/src/mcp-settings-messages.ts",
|
|
264
|
+
"../workbench/src/panels/McpSettingsPanel.tsx",
|
|
232
265
|
"../workbench/src/index.ts",
|
|
266
|
+
"src/client/messages.ts",
|
|
267
|
+
"src/client/settings-launcher.tsx",
|
|
233
268
|
"src/workspace-events.ts",
|
|
234
269
|
"src/client/workspace-events.ts",
|
|
235
270
|
"src/client/contract.ts",
|
|
236
271
|
"src/client/author-settings.ts",
|
|
237
272
|
"src/client/speech-settings.tsx",
|
|
238
273
|
"src/client/settings-opener.ts",
|
|
239
|
-
"src/client/messages.ts",
|
|
240
274
|
"src/client/brand.tsx",
|
|
241
|
-
"src/client/mascot.tsx",
|
|
242
275
|
"src/client/document-context.ts",
|
|
243
276
|
"src/client/observable.ts",
|
|
244
277
|
"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.101",
|
|
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.102",
|
|
90
|
+
"@lincyaw/mcp": "1.0.0-rc.102",
|
|
91
|
+
"@lincyaw/kernel": "1.0.0-rc.102",
|
|
92
|
+
"@lincyaw/skills": "1.0.0-rc.102"
|
|
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.102",
|
|
109
|
+
"@lincyaw/workbench": "0.2.0-rc.102"
|
|
109
110
|
},
|
|
110
111
|
"scripts": {}
|
|
111
112
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { useStartupReady } from './startup.ts'
|
|
1
2
|
import { Group, Panel, Separator, usePanelRef } from 'react-resizable-panels'
|
|
2
|
-
import { DocumentView, HomePanel, PmDialog, PmIcon, PmMenu, SHORTCUTS, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider } from '@lincyaw/workbench'
|
|
3
|
+
import { AgentActivityBar, DocumentView, HomePanel, PmDialog, PmIcon, PmMenu, SHORTCUTS, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider } from '@lincyaw/workbench'
|
|
3
4
|
import type { Workbench } from '@lincyaw/workbench'
|
|
4
5
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'
|
|
5
6
|
import type { ReactNode, RefObject } from 'react'
|
|
7
|
+
import { openMcpSettings } from './settings-opener.ts'
|
|
6
8
|
import { Logo } from './brand.tsx'
|
|
7
9
|
import { mainViewAgentSession } from './document-context.ts'
|
|
8
|
-
import { clamp, CONVERSATION_MAX, CONVERSATION_MIN,
|
|
10
|
+
import { centreMinWidth, clamp, CONVERSATION_MAX, CONVERSATION_MIN, singlePaneWidth, RIGHTBAR_MAX_RATIO, RIGHTBAR_MIN, rightbarRoom, SIDE_COLLAPSE, SIDE_MAX, SIDE_MIN } from './layout.ts'
|
|
9
11
|
import type { LayoutActions, LayoutState, NarrowPane } from './layout.ts'
|
|
10
12
|
import { useClientMessages } from './messages.ts'
|
|
11
13
|
import { isSamePath } from './paths.ts'
|
|
@@ -35,7 +37,7 @@ type Box = { left: number, top: number, width: number, height: number }
|
|
|
35
37
|
export function rootLayoutFor(options: RootLayoutOptions) {
|
|
36
38
|
return function PresmiumRootLayout(props: RootSlotProps) {
|
|
37
39
|
return (
|
|
38
|
-
<WorkbenchProvider workbench={options.workbench}>
|
|
40
|
+
<WorkbenchProvider workbench={options.workbench} dialogActions={<WorkbenchApprovals />}>
|
|
39
41
|
<WorkbenchRuntimeBoundary workbench={options.workbench}><RootLayout {...props} {...options} /></WorkbenchRuntimeBoundary>
|
|
40
42
|
</WorkbenchProvider>
|
|
41
43
|
)
|
|
@@ -45,7 +47,7 @@ export function rootLayoutFor(options: RootLayoutOptions) {
|
|
|
45
47
|
/** The columns' widths for the viewport: 0 for a column that is not shown. */
|
|
46
48
|
function solveGeometry(info: LayoutState['layoutInfo']) {
|
|
47
49
|
const viewport = info.viewportWidth
|
|
48
|
-
const narrow = viewport <
|
|
50
|
+
const narrow = viewport < singlePaneWidth()
|
|
49
51
|
const collapsed = viewport < SIDE_COLLAPSE
|
|
50
52
|
const side = narrow ? 0 : (collapsed ? info.isSideExpanded : info.isSideOpen) ? info.sideWidth : 0
|
|
51
53
|
const conversation = narrow || !info.isConversationOpen ? 0 : collapsed ? Math.min(info.conversationWidth, Math.max(300, Math.round(viewport * 0.4))) : info.conversationWidth
|
|
@@ -136,6 +138,7 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
136
138
|
const info = useStore(state => state.layoutInfo)
|
|
137
139
|
const activePanel = usePanelInfo(panel => panel.activePanelId)
|
|
138
140
|
const t = useClientMessages(workbench)
|
|
141
|
+
useStartupReady(workbench)
|
|
139
142
|
const document_ = useWorkbenchState(state => state.document)
|
|
140
143
|
const retainedDocument = useRef(false)
|
|
141
144
|
if (document_ !== undefined) retainedDocument.current = true
|
|
@@ -221,7 +224,7 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
221
224
|
<div className="pmw-frame__sidebar" data-pmw-slot="sidebar" data-shown={(narrow ? pane === 'sessions' : sideShown) || undefined}>{sidebar}</div>
|
|
222
225
|
</Panel>
|
|
223
226
|
{sideShown && <Separator className="pmw-frame__handle" data-side="side" aria-label={t.resize} />}
|
|
224
|
-
<Panel id="centre" minSize={narrow ? 0 :
|
|
227
|
+
<Panel id="centre" minSize={narrow ? 0 : centreMinWidth()} className="pmw-frame__centre-panel" hidden={narrow && (pane === 'sessions' || pane === 'conversation') && panel === null}>
|
|
225
228
|
<main id="pmw-centre" className="pmw-frame__centre" aria-label={documentTitle ?? t.centre}>{centre}</main>
|
|
226
229
|
</Panel>
|
|
227
230
|
{!narrow && info.isRightbarOpen && !info.isRightbarFullscreen && geometry.track > 0 && (
|
|
@@ -293,7 +296,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
293
296
|
}
|
|
294
297
|
|
|
295
298
|
return (
|
|
296
|
-
<nav className="pmw-appbar" aria-label={t.activity}>
|
|
299
|
+
<nav className="pm-ui-appbar pmw-appbar" aria-label={t.activity}>
|
|
297
300
|
<span className="pmw-appbar__brand"><Logo /><span className="pmw-brand-name">{t.product}</span></span>
|
|
298
301
|
<ol className="pmw-appbar__places">
|
|
299
302
|
<li>
|
|
@@ -311,21 +314,21 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
311
314
|
{panelLabel && <li><span className="pmw-appbar__place" aria-current="page"><span className="pmw-appbar__label">{panelLabel}</span></span></li>}
|
|
312
315
|
</ol>
|
|
313
316
|
<span className="pmw-spacer" />
|
|
317
|
+
<AgentActivityBar />
|
|
314
318
|
<span className="pmw-appbar__approvals" data-activity="approvals"><WorkbenchApprovals density={narrow ? 'touch' : 'compact'} /></span>
|
|
315
319
|
<button type="button" className="pmw-appbar__button pmw-appbar__assistant" data-activity="assistant" title={t.assistant} aria-pressed={chatShown} onClick={toggleAssistant}>
|
|
316
320
|
<PmIcon name="sparkle" /><span className="pmw-appbar__label">{t.assistant}</span>
|
|
317
321
|
{working && <span className="pmw-appbar__busy" aria-hidden="true" />}
|
|
318
322
|
</button>
|
|
319
323
|
<span className="pmw-appbar__divider" aria-hidden="true" />
|
|
320
|
-
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
<button type="button" className="pmw-appbar__button" data-activity="settings" aria-label={t.settings} title={t.settings} onClick={openSettings}><PmIcon name="sliders" /></button>
|
|
324
|
+
<span className="pmw-appbar__more" data-activity="settings">
|
|
325
|
+
<PmMenu label={t.settings} icon="sliders" items={[{ id: 'presmium-settings', label: t.preferences }, { id: 'presmium-mcp', label: t.mcp }, ...more]} onSelect={id => {
|
|
326
|
+
if (id === 'presmium-settings') { openSettings(); return }
|
|
327
|
+
if (id === 'presmium-mcp') { if (!openMcpSettings()) openSettings(); return }
|
|
328
|
+
actions.selectPanel(activePanel === id ? null : id)
|
|
329
|
+
if (narrow) actions.showNarrowPane('documents')
|
|
330
|
+
}} />
|
|
331
|
+
</span>
|
|
329
332
|
<button type="button" className="pmw-appbar__button" data-activity="help" aria-label={t.help} title={t.help} onClick={openHelp}><PmIcon name="help" /></button>
|
|
330
333
|
</nav>
|
|
331
334
|
)
|
|
@@ -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,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useStartupReady } from './startup.ts'
|
|
2
|
+
import { AgentActivityBar, DocumentView, HistoryPanel, HomePanel, PreviewPanel, useWorkbench, useWorkbenchState, WorkbenchProvider, WorkbenchApprovals } from '@lincyaw/workbench'
|
|
2
3
|
import type { Workbench } from '@lincyaw/workbench'
|
|
3
4
|
import { useRef } from 'react'
|
|
4
5
|
import type { ComponentType } from 'react'
|
|
@@ -11,15 +12,16 @@ export const FALLBACK_PANEL = 'presmium'
|
|
|
11
12
|
|
|
12
13
|
function Centre() {
|
|
13
14
|
const workbench = useWorkbench()
|
|
15
|
+
useStartupReady(workbench)
|
|
14
16
|
const document_ = useWorkbenchState(state => state.document)
|
|
15
17
|
const retainedDocument = useRef(false)
|
|
16
18
|
if (document_ !== undefined) retainedDocument.current = true
|
|
17
19
|
return (
|
|
18
20
|
<div className="pmw-fallback pm-ui" data-pmw-fallback="">
|
|
19
21
|
<RuntimeDiagnosticsNotice workbench={workbench} />
|
|
20
|
-
{document_ === undefined && <HomePanel />}
|
|
22
|
+
{document_ === undefined && <HomePanel actions={<AgentActivityBar />} />}
|
|
21
23
|
{retainedDocument.current && <div className="pmw-fallback__doc" hidden={document_ === undefined}>
|
|
22
|
-
<DocumentView active={document_ !== undefined} />
|
|
24
|
+
<DocumentView active={document_ !== undefined} actions={<AgentActivityBar />} />
|
|
23
25
|
</div>}
|
|
24
26
|
</div>
|
|
25
27
|
)
|
|
@@ -30,7 +32,7 @@ export function registerFallbackLayout(ctx: DshClientContext, workbench: Workben
|
|
|
30
32
|
const t = () => CLIENT_MESSAGES[workbench.state.locale]
|
|
31
33
|
const provided = (Component: ComponentType, className?: string) => function PresmiumPanel() {
|
|
32
34
|
return (
|
|
33
|
-
<WorkbenchProvider workbench={workbench}>
|
|
35
|
+
<WorkbenchProvider workbench={workbench} dialogActions={<WorkbenchApprovals />}>
|
|
34
36
|
<WorkbenchRuntimeBoundary workbench={workbench}>{className ? <div className={className}><Component /></div> : <Component />}</WorkbenchRuntimeBoundary>
|
|
35
37
|
</WorkbenchProvider>
|
|
36
38
|
)
|
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,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { openAppSettings, registerSettingsLauncher } from './settings-launcher.tsx'
|
|
2
|
+
import { connectAgentActivity, connectAuthoringClient, connectAuthoringWindow, localeOf, Workbench, workspaceClient } from '@lincyaw/workbench'
|
|
2
3
|
import type { Locale } from '@lincyaw/workbench'
|
|
3
4
|
import { workspaceSubscriptions } from './workspace-events.ts'
|
|
4
5
|
import { registerAuthorSettings } from './author-settings.ts'
|
|
5
6
|
import { registerSpeechSettings } from './speech-settings.tsx'
|
|
6
7
|
import { openSpeechSettings } from './settings-opener.ts'
|
|
7
8
|
import { registerBrand } from './brand.tsx'
|
|
8
|
-
import { registerMascot } from './mascot.tsx'
|
|
9
9
|
import { CLIENT_ID, isBootEntryLoaded, ROOT_CHILDREN, UI_LAYOUT, UI_SIDEBAR } from './contract.ts'
|
|
10
10
|
import { syncDocumentContext } from './document-context.ts'
|
|
11
11
|
import { FALLBACK_PANEL, registerFallbackLayout } from './fallback.tsx'
|
|
@@ -56,6 +56,8 @@ export function apply(ctx: DshClientContext): void {
|
|
|
56
56
|
const workbench = new Workbench({ client: workspaceClient('api/presmium/', workspaceSubscriptions(ctx)), locale: workbenchLocale(ctx.locale.getLocale().active) })
|
|
57
57
|
workbench.client.openSpeechSettings = openSpeechSettings
|
|
58
58
|
ctx.effect(() => connectAuthoringClient(workbench), 'presmium: authoring client control')
|
|
59
|
+
ctx.effect(() => connectAuthoringWindow(workbench), 'presmium: authoring window control')
|
|
60
|
+
ctx.effect(() => connectAgentActivity(workbench), 'presmium: agent activity')
|
|
59
61
|
ctx.effect(() => runtimeDiagnostics(workbench).start(), 'presmium: runtime diagnostics')
|
|
60
62
|
let showEditor = (layout: DshClientContext['layout']) => layout.selectPanel(FALLBACK_PANEL)
|
|
61
63
|
registerSourceLinks(ctx, workbench, layout => showEditor(layout))
|
|
@@ -75,6 +77,8 @@ export function apply(ctx: DshClientContext): void {
|
|
|
75
77
|
}, 'presmium: light and dark')
|
|
76
78
|
|
|
77
79
|
if (nativeLayout) {
|
|
80
|
+
// Its default conversation view does not mount HomePanel, so the host owns this first read.
|
|
81
|
+
void workbench.loadDocuments()
|
|
78
82
|
registerFallbackLayout(ctx, workbench)
|
|
79
83
|
} else {
|
|
80
84
|
ctx.effect(() => {
|
|
@@ -102,10 +106,7 @@ export function apply(ctx: DshClientContext): void {
|
|
|
102
106
|
subscribe: listener => instance.subscribe(listener),
|
|
103
107
|
})
|
|
104
108
|
showEditor = () => layout.showDocument()
|
|
105
|
-
const openSettings =
|
|
106
|
-
const triggers = document.querySelectorAll<HTMLElement>('[data-pmw-slot="sidebar"] button[aria-haspopup="dialog"]')
|
|
107
|
-
triggers[triggers.length - 1]?.click()
|
|
108
|
-
}
|
|
109
|
+
const openSettings = openAppSettings
|
|
109
110
|
const disposePanelInfo = ctx.slots.provideRoot({ hooks: { panelInfo: layout.panelInfo } })
|
|
110
111
|
const disposeRoot = ctx.slots.register({ name: 'root', locale: 'common', children: {
|
|
111
112
|
...ROOT_CHILDREN,
|
|
@@ -148,8 +149,8 @@ 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
|
+
registerSettingsLauncher(ctx, workbench)
|
|
153
154
|
registerSpeechSettings(ctx, workbench)
|
|
154
155
|
ctx.inject(['layout'], inner => inner.effect(() => connectLaunchTarget(workbench,
|
|
155
156
|
() => nativeLayout ? () => {} : restoreRootReturnPoint(workbench, reload.point),
|