@yadsh/dsh-draft-sessions 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +207 -0
- package/README.ru.md +192 -0
- package/README.zh-CN.md +207 -0
- package/SPEC.md +102 -0
- package/compatibility.json +10 -0
- package/cordis.patch.yml +4 -0
- package/docs/images/draft-sessions-actions.png +0 -0
- package/docs/images/draft-sessions-hero.png +0 -0
- package/docs/images/draft-sessions-stock-fallback.jpg +0 -0
- package/lib/client.js +6197 -0
- package/lib/constants-vAKitj5i.js +11 -0
- package/lib/index.js +292 -0
- package/lib/remote.js +71 -0
- package/lib/schema-BkmWuQBa.js +33 -0
- package/lib/shared/types.js +13 -0
- package/lib/types/client/composer.d.ts +46 -0
- package/lib/types/client/draft-sidebar-view.d.ts +22 -0
- package/lib/types/client/index.d.ts +32 -0
- package/lib/types/client/lifecycle.d.ts +69 -0
- package/lib/types/client/shortcut.d.ts +40 -0
- package/lib/types/client/sidebar.d.ts +40 -0
- package/lib/types/client/workspace-contribution.d.ts +25 -0
- package/lib/types/host/errors.d.ts +7 -0
- package/lib/types/host/schema.d.ts +40 -0
- package/lib/types/host/store.d.ts +28 -0
- package/lib/types/index.d.ts +33 -0
- package/lib/types/remote.d.ts +20 -0
- package/lib/types/shared/constants.d.ts +9 -0
- package/lib/types/shared/types.d.ts +70 -0
- package/package.json +140 -0
package/SPEC.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# v1 specification
|
|
2
|
+
|
|
3
|
+
## Product contract
|
|
4
|
+
|
|
5
|
+
1. A user can keep at least 20 drafts in one Workspace.
|
|
6
|
+
2. Every draft is independently editable.
|
|
7
|
+
3. Creating a draft never sends a model request.
|
|
8
|
+
4. Drafts appear as visually muted Session-like rows.
|
|
9
|
+
5. Opening a draft restores exactly its unsent text.
|
|
10
|
+
6. Switching between drafts never mixes their text.
|
|
11
|
+
7. A page reload does not lose drafts.
|
|
12
|
+
8. A DSH restart does not lose drafts.
|
|
13
|
+
9. If a backing blank Session disappears, the plugin creates another and rebinds it.
|
|
14
|
+
10. The first accepted Send converts the draft into a normal DSH Session.
|
|
15
|
+
11. A rejected Send leaves the draft intact.
|
|
16
|
+
12. Normal DSH Sessions are unaffected.
|
|
17
|
+
13. Removing the plugin does not corrupt or modify ordinary Session history.
|
|
18
|
+
14. Draft text never enters model context before Send.
|
|
19
|
+
15. Multiple browsers connected to one Host see the same Host-backed drafts.
|
|
20
|
+
|
|
21
|
+
## v1 data model
|
|
22
|
+
|
|
23
|
+
Each record contains a format version, draft id, nullable backing Session id, Workspace identity, unsent text, optional explicit title, timestamps, ordering, state, and optimistic `revision`.
|
|
24
|
+
|
|
25
|
+
The durable file is versioned independently from each record. Unsupported or malformed durable data fails loudly; the plugin never silently resets a corrupt file.
|
|
26
|
+
|
|
27
|
+
## Lifecycle
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
create DraftRecord
|
|
31
|
+
↓
|
|
32
|
+
create/open blank Session
|
|
33
|
+
↓
|
|
34
|
+
edit + debounced optimistic autosave
|
|
35
|
+
↓
|
|
36
|
+
first prompt accepted
|
|
37
|
+
↓
|
|
38
|
+
Session.blank: true → false
|
|
39
|
+
↓
|
|
40
|
+
delete DraftRecord
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If the prompt is rejected, `blank` remains true and the record remains. If the backing Session is missing, the client creates a replacement and calls `rebind`.
|
|
44
|
+
|
|
45
|
+
## Scope
|
|
46
|
+
|
|
47
|
+
### Included
|
|
48
|
+
|
|
49
|
+
- Text drafts and textual `@file` references
|
|
50
|
+
- Model, preset, and permission state owned by the backing Session
|
|
51
|
+
- At least 20 drafts per Workspace
|
|
52
|
+
- Reordering
|
|
53
|
+
- Host persistence
|
|
54
|
+
- Multiple browser synchronization
|
|
55
|
+
- Reload/restart recovery
|
|
56
|
+
|
|
57
|
+
### Deferred
|
|
58
|
+
|
|
59
|
+
- Images and binary attachments
|
|
60
|
+
- Archive, fork, and export before materialization
|
|
61
|
+
- Cross-Host synchronization
|
|
62
|
+
- Conflict-free collaborative text editing
|
|
63
|
+
|
|
64
|
+
## Required end-to-end scenarios
|
|
65
|
+
|
|
66
|
+
### Isolation and reload
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
create A → type AAA
|
|
70
|
+
create B → type BBB
|
|
71
|
+
open A → AAA
|
|
72
|
+
open B → BBB
|
|
73
|
+
reload
|
|
74
|
+
open A → AAA
|
|
75
|
+
open B → BBB
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Host restart recovery
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
draft A → restart Host → backing Session missing
|
|
82
|
+
→ create replacement blank Session → rebind → text preserved
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Conversion
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
draft → Send → prompt accepted → blank becomes false
|
|
89
|
+
→ draft row disappears → normal Session row appears
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Implementation status
|
|
93
|
+
|
|
94
|
+
| Area | Status |
|
|
95
|
+
| --------------------------------- | ----------- |
|
|
96
|
+
| Durable schema and JSON store | Implemented |
|
|
97
|
+
| CRUD, ordering, limits, revisions | Implemented |
|
|
98
|
+
| Strict Client Remote contract | Implemented |
|
|
99
|
+
| Backing Session lifecycle | Implemented |
|
|
100
|
+
| Composer restore/autosave | Implemented |
|
|
101
|
+
| Draft-aware workspace sidebar | Partial |
|
|
102
|
+
| Browser/Host E2E coverage | Planned |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deepseekHarness": {
|
|
3
|
+
"channel": "next",
|
|
4
|
+
"range": ">=0.1.1-rc.2 <0.2.0",
|
|
5
|
+
"testedReleases": ["0.1.1-rc.2"],
|
|
6
|
+
"requiredClientFeatures": ["sidebar.footer.action"],
|
|
7
|
+
"optionalClientProtocols": ["__dshNativeTabs@1"]
|
|
8
|
+
},
|
|
9
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
10
|
+
}
|
package/cordis.patch.yml
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|