@eya46/dsh-plugin-info 0.0.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.
@@ -0,0 +1,18 @@
1
+ /** Loose semver pieces used only to decide whether latest is newer. */
2
+ export interface ParsedVersion {
3
+ major: number;
4
+ minor: number;
5
+ patch: number;
6
+ prerelease: string[];
7
+ }
8
+ /** Strip a leading `v` and build metadata. */
9
+ export declare function normalizeVersion(input: string): string;
10
+ /** Parse `1.2.3`, `1.2.3-rc.1`, or `v1.2.3`. Returns undefined when not numeric. */
11
+ export declare function parseVersion(input: string): ParsedVersion | undefined;
12
+ /** Compare two parsed versions. Negative when `left` is older. */
13
+ export declare function compareParsed(left: ParsedVersion, right: ParsedVersion): number;
14
+ /** Compare two version strings. Unparseable values compare as equal (0). */
15
+ export declare function compareVersions(left: string, right: string): number;
16
+ /** True when `latest` is a newer published version than `installed`. */
17
+ export declare function hasNewerVersion(installed: string | undefined, latest: string | undefined): boolean;
18
+ //# sourceMappingURL=semver.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { PluginConfig, PluginSummary, PluginVersionRow, VersionNotes } from './types.ts';
2
+ /** Fetch a JSON payload with a timeout. */
3
+ export type JsonFetcher = (url: string, timeoutMs: number, headers?: Record<string, string>) => Promise<unknown>;
4
+ /** Query surface used by the HTTP API and tests. */
5
+ export declare class PluginInfoService {
6
+ private readonly config;
7
+ private readonly fetchJson;
8
+ private readonly now;
9
+ private readonly packuments;
10
+ private readonly notes;
11
+ constructor(config: PluginConfig, fetchJson: JsonFetcher, now?: () => number);
12
+ /** List user-added plugins for one profile directory. */
13
+ listPlugins(profileDir: string): Promise<{
14
+ profile: string;
15
+ plugins: PluginSummary[];
16
+ }>;
17
+ /** Recent published versions for one user-added plugin. */
18
+ listVersions(profileDir: string, name: string, limit: number): Promise<{
19
+ name: string;
20
+ installedVersion?: string;
21
+ latestVersion?: string;
22
+ versions: PluginVersionRow[];
23
+ }>;
24
+ /** Update notes for one published version. */
25
+ versionNotes(profileDir: string, name: string, version: string): Promise<VersionNotes>;
26
+ private describePlugin;
27
+ private loadPackument;
28
+ private loadNotes;
29
+ private fetchGithubRelease;
30
+ private fetchGithubCompare;
31
+ }
32
+ /** Resolve the current profile directory from the Loader base URL. */
33
+ export declare function profileDirFromBaseUrl(baseUrl: string | undefined): string;
34
+ /** Default JSON fetch used by the live plugin. */
35
+ export declare function fetchJson(url: string, timeoutMs: number, headers?: Record<string, string>): Promise<unknown>;
36
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,111 @@
1
+ /** Where a profile dependency spec came from. */
2
+ export type PluginSource = 'registry' | 'file' | 'link' | 'git' | 'other';
3
+ /** One user-added profile plugin as the UI lists it. */
4
+ export interface PluginSummary {
5
+ /** npm package name. */
6
+ name: string;
7
+ /** Installed package description, when present. */
8
+ description?: string;
9
+ /** Raw dependency spec from the profile manifest. */
10
+ spec: string;
11
+ /** Classified install source. */
12
+ source: PluginSource;
13
+ /** Version currently resolved in the profile. */
14
+ installedVersion?: string;
15
+ /** `dist-tags.latest` from the registry, when known. */
16
+ latestVersion?: string;
17
+ /** True when the registry latest is newer than the installed version. */
18
+ hasUpdate: boolean;
19
+ /** Package homepage. */
20
+ homepage?: string;
21
+ /** Normalized repository browse URL. */
22
+ repository?: string;
23
+ /** Why registry / install metadata is incomplete. */
24
+ error?: string;
25
+ }
26
+ /** One published version row. */
27
+ export interface PluginVersionRow {
28
+ version: string;
29
+ publishedAt?: string;
30
+ latest: boolean;
31
+ installed: boolean;
32
+ }
33
+ /** How version notes were recovered. */
34
+ export type VersionNotesSource = 'github-release' | 'github-compare' | 'none';
35
+ /** One commit summarized from a GitHub compare. */
36
+ export interface VersionCommit {
37
+ sha: string;
38
+ message: string;
39
+ url?: string;
40
+ }
41
+ /** Update notes for one published version. */
42
+ export interface VersionNotes {
43
+ name: string;
44
+ version: string;
45
+ source: VersionNotesSource;
46
+ publishedAt?: string;
47
+ title?: string;
48
+ body?: string;
49
+ url?: string;
50
+ commits?: VersionCommit[];
51
+ }
52
+ /** Parsed profile manifest slice this plugin reads. */
53
+ export interface ProfileManifest {
54
+ name?: string;
55
+ dependencies?: Record<string, string>;
56
+ dsh?: {
57
+ profile?: {
58
+ bundles?: string[];
59
+ };
60
+ };
61
+ }
62
+ /** Installed package.json fields used by the listing. */
63
+ export interface InstalledPackage {
64
+ name: string;
65
+ version?: string;
66
+ description?: string;
67
+ homepage?: string;
68
+ repository?: string | {
69
+ url?: string;
70
+ directory?: string;
71
+ };
72
+ }
73
+ /** npm packument subset. */
74
+ export interface Packument {
75
+ name?: string;
76
+ description?: string;
77
+ homepage?: string;
78
+ repository?: string | {
79
+ url?: string;
80
+ directory?: string;
81
+ };
82
+ 'dist-tags'?: Record<string, string>;
83
+ versions?: Record<string, {
84
+ version?: string;
85
+ description?: string;
86
+ homepage?: string;
87
+ repository?: string | {
88
+ url?: string;
89
+ directory?: string;
90
+ };
91
+ }>;
92
+ time?: Record<string, string>;
93
+ }
94
+ /** Plugin configuration. */
95
+ export interface PluginConfig {
96
+ /** npm registry origin. */
97
+ registryUrl: string;
98
+ /** Default number of recent versions to return. */
99
+ defaultVersionLimit: number;
100
+ /** HTTP timeout for registry / GitHub requests. */
101
+ timeoutMs: number;
102
+ /** How long packument and notes stay cached. */
103
+ cacheTtlMs: number;
104
+ /**
105
+ * Optional allow-list: when non-empty, only plugins whose npm name starts
106
+ * with one of these prefixes (case-insensitive, e.g. `@eya46/`) appear in
107
+ * the settings page and the version/notes APIs. Set to `[]` to show all.
108
+ */
109
+ allowScopes: string[];
110
+ }
111
+ //# sourceMappingURL=types.d.ts.map
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@eya46/dsh-plugin-info",
3
+ "description": "List profile-added DSH plugins, mark available updates, and show recent version notes",
4
+ "version": "0.0.2",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./package.json": "./package.json",
14
+ "./client": {
15
+ "types": "./lib/types/client.d.ts",
16
+ "default": "./lib/client.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "lib/index.js",
21
+ "lib/client.js",
22
+ "lib/types/**/*.d.ts",
23
+ "cordis.patch.yml",
24
+ "README.md"
25
+ ],
26
+ "engines": {
27
+ "node": "^22.19.0 || >=24.0.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "keywords": [
33
+ "deepseek-harness",
34
+ "dsh-plugin",
35
+ "plugins",
36
+ "versions"
37
+ ],
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/eya46/dsh-plugins.git"
42
+ },
43
+ "dsh": {
44
+ "bundle": {
45
+ "patch": "./cordis.patch.yml"
46
+ },
47
+ "client": {
48
+ "platform": "web"
49
+ }
50
+ },
51
+ "peerDependencies": {
52
+ "@deepseek-ai/cordis": "^4.0.1",
53
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7"
54
+ },
55
+ "peerDependenciesMeta": {
56
+ "@deepseek-ai/dsh-host-webserver": {
57
+ "optional": true
58
+ }
59
+ },
60
+ "dependencies": {
61
+ "@deepseek-ai/schemastery": "^3.18.1"
62
+ },
63
+ "devDependencies": {
64
+ "@deepseek-ai/cordis": "^4.0.1",
65
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
66
+ "@types/node": "^22.20.0",
67
+ "tsdown": "^0.22.2",
68
+ "typescript": "^5.9.3",
69
+ "vitest": "^4.1.8"
70
+ },
71
+ "scripts": {
72
+ "build": "tsc -p tsconfig.json && tsdown --config tsdown.config.ts && tsc -p tsconfig.client.json",
73
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
74
+ "test": "vitest run --config vitest.config.ts"
75
+ }
76
+ }