dsh-plugin-shop 0.7.4 → 0.8.0-beta.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.
@@ -14,7 +14,7 @@ export interface RepoPinFs {
14
14
  read: (path: string) => string;
15
15
  write: (path: string, data: string) => void;
16
16
  }
17
- /** Bundle name to the pinned commit. */
17
+ /** Install identity to the pinned commit or release tag. */
18
18
  export type RepoPins = Record<string, string>;
19
19
  /** Read the pins file; any irregularity degrades to an empty record. */
20
20
  export declare function readRepoPins(fs: RepoPinFs, path: string): RepoPins;
@@ -35,9 +35,29 @@ export type RestartOutcome = {
35
35
  * function has already returned and the caller has committed — so the gateway
36
36
  * refuses on Windows before reaching here rather than exiting into nothing
37
37
  * (index.ts `restartPlatformSupported`). */
38
- export declare function startRestart(options: {
38
+ /**
39
+ * Resolve the command line that re-runs this process.
40
+ *
41
+ * A bare `dsh` from PATH is not necessarily the process serving the current
42
+ * port: a dsh launched through `node`, `npx`, or `pnpm dlx` carries its own
43
+ * script and `execArgv`. Reconstructing that exact node invocation preserves
44
+ * the entry point and runtime flags. An explicitly named binary remains an
45
+ * explicit choice and is passed through unchanged.
46
+ */
47
+ export declare function restartCommand(options: {
39
48
  dshBin: string;
40
- argv: string[];
49
+ argv: readonly string[];
50
+ execPath: string;
51
+ execArgv: readonly string[];
52
+ script: string | undefined;
53
+ }): {
54
+ command: string;
55
+ args: string[];
56
+ };
57
+ export declare function startRestart(options: {
58
+ /** The already-resolved command — see `restartCommand`. */
59
+ command: string;
60
+ args: readonly string[];
41
61
  parentPid: number;
42
62
  logFile: string;
43
63
  env?: NodeJS.ProcessEnv;
@@ -3,7 +3,15 @@
3
3
  * check degrades to `null` and never throws, never blocks a publish. The
4
4
  * catalog cannot serve here: the shop is bootstrap-installed and is not
5
5
  * harvested into its own catalog. */
6
- /** Fetch the shop's `latest` dist-tag, or `null` when the registry cannot
7
- * answer (network failure, unexpected payload — anything). The caller
8
- * renders `null` as "no update check", never as a failure. */
9
- export declare function fetchLatestVersion(fetchFn?: typeof fetch): Promise<string | null>;
6
+ /** How long one registry gets to answer. `shop/version` is warmed at every
7
+ * web boot, so a silent socket must not hold the boot indefinitely. */
8
+ export declare const VERSION_CHECK_TIMEOUT_MS = 5000;
9
+ /**
10
+ * Fetch the shop's `latest` dist-tag, or `null` when no registry can answer.
11
+ * The user's own registry is tried first when known; npmjs is always the
12
+ * fallback so a mirror that lags cannot hide a release.
13
+ */
14
+ export declare function fetchLatestVersion(fetchFn?: typeof fetch, options?: {
15
+ registry?: string | null;
16
+ timeoutMs?: number;
17
+ }): Promise<string | null>;
@@ -5,3 +5,13 @@
5
5
  * one level below the package root, so the same relative URL resolves in
6
6
  * both. */
7
7
  export declare function ownVersion(): string;
8
+ /**
9
+ * The peer ranges this build declares — the input to the load-time harness
10
+ * self-check. Read from the same shipped manifest as `ownVersion`, so the
11
+ * ranges checked are the ones this build was actually published with, never
12
+ * a second copy that can drift from them.
13
+ *
14
+ * A non-string range is dropped rather than repaired: only what we can
15
+ * compare against is worth a verdict.
16
+ */
17
+ export declare function ownPeerRanges(): Record<string, string>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * One entry's install identity, defined once for both halves of the package.
3
+ *
4
+ * `name` is not an identity. The registry's uniqueness rule is `npm:<name>`
5
+ * for an npm entry and `github:<repo>#<subdir>` for a repository entry, so
6
+ * two repositories publishing the same package name remain distinct.
7
+ */
8
+ /** The fields that decide which catalog row a request is about. */
9
+ export interface EntryIdentity {
10
+ source: 'npm' | 'github';
11
+ name: string;
12
+ repo?: string;
13
+ subdir?: string;
14
+ }
15
+ /** The registry's uniqueness rule, shared with the presentation layer. */
16
+ export declare function identityKey(identity: EntryIdentity): string;
17
+ /** A GitHub commit pin. */
18
+ export declare const COMMIT_SHA: RegExp;
19
+ /** A GitHub release tag accepted as the version/pin of a rescued entry. */
20
+ export declare const RELEASE_TAG: RegExp;
21
+ /**
22
+ * Read the repository out of a profile dependency spec, or return null for
23
+ * an npm range/spec that does not identify a GitHub repository.
24
+ */
25
+ export declare function parseRepoSpec(spec: string): string | null;
26
+ /** Whether an installed dependency spec names this catalog entry. */
27
+ export declare function installedSpecMatches(entry: EntryIdentity, spec: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-shop",
3
- "version": "0.7.4",
3
+ "version": "0.8.0-beta.0",
4
4
  "description": "The DeepSeek Harness plugin shop: browse, install, enable, and update dsh plugins from a git-auditable catalog.",
5
5
  "keywords": [
6
6
  "dsh-plugin",
@@ -72,12 +72,6 @@
72
72
  "platform": "web"
73
73
  }
74
74
  },
75
- "scripts": {
76
- "prepublishOnly": "pnpm build",
77
- "build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsdown && tsc && tsdown -c tsdown.client.config.ts",
78
- "test": "tsdown && tsdown -c tsdown.client.config.ts && vitest run",
79
- "typecheck": "tsdown && tsc --noEmit && tsc -p tsconfig.test.json"
80
- },
81
75
  "dependencies": {
82
76
  "js-yaml": "^4.2.0",
83
77
  "semver": "^7.6.3",
@@ -118,7 +112,7 @@
118
112
  "@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
119
113
  "@deepseek-ai/dsh-home-paths": "^0.1.1-rc.2",
120
114
  "@deepseek-ai/dsh-typert-generator": "^0.1.1-rc.2",
121
- "@deepseek-ai/dsh-typert-protocol": "workspace:^0.1.1-rc.2",
115
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.2",
122
116
  "@testing-library/react": "^16.1.0",
123
117
  "@types/js-yaml": "^4.0.9",
124
118
  "@types/node": "^22.9.0",
@@ -132,5 +126,11 @@
132
126
  "tsdown": "^0.22.2",
133
127
  "typescript": "^5.6.3",
134
128
  "vitest": "^2.1.4"
129
+ },
130
+ "scripts": {
131
+ "build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsdown && tsc && tsdown -c tsdown.client.config.ts",
132
+ "test": "tsdown && tsdown -c tsdown.client.config.ts && vitest run",
133
+ "typecheck": "tsdown && tsc --noEmit && tsc -p tsconfig.test.json",
134
+ "shoot:screenshots": "node --experimental-strip-types scripts/shoot-readme-screenshots.ts"
135
135
  }
136
- }
136
+ }