@dsh-cc/command-plugin 0.5.0 → 0.6.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAA;AAEpB,eAAO,MAAM,IAAI,mBAAmB,CAAA;AACpC,eAAO,MAAM,MAAM,UAAe,CAAA;AAElC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,IAAI,IAAI,eAAe,EAAE,CAAA;IACzB,2EAA2E;IAC3E,MAAM,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAA;CACzC;AAwBD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAWxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAA;AAIpB,eAAO,MAAM,IAAI,mBAAmB,CAAA;AACpC,eAAO,MAAM,MAAM,UAAe,CAAA;AAElC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,IAAI,IAAI,eAAe,EAAE,CAAA;IACzB,2EAA2E;IAC3E,MAAM,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAA;CACzC;AA2BD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAWxC"}
package/lib/index.js CHANGED
@@ -6,19 +6,23 @@
6
6
  * rather than failing.
7
7
  * @module @dsh-cc/command-plugin
8
8
  */
9
- import { formatPluginList, formatReloadSummary, } from "./plugin.js";
9
+ import { formatReloadSummary, } from "./plugin.js";
10
+ import { executePluginManage } from "./manage.js";
11
+ import { helpable } from '@dsh-cc/command-usage';
10
12
  export const name = 'command-plugin';
11
13
  export const inject = ['commands'];
12
14
  /** Resolve the optional ccPlugins seam, or undefined when not composed. */
13
15
  function seam(ctx) {
14
16
  return ctx.get('ccPlugins');
15
- } /** Execute `/plugin`: list the mounted CC plugins. */
16
- async function executePlugin(ctx, _invocation) {
17
- const plugins = seam(ctx);
18
- if (plugins === undefined) {
19
- return { kind: 'success', text: 'No plugin registry is mounted in this composition (cc-shell-glue absent).' };
20
- }
21
- return { kind: 'success', text: formatPluginList(plugins.list()) };
17
+ }
18
+ /** Resolve the optional ccPluginManager seam, or undefined when not composed. */
19
+ function managerSeam(ctx) {
20
+ return ctx.get('ccPluginManager');
21
+ }
22
+ /** Execute `/plugin`: list the mounted CC plugins. */
23
+ /** Execute `/plugin`: route through the §3 subcommand grammar. */
24
+ async function executePlugin(ctx, invocation) {
25
+ return executePluginManage({ ctx, ccPlugins: seam(ctx), ccPluginManager: managerSeam(ctx) }, invocation);
22
26
  }
23
27
  /** Execute `/reload-plugins`: dispose and remount every discovery root. */
24
28
  async function executeReload(ctx, _invocation) {
@@ -35,11 +39,11 @@ async function executeReload(ctx, _invocation) {
35
39
  * @param ctx - context carrying the command registry.
36
40
  */
37
41
  export function apply(ctx) {
38
- ctx.commands.register({
42
+ ctx.commands.register(helpable({
39
43
  name: 'plugin',
40
- description: 'list mounted Claude Code plugins (name, root, component counts)',
44
+ description: 'manage Claude Code plugins (list/install/uninstall/enable/disable/update/marketplace)',
41
45
  handler: (invocation) => executePlugin(ctx, invocation),
42
- });
46
+ }));
43
47
  ctx.commands.register({
44
48
  name: 'reload-plugins',
45
49
  description: 'dispose and remount all Claude Code plugin discovery roots',
package/lib/index.js.map CHANGED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C,CAAA;AAC1G,CAAC;AAED,2EAA2E;AAC3E,KAAK,UAAU,aAAa,CAAC,GAAY,EAAE,WAA8B;IACvE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,2EAA2E,EAAE,CAAA;IAC/G,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAA;IACrC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,EAAE,CAAA;AAC/E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC7B,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uFAAuF;QACpG,OAAO,EAAE,CAAC,UAA6B,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;KAC3E,CAAC,CAAC,CAAA;IACH,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACpB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,CAAC,UAA6B,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;KAC3E,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Handlers for the `/plugin` management subcommands. Seams are resolved
3
+ * structurally by the caller (`index.ts`) and passed in: the optional
4
+ * `ccPlugins` registry (mounted view + live rescan) and the optional
5
+ * `ccPluginManager` service (state mutations, mounted by cc-shell-glue).
6
+ * When the manager seam is absent the handlers degrade to the repo's
7
+ * graceful sentence pattern; a core `PluginManagerError` (duck-typed by
8
+ * its `name` so this package stays dependency-light) renders as a one-line
9
+ * text result — its message, no stack.
10
+ *
11
+ * @module @dsh-cc/command-plugin/manage
12
+ */
13
+ import type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
14
+ import { type InstalledPluginRow, type MarketplaceListRow } from './render-manage.ts';
15
+ import type { CcPluginsSeam } from './index.ts';
16
+ /**
17
+ * The minimal structural face of the `ccPluginManager` service (cc-shell's
18
+ * `@dsh-cc/plugin-manager` binding). Kept local and structural so this
19
+ * package need not depend on the manager package.
20
+ */
21
+ export interface CcPluginManagerSeam {
22
+ list(opts?: {
23
+ enabled?: boolean;
24
+ disabled?: boolean;
25
+ }): Promise<InstalledPluginRow[]>;
26
+ enable(arg: string, opts?: {
27
+ scope?: string;
28
+ }): Promise<{
29
+ id: string;
30
+ scope: string;
31
+ }>;
32
+ disable(arg: string, opts?: {
33
+ scope?: string;
34
+ }): Promise<{
35
+ id: string;
36
+ scope: string;
37
+ }>;
38
+ install(arg: string, opts?: {
39
+ scope?: string;
40
+ }): Promise<{
41
+ id: string;
42
+ version: string;
43
+ scope: string;
44
+ }>;
45
+ uninstall(arg: string, opts?: {
46
+ scope?: string;
47
+ }): Promise<{
48
+ id: string;
49
+ scope: string;
50
+ }>;
51
+ update(arg: string, opts?: {
52
+ scope?: string;
53
+ }): Promise<{
54
+ upToDate: true;
55
+ id: string;
56
+ version: string;
57
+ scope: string;
58
+ } | {
59
+ upToDate: false;
60
+ id: string;
61
+ fromVersion: string;
62
+ toVersion: string;
63
+ scope: string;
64
+ }>;
65
+ listMarketplaces(): Promise<MarketplaceListRow[]>;
66
+ addMarketplace(source: string, opts?: {
67
+ scope?: string;
68
+ }): Promise<{
69
+ name: string;
70
+ sourceKind: string;
71
+ shadowedClaudeEntry?: true;
72
+ }>;
73
+ removeMarketplace(name: string): Promise<{
74
+ name: string;
75
+ removedPlugins: string[];
76
+ }>;
77
+ updateMarketplaces(name?: string): Promise<string[]>;
78
+ }
79
+ /** Seams handed to the manage handlers by `index.ts` (both optional). */
80
+ export interface ManageHandlerDeps {
81
+ ctx: unknown;
82
+ ccPlugins?: CcPluginsSeam | undefined;
83
+ ccPluginManager?: CcPluginManagerSeam | undefined;
84
+ }
85
+ /** Execute a `/plugin` invocation that routed to the management surface. */
86
+ export declare function executePluginManage(deps: ManageHandlerDeps, invocation: CommandInvocation): Promise<CommandResult>;
87
+ //# sourceMappingURL=manage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage.d.ts","sourceRoot":"","sources":["../src/manage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,EAaL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAA;IACrF,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACtF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,E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AAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CACrD;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACrC,eAAe,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAA;CAClD;AAkDD,4EAA4E;AAC5E,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmExH"}
package/lib/manage.js ADDED
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Handlers for the `/plugin` management subcommands. Seams are resolved
3
+ * structurally by the caller (`index.ts`) and passed in: the optional
4
+ * `ccPlugins` registry (mounted view + live rescan) and the optional
5
+ * `ccPluginManager` service (state mutations, mounted by cc-shell-glue).
6
+ * When the manager seam is absent the handlers degrade to the repo's
7
+ * graceful sentence pattern; a core `PluginManagerError` (duck-typed by
8
+ * its `name` so this package stays dependency-light) renders as a one-line
9
+ * text result — its message, no stack.
10
+ *
11
+ * @module @dsh-cc/command-plugin/manage
12
+ */
13
+ import { parsePluginArgv } from "./subcommands.js";
14
+ import { formatInstallResult, formatInstalledList, formatMarketplaceAdded, formatMarketplaceList, formatMarketplaceRemoved, formatMarketplacesUpdated, formatPluginHelp, formatToggleResult, formatUninstallResult, formatUpdateResult, MANAGE_FOOTER, TRUST_WARNING, } from "./render-manage.js";
15
+ import { formatPluginList } from "./plugin.js";
16
+ const MANAGER_ABSENT = 'No plugin manager is mounted in this composition (cc-shell-glue absent).';
17
+ /** Core errors carry `name === 'PluginManagerError'`; render their message verbatim. */
18
+ function isPluginManagerError(error) {
19
+ return error instanceof Error && error.name === 'PluginManagerError';
20
+ }
21
+ function text(message) {
22
+ return { kind: 'success', text: message };
23
+ }
24
+ function parseArgv(invocation) {
25
+ return invocation.rawInput.trim().split(/\s+/).filter((token) => token.length > 0);
26
+ }
27
+ /** `exactOptionalPropertyTypes`-safe scope options: omit the key entirely when unset. */
28
+ function scopeOpts(scope) {
29
+ return scope === undefined ? {} : { scope };
30
+ }
31
+ /** Rescan the mounted-plugin registry after a successful mutation (tolerates seam absence). */
32
+ async function rescan(ccPlugins) {
33
+ await ccPlugins?.rescan();
34
+ }
35
+ async function runList(manager, command) {
36
+ const rows = await manager.list(command.filter === 'enabled' ? { enabled: true }
37
+ : command.filter === 'disabled' ? { disabled: true }
38
+ : undefined);
39
+ return text(formatInstalledList(rows));
40
+ }
41
+ async function runMarketplaceAdd(manager, command, ccPlugins) {
42
+ const result = await manager.addMarketplace(command.arg, scopeOpts(command.scope));
43
+ await rescan(ccPlugins);
44
+ const added = formatMarketplaceAdded({ name: result.name, sourceKind: result.sourceKind, scope: command.scope ?? 'user' });
45
+ const lines = [added];
46
+ if (result.sourceKind !== 'directory')
47
+ lines.push(TRUST_WARNING);
48
+ if (result.shadowedClaudeEntry === true)
49
+ lines.push('This dsh-side registration shadows a Claude-home entry with a different source.');
50
+ return text(lines.join('\n'));
51
+ }
52
+ /** Execute a `/plugin` invocation that routed to the management surface. */
53
+ export async function executePluginManage(deps, invocation) {
54
+ const argv = parseArgv(invocation);
55
+ const outcome = parsePluginArgv(argv);
56
+ if (outcome.kind === 'mounted') {
57
+ const ccPlugins = deps.ccPlugins;
58
+ if (ccPlugins === undefined) {
59
+ return text('No plugin registry is mounted in this composition (cc-shell-glue absent).');
60
+ }
61
+ return text(`${formatPluginList(ccPlugins.list())}\n${MANAGE_FOOTER}`);
62
+ }
63
+ if (outcome.kind === 'help')
64
+ return text(formatPluginHelp());
65
+ if (outcome.kind === 'parse-error')
66
+ return text(outcome.message);
67
+ const manager = deps.ccPluginManager;
68
+ if (manager === undefined)
69
+ return text(MANAGER_ABSENT);
70
+ const command = outcome.command;
71
+ const ccPlugins = deps.ccPlugins;
72
+ try {
73
+ switch (command.verb) {
74
+ case 'list':
75
+ return await runList(manager, command);
76
+ case 'install': {
77
+ const result = await manager.install(command.arg, scopeOpts(command.scope));
78
+ await rescan(ccPlugins);
79
+ return text(`${formatInstallResult(result)}\n${TRUST_WARNING}`);
80
+ }
81
+ case 'uninstall': {
82
+ const result = await manager.uninstall(command.arg, scopeOpts(command.scope));
83
+ await rescan(ccPlugins);
84
+ return text(formatUninstallResult(result));
85
+ }
86
+ case 'enable': {
87
+ const result = await manager.enable(command.arg, scopeOpts(command.scope));
88
+ await rescan(ccPlugins);
89
+ return text(formatToggleResult('enable', result));
90
+ }
91
+ case 'disable': {
92
+ const result = await manager.disable(command.arg, scopeOpts(command.scope));
93
+ await rescan(ccPlugins);
94
+ return text(formatToggleResult('disable', result));
95
+ }
96
+ case 'update': {
97
+ const result = await manager.update(command.arg, scopeOpts(command.scope));
98
+ await rescan(ccPlugins);
99
+ return text(formatUpdateResult(result));
100
+ }
101
+ case 'marketplace-list':
102
+ return text(formatMarketplaceList(await manager.listMarketplaces()));
103
+ case 'marketplace-add':
104
+ return await runMarketplaceAdd(manager, command, ccPlugins);
105
+ case 'marketplace-remove': {
106
+ const result = await manager.removeMarketplace(command.arg);
107
+ await rescan(ccPlugins);
108
+ return text(formatMarketplaceRemoved(result));
109
+ }
110
+ case 'marketplace-update': {
111
+ const names = await manager.updateMarketplaces(command.arg);
112
+ await rescan(ccPlugins);
113
+ return text(formatMarketplacesUpdated(names));
114
+ }
115
+ }
116
+ }
117
+ catch (error) {
118
+ if (isPluginManagerError(error))
119
+ return text(error.message);
120
+ throw error;
121
+ }
122
+ }
123
+ //# sourceMappingURL=manage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage.js","sourceRoot":"","sources":["../src/manage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,eAAe,EAA4B,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB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M,CAAC,SAAS,CAAC,CAAA;gBACvB,OAAO,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAA;YAC/C,CAAC;YACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;gBAC1B,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;gBAC3D,MAAM,MAAM,CAAC,SAAS,CAAC,CAAA;gBACvB,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,oBAAoB,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC3D,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Pure renderers for the `/plugin` management surface: the installed-plugin
3
+ * list, the marketplace list, the frozen §3 success lines, the manage footer,
4
+ * and the help/grammar block. Only shapes data; no I/O, no seams.
5
+ *
6
+ * @module @dsh-cc/command-plugin/render-manage
7
+ */
8
+ /** One installed-plugin row (structural subset of the manager's list entry). */
9
+ export interface InstalledPluginRow {
10
+ id: string;
11
+ version: string;
12
+ scope: string;
13
+ effectiveEnabled: boolean;
14
+ overrideNote?: string;
15
+ }
16
+ /** One marketplace row (structural subset of the manager's marketplace entry). */
17
+ export interface MarketplaceListRow {
18
+ name: string;
19
+ source: {
20
+ source: 'directory';
21
+ path: string;
22
+ } | {
23
+ source: 'github';
24
+ repo: string;
25
+ } | {
26
+ source: 'git';
27
+ url: string;
28
+ };
29
+ }
30
+ /** The static security warning appended to remote-source installs. */
31
+ export declare const TRUST_WARNING = "Note: plugins can add hooks and MCP servers; only install from sources you trust.";
32
+ /** Footer appended to the bare `/plugin` mounted view. */
33
+ export declare const MANAGE_FOOTER = "Manage: /plugin install|uninstall|enable|disable|update|list \u00B7 /plugin marketplace add|remove|list|update";
34
+ /** Render `/plugin list`: header, blank line, two-space ❯ rows, four-space fields. */
35
+ export declare function formatInstalledList(rows: readonly InstalledPluginRow[]): string;
36
+ /** Render `/plugin marketplace list` with the probed CC source spelling. */
37
+ export declare function formatMarketplaceList(rows: readonly MarketplaceListRow[]): string;
38
+ /** `Installed plugin: <id> (scope: <s>, version: <v>)` */
39
+ export declare function formatInstallResult(result: {
40
+ id: string;
41
+ version: string;
42
+ scope: string;
43
+ }): string;
44
+ /** `Uninstalled plugin: <id> (scope: <s>)` */
45
+ export declare function formatUninstallResult(result: {
46
+ id: string;
47
+ scope: string;
48
+ }): string;
49
+ /** `Enabled plugin: <name> (scope: <s>)` / `Disabled plugin: <name> (scope: <s>)` */
50
+ export declare function formatToggleResult(verb: 'enable' | 'disable', result: {
51
+ id: string;
52
+ scope: string;
53
+ }): string;
54
+ /** The frozen update strings: changed-version and up-to-date forms. */
55
+ export declare function formatUpdateResult(result: {
56
+ upToDate: true;
57
+ id: string;
58
+ version: string;
59
+ scope: string;
60
+ } | {
61
+ upToDate: false;
62
+ id: string;
63
+ fromVersion: string;
64
+ toVersion: string;
65
+ scope: string;
66
+ }): string;
67
+ /** `Added marketplace: <name> (<source-kind>, declared in <s> settings)` */
68
+ export declare function formatMarketplaceAdded(result: {
69
+ name: string;
70
+ sourceKind: string;
71
+ scope: string;
72
+ }): string;
73
+ /** `Removed marketplace: <name> (also uninstalled <k> plugin installation(s))` */
74
+ export declare function formatMarketplaceRemoved(result: {
75
+ name: string;
76
+ removedPlugins: readonly string[];
77
+ }): string;
78
+ /** `Updated marketplace: <name>` for one; `Updated <k> marketplaces.` for many (or zero). */
79
+ export declare function formatMarketplacesUpdated(names: readonly string[]): string;
80
+ /** The `/plugin` grammar block shown for unknown subcommands. */
81
+ export declare function formatPluginHelp(): string;
82
+ //# sourceMappingURL=render-manage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-manage.d.ts","sourceRoot":"","sources":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AG,SAAS,EAAE,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE5G;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EACrC;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAGlG;AAED,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE1G;AAED,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAE5G;AAED,6FAA6F;AAC7F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAG1E;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAI,MAAM,CAiBzC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Pure renderers for the `/plugin` management surface: the installed-plugin
3
+ * list, the marketplace list, the frozen §3 success lines, the manage footer,
4
+ * and the help/grammar block. Only shapes data; no I/O, no seams.
5
+ *
6
+ * @module @dsh-cc/command-plugin/render-manage
7
+ */
8
+ /** The static security warning appended to remote-source installs. */
9
+ export const TRUST_WARNING = 'Note: plugins can add hooks and MCP servers; only install from sources you trust.';
10
+ /** Footer appended to the bare `/plugin` mounted view. */
11
+ export const MANAGE_FOOTER = 'Manage: /plugin install|uninstall|enable|disable|update|list · /plugin marketplace add|remove|list|update';
12
+ /** Render `/plugin list`: header, blank line, two-space ❯ rows, four-space fields. */
13
+ export function formatInstalledList(rows) {
14
+ if (rows.length === 0)
15
+ return 'No Claude Code plugins are installed (or none visible from this project).';
16
+ const lines = ['Installed Claude Code plugins:', ''];
17
+ for (const row of rows) {
18
+ lines.push(` ❯ ${row.id}`);
19
+ lines.push(` Version: ${row.version}`);
20
+ lines.push(` Scope: ${row.scope}`);
21
+ lines.push(` Status: ${row.effectiveEnabled ? '✔ enabled' : '✘ disabled'}`);
22
+ if (row.overrideNote !== undefined)
23
+ lines.push(` Overrides: ${row.overrideNote}`);
24
+ }
25
+ return lines.join('\n');
26
+ }
27
+ /** Render `/plugin marketplace list` with the probed CC source spelling. */
28
+ export function formatMarketplaceList(rows) {
29
+ if (rows.length === 0)
30
+ return 'No marketplaces are configured.';
31
+ const lines = ['Configured marketplaces:', ''];
32
+ for (const row of rows) {
33
+ lines.push(` ❯ ${row.name}`);
34
+ const source = row.source;
35
+ if (source.source === 'directory')
36
+ lines.push(` Source: Directory (${source.path})`);
37
+ else if (source.source === 'github')
38
+ lines.push(` Source: GitHub (${source.repo})`);
39
+ else
40
+ lines.push(` Source: Git (${source.url})`);
41
+ }
42
+ return lines.join('\n');
43
+ }
44
+ /** `Installed plugin: <id> (scope: <s>, version: <v>)` */
45
+ export function formatInstallResult(result) {
46
+ return `Installed plugin: ${result.id} (scope: ${result.scope}, version: ${result.version})`;
47
+ }
48
+ /** `Uninstalled plugin: <id> (scope: <s>)` */
49
+ export function formatUninstallResult(result) {
50
+ return `Uninstalled plugin: ${result.id} (scope: ${result.scope})`;
51
+ }
52
+ /** `Enabled plugin: <name> (scope: <s>)` / `Disabled plugin: <name> (scope: <s>)` */
53
+ export function formatToggleResult(verb, result) {
54
+ return `${verb === 'enable' ? 'Enabled' : 'Disabled'} plugin: ${result.id} (scope: ${result.scope})`;
55
+ }
56
+ /** The frozen update strings: changed-version and up-to-date forms. */
57
+ export function formatUpdateResult(result) {
58
+ if (result.upToDate)
59
+ return `Plugin "${result.id}" is already up to date (scope: ${result.scope}).`;
60
+ return `Plugin "${result.id}" updated from ${result.fromVersion} to ${result.toVersion} for scope ${result.scope}. Restart to apply changes (or /reload-plugins).`;
61
+ }
62
+ /** `Added marketplace: <name> (<source-kind>, declared in <s> settings)` */
63
+ export function formatMarketplaceAdded(result) {
64
+ return `Added marketplace: ${result.name} (${result.sourceKind}, declared in ${result.scope} settings)`;
65
+ }
66
+ /** `Removed marketplace: <name> (also uninstalled <k> plugin installation(s))` */
67
+ export function formatMarketplaceRemoved(result) {
68
+ return `Removed marketplace: ${result.name} (also uninstalled ${result.removedPlugins.length} plugin installation(s))`;
69
+ }
70
+ /** `Updated marketplace: <name>` for one; `Updated <k> marketplaces.` for many (or zero). */
71
+ export function formatMarketplacesUpdated(names) {
72
+ if (names.length === 1)
73
+ return `Updated marketplace: ${names[0]}`;
74
+ return `Updated ${names.length} marketplaces.`;
75
+ }
76
+ /** The `/plugin` grammar block shown for unknown subcommands. */
77
+ export function formatPluginHelp() {
78
+ return [
79
+ 'Usage: /plugin <subcommand>',
80
+ '',
81
+ ' /plugin mounted-plugins view',
82
+ ' /plugin list [--enabled|--disabled]',
83
+ ' /plugin install <plugin[@mkt]> [--scope user|project|local]',
84
+ ' /plugin uninstall <plugin[@mkt]> [--scope user|project|local]',
85
+ ' /plugin enable <plugin[@mkt]> [--scope user|project|local]',
86
+ ' /plugin disable <plugin[@mkt]> [--scope user|project|local]',
87
+ ' /plugin update <plugin[@mkt]> [--scope user|project|local]',
88
+ ' /plugin marketplace list',
89
+ ' /plugin marketplace add <source> [--scope user|project|local]',
90
+ ' /plugin marketplace remove <name>',
91
+ ' /plugin marketplace update [name]',
92
+ ' /plugin help show this help',
93
+ ].join('\n');
94
+ }
95
+ //# sourceMappingURL=render-manage.js.map
@@ -0,0 +1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AE,kBAAkB,MAAM,CAAC,WAAW,OAAO,MAAM,CAAC,SAAS,cAAc,MAAM,CAAC,KAAK,kDAAkD,CAAA;AACpK,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CAAC,MAA2D;IAChG,OAAO,sBAAsB,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,UAAU,iBAAiB,MAAM,CAAC,KAAK,YAAY,CAAA;AACzG,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,wBAAwB,CAAC,MAA2D;IAClG,OAAO,wBAAwB,MAAM,CAAC,IAAI,sBAAsB,MAAM,CAAC,cAAc,CAAC,MAAM,0BAA0B,CAAA;AACxH,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,yBAAyB,CAAC,KAAwB;IAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,wBAAwB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IACjE,OAAO,WAAW,KAAK,CAAC,MAAM,gBAAgB,CAAA;AAChD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,6BAA6B;QAC7B,EAAE;QACF,kEAAkE;QAClE,uCAAuC;QACvC,+DAA+D;QAC/D,iEAAiE;QACjE,8DAA8D;QAC9D,+DAA+D;QAC/D,8DAA8D;QAC9D,4BAA4B;QAC5B,iEAAiE;QACjE,qCAAqC;QACrC,qCAAqC;QACrC,4DAA4D;KAC7D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Pure argv parser for the `/plugin` command grammar (plan §3):
3
+ *
4
+ * ```
5
+ * /plugin # bare → mounted view
6
+ * /plugin list [--enabled|--disabled]
7
+ * /plugin install|uninstall|enable|disable|update <plugin[@mkt]> [--scope user|project|local]
8
+ * /plugin marketplace list|add <source> [--scope …]|remove <name>|update [name]
9
+ * ```
10
+ *
11
+ * Unknown subcommands route to the help block; malformed forms and bad flag
12
+ * values produce a parse error whose message is a one-line `Usage:` string
13
+ * naming the exact expected form. No I/O, no imports — fully table-testable.
14
+ *
15
+ * @module @dsh-cc/command-plugin/subcommands
16
+ */
17
+ /** Verb dispatched to the manage handlers (marketplace verbs are prefixed). */
18
+ export type PluginVerb = 'list' | 'install' | 'uninstall' | 'enable' | 'disable' | 'update' | 'marketplace-list' | 'marketplace-add' | 'marketplace-remove' | 'marketplace-update';
19
+ /** A fully-validated manage command: what to run, with which arguments. */
20
+ export interface ParsedPluginCommand {
21
+ verb: PluginVerb;
22
+ /** Plugin id, marketplace source, or marketplace name — per verb. */
23
+ arg?: string;
24
+ /** Validated `--scope` value (`user` | `project` | `local`). */
25
+ scope?: string;
26
+ /** `--enabled` / `--disabled` filter for `list`. */
27
+ filter?: 'enabled' | 'disabled';
28
+ }
29
+ /** Parser outcome for one `/plugin` invocation. */
30
+ export type ParseOutcome = {
31
+ kind: 'mounted';
32
+ } | {
33
+ kind: 'help';
34
+ } | {
35
+ kind: 'parse-error';
36
+ message: string;
37
+ } | {
38
+ kind: 'command';
39
+ command: ParsedPluginCommand;
40
+ };
41
+ /**
42
+ * Parse raw `/plugin` argument tokens (already split on whitespace, command
43
+ * name excluded): `parsePluginArgv(['install', 'foo'])` for `/plugin install foo`.
44
+ */
45
+ export declare function parsePluginArgv(args: readonly string[]): ParseOutcome;
46
+ //# sourceMappingURL=subcommands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subcommands.d.ts","sourceRoot":"","sources":["../src/subcommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,CAAA;AAExB,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,UAAU,CAAA;IAChB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CAChC;AAED,mDAAmD;AACnD,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,CAAA;AA4GrD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CA0BrE"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Pure argv parser for the `/plugin` command grammar (plan §3):
3
+ *
4
+ * ```
5
+ * /plugin # bare → mounted view
6
+ * /plugin list [--enabled|--disabled]
7
+ * /plugin install|uninstall|enable|disable|update <plugin[@mkt]> [--scope user|project|local]
8
+ * /plugin marketplace list|add <source> [--scope …]|remove <name>|update [name]
9
+ * ```
10
+ *
11
+ * Unknown subcommands route to the help block; malformed forms and bad flag
12
+ * values produce a parse error whose message is a one-line `Usage:` string
13
+ * naming the exact expected form. No I/O, no imports — fully table-testable.
14
+ *
15
+ * @module @dsh-cc/command-plugin/subcommands
16
+ */
17
+ /** One-line `Usage:` strings per grammar form (parse-error messages). */
18
+ const USAGE = {
19
+ list: 'Usage: /plugin list [--enabled|--disabled]',
20
+ plugin: 'Usage: /plugin <verb> <plugin[@mkt]> [--scope user|project|local]',
21
+ install: 'Usage: /plugin install <plugin[@mkt]> [--scope user|project|local]',
22
+ uninstall: 'Usage: /plugin uninstall <plugin[@mkt]> [--scope user|project|local]',
23
+ enable: 'Usage: /plugin enable <plugin[@mkt]> [--scope user|project|local]',
24
+ disable: 'Usage: /plugin disable <plugin[@mkt]> [--scope user|project|local]',
25
+ update: 'Usage: /plugin update <plugin[@mkt]> [--scope user|project|local]',
26
+ marketplace: 'Usage: /plugin marketplace list|add|remove|update',
27
+ 'marketplace-list': 'Usage: /plugin marketplace list',
28
+ 'marketplace-add': 'Usage: /plugin marketplace add <source> [--scope user|project|local]',
29
+ 'marketplace-remove': 'Usage: /plugin marketplace remove <name>',
30
+ 'marketplace-update': 'Usage: /plugin marketplace update [name]',
31
+ };
32
+ const SCOPES = ['user', 'project', 'local'];
33
+ function parseError(message) {
34
+ return { kind: 'parse-error', message };
35
+ }
36
+ /** Consume `--scope user` / `--scope=user` starting at `index`; returns the scope and the next index. */
37
+ function readScopeFlag(args, index, usage) {
38
+ const token = args[index];
39
+ const inline = token.startsWith('--scope=');
40
+ const value = inline ? token.slice('--scope='.length) : args[index + 1];
41
+ const next = inline ? index + 1 : index + 2;
42
+ if (value === undefined || !SCOPES.includes(value))
43
+ return parseError(usage);
44
+ return { scope: value, next };
45
+ }
46
+ function parsePluginVerb(verb, args) {
47
+ const usage = USAGE[verb];
48
+ const positional = [];
49
+ let scope;
50
+ for (let index = 1; index < args.length; index += 1) {
51
+ const token = args[index];
52
+ if (token === '--scope') {
53
+ const read = readScopeFlag(args, index, usage);
54
+ if ('kind' in read)
55
+ return read;
56
+ scope = read.scope;
57
+ index = read.next - 1;
58
+ continue;
59
+ }
60
+ if (token.startsWith('--scope=')) {
61
+ const read = readScopeFlag(args, index, usage);
62
+ if ('kind' in read)
63
+ return read;
64
+ scope = read.scope;
65
+ index = read.next - 1;
66
+ continue;
67
+ }
68
+ if (token.startsWith('--'))
69
+ return parseError(usage);
70
+ positional.push(token);
71
+ }
72
+ if (positional.length !== 1)
73
+ return parseError(usage);
74
+ const command = { verb, arg: positional[0] };
75
+ if (scope !== undefined)
76
+ command.scope = scope;
77
+ return { kind: 'command', command };
78
+ }
79
+ function parseMarketplace(args) {
80
+ const sub = args[1];
81
+ if (sub === undefined)
82
+ return { kind: 'help' };
83
+ switch (sub) {
84
+ case 'list':
85
+ if (args.length !== 2)
86
+ return parseError(USAGE['marketplace-list']);
87
+ return { kind: 'command', command: { verb: 'marketplace-list' } };
88
+ case 'add': {
89
+ if (args.length < 3)
90
+ return parseError(USAGE['marketplace-add']);
91
+ const positional = [];
92
+ let scope;
93
+ for (let index = 2; index < args.length; index += 1) {
94
+ const token = args[index];
95
+ if (token === '--scope' || token.startsWith('--scope=')) {
96
+ const read = readScopeFlag(args, index, USAGE['marketplace-add']);
97
+ if ('kind' in read)
98
+ return read;
99
+ scope = read.scope;
100
+ index = read.next - 1;
101
+ continue;
102
+ }
103
+ if (token.startsWith('--'))
104
+ return parseError(USAGE['marketplace-add']);
105
+ positional.push(token);
106
+ }
107
+ if (positional.length !== 1)
108
+ return parseError(USAGE['marketplace-add']);
109
+ const command = { verb: 'marketplace-add', arg: positional[0] };
110
+ if (scope !== undefined)
111
+ command.scope = scope;
112
+ return { kind: 'command', command };
113
+ }
114
+ case 'remove':
115
+ if (args.length !== 3)
116
+ return parseError(USAGE['marketplace-remove']);
117
+ return { kind: 'command', command: { verb: 'marketplace-remove', arg: args[2] } };
118
+ case 'update':
119
+ if (args.length > 3)
120
+ return parseError(USAGE['marketplace-update']);
121
+ return args.length === 3
122
+ ? { kind: 'command', command: { verb: 'marketplace-update', arg: args[2] } }
123
+ : { kind: 'command', command: { verb: 'marketplace-update' } };
124
+ default:
125
+ return { kind: 'help' };
126
+ }
127
+ }
128
+ /**
129
+ * Parse raw `/plugin` argument tokens (already split on whitespace, command
130
+ * name excluded): `parsePluginArgv(['install', 'foo'])` for `/plugin install foo`.
131
+ */
132
+ export function parsePluginArgv(args) {
133
+ const head = args[0];
134
+ if (head === undefined)
135
+ return { kind: 'mounted' };
136
+ switch (head) {
137
+ case 'list': {
138
+ if (args.length > 2)
139
+ return parseError(USAGE.list);
140
+ const flag = args[1];
141
+ if (flag === undefined)
142
+ return { kind: 'command', command: { verb: 'list' } };
143
+ if (flag === '--enabled' || flag === '--disabled') {
144
+ return { kind: 'command', command: { verb: 'list', filter: flag === '--enabled' ? 'enabled' : 'disabled' } };
145
+ }
146
+ return parseError(USAGE.list);
147
+ }
148
+ case 'install':
149
+ case 'uninstall':
150
+ case 'enable':
151
+ case 'disable':
152
+ case 'update':
153
+ return parsePluginVerb(head, args);
154
+ case 'marketplace':
155
+ return parseMarketplace(args);
156
+ case 'help':
157
+ return { kind: 'help' };
158
+ default:
159
+ return { kind: 'help' };
160
+ }
161
+ }
162
+ //# sourceMappingURL=subcommands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subcommands.js","sourceRoot":"","sources":["../src/subcommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAiCH,yEAAyE;AACzE,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,4CAA4C;IAClD,MAAM,EAAE,mEAAmE;IAC3E,OAAO,EAAE,oEAAoE;IAC7E,SAAS,EAAE,sEAAsE;IACjF,MAAM,EAAE,mEAAmE;IAC3E,OAAO,EAAE,oEAAoE;IAC7E,MAAM,EAAE,mEAAmE;IAC3E,WAAW,EAAE,mDAAmD;IAChE,kBAAkB,EAAE,iCAAiC;IACrD,iBAAiB,EAAE,sEAAsE;IACzF,oBAAoB,EAAE,0CAA0C;IAChE,oBAAoB,EAAE,0CAA0C;CACxD,CAAA;AAEV,MAAM,MAAM,GAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAE9D,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,CAAA;AACzC,CAAC;AAED,yGAAyG;AACzG,SAAS,aAAa,CACpB,IAAuB,EACvB,KAAa,EACb,KAAa;IAEb,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAE,CAAA;IAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;IA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AAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,CAAA;YAC9G,CAAC;YACD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC/B,CAAC;QACD,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACpC,KAAK,aAAa;YAChB,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA;QAC/B,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;QACzB;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAC3B,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dsh-cc/command-plugin",
3
3
  "description": "Human-facing slash commands to list and reload mounted Claude Code plugins",
4
- "version": "0.5.0",
4
+ "version": "0.6.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/dsh-cc/dsh-cc.git",
@@ -24,11 +24,14 @@
24
24
  "lib"
25
25
  ],
26
26
  "license": "Apache-2.0",
27
+ "dependencies": {
28
+ "@dsh-cc/command-usage": "^0.6.1"
29
+ },
27
30
  "peerDependencies": {
28
- "@deepseek-ai/dsh-commands": ">=0.1.1-rc.2",
29
- "@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2",
30
- "@deepseek-ai/dsh-session": ">=0.1.1-rc.2",
31
- "@deepseek-ai/cordis": ">=0.1.1-rc.2"
31
+ "@deepseek-ai/dsh-commands": ">=0.1.2-rc.1",
32
+ "@deepseek-ai/dsh-invariants": ">=0.1.2-rc.1",
33
+ "@deepseek-ai/dsh-session": ">=0.1.2-rc.1",
34
+ "@deepseek-ai/cordis": ">=0.1.2-rc.1"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",