dsh-code-server-app 0.3.59 → 0.3.65
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-Apache-2.0.txt +201 -0
- package/README.en.md +100 -16
- package/README.md +79 -16
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/assets/extensions/dshcs-editor-bridge/extension.js +149 -2
- package/assets/extensions/dshcs-editor-bridge/lib/bridge-client.js +38 -2
- package/assets/extensions/dshcs-editor-bridge/lib/fim-completion.js +264 -0
- package/assets/extensions/dshcs-editor-bridge/package.json +2 -2
- package/lib/bridge.mjs +6 -3
- package/lib/client.js +163 -19
- package/lib/fim-adapter.mjs +603 -0
- package/lib/index.js +294 -1
- package/package.json +17 -14
- package/vendor/VENDOR.json +5 -5
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.en.md
CHANGED
|
@@ -23,7 +23,7 @@ A static profile plugin (npm package with host + client bundle) that ships the *
|
|
|
23
23
|
|
|
24
24
|
| DSH version | Carrier | Entry points |
|
|
25
25
|
|---|---|---|
|
|
26
|
-
|
|
|
26
|
+
| **rc line** `0.1.5-rc.x` (latest `0.1.5-rc.3` = npm `latest`/`next`)**and alpha line** `>= 0.1.6-alpha.2` (latest `0.1.7-alpha.1`) — detected by the presence of `sidebarRight` / `sidebarRightTabs`, never by version comparison | **Right-sidebar tab** (kind `code-server`, chip `Code Server`), which also **claims file addresses** (see below) | ① DSH's own **produced-file chips / presented-file card previews / inline file names in prose** (since 0.2.5, via the official `openFile` → file address → this tab); ② the **Code Server box** on the sidebar's guide ("开始") page; ③ Settings → Plugins → Code Server → **"Open in right sidebar"** |
|
|
27
27
|
| older (no sidebar service) | **Unsupported**: nothing but one notice on the settings page | none (Settings → Plugins → Code Server shows an upgrade notice) |
|
|
28
28
|
|
|
29
29
|
- Detection: first a synchronous `ctx.get('sidebarRightTabs') / ctx.get('sidebarRight')` probe; because the services may come up after this plugin, `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` is awaited and a **2.5 s timeout marks the DSH as legacy** (no version comparison, and the plugin's own activation is never blocked).
|
|
@@ -50,7 +50,7 @@ A static profile plugin (npm package with host + client bundle) that ships the *
|
|
|
50
50
|
the narrow-viewport handling). When the button is missing it keeps the current mode and logs one `console.warn` — panel
|
|
51
51
|
rendering is never affected.
|
|
52
52
|
- **Resident IDE (0.2.2, on by default)**: switching to another tab or collapsing the sidebar and coming back **no longer reloads** code-server — unsaved editor buffers, terminals and debug sessions all stay put (see "Why switching tabs no longer reloads" below).
|
|
53
|
-
- The settings card has exactly **
|
|
53
|
+
- The settings card has exactly **four settings**: "**Claim types**", "**Fullscreen on open**", "Resident in background" and "**FIM completion (experimental, off by default)**" — no other rows (0.2.7 removed the "Entry", "dependency install" and "environment check" rows).
|
|
54
54
|
Open the IDE from the **Code Server box** on the sidebar's guide page, or by clicking DSH's own produced-file chips / delivered-file previews / inline file names;
|
|
55
55
|
diagnostics stay out of the UI — the `[code-server]` lines in the DSH host log are the place to look (`/api/code-server/status` still returns `env` for scripts).
|
|
56
56
|
The old `windowedOpen` (open in a window) and `reserveComposer` were **removed in 0.2.6**: leftover keys in an old settings document neither fail nor apply (they are no longer part of the schema).
|
|
@@ -354,10 +354,15 @@ Regression: the "push → take → clear, twice" case in `scripts/test-bridge-ro
|
|
|
354
354
|
The token lives in `<extensionsDir>/.dshcs-bridge/bridge.json`, **readable by any process of the same local
|
|
355
355
|
user**, so:
|
|
356
356
|
|
|
357
|
-
1. **`/code-server-bridge/*` is read-only, with
|
|
357
|
+
1. **`/code-server-bridge/*` is read-only, with two bounded exceptions.** No route writes files,
|
|
358
358
|
edits documents, runs commands, or spawns processes. A leaked token is therefore bounded to "sees information
|
|
359
359
|
that is in the editor" and **can never** become arbitrary file writes or command execution. A whitelist
|
|
360
360
|
assertion in `scripts/test-bridge-routes.mjs` guards this.
|
|
361
|
+
`/complete` (0.3.61, **experimental FIM completion, off by default**) is the one route that makes a **model
|
|
362
|
+
call**: it takes two strings (the text before/after the cursor) and returns one string. It still writes
|
|
363
|
+
nothing and runs nothing, is disabled unless the setting is on (403 otherwise), and is bounded by
|
|
364
|
+
length/rate/concurrency/timeout caps — so the worst case for a leaked token grows only to "spends a little
|
|
365
|
+
completion budget and reads back one completion".
|
|
361
366
|
`/old` (added in 0.3.55) lives under the same invariant: it only reads the bounded cache of "pre-write copies of
|
|
362
367
|
the last few agent writes" (≤8 entries, ≤1 MB each, ≤4 MB total, 5-minute TTL) by **opaque key**, 404s when it
|
|
363
368
|
is gone, takes no path argument (so it cannot read arbitrary files) and does not consume (repeat polls get the
|
|
@@ -394,6 +399,64 @@ as stated for the loopback port.
|
|
|
394
399
|
Diagnostics: `GET /api/code-server/status` exposes
|
|
395
400
|
`bridge: { enabled, live, toolsRegistered, supported, url, file }` — **never the token** (that only exists in the file).
|
|
396
401
|
|
|
402
|
+
## FIM completion (experimental, since 0.3.61, **off by default**)
|
|
403
|
+
|
|
404
|
+
When you pause while typing, a grey continuation appears after the cursor (Tab accepts, Esc discards).
|
|
405
|
+
It is **off by default**; turn it on with that row in the settings card — it takes effect immediately
|
|
406
|
+
(no host restart, no reinstall).
|
|
407
|
+
|
|
408
|
+
| Item | Value |
|
|
409
|
+
|---|---|
|
|
410
|
+
| Endpoint | DeepSeek **FIM (Beta)**: `POST https://api.deepseek.com/beta/completions`, params `prompt` (prefix) + `suffix` (suffix) |
|
|
411
|
+
| Model | `deepseek-flash` (the model the official FIM doc uses — also this deployment's default) |
|
|
412
|
+
| Credential | Reuses the `DEEPSEEK_API_KEY` DSH already has: `ctx.get('credentials').resolve(...)`, the same path the official adapter takes (falling back to the launch environment) |
|
|
413
|
+
| Measured latency | **112–416 ms** (non-streaming; streaming was *slower*, hence non-streaming on purpose) |
|
|
414
|
+
| When it fires | After a ≥250 ms pause and only past the gates: non-empty selection / non-`file` document / empty context / document >20k lines — those **never send a request** |
|
|
415
|
+
|
|
416
|
+
**How it is wired in (option A)**: FIM speaks the Completions API, while `ctx.llm.stream(GenerateOptions)`
|
|
417
|
+
only knows `messages` (no `prompt`/`suffix`; `purpose` is a closed union of `'compaction' | 'session-title'`).
|
|
418
|
+
So the plugin **registers its own LLM adapter route** `dshcs-fim`: the prefix/suffix travel inside a
|
|
419
|
+
`messages` envelope with a fixed marker (`dshcs-fim/1 `), and the adapter decodes it before hitting that
|
|
420
|
+
endpoint. The call therefore still goes **through DSH's LLM service** — cancellation, timeouts, terminal
|
|
421
|
+
chunks and stable error codes all follow the service contract (instead of the plugin bypassing it with a
|
|
422
|
+
raw fetch). Evidence and measurements: B6/B7 of `docs/analysis-continuedev-reuse.md`.
|
|
423
|
+
|
|
424
|
+
**Three knobs (0.3.62, all in the settings card, effective immediately)**:
|
|
425
|
+
|
|
426
|
+
| Setting | Default | Effect |
|
|
427
|
+
|---|---|---|
|
|
428
|
+
| Pause in ms | `250` | How long typing must stop before a request. Range 100–3000 ms (clamped on save); the endpoint round trip measured **112–416 ms**, so the pause *is* the perceived latency |
|
|
429
|
+
| Allow multi-line | on | Off ⇒ the host returns the first line only; an empty first line means no completion. Turn it off to be less intrusive |
|
|
430
|
+
| Disable by glob | empty | In these files **no request is sent at all**. Semantics: `*` does not cross directories, `**` does, a pattern without `/` matches the basename, a pattern with `/` matches any path suffix (so `vendor/**` and `src/*.ts` work at any depth), a trailing `/` means `/**`. Example: `*.md;vendor/**;**/dist/**` |
|
|
431
|
+
|
|
432
|
+
> Both sides implement these semantics independently (the extension is a static file shipped with the package
|
|
433
|
+
> and cannot import host code); `scripts/test-fim.mjs` pins their equivalence with one shared (pattern, path)
|
|
434
|
+
> corpus.
|
|
435
|
+
|
|
436
|
+
**Safety and bounds** (this is the only capability of the plugin that sends content out):
|
|
437
|
+
|
|
438
|
+
- **Still read-only**: the extension never writes files and never runs commands — it only *proposes* text;
|
|
439
|
+
insertion happens when you press Tab;
|
|
440
|
+
- The bridge gains its fifth route `POST /complete` (**the only route that makes a model call**) only while
|
|
441
|
+
the setting is on; with it off the route answers 403 and no request is made;
|
|
442
|
+
- Bounded: prefix/suffix ≤6000/2000 chars (120/40 lines, whichever comes first), output ≤2000 chars,
|
|
443
|
+
4 s timeout, 120 ms minimum interval, concurrency 1, 60 calls/minute; over-limit requests are rejected
|
|
444
|
+
(409/429) and the extension simply shows no completion for that beat;
|
|
445
|
+
- One more layer in the extension: turning the setting off disposes the provider immediately (no requests at
|
|
446
|
+
all), and identical context hits a local 2-minute cache;
|
|
447
|
+
|
|
448
|
+
**Usage is visible in exactly two places**: these calls are **not session requests**, so they are not written
|
|
449
|
+
to the session log and DSH's own token accounting (per-turn usage, context pressure, telemetry) **excludes
|
|
450
|
+
them**. Usage therefore shows up in ① the IDE status bar's DSH item — a `$(zap) 1.2k` counter when on, with
|
|
451
|
+
input/output/cache-read/last-latency/last-error on hover, and ② the `fim` field of
|
|
452
|
+
`GET /api/code-server/status` (same snapshot).
|
|
453
|
+
|
|
454
|
+
**Known limits**: the model occasionally invents an insertion where nothing is needed (2/2 reproduced at a
|
|
455
|
+
cursor position that needed none); the filter pipeline strips code fences and control markers, but "should
|
|
456
|
+
this be completed at all" stays your call — Esc or typing on makes it disappear. A more reliable shape needs
|
|
457
|
+
a faster completion route, or DSH making completion a first-class request (at which point only the adapter's
|
|
458
|
+
data call changes; the caller stays as it is).
|
|
459
|
+
|
|
397
460
|
## Legacy DSH (unsupported since 0.2.3)
|
|
398
461
|
|
|
399
462
|
**Behaviour**: when `sidebarRightTabs` / `sidebarRight` cannot be found, the plugin registers a single settings card:
|
|
@@ -402,7 +465,7 @@ Diagnostics: `GET /api/code-server/status` exposes
|
|
|
402
465
|
> Since 0.2.3 this plugin no longer supports older DSH versions.
|
|
403
466
|
> The right-sidebar plugin services `sidebarRightTabs` / `sidebarRight` were not detected, so the plugin exposes no
|
|
404
467
|
> entry point at all (the old floating ball and floating window have been removed) and will not start the IDE in the
|
|
405
|
-
> background. Upgrade DSH to
|
|
468
|
+
> background. Upgrade DSH to the rc line (0.1.5-rc.x) or the alpha line from 0.1.6-alpha.2 on: Code Server then appears as a
|
|
406
469
|
> right-sidebar tab, this page shows the full settings again, and no reinstall is needed — a page refresh is enough.
|
|
407
470
|
|
|
408
471
|
- **No other UI**: no `shell.overlay` registration (floating ball), no file-address claim, no resident preload.
|
|
@@ -418,8 +481,8 @@ Diagnostics: `GET /api/code-server/status` exposes
|
|
|
418
481
|
|
|
419
482
|
- code-server's workspace **follows the active DSH session/workspace**: switching sessions/workspaces while the IDE is open moves code-server to the new directory
|
|
420
483
|
(resolution order: current session cwd → session's `workspace.path` → workspace of the most recently active session → first workspace.path;
|
|
421
|
-
**where "the current session" comes from depends on the DSH version**: ≥ 0.1.6-alpha.2 reads the session-scoped standard prop `sessionId`,
|
|
422
|
-
≤ 0.1.
|
|
484
|
+
**where "the current session" comes from depends on the DSH version**: the alpha line (≥ 0.1.6-alpha.2) reads the session-scoped standard prop `sessionId`,
|
|
485
|
+
the rc line (≤ 0.1.5-rc.3) falls back to `current` on the session-list snapshot — see the 0.3.48 bullet below; the logic is inlined in `lib/client.js`
|
|
423
486
|
(the "workspace resolution" section) and the contract for both shapes is pinned by `scripts/test-client-bundle-cwd.mjs` directly against the entry file);
|
|
424
487
|
the opened directory is shown inside code-server (`?folder=<cwd>`, the page reloads when following a switch);
|
|
425
488
|
implementation note: the iframe `src` must carry `?folder=<cwd>` — code-server's front-end remembers the "last workspace" and restores it by itself;
|
|
@@ -457,7 +520,7 @@ Diagnostics: `GET /api/code-server/status` exposes
|
|
|
457
520
|
committed hand-written source: there is no build step anywhere on that chain).
|
|
458
521
|
|
|
459
522
|
> Verified locally (BM: Windows 11 ARM64): the whole tree/dependency chain hangs directly off the plugin's
|
|
460
|
-
> dependency table — the tree package `@jinsiyu/dshcs-vscode-server` (currently 4.
|
|
523
|
+
> dependency table — the tree package `@jinsiyu/dshcs-vscode-server` (currently 4.138.0, a 50.9 MB tarball),
|
|
461
524
|
> the pure-JS inner dependencies plus the 8 platform-independent repacks in `dependencies`, and the 8
|
|
462
525
|
> platform-specific repacks (win32-arm64 / win32-x64) in `optionalDependencies` with their own os/cpu gates;
|
|
463
526
|
> the original names are restored by junctions created at runtime (`lib/native.js`)
|
|
@@ -505,7 +568,7 @@ pnpm run promote -- <version>
|
|
|
505
568
|
| Goal | Command |
|
|
506
569
|
|---|---|
|
|
507
570
|
| **Build from the latest upstream release** | `pnpm run vendor:latest` (= `--force`): pulls `code-server@latest`'s tree into `vendor/vscode`; afterwards you **must** re-run `repack:build` and republish every sub-package |
|
|
508
|
-
| **Pin a version** | `pnpm run vendor:vscode -- --version 4.
|
|
571
|
+
| **Pin a version** | `pnpm run vendor:vscode -- --version 4.138.0` |
|
|
509
572
|
| **Snapshot from an existing tree** | `pnpm run vendor:vscode -- --from <code-server dir>` (seconds) |
|
|
510
573
|
| **Rebuild every sub-package** | `pnpm run repack:build -- --target win32-arm64,win32-x64 --pack` (without `--from` it npm-installs and compiles the source tree itself — slow) |
|
|
511
574
|
| **Rebuild only the tree + dependency table** | `node scripts/vendor-repacks.mjs --reuse --target win32-arm64,win32-x64 --pack` (reuses the natives already in `repack/build`; also rewrites `lib/vendored.json` and the plugin dependency table) |
|
|
@@ -629,11 +692,11 @@ pnpm test:bridge-extension # extension-side pure logic (dirty buffers, diagnos
|
|
|
629
692
|
pnpm test:ask-dialog # ask-dialog wiring: no artifacts/build chain left, the host's four ask routes, the extension only reporting editor state, the four approval constraints, the bridge's safety invariants
|
|
630
693
|
pnpm test:launcher-routes # launcher HTTP surface (spawns a real process; slow)
|
|
631
694
|
pnpm test:workspace-switch # switching workspaces does not restart the process
|
|
632
|
-
pnpm test:workspace-cwd # "current workspace directory" resolution (
|
|
695
|
+
pnpm test:workspace-cwd # "current workspace directory" resolution (alpha line: sessionId vs. rc line: the snapshot's current)
|
|
633
696
|
pnpm test:client-cwd # the same contract, but asserted against the **client entry** lib/client.js
|
|
634
697
|
pnpm test:client-tabs # "one code-server tab on the DSH side": a new tab closes the old one in the same pane
|
|
635
698
|
pnpm test:client-entry # client-entry guard: classic script + factory wrapper, require whitelist, src/ gone, parity with lib/claim-types.js
|
|
636
|
-
pnpm test:client-seat # which seat the settings card uses: plugins.bundle.config (
|
|
699
|
+
pnpm test:client-seat # which seat the settings card uses: plugins.bundle.config (alpha line >= 0.1.6-alpha.2) vs settings.plugin.item (rc line <= 0.1.5-rc.3)
|
|
637
700
|
pnpm test:fullscreen # opening the tab goes fullscreen
|
|
638
701
|
pnpm test:vendored # repack table ↔ plugin dependency table (no npm: aliases, no aggregator)
|
|
639
702
|
pnpm test:installed # install smoke: assert on what was **installed into a profile**
|
|
@@ -956,7 +1019,7 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
|
|
|
956
1019
|
### Upgrading the VS Code tree (upstream = a code-server release)
|
|
957
1020
|
|
|
958
1021
|
- **The version is decided at pack time**: `pnpm run vendor:latest` (= `--force`) pulls the tree of the npm **latest**
|
|
959
|
-
release; or use `pnpm run vendor:vscode -- --version 4.
|
|
1022
|
+
release; or use `pnpm run vendor:vscode -- --version 4.138.0` / `DSHCS_CODE_SERVER_VERSION`.
|
|
960
1023
|
With an existing `vendor/vscode`, a plain `pnpm pack` never upgrades (it is a no-op).
|
|
961
1024
|
**Source-tree precedence (fixed in 0.2.13)**: an explicit `--from` uses that tree, while an explicit
|
|
962
1025
|
`--force`/`--version` now **always goes to the registry** — before the fix a local source tree won
|
|
@@ -971,13 +1034,14 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
|
|
|
971
1034
|
- **A version bump means rebuilding and republishing the sub-packages** (all with the same script):
|
|
972
1035
|
1. `pnpm run repack:build -- --target win32-arm64,win32-x64 --pack` → the new tree package
|
|
973
1036
|
(`@jinsiyu/dshcs-vscode-server@<new version>`) and the natives rebuilt against the new inner dependencies (the
|
|
974
|
-
script also rewrites the plugin's pure-JS `dependencies
|
|
975
|
-
|
|
1037
|
+
script also rewrites the plugin's pure-JS `dependencies`, writes the 16 repacks under their real names into
|
|
1038
|
+
`dependencies` / `optionalDependencies`, and rewrites `lib/vendored.json`);
|
|
1039
|
+
2. `pnpm run publish:repacks` → publish; then bump the plugin version → `pnpm pack`
|
|
976
1040
|
→ publish the plugin.
|
|
977
1041
|
- `productPath` (`<quality>-<commit>`, part of the client WebSocket path) is **computed from `lib/vscode/product.json`**,
|
|
978
1042
|
so upgrading the tree needs no code change — but the routes are registered at activation, so restart `dsh web` afterwards.
|
|
979
1043
|
- **No runtime auto-upgrade anymore**: nothing fetches latest at startup; the version is fully determined by the bundled artifact.
|
|
980
|
-
- Bundled locally right now: the tree of `code-server@4.
|
|
1044
|
+
- Bundled locally right now: the tree of `code-server@4.138.0` (VS Code 1.138.0, `productPath=stable-59c988c7…`).
|
|
981
1045
|
|
|
982
1046
|
### Compatibility with the old install locations
|
|
983
1047
|
|
|
@@ -996,8 +1060,12 @@ persisted via the official settings domain (`settingsScope`, namespace `code-ser
|
|
|
996
1060
|
| `claimExtensions` | `*` + three exclusion groups (preview-friendly / executables / Office; full lists in the "Claim types" section) | **Claim types** (0.2.11, replaces 0.2.5's `fileOpenScope`): decides by extension which files go to VS Code, semicolon-separated; `*` claims every other type, `!ext` excludes (exclusion wins). The default leaves the four categories DSH's preview renders well (markdown/html/images/PDF) to DSH and sends everything else to the IDE; an empty value claims nothing. **Scope (session vs absolute) is no longer distinguished** |
|
|
997
1061
|
| `fullscreenOnOpen` | `true` | **Fullscreen on open** (0.2.9): opening the Code Server tab (including clicking a file) switches the right sidebar to fullscreen (fills the window); off keeps DSH's default push mode (side by side with the conversation). Only the moment of opening is affected — a manual "Exit fullscreen" is never fought back |
|
|
998
1062
|
| `keepResident` | `true` | **Resident in background**: on, the host preloads the IDE into a parked surface right after start — switching tabs or collapsing the sidebar never reloads it and the first open needs no cold start; off loads it only when the panel is opened (saves memory) |
|
|
1063
|
+
| `fim` | `false` | **FIM completion (experimental, 0.3.61)**: when on, pausing while typing shows a grey inline continuation (Tab accepts, Esc discards). **Off by default** — it is the only capability of this plugin that sends content out (a bounded slice of code around the cursor, per completion), and those calls **do not enter DSH's token accounting**, so usage is visible only in the IDE status bar. See the "FIM completion" section |
|
|
1064
|
+
| `fimDebounceMs` | `250` | **FIM · pause in milliseconds** (0.3.62): how long typing must stop before one completion request is sent. Effective range **100–3000 ms**, clamped on save (same rule as the host); empty/invalid falls back to 250 |
|
|
1065
|
+
| `fimMultiline` | `true` | **FIM · allow multi-line completions** (0.3.62): off means the host returns the first line only (an empty first line = no completion this time). The model does invent insertions where none are needed, and multi-line amplifies that noise |
|
|
1066
|
+
| `fimDisableGlobs` | empty | **FIM · disable by glob** (0.3.62): semicolon/newline separated. `*` does not cross directories, `**` does, a pattern without `/` matches the basename, a pattern with `/` matches any path suffix, and a trailing `/` means `/**`. Examples: `*.md`, `vendor/**`, `**/dist/**`. **Checked on both sides**: the extension first (no request at all), the host again |
|
|
999
1067
|
|
|
1000
|
-
(Since 0.2.9 the card keeps only those three
|
|
1068
|
+
(Since 0.2.9 the card keeps only those settings (0.3.61 added FIM completion, 0.3.62 its three sub-rows); `windowedOpen` and `reserveComposer` are gone — leftover keys in an old
|
|
1001
1069
|
settings document neither fail nor apply. `serve` remains a key in the settings namespace (usable from a settings document) but
|
|
1002
1070
|
has **no card row** — see "Serving mode".)
|
|
1003
1071
|
|
|
@@ -1130,6 +1198,22 @@ What remains on the plugin side:
|
|
|
1130
1198
|
**built-in** extension (in `lib/vscode/extensions`), so users cannot remove it from the extensions panel, and the
|
|
1131
1199
|
installer re-syncs it whenever its content changes.
|
|
1132
1200
|
|
|
1201
|
+
## Third-party and license
|
|
1202
|
+
|
|
1203
|
+
This project is **MIT**-licensed (see [`LICENSE`](LICENSE)). Its experimental **FIM completion** feature was
|
|
1204
|
+
**designed with reference to** [continuedev/continue](https://github.com/continuedev/continue)
|
|
1205
|
+
(Apache License 2.0, Copyright 2023 Continue) — specifically the settings taxonomy of upstream
|
|
1206
|
+
`tabAutocompleteOptions` (`debounceDelay`, `useAutocompleteMultilineCompletions`, `disableInFiles`) and its
|
|
1207
|
+
debounce / cursor-window / filtering / bounded-cache approach.
|
|
1208
|
+
|
|
1209
|
+
**No source code, template strings or files from continuedev/continue are included here** (completion
|
|
1210
|
+
requests target DeepSeek's official FIM (Beta) endpoint; the prompt shape comes from DeepSeek's docs and
|
|
1211
|
+
local measurement). The standard Apache License 2.0 text ships as
|
|
1212
|
+
[`LICENSE-Apache-2.0.txt`](LICENSE-Apache-2.0.txt), and the per-location reference log is
|
|
1213
|
+
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) — so Apache-2.0's obligations (notices, marking modified
|
|
1214
|
+
files, keeping an upstream NOTICE if one appears) are already satisfied should a code fragment ever be ported
|
|
1215
|
+
in. Apache-2.0 grants no trademark rights; this project does not use "Continue" as a name or in promotion.
|
|
1216
|
+
|
|
1133
1217
|
## Known limitations
|
|
1134
1218
|
|
|
1135
1219
|
- **~~The editor bridge needs DSH to provide `webServer`~~ no longer true (fixed in 0.3.13)**: the bridge now runs
|
|
@@ -1175,7 +1259,7 @@ What remains on the plugin side:
|
|
|
1175
1259
|
- **`serve: dsh` shares DSH's origin**, so the iframe is not sandboxed there (same-origin plus `allow-same-origin` is
|
|
1176
1260
|
escapable by the frame itself); in `loopback` mode the iframe is cross-origin and `sandbox` stays as real protection.
|
|
1177
1261
|
- **Single instance across sessions**: one shared IDE per host; switching cwd only re-navigates the workbench (since 0.2.12 no process restart, so the old directory's background terminals are not collected).
|
|
1178
|
-
- **Older DSH versions are unsupported (since 0.2.3)
|
|
1262
|
+
- **Older DSH versions are unsupported (since 0.2.3).** Exactly two lines are supported (converged 2026-09-22): the **rc line** `0.1.5-rc.x` (old seat + `current` on the snapshot) and the **alpha line** `>= 0.1.6-alpha.2` (new seat + the `sessionId` standard prop). Earlier alphas (`0.1.5-alpha.x`, `0.1.6-alpha.1`) are **not separate targets** — they share the rc line's shapes, so the code happens to work, but they are not verified. Detail: on a DSH without `sidebarRightTabs` / `sidebarRight` the plugin
|
|
1179
1263
|
offers nothing but an upgrade notice on the settings page; older-DSH users should stay on `0.2.2`
|
|
1180
1264
|
(`dsh plugin --profile web add dsh-code-server-app@0.2.2`).
|
|
1181
1265
|
- **Sidebar tab switching** (no longer reloads since 0.2.2): DSH's right sidebar renders only the active tab's body, and
|