@dsh-plugin-hub/dsh-plugin 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +20 -3
  2. package/index.js +105 -7
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @dsh-plugin-hub/dsh-plugin
2
2
 
3
3
  Agent-facing DSH tools for planning, sharing, applying, and rolling back
4
- reproducible [DSH Plugin Hub](https://dshpluginhub.ai) Profiles.
4
+ reproducible [DSH Plugin Hub](https://dshpluginhub.ai) Presets.
5
5
 
6
6
  - Website: [dshpluginhub.ai](https://dshpluginhub.ai)
7
7
  - Browse plugins: [dshpluginhub.ai/plugins](https://dshpluginhub.ai/plugins)
8
- - Explore Profiles: [dshpluginhub.ai/profiles](https://dshpluginhub.ai/profiles)
8
+ - Explore Presets: [dshpluginhub.ai/profiles](https://dshpluginhub.ai/profiles)
9
9
 
10
10
  Install into a Profile:
11
11
 
@@ -13,9 +13,16 @@ Install into a Profile:
13
13
  dsh plugin --profile web add @dsh-plugin-hub/dsh-plugin
14
14
  ```
15
15
 
16
- The bundle exposes five DSH tools backed by the local `dsh-hub` CLI:
16
+ The bundle exposes read-only discovery and diagnosis tools plus confirmed plan
17
+ application, all backed by the local `dsh-hub` CLI:
17
18
 
19
+ - `dsh_hub_search` searches the live catalog.
20
+ - `dsh_hub_plugin_info` reviews exact versions, compatibility and security.
21
+ - `dsh_hub_plugin_plan` creates an exact, preconditioned Plugin install plan.
18
22
  - `dsh_hub_profile_plan` creates a read-only, expiring install plan.
23
+ - `dsh_hub_profile_diff` compares Plugin membership, order, versions, sources, and Release identity.
24
+ - `dsh_hub_profile_upgrade_plan` plans an upgrade and returns its full diff.
25
+ - `dsh_hub_profile_doctor` diagnoses local state and release drift.
19
26
  - `dsh_hub_profile_share_plan` captures an exact, read-only publication plan.
20
27
  - `dsh_hub_profile_rollback_plan` selects a complete recoverable revision.
21
28
  - `dsh_hub_operation_apply` applies that plan after explicit confirmation.
@@ -25,6 +32,16 @@ Every machine-triggered mutation uses an expiring, single-use, preconditioned
25
32
  plan and the same staging, validation, atomic switch and rollback implementation
26
33
  as direct CLI use.
27
34
 
35
+ ## Telemetry
36
+
37
+ This adapter does not add a separate telemetry client. Commands it invokes use
38
+ the installed `dsh-hub` CLI preference. On the CLI's first run a notice is
39
+ shown and that run sends no event; later eligible install and Preset lifecycle
40
+ operations report anonymous aggregates unless the user runs `dsh-hub telemetry
41
+ off` or uses one of the documented per-invocation opt-outs. See the
42
+ [`@dsh-plugin-hub/cli` README](https://github.com/pax-beehive/dsh-hub-cli/tree/main/packages/cli#anonymous-cli-telemetry) for the
43
+ exact fields, retention period, debug mode, and controls.
44
+
28
45
  Requires Node.js 22.13 or later, `@deepseek-ai/cordis`, and
29
46
  `@deepseek-ai/dsh-tools`.
30
47
 
package/index.js CHANGED
@@ -32,13 +32,57 @@ const output = {
32
32
  }
33
33
 
34
34
  export function apply(ctx) {
35
+ ctx.tools.register(defineTool({
36
+ name: 'dsh_hub_search',
37
+ description: 'Search the live DSH Plugin Hub catalog by name, capability, or natural-language need. This is read-only.',
38
+ parameters: {
39
+ query: { type: 'string', required: true, description: 'Plugin name, capability, or task to search for.' },
40
+ },
41
+ output,
42
+ async execute(args, exec) {
43
+ const events = await run(['search', args.query, '--json'], exec.signal)
44
+ return events[0] ?? { items: [] }
45
+ },
46
+ }))
47
+
48
+ ctx.tools.register(defineTool({
49
+ name: 'dsh_hub_plugin_info',
50
+ description: 'Inspect one Plugin, its exact selected version, source, compatibility, and published security assessment. This is read-only.',
51
+ parameters: {
52
+ packageName: { type: 'string', required: true, description: 'Exact npm package name.' },
53
+ version: { type: 'string', description: 'Exact version, tag, or range (default latest).' },
54
+ },
55
+ output,
56
+ async execute(args, exec) {
57
+ const values = ['info', args.packageName, '--version', args.version ?? 'latest', '--json']
58
+ const events = await run(values, exec.signal)
59
+ return events[0] ?? {}
60
+ },
61
+ }))
62
+
63
+ ctx.tools.register(defineTool({
64
+ name: 'dsh_hub_plugin_plan',
65
+ description: 'Create a non-mutating, exact and preconditioned plan to install one reviewed Plugin. Present the source, security assessment, target Profile, and exact version before applying it.',
66
+ parameters: {
67
+ packageName: { type: 'string', required: true, description: 'Exact npm package name.' },
68
+ profile: { type: 'string', description: 'Local target Profile name (default web).' },
69
+ version: { type: 'string', description: 'Exact version, tag, or range (default latest).' },
70
+ },
71
+ output,
72
+ async execute(args, exec) {
73
+ const values = ['install', args.packageName, '--profile', args.profile ?? 'web', '--version', args.version ?? 'latest', '--plan', '--json']
74
+ const events = await run(values, exec.signal)
75
+ return events[0] ?? {}
76
+ },
77
+ }))
78
+
35
79
  ctx.tools.register(defineTool({
36
80
  name: 'dsh_hub_profile_plan',
37
- description: 'Create a non-mutating, exact and preconditioned plan to install or upgrade a public DSH Hub Profile. Present the plan to the user before applying it.',
81
+ description: 'Create a non-mutating, exact and preconditioned plan to install or upgrade a public DSH Hub Preset. Present the plan to the user before applying it.',
38
82
  parameters: {
39
- slug: { type: 'string', required: true, description: 'Hub Profile slug.' },
83
+ slug: { type: 'string', required: true, description: 'Hub Preset slug.' },
40
84
  profile: { type: 'string', description: 'Local target Profile name (default web).' },
41
- version: { type: 'string', description: 'Profile Release version (default latest).' },
85
+ version: { type: 'string', description: 'Preset Release version (default latest).' },
42
86
  },
43
87
  output,
44
88
  async execute(args, exec) {
@@ -48,9 +92,63 @@ export function apply(ctx) {
48
92
  },
49
93
  }))
50
94
 
95
+ ctx.tools.register(defineTool({
96
+ name: 'dsh_hub_profile_diff',
97
+ description: 'Compare the current local Profile lock with a public Hub Release, including additions, removals, load-order changes, versions, and immutable sources. This is read-only.',
98
+ parameters: {
99
+ slug: { type: 'string', description: 'Hub Preset slug; defaults to the installed Hub Preset.' },
100
+ profile: { type: 'string', description: 'Local target Profile name (default web).' },
101
+ version: { type: 'string', description: 'Target Release version (default latest).' },
102
+ },
103
+ output,
104
+ async execute(args, exec) {
105
+ const values = ['profile', 'diff']
106
+ if (args.slug) values.push(args.slug)
107
+ values.push('--profile', args.profile ?? 'web', '--version', args.version ?? 'latest', '--json')
108
+ const events = await run(values, exec.signal)
109
+ return events[0] ?? {}
110
+ },
111
+ }))
112
+
113
+ ctx.tools.register(defineTool({
114
+ name: 'dsh_hub_profile_upgrade_plan',
115
+ description: 'Create a reviewed plan to upgrade the installed Profile to a selected Hub Release. Returns an up-to-date result without creating a mutation when no change is needed.',
116
+ parameters: {
117
+ slug: { type: 'string', description: 'Hub Preset slug; defaults to the installed Hub Preset.' },
118
+ profile: { type: 'string', description: 'Local target Profile name (default web).' },
119
+ version: { type: 'string', description: 'Target Release version (default latest).' },
120
+ },
121
+ output,
122
+ async execute(args, exec) {
123
+ const values = ['profile', 'upgrade']
124
+ if (args.slug) values.push(args.slug)
125
+ values.push('--profile', args.profile ?? 'web', '--version', args.version ?? 'latest', '--plan', '--json')
126
+ const events = await run(values, exec.signal)
127
+ return events[0] ?? {}
128
+ },
129
+ }))
130
+
131
+ ctx.tools.register(defineTool({
132
+ name: 'dsh_hub_profile_doctor',
133
+ description: 'Diagnose the local Profile directory, lockfile, bundle order, installed versions, required inputs, and drift from a Hub Release. This is read-only.',
134
+ parameters: {
135
+ slug: { type: 'string', description: 'Hub Preset slug; defaults to the installed Hub Preset.' },
136
+ profile: { type: 'string', description: 'Local Profile name (default web).' },
137
+ version: { type: 'string', description: 'Release used for drift and input checks (default latest).' },
138
+ },
139
+ output,
140
+ async execute(args, exec) {
141
+ const values = ['profile', 'doctor']
142
+ if (args.slug) values.push(args.slug)
143
+ values.push('--profile', args.profile ?? 'web', '--version', args.version ?? 'latest', '--json')
144
+ const events = await run(values, exec.signal)
145
+ return events[0] ?? {}
146
+ },
147
+ }))
148
+
51
149
  ctx.tools.register(defineTool({
52
150
  name: 'dsh_hub_operation_apply',
53
- description: 'Apply a previously reviewed DSH Hub install, share, or rollback plan. Set confirmed=true only after the user explicitly confirms that exact plan.',
151
+ description: 'Apply a previously reviewed DSH Hub Plugin or Preset mutation plan. Set confirmed=true only after the user explicitly confirms that exact plan.',
54
152
  parameters: {
55
153
  planId: { type: 'string', required: true, description: 'Plan UUID returned by any DSH Hub planning tool.' },
56
154
  confirmed: { type: 'boolean', required: true, description: 'Must reflect explicit user confirmation of this plan.' },
@@ -67,11 +165,11 @@ export function apply(ctx) {
67
165
  name: 'dsh_hub_profile_share_plan',
68
166
  description: 'Create a non-mutating plan to publish the exact current local Profile as an immutable Hub Release. Review the captured layers and local input contract before applying it.',
69
167
  parameters: {
70
- slug: { type: 'string', required: true, description: 'New or owned Hub Profile slug.' },
168
+ slug: { type: 'string', required: true, description: 'New or owned Hub Preset slug.' },
71
169
  version: { type: 'string', required: true, description: 'Exact SemVer for the immutable Release.' },
72
170
  profile: { type: 'string', description: 'Local source Profile name (default web).' },
73
- displayName: { type: 'string', description: 'Public Profile name.' },
74
- description: { type: 'string', description: 'Public Profile description.' },
171
+ displayName: { type: 'string', description: 'Public Preset name.' },
172
+ description: { type: 'string', description: 'Public Preset description.' },
75
173
  runtimeVersion: { type: 'string', description: 'Exact DSH runtime; auto-detected when omitted.' },
76
174
  },
77
175
  output,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plugin-hub/dsh-plugin",
3
- "version": "0.1.4",
3
+ "version": "0.3.0",
4
4
  "description": "DSH tools for planning and applying reproducible Plugin Hub Profiles through the local dsh-hub CLI",
5
5
  "keywords": [
6
6
  "dsh-plugin",
@@ -27,7 +27,7 @@
27
27
  "LICENSE"
28
28
  ],
29
29
  "dependencies": {
30
- "@dsh-plugin-hub/cli": "0.1.4"
30
+ "@dsh-plugin-hub/cli": "0.3.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.1",