dsh-agent-plugins-market 0.4.6 → 0.5.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.
- package/README.md +16 -10
- package/README.zh.md +16 -10
- package/client/client.js +540 -417
- package/client/client.js.map +1 -1
- package/lib/application/catalog.js +447 -0
- package/lib/application/details.js +136 -0
- package/lib/application/queries.js +1 -0
- package/lib/{discovery → catalog}/manifests.js +20 -12
- package/lib/{paths.js → catalog/paths.js} +5 -1
- package/lib/{skills-parse.js → catalog/skills-parse.js} +7 -4
- package/lib/catalog/source-catalog.js +38 -0
- package/lib/{discovery.js → catalog/suite-scanner.js} +28 -86
- package/lib/{discovery → catalog}/surfaces.js +9 -11
- package/lib/{validate.js → catalog/validate.js} +3 -3
- package/lib/context.js +11 -13
- package/lib/contracts/market.js +27 -0
- package/lib/contracts/mcp-status.js +2 -0
- package/lib/index.js +32 -49
- package/lib/{state.js → model/state.js} +2 -2
- package/lib/routes.js +21 -21
- package/lib/{commands-mounts.js → runtime/commands-mounts.js} +10 -11
- package/lib/{hooks-mounts.js → runtime/hooks-mounts.js} +1 -1
- package/lib/{mcp-config.js → runtime/mcp-config.js} +7 -4
- package/lib/{mcp-status.js → runtime/mcp-status.js} +8 -41
- package/lib/runtime/reconciler.js +46 -0
- package/lib/{skills-provider.js → runtime/skills-provider.js} +26 -23
- package/lib/runtime/tool-registry-observer.js +35 -0
- package/lib/types/application/catalog.d.ts +113 -0
- package/lib/types/application/details.d.ts +12 -0
- package/lib/types/application/queries.d.ts +33 -0
- package/lib/types/{discovery → catalog}/manifests.d.ts +1 -1
- package/lib/types/catalog/source-catalog.d.ts +3 -0
- package/lib/types/catalog/suite-scanner.d.ts +9 -0
- package/lib/types/{discovery → catalog}/surfaces.d.ts +1 -1
- package/lib/types/{validate.d.ts → catalog/validate.d.ts} +1 -1
- package/lib/types/context.d.ts +2 -2
- package/lib/types/contracts/market.d.ts +153 -0
- package/lib/types/contracts/mcp-status.d.ts +38 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/{types.d.ts → model/types.d.ts} +2 -42
- package/lib/types/routes.d.ts +2 -2
- package/lib/types/{commands-mounts.d.ts → runtime/commands-mounts.d.ts} +1 -1
- package/lib/types/{hooks-mounts.d.ts → runtime/hooks-mounts.d.ts} +1 -1
- package/lib/types/{mcp-config.d.ts → runtime/mcp-config.d.ts} +1 -1
- package/lib/types/{mcp-mounts.d.ts → runtime/mcp-mounts.d.ts} +1 -1
- package/lib/types/runtime/mcp-status.d.ts +13 -0
- package/lib/types/runtime/reconciler.d.ts +33 -0
- package/lib/types/{skills-provider.d.ts → runtime/skills-provider.d.ts} +3 -3
- package/lib/types/runtime/tool-registry-observer.d.ts +14 -0
- package/package.json +34 -19
- package/schemas/README.md +2 -5
- package/lib/manager.js +0 -581
- package/lib/types/discovery.d.ts +0 -19
- package/lib/types/manager.d.ts +0 -124
- package/lib/types/mcp-status.d.ts +0 -51
- /package/lib/{git.js → catalog/git.js} +0 -0
- /package/lib/{types.js → model/types.js} +0 -0
- /package/lib/{mcp-mounts.js → runtime/mcp-mounts.js} +0 -0
- /package/lib/types/{git.d.ts → catalog/git.d.ts} +0 -0
- /package/lib/types/{paths.d.ts → catalog/paths.d.ts} +0 -0
- /package/lib/types/{skills-parse.d.ts → catalog/skills-parse.d.ts} +0 -0
- /package/lib/types/{state.d.ts → model/state.d.ts} +0 -0
package/lib/types/manager.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { type McpStatusPayload, type McpToolSnapshot } from './mcp-status.js';
|
|
2
|
-
import type { OverviewPayload, SourceRef, Suite, SuiteDimension } from './types.js';
|
|
3
|
-
export interface ManagerOptions {
|
|
4
|
-
userRoot: string;
|
|
5
|
-
dataRoot: string;
|
|
6
|
-
onChanged: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare class SuiteManager {
|
|
9
|
-
private readonly options;
|
|
10
|
-
private state;
|
|
11
|
-
private mutationQueue;
|
|
12
|
-
private readonly statePath;
|
|
13
|
-
/** Cached `git rev-parse HEAD` per source id, so overview reads stay instant; cleared whenever a checkout may have moved. */
|
|
14
|
-
private readonly headCache;
|
|
15
|
-
/** Latest MCP mount diagnostics (suiteId -> reasons), fed by the host reconcile. */
|
|
16
|
-
mcpDiagnostics: Array<{
|
|
17
|
-
suiteId: string;
|
|
18
|
-
serverKey: string;
|
|
19
|
-
reason: string;
|
|
20
|
-
}>;
|
|
21
|
-
private toolSnapshotProvider;
|
|
22
|
-
constructor(options: ManagerOptions);
|
|
23
|
-
/** Install the host tool snapshot provider used by the MCP status surface. */
|
|
24
|
-
setMcpToolSnapshotProvider(provider: () => readonly McpToolSnapshot[]): void;
|
|
25
|
-
/** Build the flat MCP service inventory for the status surface. */
|
|
26
|
-
mcpStatus(): Promise<McpStatusPayload>;
|
|
27
|
-
/** Load persisted state once at plugin activation. */
|
|
28
|
-
load(): Promise<void>;
|
|
29
|
-
get sources(): SourceRef[];
|
|
30
|
-
/** The user-dimension suite root this manager operates. */
|
|
31
|
-
get userRoot(): string;
|
|
32
|
-
/**
|
|
33
|
-
* One suite's full detail for the market detail modal: manifest fields,
|
|
34
|
-
* skill metadata, validated mcp.json servers, and per-surface file lists.
|
|
35
|
-
*/
|
|
36
|
-
suiteDetail(sourceId: string, suiteId: string): Promise<Record<string, unknown>>;
|
|
37
|
-
private readPreview;
|
|
38
|
-
/** One skill's full SKILL.md text for the market detail modal. */
|
|
39
|
-
skillContent(sourceId: string, suiteId: string, skillName: string): Promise<{
|
|
40
|
-
name: string;
|
|
41
|
-
description: string;
|
|
42
|
-
content: string;
|
|
43
|
-
path: string;
|
|
44
|
-
}>;
|
|
45
|
-
/** The full market overview: fresh discovery merged with install entries. */
|
|
46
|
-
overview(): Promise<OverviewPayload>;
|
|
47
|
-
/** Enabled user-dimension suites (the MCP mount input). */
|
|
48
|
-
enabledUserSuites(): Promise<Suite[]>;
|
|
49
|
-
/** Enabled user- and project-dimension suites for a workspace cwd. */
|
|
50
|
-
enabledSuitesForCwd(cwd: string): Promise<{
|
|
51
|
-
user: Suite[];
|
|
52
|
-
project: Suite[];
|
|
53
|
-
}>;
|
|
54
|
-
/** All suites (any enabled state) of one dimension. */
|
|
55
|
-
suitesForDimension(dimension: SuiteDimension, dimensionRoot: string): Promise<Suite[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Add a source and clone it immediately. The id is derived from the suite
|
|
58
|
-
* repository's own JSON (marketplace plugin entry name first, then the
|
|
59
|
-
* root manifest name, then the repo basename), sanitized; collisions get a
|
|
60
|
-
* numeric suffix.
|
|
61
|
-
*/
|
|
62
|
-
addSource(input: {
|
|
63
|
-
url: string;
|
|
64
|
-
branch?: string;
|
|
65
|
-
local?: boolean;
|
|
66
|
-
}): Promise<SourceRef>;
|
|
67
|
-
/**
|
|
68
|
-
* Progress snapshot of the source mutation currently in flight, if any.
|
|
69
|
-
* While present, `overview()` reports it instead of running git against
|
|
70
|
-
* the transient checkout directory.
|
|
71
|
-
*/
|
|
72
|
-
private currentSourceState;
|
|
73
|
-
/**
|
|
74
|
-
* Begin reporting progress for a source mutation: `step` names the active
|
|
75
|
-
* phase and `cloned` whether the checkout directory exists yet. The client
|
|
76
|
-
* polls this through the `progress` route while its add-source modal is
|
|
77
|
-
* open, and `overview()` merges the snapshot into the source row.
|
|
78
|
-
*/
|
|
79
|
-
beginSourceState(sourceId: string, step: string, cloned: boolean): void;
|
|
80
|
-
/** Advance the in-flight mutation's step (checkout state unchanged). */
|
|
81
|
-
updateSourceStep(step: string): void;
|
|
82
|
-
/** Stop reporting progress; `overview()` falls back to on-disk inspection. */
|
|
83
|
-
endSourceState(): void;
|
|
84
|
-
/** Progress snapshot for the `progress` route (never throws). */
|
|
85
|
-
sourceProgress(): {
|
|
86
|
-
active: boolean;
|
|
87
|
-
sourceId: string;
|
|
88
|
-
step: string;
|
|
89
|
-
};
|
|
90
|
-
private uniqueSourceId;
|
|
91
|
-
/**
|
|
92
|
-
* Update one source's url / branch / local flag. A git source whose URL
|
|
93
|
-
* changes drops its stale checkout (the next refresh clones the new URL);
|
|
94
|
-
* a local source's directory is never touched.
|
|
95
|
-
*/
|
|
96
|
-
updateSource(sourceId: string, patch: {
|
|
97
|
-
url?: string;
|
|
98
|
-
branch?: string;
|
|
99
|
-
local?: boolean;
|
|
100
|
-
}): Promise<void>;
|
|
101
|
-
/** Remove a source: delete its checkout, forget its suites and install entries. */
|
|
102
|
-
removeSource(sourceId: string): Promise<void>;
|
|
103
|
-
/** Refresh one source checkout (pull), or every source when `sourceId` is omitted. */
|
|
104
|
-
refreshSource(sourceId?: string): Promise<void>;
|
|
105
|
-
/** Install a suite: the source must be cloned; the suite dir becomes an enabled install entry. */
|
|
106
|
-
install(sourceId: string, suiteId: string): Promise<void>;
|
|
107
|
-
/** Uninstall a suite: drop the install entry (the source clone stays for browsing). */
|
|
108
|
-
uninstall(sourceId: string, suiteId: string): Promise<void>;
|
|
109
|
-
/** Enable or disable an installed suite. */
|
|
110
|
-
setEnabled(sourceId: string, suiteId: string, enabled: boolean): Promise<void>;
|
|
111
|
-
/** Append config-seeded sources missing from state and persist; clones lazily on first refresh/install. */
|
|
112
|
-
mergeSources(sources: SourceRef[]): Promise<void>;
|
|
113
|
-
private setInstalled;
|
|
114
|
-
private ensureClone;
|
|
115
|
-
/** The filesystem location one source is read from. */
|
|
116
|
-
private sourceCheckoutPath;
|
|
117
|
-
private discoverDimension;
|
|
118
|
-
private commandPreviews;
|
|
119
|
-
private agentPreviews;
|
|
120
|
-
/** Parse CC hooks.json into flat {event, matcher, command} preview entries. */
|
|
121
|
-
private hooksPreviews;
|
|
122
|
-
private lspPreviews;
|
|
123
|
-
private enqueue;
|
|
124
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Suite } from './types.js';
|
|
2
|
-
/** A tool observed in the host tool registry. */
|
|
3
|
-
export interface McpToolSnapshot {
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
}
|
|
7
|
-
export type McpStatusKind = 'plugin' | 'direct';
|
|
8
|
-
export type McpStatusState = 'connected' | 'degraded' | 'failed' | 'disabled';
|
|
9
|
-
/** One MCP service row for the status surface. */
|
|
10
|
-
export interface McpStatusEntry {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
kind: McpStatusKind;
|
|
14
|
-
state: McpStatusState;
|
|
15
|
-
source?: string;
|
|
16
|
-
suiteId?: string;
|
|
17
|
-
serverKey?: string;
|
|
18
|
-
transport: string;
|
|
19
|
-
endpoint?: string;
|
|
20
|
-
config?: Record<string, unknown>;
|
|
21
|
-
tools: Array<{
|
|
22
|
-
name: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
}>;
|
|
25
|
-
reason?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface McpStatusPayload {
|
|
28
|
-
entries: McpStatusEntry[];
|
|
29
|
-
observedAt: string;
|
|
30
|
-
totals: {
|
|
31
|
-
all: number;
|
|
32
|
-
connected: number;
|
|
33
|
-
degraded: number;
|
|
34
|
-
failed: number;
|
|
35
|
-
disabled: number;
|
|
36
|
-
};
|
|
37
|
-
directObservationOnly: boolean;
|
|
38
|
-
}
|
|
39
|
-
interface McpDiagnostic {
|
|
40
|
-
suiteId: string;
|
|
41
|
-
serverKey: string;
|
|
42
|
-
reason: string;
|
|
43
|
-
}
|
|
44
|
-
/** Build status rows from discovered plugin MCP definitions and observed tool names. */
|
|
45
|
-
export declare function buildMcpStatus(suites: Suite[], diagnostics: McpDiagnostic[], observed: readonly McpToolSnapshot[]): McpStatusPayload;
|
|
46
|
-
/** Read model-facing MCP tool names from the dsh-tools runtime when available.
|
|
47
|
-
* The registry intentionally has no public listing API in rc.6; this adapter
|
|
48
|
-
* uses only the runtime's stable `layers.merge(...).tools.entries()` data shape
|
|
49
|
-
* and safely returns an empty observation when another host changes it. */
|
|
50
|
-
export declare function inspectToolRegistry(runtime: unknown): McpToolSnapshot[];
|
|
51
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|