Skip to content

Commit 633d804

Browse files
authored
Merge pull request #59 from sredevopsorg/feat/remove-supabase-add-line-wrap
Remove Supabase skills, enable code-editor writes everywhere, add line-wrap toggle
2 parents 5ffc0b4 + 0b7fc4f commit 633d804

57 files changed

Lines changed: 128 additions & 2192 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎NOTICE.md‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ reproduced below. Full license texts ship with the upstream projects.
88

99
| Path | Upstream | License |
1010
|---|---|---|
11-
| [`plugins/skills/skills/supabase`](plugins/skills/skills/supabase/SKILL.md) | Supabase agent skills — https://github.com/supabase/agent-skills | MIT |
12-
| [`plugins/skills/skills/supabase-postgres-best-practices`](plugins/skills/skills/supabase-postgres-best-practices/SKILL.md) | Supabase agent skills (Postgres best practices, v1.1.1) — https://github.com/supabase/agent-skills | MIT |
1311
| [`plugins/skills/skills/ghost-theme-modern-frontend`](plugins/skills/skills/ghost-theme-modern-frontend/SKILL.md) | Guidance grounded in the MIT-licensed community theme https://github.com/christopher-b/vapour and the official docs at https://docs.ghost.org | MIT |
1412
| [`plugins/skills/skills/helm-chart-development`](plugins/skills/skills/helm-chart-development/SKILL.md) | Guidance grounded in the official Helm docs — https://helm.sh/docs/chart_template_guide/ (source: https://github.com/helm/helm-www) | CC-BY-4.0 |
1513
| [`plugins/skills/skills/github-actions-security-audit`](plugins/skills/skills/github-actions-security-audit/SKILL.md) | Guidance grounded in GitHub's Secure use reference — https://docs.github.com/en/actions/reference/security/secure-use (source: https://github.com/github/docs) | CC-BY-4.0 |
1614
| [`plugins/skills/skills/kubernetes-kubectl-operations`](plugins/skills/skills/kubernetes-kubectl-operations/SKILL.md) | Guidance grounded in the official Kubernetes documentation — https://kubernetes.io/docs/ (source: https://github.com/kubernetes/website) and the Kubernetes MCP Server documentation — https://github.com/containers/kubernetes-mcp-server | CC-BY-4.0 (Kubernetes docs); Apache-2.0 (MCP server docs) |
1715
| [`plugins/skills/skills/kustomize`](plugins/skills/skills/kustomize/SKILL.md) | Guidance grounded in the Kustomize project documentation — https://kustomize.io/ (source: https://github.com/kubernetes-sigs/kustomize) and the Kubernetes tasks https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/ and https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kustomize/ (source: https://github.com/kubernetes/website) | Apache-2.0 (Kustomize docs); CC-BY-4.0 (Kubernetes docs) |
1816

1917
Each derived `SKILL.md` preserves its upstream `metadata` (author, version,
20-
organization). The Supabase skills carry fields authored by Supabase; they are
21-
reproduced here unmodified apart from repository-local path handling. Every
22-
skill now ships inside the installable [`plugins/skills`](plugins/skills/README.md)
23-
plugin package, so the paths above are package-internal.
18+
organization). They are reproduced here unmodified apart from repository-local
19+
path handling. Every skill now ships inside the installable
20+
[`plugins/skills`](plugins/skills/README.md) plugin package, so the paths above
21+
are package-internal.
2422

2523
## Plugins
2624

@@ -35,4 +33,4 @@ upstream README states. The upstream `LICENSE` is kept in the plugin directory.
3533

3634
> Copyright for the upstream material remains with its authors. Nothing in this
3735
> repository's MIT license grants rights to third-party trademarks such as
38-
> "Supabase", "Ghost", "Kubernetes", "OpenShift", "Video Explainer", or "DeepSeek".
36+
> "Ghost", "Kubernetes", "OpenShift", "Video Explainer", or "DeepSeek".

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ Quote the spec so the shell does not interpret `&`. Replace `web` with your prof
6767

6868
```bash
6969
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#agent-opencode-v0.4.0&path:/plugins/agent-opencode"
70-
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
70+
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
7171
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#peak-rate-footer-v0.1.0&path:/plugins/peak-rate-footer"
72-
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.2.0&path:/plugins/skills"
72+
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.3.0&path:/plugins/skills"
7373
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#sredevops-writer-v0.1.1&path:/plugins/sredevops-writer"
7474
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#subagent-opencode-v0.4.0&path:/plugins/subagent-opencode"
7575
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#superagent-v0.1.2&path:/plugins/superagent"

‎docs/ghost-themes.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ through one provider row (no filesystem roots involved):
6767
dsh plugin --profile web add ./plugins/skills
6868

6969
# or the pinned release (quotes required: & is part of the spec)
70-
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.2.0&path:/plugins/skills"
70+
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.3.0&path:/plugins/skills"
7171
```
7272

7373
Restart DSH after installing. The plugin's package README covers the provider, the bundled

‎docs/installing-plugins-from-github.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ github:sredevopsorg/dsh-plugins#<plugin-directory>-v<version>&path:/plugins/<plu
2525
```
2626

2727
- `github:` selects the GitHub shorthand.
28-
- `<plugin-directory>-v<version>` is the release tag, e.g. `code-editor-v0.1.0`.
28+
- `<plugin-directory>-v<version>` is the release tag, e.g. `code-editor-v0.2.0`.
2929
- `&path:/plugins/<plugin-directory>` tells pnpm to pack only that package from
3030
the monorepo (supported since pnpm 9).
3131
- Quote the whole spec: the shell must not interpret `&`.
@@ -51,8 +51,8 @@ github:sredevopsorg/dsh-plugins#<plugin-directory>-v<version>&path:/plugins/<plu
5151

5252
| Plugin | Tag | Command |
5353
|---|---|---|
54-
| `code-editor` | `code-editor-v0.1.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"` |
55-
| `skills` | `skills-v0.2.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.2.0&path:/plugins/skills"` |
54+
| `code-editor` | `code-editor-v0.2.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"` |
55+
| `skills` | `skills-v0.3.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.3.0&path:/plugins/skills"` |
5656
| `superagent` | `superagent-v0.1.2` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#superagent-v0.1.2&path:/plugins/superagent"` |
5757
| `subagent-opencode` | `subagent-opencode-v0.3.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#subagent-opencode-v0.3.0&path:/plugins/subagent-opencode"` |
5858

@@ -66,14 +66,14 @@ If your environment does not accept the `github:` shorthand, spell out the Git
6666
URL — pnpm treats both forms as the same dependency:
6767

6868
```bash
69-
dsh plugin --profile web add "git+https://github.com/sredevopsorg/dsh-plugins.git#code-editor-v0.1.0&path:/plugins/code-editor"
69+
dsh plugin --profile web add "git+https://github.com/sredevopsorg/dsh-plugins.git#code-editor-v0.2.0&path:/plugins/code-editor"
7070
```
7171

7272
### Other refs
7373

7474
| Ref | Example fragment | Use |
7575
|---|---|---|
76-
| Release tag | `#code-editor-v0.1.0&path:/plugins/code-editor` | Reproducible install (recommended) |
76+
| Release tag | `#code-editor-v0.2.0&path:/plugins/code-editor` | Reproducible install (recommended) |
7777
| Commit | `#<40-hex-commit>&path:/plugins/code-editor` | Reproducible install before a tag exists |
7878
| Branch | `#main&path:/plugins/code-editor` | Latest unreleased code; may change without notice |
7979

@@ -86,7 +86,7 @@ In a Web session, `plugin_manager` with `install_bundle`:
8686
```json
8787
{
8888
"action": "install_bundle",
89-
"target": "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
89+
"target": "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
9090
}
9191
```
9292

@@ -114,7 +114,7 @@ See the plugin README for its full verification checklist.
114114
Install the newer tag over the existing package:
115115

116116
```bash
117-
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
117+
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
118118
```
119119

120120
If the bundle is running and cannot be replaced in place, DSH reports
@@ -150,7 +150,7 @@ Release tags are created automatically when a version bump merges to `main`:
150150
<plugin-directory>-v<package-version>
151151
```
152152

153-
Examples: `code-editor-v0.1.0`, `skills-v0.2.0`, `superagent-v0.1.2`.
153+
Examples: `code-editor-v0.2.0`, `skills-v0.3.0`, `superagent-v0.1.2`.
154154

155155
[`.github/workflows/version-plugins.yml`](../.github/workflows/version-plugins.yml)
156156
runs on every push to `main`, tags each plugin whose `<dir>-v<version>` tag does

‎index.json‎

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/code-editor/README.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ UTF-8 files.
1111
- Opens and edits UTF-8 text files up to 1 MiB / 20,000 lines.
1212
- Saves through one authenticated Host endpoint, using the file version read
1313
from disk for optimistic conflict detection.
14-
- Respects the Session file policy: a `read-only` Session can browse and edit
15-
its local buffer but cannot save.
14+
- Saves anywhere inside the Session workspace regardless of the Session's agent
15+
file policy: the editor's write bypasses the agent sandbox mode, so a
16+
`read-only` Session, or a file outside the writable root under
17+
`workspace-write`, still saves. Containment to the Session workspace root is
18+
enforced by the endpoint itself and cannot be bypassed.
1619
- Keeps unsaved drafts in memory while the plugin stays loaded, keyed by
1720
Session and path. Drafts survive tab switches and closing/reopening the
1821
editor tab; a page reload loses them. A restored draft is saved against the
@@ -29,7 +32,7 @@ Requires a DSH Web profile with the built-in right Sidebar. From the pinned
2932
release:
3033

3134
```bash
32-
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
35+
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
3336
```
3437

3538
Or from a local checkout:
@@ -76,9 +79,9 @@ The endpoint:
7679
2. requires a live Session and a body no larger than 8 MiB;
7780
3. resolves the Session workspace root and refuses any target outside it;
7881
4. refuses a missing path, a non-regular file, or a final symlink;
79-
5. refuses writes when `ctx.sandboxPolicy.resolve({ session })` is `read-only`;
80-
6. writes with `fs.writeText` and `{ kind: 'replaceIfVersion' }`, unless
81-
`force` is true.
82+
5. writes with `fs.writeText` and `{ kind: 'replaceIfVersion' }`, unless
83+
`force` is true, passing `{ mode: 'danger-full-access' }` so the agent's
84+
sandbox mode does not fence the save. Step 3 is then the only boundary.
8285

8386
Success returns `{ "ok": true, "operation": "create"|"update", "version": "…" }`.
8487
Conflicts return HTTP 409 with a `stale` code and the current version when it can

‎plugins/code-editor/client.js‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ window.__ModuleLoader__.load({
5050
'editor.back': 'Back to files',
5151
'editor.save': 'Save file',
5252
'editor.saving': 'Saving…',
53+
'editor.wrap': 'Wrap lines',
54+
'editor.unwrap': 'Unwrap lines',
5355
'editor.saved': 'File saved.',
5456
'editor.reload': 'Reload from disk',
5557
'editor.discard': 'Discard changes',
@@ -59,7 +61,6 @@ window.__ModuleLoader__.load({
5961
'editor.conflict': 'The file changed on disk. Reload it or overwrite the newer content.',
6062
'editor.conflict.reload': 'Reload from disk',
6163
'editor.conflict.overwrite': 'Overwrite',
62-
'editor.readOnly': 'This Session is read-only. Change its file policy before saving.',
6364
'editor.authFailed': 'The browser session expired. Reload the page to continue.',
6465
'editor.sessionInactive': 'The Session is not active. Open the Session before saving.',
6566
'editor.saveFailed': 'The file could not be saved. {message}',
@@ -104,6 +105,8 @@ window.__ModuleLoader__.load({
104105
'editor.back': 'Volver a los archivos',
105106
'editor.save': 'Guardar archivo',
106107
'editor.saving': 'Guardando…',
108+
'editor.wrap': 'Ajustar líneas',
109+
'editor.unwrap': 'No ajustar líneas',
107110
'editor.saved': 'Archivo guardado.',
108111
'editor.reload': 'Recargar desde el disco',
109112
'editor.discard': 'Descartar cambios',
@@ -113,7 +116,6 @@ window.__ModuleLoader__.load({
113116
'editor.conflict': 'El archivo cambió en el disco. Recárgalo o sobrescribe el contenido más reciente.',
114117
'editor.conflict.reload': 'Recargar desde el disco',
115118
'editor.conflict.overwrite': 'Sobrescribir',
116-
'editor.readOnly': 'Esta sesión es de solo lectura. Cambia su política de archivos antes de guardar.',
117119
'editor.authFailed': 'La sesión del navegador expiró. Recarga la página para continuar.',
118120
'editor.sessionInactive': 'La sesión no está activa. Abre la sesión antes de guardar.',
119121
'editor.saveFailed': 'No se pudo guardar el archivo. {message}',
@@ -259,6 +261,7 @@ window.__ModuleLoader__.load({
259261
const UpIcon = makeIcon(['M12 19V5', 'M5 12l7-7 7 7']);
260262
const RefreshIcon = makeIcon(['M20 12a8 8 0 1 1-2.3-5.6', 'M20 4v5h-5']);
261263
const SaveIcon = makeIcon(['M5 4h11l3 3v13H5z', 'M8 4v6h7V4', 'M8 14h8v6H8z']);
264+
const WrapIcon = makeIcon(['M4 6h16', 'M4 12h12', 'M4 18h16', 'M17 10l3 2-3 2']);
262265
const DiscardIcon = makeIcon(['M5 7h14', 'M9 7V4h6v3', 'M7 7l1 13h8l1-13']);
263266
const FolderIcon = makeIcon(['M3 7h6l2 2h10v10H3z']);
264267
const FileIcon = makeIcon(['M6 3h8l4 4v14H6z', 'M14 3v4h4']);
@@ -351,6 +354,7 @@ window.__ModuleLoader__.load({
351354
opacity: 0.92;
352355
}
353356
.dsh-code-editor-button.is-danger { color: var(--dsw-alias-state-error-primary); }
357+
.dsh-code-editor-button.is-active { color: var(--dsw-alias-brand-primary); }
354358
.dsh-code-editor-button.is-icon { padding: 0; width: 28px; }
355359
.dsh-code-editor-breadcrumb {
356360
display: flex;
@@ -590,6 +594,7 @@ window.__ModuleLoader__.load({
590594
const [cursor, setCursor] = useState({ line: 1, column: 1 });
591595
const [scrollTop, setScrollTop] = useState(0);
592596
const [viewportHeight, setViewportHeight] = useState(240);
597+
const [wrap, setWrap] = useState(false);
593598

594599
const fileRef = useRef(null);
595600
const savingRef = useRef(false);
@@ -906,10 +911,6 @@ window.__ModuleLoader__.load({
906911
setNotice({ kind: 'error', text: tr('editor.conflict') });
907912
return;
908913
}
909-
if (payload?.code === 'read-only') {
910-
setNotice({ kind: 'error', text: tr('editor.readOnly') });
911-
return;
912-
}
913914
if (payload?.code === 'session-not-found') {
914915
setNotice({ kind: 'error', text: tr('editor.sessionInactive') });
915916
return;
@@ -1283,6 +1284,18 @@ window.__ModuleLoader__.load({
12831284
},
12841285
h(DiscardIcon),
12851286
),
1287+
h(
1288+
'button',
1289+
{
1290+
type: 'button',
1291+
className: `dsh-code-editor-button is-icon${wrap ? ' is-active' : ''}`,
1292+
title: wrap ? tr('editor.unwrap') : tr('editor.wrap'),
1293+
'aria-label': wrap ? tr('editor.unwrap') : tr('editor.wrap'),
1294+
'aria-pressed': wrap,
1295+
onClick: () => setWrap((w) => !w),
1296+
},
1297+
h(WrapIcon),
1298+
),
12861299
h(
12871300
'button',
12881301
{
@@ -1362,7 +1375,8 @@ window.__ModuleLoader__.load({
13621375
className: 'dsh-code-editor-textarea',
13631376
value: file.text,
13641377
spellCheck: false,
1365-
wrap: 'off',
1378+
wrap: wrap ? 'soft' : 'off',
1379+
style: { whiteSpace: wrap ? 'pre-wrap' : 'pre' },
13661380
autoCapitalize: 'off',
13671381
autoCorrect: 'off',
13681382
'aria-label': `${baseName(file.path)} — ${tr('editor.lineColumn', { line: cursor.line, column: cursor.column })}`,

‎plugins/code-editor/index.js‎

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*
44
* It registers one authenticated endpoint used by the right-sidebar editor
55
* tab. The endpoint is deliberately small: a body is validated, the target is
6-
* confined to the live Session workspace, the Session sandbox policy is
7-
* applied, and `fs.writeText` performs the atomic publication with the version
8-
* guard the editor read from disk.
6+
* confined to the live Session workspace, and `fs.writeText` performs the
7+
* atomic publication with the version guard the editor read from disk.
98
*
109
* No agent tool, prompt section, or session event is registered here.
1110
*/
@@ -42,7 +41,7 @@ export function apply(ctx) {
4241

4342
/**
4443
* Handle one request to the write endpoint.
45-
* @param {object} ctx - Host context with connection, fs, policy, and sessions.
44+
* @param {object} ctx - Host context with connection, fs, and sessions.
4645
* @param {import('node:http').IncomingMessage} req - HTTP request.
4746
* @param {import('node:http').ServerResponse} res - HTTP response.
4847
*/
@@ -169,22 +168,26 @@ export async function handleRequest(ctx, req, res) {
169168
})
170169
}
171170

172-
const policy = ctx.sandboxPolicy.resolve({ session })
173-
if (policy.mode === 'read-only') {
174-
return sendJson(res, 403, {
175-
ok: false,
176-
code: 'read-only',
177-
message: 'This Session is read-only. Switch its file policy before saving.',
178-
})
179-
}
180-
181171
const expected = force
182172
? undefined
183173
: { kind: 'replaceIfVersion', version: expectedVersion }
184174

185175
let outcome
186176
try {
187-
outcome = await ctx.fs.writeText(target, content, expected, undefined, policy)
177+
// The editor saves what the user typed, so it must not be fenced by the
178+
// agent's file policy: a `read-only` Session, or a target outside the
179+
// writable root under `workspace-write`, would otherwise reject a save
180+
// the sidebar allows. The workspace containment check above is the
181+
// editor's own boundary, so the write itself runs unrestricted. Passing
182+
// `undefined` here would NOT do that; it falls back to the deployment
183+
// mode inside `checkedTarget`.
184+
outcome = await ctx.fs.writeText(
185+
target,
186+
content,
187+
expected,
188+
undefined,
189+
{ mode: 'danger-full-access' },
190+
)
188191
} catch (error) {
189192
if (error?.code === 'FS_STALE_VERSION') {
190193
let version

‎plugins/code-editor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sredevopsorg/dsh-code-editor",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Workspace code editor for the DSH Web GUI right sidebar: browse directories, edit UTF-8 files, save with sandbox and conflict protection.",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)