dsh-agent-plugins-market 0.6.0 → 0.6.2
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/README.md +143 -169
- package/README.zh.md +136 -170
- package/client/client.js +8202 -684
- package/client/client.js.map +1 -1
- package/lib/application/catalog.js +236 -47
- package/lib/application/details.js +19 -10
- package/lib/application/panel-resources.js +95 -0
- package/lib/application/project-agent-roles.js +39 -0
- package/lib/catalog/codex-mcp.js +114 -0
- package/lib/catalog/component-files.js +151 -0
- package/lib/catalog/manifests.js +105 -44
- package/lib/catalog/native-project.js +44 -23
- package/lib/catalog/paths.js +6 -6
- package/lib/catalog/project-config.js +96 -0
- package/lib/catalog/project-hooks.js +108 -0
- package/lib/catalog/scan-pipeline.js +6 -1
- package/lib/catalog/scan-resolvers.js +70 -26
- package/lib/catalog/source-catalog.js +16 -3
- package/lib/catalog/suite-components.js +125 -0
- package/lib/catalog/surfaces.js +60 -46
- package/lib/catalog/validate.js +16 -11
- package/lib/contracts/market.js +16 -1
- package/lib/index.js +187 -35
- package/lib/model/layouts.js +49 -0
- package/lib/routes.js +106 -6
- package/lib/runtime/agent-role-router.js +226 -0
- package/lib/runtime/commands-mounts.js +27 -67
- package/lib/runtime/feedback-tool.js +181 -0
- package/lib/runtime/hooks-mounts.js +66 -13
- package/lib/runtime/host-locale.js +23 -7
- package/lib/runtime/legacy-root-migration.js +12 -0
- package/lib/runtime/lsp-direct-config.js +6 -3
- package/lib/runtime/lsp-mounts.js +38 -24
- package/lib/runtime/lsp-server-state.js +19 -0
- package/lib/runtime/lsp-status.js +3 -2
- package/lib/runtime/mcp-backend.js +6 -2
- package/lib/runtime/mcp-client/config.js +6 -0
- package/lib/runtime/mcp-client/connection.js +8 -2
- package/lib/runtime/mcp-client/tools.js +6 -3
- package/lib/runtime/mcp-config.js +26 -13
- package/lib/runtime/mcp-direct-config.js +56 -0
- package/lib/runtime/mcp-mounts.js +25 -9
- package/lib/runtime/mcp-overrides.js +11 -5
- package/lib/runtime/mcp-status.js +10 -7
- package/lib/runtime/model-catalog.js +48 -0
- package/lib/runtime/project-runtime.js +136 -0
- package/lib/runtime/reconciler.js +38 -28
- package/lib/runtime/server-config.js +75 -0
- package/lib/runtime/skills-provider.js +31 -77
- package/lib/runtime/storage-migration.js +169 -0
- package/lib/runtime/subagent-catalog.js +129 -0
- package/lib/runtime/user-commands.js +86 -0
- package/lib/runtime/user-panels.js +176 -0
- package/lib/runtime/user-store.js +142 -0
- package/lib/types/application/catalog.d.ts +39 -9
- package/lib/types/application/panel-resources.d.ts +13 -0
- package/lib/types/application/project-agent-roles.d.ts +3 -0
- package/lib/types/application/queries.d.ts +17 -1
- package/lib/types/catalog/codex-mcp.d.ts +4 -0
- package/lib/types/catalog/component-files.d.ts +17 -0
- package/lib/types/catalog/manifests.d.ts +14 -9
- package/lib/types/catalog/native-project.d.ts +2 -5
- package/lib/types/catalog/paths.d.ts +4 -4
- package/lib/types/catalog/project-config.d.ts +6 -0
- package/lib/types/catalog/project-hooks.d.ts +10 -0
- package/lib/types/catalog/scan-pipeline.d.ts +2 -0
- package/lib/types/catalog/scan-resolvers.d.ts +4 -3
- package/lib/types/catalog/source-catalog.d.ts +1 -1
- package/lib/types/catalog/suite-components.d.ts +5 -0
- package/lib/types/catalog/surfaces.d.ts +2 -2
- package/lib/types/catalog/validate.d.ts +2 -0
- package/lib/types/contracts/market.d.ts +60 -0
- package/lib/types/contracts/mcp-status.d.ts +5 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/model/layouts.d.ts +102 -0
- package/lib/types/model/types.d.ts +51 -6
- package/lib/types/routes.d.ts +6 -1
- package/lib/types/runtime/agent-role-router.d.ts +95 -0
- package/lib/types/runtime/commands-mounts.d.ts +16 -7
- package/lib/types/runtime/feedback-tool.d.ts +49 -0
- package/lib/types/runtime/hooks-mounts.d.ts +4 -0
- package/lib/types/runtime/host-locale.d.ts +1 -1
- package/lib/types/runtime/legacy-root-migration.d.ts +2 -0
- package/lib/types/runtime/lsp-mounts.d.ts +4 -0
- package/lib/types/runtime/lsp-server-state.d.ts +3 -0
- package/lib/types/runtime/lsp-status.d.ts +1 -0
- package/lib/types/runtime/mcp-backend.d.ts +9 -1
- package/lib/types/runtime/mcp-client/config.d.ts +4 -3
- package/lib/types/runtime/mcp-client/tools.d.ts +3 -0
- package/lib/types/runtime/mcp-config.d.ts +11 -5
- package/lib/types/runtime/mcp-direct-config.d.ts +7 -0
- package/lib/types/runtime/mcp-mounts.d.ts +2 -1
- package/lib/types/runtime/mcp-overrides.d.ts +2 -0
- package/lib/types/runtime/mcp-status.d.ts +1 -1
- package/lib/types/runtime/model-catalog.d.ts +7 -0
- package/lib/types/runtime/project-runtime.d.ts +32 -0
- package/lib/types/runtime/reconciler.d.ts +2 -0
- package/lib/types/runtime/server-config.d.ts +10 -0
- package/lib/types/runtime/skills-provider.d.ts +1 -5
- package/lib/types/runtime/storage-migration.d.ts +15 -0
- package/lib/types/runtime/subagent-catalog.d.ts +52 -0
- package/lib/types/runtime/user-commands.d.ts +24 -0
- package/lib/types/runtime/user-panels.d.ts +91 -0
- package/lib/types/runtime/user-store.d.ts +51 -0
- package/package.json +10 -3
- package/schemas/README.md +69 -7
- package/schemas/agent-plugins/spec.md +48 -0
- package/schemas/claude-code/marketplace.schema.json +143 -0
- package/schemas/claude-code/plugin.schema.json +105 -0
- package/schemas/claude-code/spec.md +108 -0
- package/schemas/codex/marketplace.schema.json +78 -0
- package/schemas/codex/plugin.schema.json +77 -0
- package/schemas/codex/spec.md +91 -0
- package/schemas/cursor/marketplace.schema.json +82 -0
- package/schemas/cursor/plugin.schema.json +58 -0
- package/schemas/cursor/spec.md +92 -0
- package/schemas/github-copilot/marketplace.schema.json +107 -0
- package/schemas/github-copilot/plugin.schema.json +89 -0
- package/schemas/github-copilot/spec.md +105 -0
- package/schemas/kimi/marketplace.schema.json +38 -0
- package/schemas/kimi/plugin.schema.json +84 -0
- package/schemas/kimi/spec.md +94 -0
- package/schemas/qoder/marketplace.schema.json +115 -0
- package/schemas/qoder/plugin.schema.json +127 -0
- package/schemas/qoder/spec.md +111 -0
- package/schemas/skill-collection/spec.md +29 -0
- package/schemas/universal/marketplace.schema.json +98 -0
- package/schemas/universal/plugin.schema.json +49 -0
- package/schemas/universal/spec.md +53 -0
- package/schemas/zcode/marketplace.schema.json +161 -0
- package/schemas/zcode/plugin.schema.json +89 -0
- package/schemas/zcode/spec.md +102 -0
- package/lib/catalog/legacy-root-migration.js +0 -51
- package/lib/types/catalog/legacy-root-migration.d.ts +0 -14
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ZCode (Z.ai) plugin and marketplace specification
|
|
2
|
+
|
|
3
|
+
Reference contract for ZCode-compatible plugin repositories. Machine-readable companions: [plugin.schema.json](plugin.schema.json) and [marketplace.schema.json](marketplace.schema.json).
|
|
4
|
+
|
|
5
|
+
- **Verified:** 2026-09-08 against ZCode 3.11.2.
|
|
6
|
+
- **Evidence:** official authoring page `https://zcode.z.ai/en/docs/plugin`; official marketplace repository [`zai-org/zcode-plugins`](https://github.com/zai-org/zcode-plugins) (`marketplace.json`, `docs/distribution.md`, `docs/PLUGIN_DEVELOPMENT.md`, `scripts/validate.py`, `plugins/example-plugin`); shipped runtime constants and on-disk install state under `~/.zcode/cli/plugins/`.
|
|
7
|
+
- **Upstream JSON Schema:** none. The docs page contains no `$schema`; the repository ships a hand-written `scripts/validate.py`, not a schema. The schemas in this directory are authored, not vendored.
|
|
8
|
+
- **Spec status:** no cross-vendor alignment. ZCode is not listed among agent-plugins.org compatible clients and does not read root `plugin.json` or `mcp.json`.
|
|
9
|
+
|
|
10
|
+
## Manifest locations and precedence
|
|
11
|
+
|
|
12
|
+
| Artifact | Lookup order | Evidence |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Plugin manifest | `.zcode-plugin/plugin.json` → `.claude-plugin/plugin.json` → `.codex-plugin/plugin.json` | Docs (first two) + runtime (`findPluginManifestPath`); `.cursor-plugin/plugin.json` appears only in the skill-adapter candidate list |
|
|
15
|
+
| Marketplace manifest | explicit `path` from a `github`/`git` source → `.claude-plugin/marketplace.json` → `marketplace.json` | Runtime `Nit()`; there is no `.zcode-plugin/marketplace.json` |
|
|
16
|
+
| MCP configuration | `.mcp.json` only; inline manifest `mcpServers` is merged over it per server key | Runtime `EN()`; bare `mcp.json` has zero occurrences in the runtime |
|
|
17
|
+
| Hooks configuration | `hooks/hooks.json` | Docs; runtime `join('hooks', 'hooks.json')` |
|
|
18
|
+
|
|
19
|
+
When no manifest exists and the marketplace entry sets `strict: false`, ZCode synthesizes a manifest from the entry and writes `.claude-plugin/plugin.json` into the install target. Otherwise a missing manifest is a hard error.
|
|
20
|
+
|
|
21
|
+
## Plugin manifest (`plugin.json`)
|
|
22
|
+
|
|
23
|
+
Required: `name`. `name` must match `^[a-z0-9][a-z0-9._-]{0,127}$`; the runtime defaults `version` to `0.0.0`.
|
|
24
|
+
|
|
25
|
+
| Field | Type | Notes |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `name` | string | Plugin identifier; regex above. |
|
|
28
|
+
| `version` | string | The official validator requires it to equal the marketplace entry version. |
|
|
29
|
+
| `description` | string | English compatibility fallback. |
|
|
30
|
+
| `description_i18n` | `{locale: string}` | Not in the docs field table, but required per plugin by the official validator (`en` + `zh-CN`) and must equal the marketplace entry. |
|
|
31
|
+
| `author` | string \| `{name, email, url}` | |
|
|
32
|
+
| `homepage`, `repository`, `license`, `keywords` | string / string / string / string[] | `license` is an SPDX id. |
|
|
33
|
+
| `commands`, `skills`, `agents`, `hooks`, `mcpServers` | string \| string[] \| object | Paths resolve against the plugin root; `mcpServers` also accepts inline server maps, which win per key over `.mcp.json`. |
|
|
34
|
+
| `dependencies` | string[] | `name` or `name@marketplace`. |
|
|
35
|
+
| `userConfig` | object | Prompted at enable time; see below. |
|
|
36
|
+
| `channels`, `lspServers`, `outputStyles`, `settings` | any | Registered but **diagnostic-only** in the observed runtime: a warning is emitted and the field is not executed. |
|
|
37
|
+
|
|
38
|
+
`userConfig` entries are strict: `{type?: 'string'|'number'|'boolean'|'directory'|'file', title?, description?, default?: string|number|boolean, required?, sensitive?}`. A `required: true` entry without a default emits a diagnostic. Values are referenced as `${user_config.<key>}`.
|
|
39
|
+
|
|
40
|
+
## Marketplace manifest (`marketplace.json`)
|
|
41
|
+
|
|
42
|
+
Required: `name` and `plugins`. The official validator additionally requires `owner` and a top-level `description` plus `description_i18n` with `en` and `zh-CN`.
|
|
43
|
+
|
|
44
|
+
| Field | Type | Notes |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `name` | string | |
|
|
47
|
+
| `description`, `description_i18n` | string, `{locale: string}` | |
|
|
48
|
+
| `owner` | `{name, url}` | Required by the validator; absent from the docs field table. |
|
|
49
|
+
| `plugins` | array \| object map | Documented as an array; the runtime also accepts an object keyed by plugin name. |
|
|
50
|
+
| `pluginRoot` | string | Documented at the top level; the runtime reads `metadata.pluginRoot` and only surfaces a top-level value on already-normalized manifests. Which wins for a hand-written manifest is unverified. |
|
|
51
|
+
| `metadata` | `{description?, pluginRoot?, version?}` | Runtime fallback location for `pluginRoot`. |
|
|
52
|
+
| `allowCrossMarketplaceDependenciesOn` | string[] | |
|
|
53
|
+
| `featured` | string[] | Read by the runtime normalizer; undocumented. |
|
|
54
|
+
| `version` | number | Seen in per-plugin payload manifests. |
|
|
55
|
+
|
|
56
|
+
Entry fields (documented): `name`, `source`, `description`, `version`, `category`, `tags`, `dependencies`, `strict`. The official category set is `developer-tools`, `productivity`, `utilities`, `guides`, `finance`, `template`, `other` — the docs example uses `demo`, which fails the validator. `version` drives update checks while the installed version comes from the plugin's own manifest, so both must be bumped.
|
|
57
|
+
|
|
58
|
+
Entry fields read by the runtime but absent from every field table: `displayName`, `displayName_i18n`, `description_i18n`, `icon`, `author`/`authorUrl`, `homepage`, `privacyPolicy`, `termsOfService`, `heroImage`, `examplePrompts`, `examplePrompts_i18n`, `requiresPaidPlan`, `cachePath`, `keywords`, `_artifact`.
|
|
59
|
+
|
|
60
|
+
## Plugin sources
|
|
61
|
+
|
|
62
|
+
| Form | Meaning |
|
|
63
|
+
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `"./plugins/hello"` | Subdirectory relative to the marketplace root. |
|
|
65
|
+
| `{source: 'directory', path}` | Local absolute directory. |
|
|
66
|
+
| `{source: 'github', repo, path?, ref?}` | GitHub repository, optionally a subdirectory. |
|
|
67
|
+
| `{source: 'git', url, path?, ref?}` | Any Git repository. |
|
|
68
|
+
| `{source: 'git-subdir', url, path, ref?}` | Runtime-only; undocumented. |
|
|
69
|
+
| `{source: 'file', path}` | Local manifest file. |
|
|
70
|
+
| `{source: 'url', url, headers?}` | Remote JSON. |
|
|
71
|
+
| `{source: 'url', type: 'zip', url, sha256, path, stripRoot?, headers?}` | Verified archive install: `sha256` is mandatory 64-character lowercase hex and HTTPS is enforced. |
|
|
72
|
+
| `{source: 'npm', package}` | Documented, but the runtime warns "recognized but not supported in V1 install". |
|
|
73
|
+
|
|
74
|
+
## Public distribution format
|
|
75
|
+
|
|
76
|
+
A distribution source exposes a static layout under a base URL: `marketplace.json`, `assets/<plugin>/icon.png`, and `plugins/<plugin>/<version>/plugin.zip`. The marketplace entry carries the archive as `source: {source: 'url', type: 'zip', url, sha256, path}` plus an `_artifact: {path, sha256, size}` block whose `path` is relative to the base URL. Installation fetches the catalog, downloads the archive, verifies SHA-256, extracts the declared directory, and records the version. Plugin versions are immutable.
|
|
77
|
+
|
|
78
|
+
## Directory layout
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
my-plugin/
|
|
82
|
+
├── .zcode-plugin/plugin.json # manifest (only required file)
|
|
83
|
+
├── commands/*.md # slash commands; $ARGUMENTS, $1, $2
|
|
84
|
+
├── skills/<name>/SKILL.md # name + description (<=1024 chars)
|
|
85
|
+
├── agents/*.md # name + description; body is the system prompt
|
|
86
|
+
├── hooks/hooks.json # SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Stop
|
|
87
|
+
└── .mcp.json # MCP declarations
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Recognized root entries: `.mcp.json`, `.zcode-plugin`, `README.md`, `agents`, `commands`, `dist`, `docs`, `hooks`, `output-styles`, `package.json`, `scripts`, `skills`, `templates`. `output-styles/` is recognized while the `outputStyles` field is diagnostic-only, and `workflows` is not a plugin component directory.
|
|
91
|
+
|
|
92
|
+
Placeholders: `${ZCODE_PLUGIN_ROOT}` (alias `${CLAUDE_PLUGIN_ROOT}`), `${ZCODE_PLUGIN_DATA}`, `${ZCODE_PROJECT_DIR}` / `${CLAUDE_PROJECT_DIR}`, `${user_config.<key>}`. Official artifacts use both the `ZCODE_` and `CLAUDE_` spellings, so the canonical form is unverified.
|
|
93
|
+
|
|
94
|
+
## Evidence gaps
|
|
95
|
+
|
|
96
|
+
1. `pluginRoot`: top-level (docs) versus `metadata.pluginRoot` (runtime).
|
|
97
|
+
2. `plugins` as an object map is undocumented.
|
|
98
|
+
3. `npm`/`pip` sources are documented but non-functional in the observed runtime; `git-subdir` is implemented but undocumented.
|
|
99
|
+
4. `agents` is documented and appears in status records, yet one external-source compatibility report lists it as diagnostic-only.
|
|
100
|
+
5. `output-styles/` versus diagnostic-only `outputStyles`; `workflows` is not a plugin surface.
|
|
101
|
+
6. Marketplace listing fields (`displayName`, `icon`, `requiresPaidPlan`, `examplePrompts`, …) are runtime-read and used by the official market but appear in no field table.
|
|
102
|
+
7. The docs example category `demo` is outside the official validator's set.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-time migration from the pre-0.5.4 split layout, where suite data and
|
|
3
|
-
* MCP overrides lived under a sibling `~/.dsh/agent-plugins-data` root: if
|
|
4
|
-
* that root exists, its `data/` and `overrides/` subtrees move to their
|
|
5
|
-
* consolidated homes (`<dataRoot>/data` and `<dataRoot>/overrides`, matching
|
|
6
|
-
* the live resolution) and the emptied sibling is removed. Idempotent — a
|
|
7
|
-
* missing, empty, or already-migrated legacy root is a no-op — and
|
|
8
|
-
* best-effort: a filesystem failure leaves both trees in place for a manual
|
|
9
|
-
* move rather than deleting user data.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
import { existsSync } from 'node:fs';
|
|
14
|
-
import { cp, mkdir, readdir, rm } from 'node:fs/promises';
|
|
15
|
-
import { join } from 'node:path';
|
|
16
|
-
/** Migrate `data/` and `overrides/` from the legacy sibling root, if present. */
|
|
17
|
-
export async function migrateLegacyDataRoot(legacyRoot, dataRoot) {
|
|
18
|
-
if (!existsSync(legacyRoot))
|
|
19
|
-
return;
|
|
20
|
-
let entries = [];
|
|
21
|
-
try {
|
|
22
|
-
entries = await readdir(legacyRoot);
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
// Unreadable legacy root: leave everything for a manual move.
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
for (const subtree of ['data', 'overrides']) {
|
|
29
|
-
const from = join(legacyRoot, subtree);
|
|
30
|
-
if (!entries.includes(subtree) || !existsSync(from))
|
|
31
|
-
continue;
|
|
32
|
-
const to = join(dataRoot, subtree);
|
|
33
|
-
if (existsSync(to)) {
|
|
34
|
-
// Merge into an existing target: copy contents, then drop the source.
|
|
35
|
-
await mkdir(to, { recursive: true });
|
|
36
|
-
for (const entry of await readdir(from)) {
|
|
37
|
-
await cp(join(from, entry), join(to, entry), { recursive: true, force: false, errorOnExist: false });
|
|
38
|
-
}
|
|
39
|
-
await rm(from, { recursive: true, force: true });
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
await mkdir(dataRoot, { recursive: true });
|
|
43
|
-
await cp(from, to, { recursive: true });
|
|
44
|
-
await rm(from, { recursive: true, force: true });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Remove the legacy root only when nothing else remains inside it.
|
|
48
|
-
const remaining = await readdir(legacyRoot).catch(() => ['keep']);
|
|
49
|
-
if (remaining.length === 0)
|
|
50
|
-
await rm(legacyRoot, { recursive: true, force: true });
|
|
51
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-time migration from the pre-0.5.4 split layout, where suite data and
|
|
3
|
-
* MCP overrides lived under a sibling `~/.dsh/agent-plugins-data` root: if
|
|
4
|
-
* that root exists, its `data/` and `overrides/` subtrees move to their
|
|
5
|
-
* consolidated homes (`<dataRoot>/data` and `<dataRoot>/overrides`, matching
|
|
6
|
-
* the live resolution) and the emptied sibling is removed. Idempotent — a
|
|
7
|
-
* missing, empty, or already-migrated legacy root is a no-op — and
|
|
8
|
-
* best-effort: a filesystem failure leaves both trees in place for a manual
|
|
9
|
-
* move rather than deleting user data.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
/** Migrate `data/` and `overrides/` from the legacy sibling root, if present. */
|
|
14
|
-
export declare function migrateLegacyDataRoot(legacyRoot: string, dataRoot: string): Promise<void>;
|