Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ reproduced below. Full license texts ship with the upstream projects.

| Path | Upstream | License |
|---|---|---|
| [`plugins/skills/skills/supabase`](plugins/skills/skills/supabase/SKILL.md) | Supabase agent skills — https://github.com/supabase/agent-skills | MIT |
| [`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 |
| [`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 |
| [`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 |
| [`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 |
| [`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) |
| [`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) |

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

## Plugins

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

> Copyright for the upstream material remains with its authors. Nothing in this
> repository's MIT license grants rights to third-party trademarks such as
> "Supabase", "Ghost", "Kubernetes", "OpenShift", "Video Explainer", or "DeepSeek".
> "Ghost", "Kubernetes", "OpenShift", "Video Explainer", or "DeepSeek".
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Quote the spec so the shell does not interpret `&`. Replace `web` with your prof

```bash
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#agent-opencode-v0.4.0&path:/plugins/agent-opencode"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#peak-rate-footer-v0.1.0&path:/plugins/peak-rate-footer"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.2.0&path:/plugins/skills"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.3.0&path:/plugins/skills"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#sredevops-writer-v0.1.1&path:/plugins/sredevops-writer"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#subagent-opencode-v0.4.0&path:/plugins/subagent-opencode"
dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#superagent-v0.1.2&path:/plugins/superagent"
Expand Down
2 changes: 1 addition & 1 deletion docs/ghost-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ through one provider row (no filesystem roots involved):
dsh plugin --profile web add ./plugins/skills

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

Restart DSH after installing. The plugin's package README covers the provider, the bundled
Expand Down
16 changes: 8 additions & 8 deletions docs/installing-plugins-from-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ github:sredevopsorg/dsh-plugins#<plugin-directory>-v<version>&path:/plugins/<plu
```

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

| Plugin | Tag | Command |
|---|---|---|
| `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"` |
| `skills` | `skills-v0.2.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.2.0&path:/plugins/skills"` |
| `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"` |
| `skills` | `skills-v0.3.0` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#skills-v0.3.0&path:/plugins/skills"` |
| `superagent` | `superagent-v0.1.2` | `dsh plugin --profile web add "github:sredevopsorg/dsh-plugins#superagent-v0.1.2&path:/plugins/superagent"` |
| `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"` |

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

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

### Other refs

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

Expand All @@ -86,7 +86,7 @@ In a Web session, `plugin_manager` with `install_bundle`:
```json
{
"action": "install_bundle",
"target": "github:sredevopsorg/dsh-plugins#code-editor-v0.1.0&path:/plugins/code-editor"
"target": "github:sredevopsorg/dsh-plugins#code-editor-v0.2.0&path:/plugins/code-editor"
}
```

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

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

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

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

[`.github/workflows/version-plugins.yml`](../.github/workflows/version-plugins.yml)
runs on every push to `main`, tags each plugin whose `<dir>-v<version>` tag does
Expand Down
3 changes: 1 addition & 2 deletions index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

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

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

Success returns `{ "ok": true, "operation": "create"|"update", "version": "…" }`.
Conflicts return HTTP 409 with a `stale` code and the current version when it can
Expand Down
28 changes: 21 additions & 7 deletions plugins/code-editor/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ window.__ModuleLoader__.load({
'editor.back': 'Back to files',
'editor.save': 'Save file',
'editor.saving': 'Saving…',
'editor.wrap': 'Wrap lines',
'editor.unwrap': 'Unwrap lines',
'editor.saved': 'File saved.',
'editor.reload': 'Reload from disk',
'editor.discard': 'Discard changes',
Expand All @@ -59,7 +61,6 @@ window.__ModuleLoader__.load({
'editor.conflict': 'The file changed on disk. Reload it or overwrite the newer content.',
'editor.conflict.reload': 'Reload from disk',
'editor.conflict.overwrite': 'Overwrite',
'editor.readOnly': 'This Session is read-only. Change its file policy before saving.',
'editor.authFailed': 'The browser session expired. Reload the page to continue.',
'editor.sessionInactive': 'The Session is not active. Open the Session before saving.',
'editor.saveFailed': 'The file could not be saved. {message}',
Expand Down Expand Up @@ -104,6 +105,8 @@ window.__ModuleLoader__.load({
'editor.back': 'Volver a los archivos',
'editor.save': 'Guardar archivo',
'editor.saving': 'Guardando…',
'editor.wrap': 'Ajustar líneas',
'editor.unwrap': 'No ajustar líneas',
'editor.saved': 'Archivo guardado.',
'editor.reload': 'Recargar desde el disco',
'editor.discard': 'Descartar cambios',
Expand All @@ -113,7 +116,6 @@ window.__ModuleLoader__.load({
'editor.conflict': 'El archivo cambió en el disco. Recárgalo o sobrescribe el contenido más reciente.',
'editor.conflict.reload': 'Recargar desde el disco',
'editor.conflict.overwrite': 'Sobrescribir',
'editor.readOnly': 'Esta sesión es de solo lectura. Cambia su política de archivos antes de guardar.',
'editor.authFailed': 'La sesión del navegador expiró. Recarga la página para continuar.',
'editor.sessionInactive': 'La sesión no está activa. Abre la sesión antes de guardar.',
'editor.saveFailed': 'No se pudo guardar el archivo. {message}',
Expand Down Expand Up @@ -259,6 +261,7 @@ window.__ModuleLoader__.load({
const UpIcon = makeIcon(['M12 19V5', 'M5 12l7-7 7 7']);
const RefreshIcon = makeIcon(['M20 12a8 8 0 1 1-2.3-5.6', 'M20 4v5h-5']);
const SaveIcon = makeIcon(['M5 4h11l3 3v13H5z', 'M8 4v6h7V4', 'M8 14h8v6H8z']);
const WrapIcon = makeIcon(['M4 6h16', 'M4 12h12', 'M4 18h16', 'M17 10l3 2-3 2']);
const DiscardIcon = makeIcon(['M5 7h14', 'M9 7V4h6v3', 'M7 7l1 13h8l1-13']);
const FolderIcon = makeIcon(['M3 7h6l2 2h10v10H3z']);
const FileIcon = makeIcon(['M6 3h8l4 4v14H6z', 'M14 3v4h4']);
Expand Down Expand Up @@ -351,6 +354,7 @@ window.__ModuleLoader__.load({
opacity: 0.92;
}
.dsh-code-editor-button.is-danger { color: var(--dsw-alias-state-error-primary); }
.dsh-code-editor-button.is-active { color: var(--dsw-alias-brand-primary); }
.dsh-code-editor-button.is-icon { padding: 0; width: 28px; }
.dsh-code-editor-breadcrumb {
display: flex;
Expand Down Expand Up @@ -590,6 +594,7 @@ window.__ModuleLoader__.load({
const [cursor, setCursor] = useState({ line: 1, column: 1 });
const [scrollTop, setScrollTop] = useState(0);
const [viewportHeight, setViewportHeight] = useState(240);
const [wrap, setWrap] = useState(false);

const fileRef = useRef(null);
const savingRef = useRef(false);
Expand Down Expand Up @@ -906,10 +911,6 @@ window.__ModuleLoader__.load({
setNotice({ kind: 'error', text: tr('editor.conflict') });
return;
}
if (payload?.code === 'read-only') {
setNotice({ kind: 'error', text: tr('editor.readOnly') });
return;
}
if (payload?.code === 'session-not-found') {
setNotice({ kind: 'error', text: tr('editor.sessionInactive') });
return;
Expand Down Expand Up @@ -1283,6 +1284,18 @@ window.__ModuleLoader__.load({
},
h(DiscardIcon),
),
h(
'button',
{
type: 'button',
className: `dsh-code-editor-button is-icon${wrap ? ' is-active' : ''}`,
title: wrap ? tr('editor.unwrap') : tr('editor.wrap'),
'aria-label': wrap ? tr('editor.unwrap') : tr('editor.wrap'),
'aria-pressed': wrap,
onClick: () => setWrap((w) => !w),
},
h(WrapIcon),
),
h(
'button',
{
Expand Down Expand Up @@ -1362,7 +1375,8 @@ window.__ModuleLoader__.load({
className: 'dsh-code-editor-textarea',
value: file.text,
spellCheck: false,
wrap: 'off',
wrap: wrap ? 'soft' : 'off',
style: { whiteSpace: wrap ? 'pre-wrap' : 'pre' },
autoCapitalize: 'off',
autoCorrect: 'off',
'aria-label': `${baseName(file.path)} — ${tr('editor.lineColumn', { line: cursor.line, column: cursor.column })}`,
Expand Down
31 changes: 17 additions & 14 deletions plugins/code-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
*
* It registers one authenticated endpoint used by the right-sidebar editor
* tab. The endpoint is deliberately small: a body is validated, the target is
* confined to the live Session workspace, the Session sandbox policy is
* applied, and `fs.writeText` performs the atomic publication with the version
* guard the editor read from disk.
* confined to the live Session workspace, and `fs.writeText` performs the
* atomic publication with the version guard the editor read from disk.
*
* No agent tool, prompt section, or session event is registered here.
*/
Expand Down Expand Up @@ -42,7 +41,7 @@ export function apply(ctx) {

/**
* Handle one request to the write endpoint.
* @param {object} ctx - Host context with connection, fs, policy, and sessions.
* @param {object} ctx - Host context with connection, fs, and sessions.
* @param {import('node:http').IncomingMessage} req - HTTP request.
* @param {import('node:http').ServerResponse} res - HTTP response.
*/
Expand Down Expand Up @@ -169,22 +168,26 @@ export async function handleRequest(ctx, req, res) {
})
}

const policy = ctx.sandboxPolicy.resolve({ session })
if (policy.mode === 'read-only') {
return sendJson(res, 403, {
ok: false,
code: 'read-only',
message: 'This Session is read-only. Switch its file policy before saving.',
})
}

const expected = force
? undefined
: { kind: 'replaceIfVersion', version: expectedVersion }

let outcome
try {
outcome = await ctx.fs.writeText(target, content, expected, undefined, policy)
// The editor saves what the user typed, so it must not be fenced by the
// agent's file policy: a `read-only` Session, or a target outside the
// writable root under `workspace-write`, would otherwise reject a save
// the sidebar allows. The workspace containment check above is the
// editor's own boundary, so the write itself runs unrestricted. Passing
// `undefined` here would NOT do that; it falls back to the deployment
// mode inside `checkedTarget`.
outcome = await ctx.fs.writeText(
target,
content,
expected,
undefined,
{ mode: 'danger-full-access' },
)
} catch (error) {
if (error?.code === 'FS_STALE_VERSION') {
let version
Expand Down
2 changes: 1 addition & 1 deletion plugins/code-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sredevopsorg/dsh-code-editor",
"version": "0.1.0",
"version": "0.2.0",
"description": "Workspace code editor for the DSH Web GUI right sidebar: browse directories, edit UTF-8 files, save with sandbox and conflict protection.",
"license": "MIT",
"repository": {
Expand Down
Loading