dsh-multi-folder 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/design.md +7 -3
- package/lib/client.js +28 -4
- package/package.json +1 -1
package/docs/design.md
CHANGED
|
@@ -200,9 +200,13 @@ window.__ModuleLoader__.load({
|
|
|
200
200
|
renders directly ABOVE the composer card, in the same band as the
|
|
201
201
|
git-branch chip. The entry receives the dock owner share (`{ session,
|
|
202
202
|
input }`) plus the standard `useSessions` / `useWorkspaces` selector hooks,
|
|
203
|
-
so the hero phase
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
so the hero phase and the target workspace come from framework props instead
|
|
204
|
+
of DOM probing. Detection is DSH-version-adaptive: a shell whose
|
|
205
|
+
`SessionSnapshot` carries `composerPhase` uses
|
|
206
|
+
`composerPhase === 'blank' && (openState === 'open' || blank)`, while DSH
|
|
207
|
+
0.1.2 (no `composerPhase`) uses the settled-blank fallback
|
|
208
|
+
`blank && !running && !promptAttempted && (openState === 'open' || blank)`.
|
|
209
|
+
The row stays **in flow** — `display:flex` with the official hero
|
|
206
210
|
row's 20px indent, no absolute positioning — so the framework's list-slot
|
|
207
211
|
arrangement keeps it clear of every other plugin's dock row. It renders
|
|
208
212
|
only on the session-creation page; an active session keeps its entry in the
|
package/lib/client.js
CHANGED
|
@@ -214,12 +214,13 @@ window.__ModuleLoader__.load({
|
|
|
214
214
|
|
|
215
215
|
// ------------------------------------------------------------- plugin
|
|
216
216
|
var name = 'dsh-multi-folder';
|
|
217
|
-
var inject = ['remote', 'remote.commands', 'slots', 'workspaces', 'connection', 'sessions', 'locale'];
|
|
217
|
+
var inject = ['remote', 'remote.commands', 'slots', 'workspaces', 'uiWorkspace', 'connection', 'sessions', 'locale'];
|
|
218
218
|
|
|
219
219
|
function apply(ctx) {
|
|
220
220
|
var slots = ctx.slots;
|
|
221
221
|
var remote = ctx.remote;
|
|
222
222
|
var workspaces = ctx.workspaces;
|
|
223
|
+
var uiWorkspace = ctx.uiWorkspace;
|
|
223
224
|
var connection = ctx.connection;
|
|
224
225
|
var sessions = ctx.sessions;
|
|
225
226
|
var locale = ctx.locale;
|
|
@@ -398,7 +399,18 @@ window.__ModuleLoader__.load({
|
|
|
398
399
|
}
|
|
399
400
|
|
|
400
401
|
function addDirectory() {
|
|
401
|
-
|
|
402
|
+
// DSH 0.1.2 moved the directory picker onto `uiWorkspace`; earlier
|
|
403
|
+
// shells kept it on `workspaces`. Pick whichever service actually
|
|
404
|
+
// exposes it (and call it with the right receiver), surfacing a clear
|
|
405
|
+
// error when neither does instead of throwing synchronously.
|
|
406
|
+
var picker = (uiWorkspace && typeof uiWorkspace.pickDirectory === 'function')
|
|
407
|
+
? uiWorkspace
|
|
408
|
+
: (workspaces && typeof workspaces.pickDirectory === 'function') ? workspaces : null;
|
|
409
|
+
if (picker === null) {
|
|
410
|
+
patch({ error: 'multi-folder: the directory picker service is unavailable' });
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
picker.pickDirectory().then(function (path) {
|
|
402
414
|
if (path === null || path === undefined) return;
|
|
403
415
|
var snapshot = getSnapshot();
|
|
404
416
|
if (snapshot.sessionId) {
|
|
@@ -763,10 +775,22 @@ window.__ModuleLoader__.load({
|
|
|
763
775
|
/** The shell's own hero predicate, read from the dock's owner share: a
|
|
764
776
|
* blank conversation with an open session. A still-loading blank
|
|
765
777
|
* session already lists as blank, so it may enter the hero phase
|
|
766
|
-
* before the composer snapshot settles to `open`.
|
|
778
|
+
* before the composer snapshot settles to `open`.
|
|
779
|
+
*
|
|
780
|
+
* DSH 0.1.2 exposes no `composerPhase` on SessionSnapshot; the hero
|
|
781
|
+
* phase there is a settled blank session (mirroring ConversationRoot's
|
|
782
|
+
* `hero = sessionId === undefined || (shellPhase === 'blank' && ...)`),
|
|
783
|
+
* so the blank/lifecycle fields are used as the fallback. Newer DSH
|
|
784
|
+
* shells that do carry `composerPhase` keep their original check. */
|
|
767
785
|
function isHeroPhase(session, blank) {
|
|
768
786
|
if (!session) return false;
|
|
769
|
-
|
|
787
|
+
if (session.composerPhase !== undefined) {
|
|
788
|
+
return session.composerPhase === 'blank' && (session.openState === 'open' || blank === true);
|
|
789
|
+
}
|
|
790
|
+
return session.blank === true
|
|
791
|
+
&& !session.running
|
|
792
|
+
&& !session.promptAttempted
|
|
793
|
+
&& (blank === true || session.openState === 'open');
|
|
770
794
|
}
|
|
771
795
|
|
|
772
796
|
/** The workspace path a session belongs to, from the workspaces list. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-multi-folder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "DeepSeek Harness plugin: secondary working directories for a project. The agent keeps the primary workspace as cwd, gains equal write/exec permissions on configured secondary directories under workspace-write mode, and is notified of configuration changes at the next message boundary. Configurable from the session header AND from the session-creation page (before the first message) through a sessionless multiFolder remote API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|