dsh-plugin-shop 0.8.7-beta.0 → 0.8.7-beta.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.
- package/assets/icon.png +0 -0
- package/lib/client.js +748 -396
- package/lib/index.js +2 -1
- package/lib/typert.host.js +2 -1
- package/lib/typert.remote-client.js +1 -0
- package/lib/types/client/FoldableRedBlock.d.ts +27 -0
- package/lib/types/client/ShopTab.d.ts +2 -2
- package/lib/types/client/locales.d.ts +42 -8
- package/lib/types/client/present.d.ts +111 -28
- package/lib/types/client/useFlows.d.ts +4 -0
- package/lib/types/client/useFoldableRedBlock.d.ts +36 -0
- package/lib/types/host/types.d.ts +5 -0
- package/package.json +3 -1
package/lib/index.js
CHANGED
|
@@ -652,7 +652,8 @@ const entrySchema = z.object({
|
|
|
652
652
|
manifestVersion: z.string().optional(),
|
|
653
653
|
unpackedSize: z.number().int().nonnegative().optional(),
|
|
654
654
|
installSize: z.number().int().nonnegative().optional(),
|
|
655
|
-
archived: z.boolean().optional()
|
|
655
|
+
archived: z.boolean().optional(),
|
|
656
|
+
forked: z.boolean().optional()
|
|
656
657
|
}).superRefine((entry, ctx) => {
|
|
657
658
|
if (entry.source === "npm") {
|
|
658
659
|
if (!NPM_NAME.test(entry.name)) ctx.addIssue({
|
package/lib/typert.host.js
CHANGED
|
@@ -54,6 +54,7 @@ const dsh_plugin_shop_shop_catalog_result$schema = z.object({
|
|
|
54
54
|
'unpackedSize': z.union([z.undefined(), z.number()]).optional(),
|
|
55
55
|
'installSize': z.union([z.undefined(), z.number()]).optional(),
|
|
56
56
|
'archived': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
57
|
+
'forked': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
57
58
|
})),
|
|
58
59
|
'denied': z.array(z.object({
|
|
59
60
|
'name': z.string(),
|
|
@@ -499,7 +500,7 @@ export const TYPERT = {
|
|
|
499
500
|
},
|
|
500
501
|
{
|
|
501
502
|
"name": "CatalogEntry",
|
|
502
|
-
"declaration": "export interface CatalogEntry {\n name: string;\n version: string;\n integrity: string | null;\n publishedAt: string | null;\n repository: string | null;\n license: string | null;\n tier: 'verified' | 'verified-stale' | 'community';\n metadata: 'declared' | 'derived';\n review?: { reviewedVersion?: string; reviewedCommit?: string; reviewedSha256?: string; repo?: string; reviewer: string; reviewCommit: string; notes: string; };\n catalog?: CatalogSection;\n source: 'npm' | 'github';\n publisher?: string;\n repo?: string;\n subdir?: string;\n tarball?: { url: string; sha256: string; };\n added?: string;\n peers?: string[];\n compatibility?: { dsh?: string; profiles?: string[]; };\n dshPeers?: Record<string, string>;\n manifestVersion?: string;\n unpackedSize?: number;\n installSize?: number;\n archived?: boolean;\n}"
|
|
503
|
+
"declaration": "export interface CatalogEntry {\n name: string;\n version: string;\n integrity: string | null;\n publishedAt: string | null;\n repository: string | null;\n license: string | null;\n tier: 'verified' | 'verified-stale' | 'community';\n metadata: 'declared' | 'derived';\n review?: { reviewedVersion?: string; reviewedCommit?: string; reviewedSha256?: string; repo?: string; reviewer: string; reviewCommit: string; notes: string; };\n catalog?: CatalogSection;\n source: 'npm' | 'github';\n publisher?: string;\n repo?: string;\n subdir?: string;\n tarball?: { url: string; sha256: string; };\n added?: string;\n peers?: string[];\n compatibility?: { dsh?: string; profiles?: string[]; };\n dshPeers?: Record<string, string>;\n manifestVersion?: string;\n unpackedSize?: number;\n installSize?: number;\n archived?: boolean;\n forked?: boolean;\n}"
|
|
503
504
|
},
|
|
504
505
|
{
|
|
505
506
|
"name": "CatalogSection",
|
|
@@ -54,6 +54,7 @@ const dsh_plugin_shop_shop_catalog_result$schema = z.object({
|
|
|
54
54
|
'unpackedSize': z.union([z.undefined(), z.number()]).optional(),
|
|
55
55
|
'installSize': z.union([z.undefined(), z.number()]).optional(),
|
|
56
56
|
'archived': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
57
|
+
'forked': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
|
|
57
58
|
})),
|
|
58
59
|
'denied': z.array(z.object({
|
|
59
60
|
'name': z.string(),
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared fold: one surface's whole red block, clamped to two lines by
|
|
3
|
+
* default, expanded on one press of the small pill under it, and back to two
|
|
4
|
+
* on a second. One fold per surface, never per blocker: a card's body and an
|
|
5
|
+
* Updatable row's refusal print the same verdict through two spellings, and
|
|
6
|
+
* each folds on its own.
|
|
7
|
+
*
|
|
8
|
+
* The fold is measured, NOT declared: `useFoldableRedBlock` watches the block
|
|
9
|
+
* and answers "is this too tall to leave alone?" from the block's own
|
|
10
|
+
* rendered height, whenever the box or the text in it changes. Where nothing
|
|
11
|
+
* can be measured — jsdom lays nothing out — no toggle is offered, and the
|
|
12
|
+
* unit suite supplies a model of the engine instead
|
|
13
|
+
* (`tests/fixtures/fold-geometry.ts`).
|
|
14
|
+
*
|
|
15
|
+
* The toggle is a BUTTON with `aria-expanded`, not a semantic fold the DOM
|
|
16
|
+
* carries. A screen reader meets the whole block either way: the label
|
|
17
|
+
* above it (`role="img"` + `aria-label` and `title`) is the accessible name
|
|
18
|
+
* of the whole verdict, and it is NOT the thing that folds.
|
|
19
|
+
*/
|
|
20
|
+
import type { ReactNode } from 'react';
|
|
21
|
+
import type { ShopTabProps } from './ShopTab.tsx';
|
|
22
|
+
export declare function FoldableRedBlock({ children, t, attrName }: {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
t: ShopTabProps['t'];
|
|
25
|
+
/** The data attribute the block is located by; its suffix names the toggle. */
|
|
26
|
+
attrName: 'data-shop-remedy' | 'data-shop-refusal' | 'data-shop-blocker-lines';
|
|
27
|
+
}): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** The shop tab: browse the catalog, detail an entry, install
|
|
2
|
-
*
|
|
1
|
+
/** The shop tab: browse the catalog, detail an entry, install on one click,
|
|
2
|
+
* poll the install to its terminal state (§7.2).
|
|
3
3
|
* Everything the tab renders is text — summaries, capabilities, log lines,
|
|
4
4
|
* details — never markup, so hostile npm descriptions cannot inject (spec
|
|
5
5
|
* §11.3.4): no render path here may ever use dangerouslySetInnerHTML. */
|
|
@@ -19,6 +19,14 @@ export declare const zh: {
|
|
|
19
19
|
all: string;
|
|
20
20
|
catalog: string;
|
|
21
21
|
catalogStats: string;
|
|
22
|
+
/** The shelf's order control, and the date each card carries under the two
|
|
23
|
+
* date orders (design 2026-10-12-shelf-orders §4). */
|
|
24
|
+
sortLabel: string;
|
|
25
|
+
sortStars: string;
|
|
26
|
+
sortAdded: string;
|
|
27
|
+
sortUpdated: string;
|
|
28
|
+
listedOn: string;
|
|
29
|
+
updatedOn: string;
|
|
22
30
|
stars: string;
|
|
23
31
|
categoryTool: string;
|
|
24
32
|
categoryProvider: string;
|
|
@@ -38,11 +46,16 @@ export declare const zh: {
|
|
|
38
46
|
archivedBadge: string;
|
|
39
47
|
capabilitiesNote: string;
|
|
40
48
|
install: string;
|
|
41
|
-
confirm: string;
|
|
42
49
|
cancel: string;
|
|
43
50
|
dismiss: string;
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
/** What every install now stands under, on the page rather than in a dialog
|
|
52
|
+
* (spec §9.2/§9.3, amended 2026-10-14). */
|
|
53
|
+
disclosure: string;
|
|
54
|
+
/** The fold toggle under a card's collapsed red block. `aria-expanded` plus:
|
|
55
|
+
* open shows the whole block; closed shows two lines of it. This toggle is
|
|
56
|
+
* independent of the card's own header-expand. */
|
|
57
|
+
moreRedLines: string;
|
|
58
|
+
lessRedLines: string;
|
|
46
59
|
installing: string;
|
|
47
60
|
downloading: string;
|
|
48
61
|
installedRestartNotice: string;
|
|
@@ -54,8 +67,9 @@ export declare const zh: {
|
|
|
54
67
|
* "unsupported" leaves the reader guessing which side is off. */
|
|
55
68
|
harnessRangeDetail: string;
|
|
56
69
|
harnessProfileDetail: string;
|
|
57
|
-
/** dsh's OWN refusal (0.1.7 on), not the author's claim: the
|
|
58
|
-
*
|
|
70
|
+
/** dsh's OWN refusal (0.1.7 on), not the author's claim: the card shows the
|
|
71
|
+
* refused label in the install button's place (design
|
|
72
|
+
* 2026-09-26-dsh-017-readiness, B1, amended 2026-10-14). `{peers}`
|
|
59
73
|
* is each refused peer with the range the package declared. The remedy
|
|
60
74
|
* leads into the exemption command, rendered on its own line after it, and
|
|
61
75
|
* names the Refresh button by its label. */
|
|
@@ -117,6 +131,13 @@ export declare const zh: {
|
|
|
117
131
|
nameTakenDetail: string;
|
|
118
132
|
npmSource: string;
|
|
119
133
|
githubSource: string;
|
|
134
|
+
/** The accessible name and the tooltip of a card's version, which say which
|
|
135
|
+
* of three things the printed string is (market borrowings §11): the string
|
|
136
|
+
* alone cannot tell a release tag from a version number, and a short commit
|
|
137
|
+
* printed with a `v` read as one. */
|
|
138
|
+
npmVersionLabel: string;
|
|
139
|
+
commitVersionLabel: string;
|
|
140
|
+
releaseVersionLabel: string;
|
|
120
141
|
/** The badge and the explanation for an installed github entry no catalog
|
|
121
142
|
* row claims (C10 MVP). The mechanism synthesizes a row for ANY github spec
|
|
122
143
|
* with no catalog row — shadowed by a same-named npm package, an unlisted
|
|
@@ -126,6 +147,8 @@ export declare const zh: {
|
|
|
126
147
|
shadowedBadge: string;
|
|
127
148
|
shadowedDetail: string;
|
|
128
149
|
updatableSection: string;
|
|
150
|
+
/** `{version}` is the shelf's own version text (`versionLabel`), which
|
|
151
|
+
* carries the `v` an npm version takes and no other kind does. */
|
|
129
152
|
installedVersion: string;
|
|
130
153
|
latestVersion: string;
|
|
131
154
|
update: string;
|
|
@@ -185,6 +208,14 @@ export declare const en: {
|
|
|
185
208
|
all: string;
|
|
186
209
|
catalog: string;
|
|
187
210
|
catalogStats: string;
|
|
211
|
+
/** The shelf's order control, and the date each card carries under the two
|
|
212
|
+
* date orders (design 2026-10-12-shelf-orders §4). */
|
|
213
|
+
sortLabel: string;
|
|
214
|
+
sortStars: string;
|
|
215
|
+
sortAdded: string;
|
|
216
|
+
sortUpdated: string;
|
|
217
|
+
listedOn: string;
|
|
218
|
+
updatedOn: string;
|
|
188
219
|
stars: string;
|
|
189
220
|
categoryTool: string;
|
|
190
221
|
categoryProvider: string;
|
|
@@ -204,11 +235,11 @@ export declare const en: {
|
|
|
204
235
|
tierCommunity: string;
|
|
205
236
|
capabilitiesNote: string;
|
|
206
237
|
install: string;
|
|
207
|
-
confirm: string;
|
|
208
238
|
cancel: string;
|
|
209
239
|
dismiss: string;
|
|
210
|
-
|
|
211
|
-
|
|
240
|
+
disclosure: string;
|
|
241
|
+
moreRedLines: string;
|
|
242
|
+
lessRedLines: string;
|
|
212
243
|
installing: string;
|
|
213
244
|
downloading: string;
|
|
214
245
|
installedRestartNotice: string;
|
|
@@ -259,6 +290,9 @@ export declare const en: {
|
|
|
259
290
|
nameTakenDetail: string;
|
|
260
291
|
npmSource: string;
|
|
261
292
|
githubSource: string;
|
|
293
|
+
npmVersionLabel: string;
|
|
294
|
+
commitVersionLabel: string;
|
|
295
|
+
releaseVersionLabel: string;
|
|
262
296
|
shadowedBadge: string;
|
|
263
297
|
shadowedDetail: string;
|
|
264
298
|
updatableSection: string;
|
|
@@ -64,14 +64,14 @@ export declare function harnessVerdictOf(verdicts: Readonly<Record<string, Harne
|
|
|
64
64
|
* facts its copy names — never the copy, which the tab localizes (§4: no copy
|
|
65
65
|
* crosses the RPC).
|
|
66
66
|
*
|
|
67
|
-
* Refusals and warnings, each with its own remedy. Two are refusals, and
|
|
68
|
-
*
|
|
69
|
-
* refuse and the reader fixes by uninstalling a plugin; and harness
|
|
70
|
-
* running dsh WILL refuse (0.1.7 on), fixed by dsh's exact-version
|
|
71
|
-
* whose command the host sends when dsh would accept one.
|
|
72
|
-
* about this harness and is advisory — the host installs
|
|
73
|
-
* node resolution and the page's module table both lack,
|
|
74
|
-
* declared range or profile list this dsh falls outside of.
|
|
67
|
+
* Refusals and warnings, each with its own remedy. Two are refusals, and put
|
|
68
|
+
* a label in the button's place (`refusesInstall`): a taken name, which the
|
|
69
|
+
* host WILL refuse and the reader fixes by uninstalling a plugin; and harness
|
|
70
|
+
* peers the running dsh WILL refuse (0.1.7 on), fixed by dsh's exact-version
|
|
71
|
+
* exemption, whose command the host sends when dsh would accept one.
|
|
72
|
+
* Everything else is about this harness and is advisory — the host installs
|
|
73
|
+
* anyway: components node resolution and the page's module table both lack,
|
|
74
|
+
* and an author's declared range or profile list this dsh falls outside of.
|
|
75
75
|
*/
|
|
76
76
|
export type Blocker = {
|
|
77
77
|
kind: 'name-taken';
|
|
@@ -127,10 +127,10 @@ export declare function readsIncompatible(blockers: readonly {
|
|
|
127
127
|
kind: BlockerKind;
|
|
128
128
|
}[]): boolean;
|
|
129
129
|
/**
|
|
130
|
-
* Whether this install is refused before it starts, so
|
|
131
|
-
*
|
|
132
|
-
* cannot proceed: by the host, for a taken name, or by
|
|
133
|
-
* its harness peers.
|
|
130
|
+
* Whether this install is refused before it starts, so the card shows the
|
|
131
|
+
* refused label where its button would be, rather than a button for an
|
|
132
|
+
* install that cannot proceed: refused by the host, for a taken name, or by
|
|
133
|
+
* the running dsh, for its harness peers.
|
|
134
134
|
*
|
|
135
135
|
* The second is the one harness reason that blocks (design
|
|
136
136
|
* 2026-09-26-dsh-017-readiness, B1, amending "warn, never block"): dsh 0.1.7
|
|
@@ -138,9 +138,9 @@ export declare function readsIncompatible(blockers: readonly {
|
|
|
138
138
|
* entry after it, rolling the profile back, and the shop cannot install past
|
|
139
139
|
* it. The verdict is dsh's own rule on the profile's own exemptions, whichever
|
|
140
140
|
* channel the entry comes from (design
|
|
141
|
-
* 2026-09-28-bundle-components-and-github-peers, section 7.3), so
|
|
142
|
-
*
|
|
143
|
-
*
|
|
141
|
+
* 2026-09-28-bundle-components-and-github-peers, section 7.3), so the label
|
|
142
|
+
* is dsh's answer given early, never the shop's opinion — and recording the
|
|
143
|
+
* exemption the card shows is what brings the button back.
|
|
144
144
|
*/
|
|
145
145
|
export declare function refusesInstall(blockers: readonly {
|
|
146
146
|
kind: BlockerKind;
|
|
@@ -169,24 +169,63 @@ export declare function refusedPeersText(refused: Readonly<Record<string, string
|
|
|
169
169
|
* install it cannot vouch for.
|
|
170
170
|
*/
|
|
171
171
|
export declare function heldBy(entry: EntryIdentity, specs: Readonly<Record<string, string>> | undefined): string | undefined;
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
/** The disclosure every install now stands under (spec §9.3, amended
|
|
173
|
+
* 2026-10-14). It used to be the acknowledgement dialog's body: the gate asked
|
|
174
|
+
* a reader to accept THESE privileges before each community install. The gate
|
|
175
|
+
* is gone, and the same facts stand instead as one quiet line on the page, so
|
|
176
|
+
* they cannot be missed and cannot be dismissed unread.
|
|
177
|
+
*
|
|
178
|
+
* Stated in the general case — "a plugin", not "this plugin" — because it now
|
|
179
|
+
* describes the tier system rather than one entry, and because the community
|
|
180
|
+
* tier is never badged on a card: naming a badge that is not rendered would
|
|
181
|
+
* send a reader looking for it. */
|
|
182
|
+
export declare const DISCLOSURE_EN = "Once installed, a plugin holds the same privileges as a built-in one: reading and writing your files, running shell commands, and reading and modifying the requests sent to the model. Plugins not marked Verified have not been reviewed.";
|
|
183
|
+
/** The same facts in the zh register, with the same force. */
|
|
184
|
+
export declare const DISCLOSURE_ZH = "\u5B89\u88C5\u540E\uFF0C\u63D2\u4EF6\u62E5\u6709\u4E0E\u5185\u7F6E\u63D2\u4EF6\u76F8\u540C\u7684\u6743\u9650\uFF1A\u8BFB\u5199\u4F60\u7684\u6587\u4EF6\u3001\u6267\u884C shell \u547D\u4EE4\uFF0C\u4EE5\u53CA\u8BFB\u53D6\u548C\u4FEE\u6539\u53D1\u9001\u7ED9\u6A21\u578B\u7684\u8BF7\u6C42\u3002\u672A\u6807\u300C\u5DF2\u5BA1\u6838\u300D\u7684\u63D2\u4EF6\u672A\u7ECF\u5BA1\u6838\u3002";
|
|
177
185
|
/** Install rejection code → locale key, for the rejected-state code label
|
|
178
186
|
* (§7.2): every rejection the host can return has a human label here. */
|
|
179
187
|
export declare function rejectionCodeKey(code: InstallRejectionCode): ShopLocaleKey;
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
/** What a shelf version string is (market borrowings §11): a version npm
|
|
189
|
+
* serves, or the spec a profile manifest holds for one; the commit a github
|
|
190
|
+
* entry is pinned to; or the tag of the release a rescued github entry
|
|
191
|
+
* installs from. */
|
|
192
|
+
export type VersionKind = 'npm' | 'commit' | 'release';
|
|
193
|
+
export interface VersionLabel {
|
|
194
|
+
kind: VersionKind;
|
|
195
|
+
/** What the shelf prints: `v1.2.3`, `4da5ae8`, `v0.29.10`. */
|
|
196
|
+
text: string;
|
|
197
|
+
/** What the accessible name and the tooltip print after the kind's word:
|
|
198
|
+
* the same string without the `v` the shelf adds to an npm version. */
|
|
199
|
+
value: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* How a version string reads on the shelf, decided by its source and its
|
|
203
|
+
* shape alone (market borrowings §11).
|
|
204
|
+
*
|
|
205
|
+
* Shape, never the entry's `tarball`, because an installed row carries only
|
|
206
|
+
* the pin the shop recorded at install — the catalog `version` of that moment
|
|
207
|
+
* — and no `tarball`. The registry pins a commit as forty lowercase hex and a
|
|
208
|
+
* release by its tag, so the two shapes do not cross; `present.test.ts`
|
|
209
|
+
* checks that against the committed live catalog.
|
|
210
|
+
*
|
|
211
|
+
* - An npm version takes the `v` the shelf has always shown, and only before
|
|
212
|
+
* a digit: an installed row reports the manifest's spec, and a range there
|
|
213
|
+
* (`^1.2.3`) is not a version to prefix.
|
|
214
|
+
* - A commit is cut to the seven characters git abbreviates to, with no `v`:
|
|
215
|
+
* it is not a version number.
|
|
216
|
+
* - A release tag prints exactly as tagged, never cut and never prefixed:
|
|
217
|
+
* cutting `v0.29.10` to seven characters printed `v0.29.1`, another
|
|
218
|
+
* version, and the `v` this function no longer adds doubled the tag's own.
|
|
219
|
+
*/
|
|
220
|
+
export declare function versionLabel(source: 'npm' | 'github', version: string): VersionLabel;
|
|
221
|
+
/** The copy that names a version's kind, for the accessible name and the
|
|
222
|
+
* tooltip; its `{version}` takes {@link VersionLabel.value}. */
|
|
223
|
+
export declare function versionLabelKey(kind: VersionKind): ShopLocaleKey;
|
|
185
224
|
/** The hash pin a stale line names for a repo or release-rescued entry — the
|
|
186
225
|
* reviewed commit, or the reviewed release tarball sha256 (market borrowings
|
|
187
|
-
* §3.1). Shortened to 7 chars like the card
|
|
188
|
-
* hand-built fixture carrying no pin. The npm form is a version
|
|
189
|
-
*
|
|
226
|
+
* §3.1). Shortened to 7 chars like a commit on the card; '' only for a
|
|
227
|
+
* hand-built fixture carrying no pin. The npm form is a version, which
|
|
228
|
+
* {@link versionLabel} prints instead. */
|
|
190
229
|
export declare function reviewHashPin(review: NonNullable<CatalogEntry['review']>): string;
|
|
191
230
|
/**
|
|
192
231
|
* Whether the license value is the npm idiom `SEE LICENSE IN <file>` — a
|
|
@@ -324,6 +363,25 @@ export declare function nextVisibleCount(visible: number, total: number, batch:
|
|
|
324
363
|
* view is tracking — a status for an install it never started (idle) is an
|
|
325
364
|
* unrelated event and a no-op, like any other event it does not recognize. */
|
|
326
365
|
export declare function reduceInstall(state: InstallView, event: InstallEvent): InstallView;
|
|
366
|
+
/**
|
|
367
|
+
* Which order the shelf is in (design 2026-10-12-shelf-orders). `stars` is
|
|
368
|
+
* the default AND the tie-break of both date orders, so the two date orders
|
|
369
|
+
* are stable re-sorts of it rather than orders with comparators of their own.
|
|
370
|
+
*/
|
|
371
|
+
declare const SHELF_ORDER_KEYS: {
|
|
372
|
+
readonly stars: "sortStars";
|
|
373
|
+
readonly added: "sortAdded";
|
|
374
|
+
readonly updated: "sortUpdated";
|
|
375
|
+
};
|
|
376
|
+
/** The order vocabulary as a type, derived from the map above so the client
|
|
377
|
+
* never repeats the three literals. */
|
|
378
|
+
export type ShelfOrder = keyof typeof SHELF_ORDER_KEYS;
|
|
379
|
+
/** The three orders in display order (map insertion order). `readonly`: this
|
|
380
|
+
* is a shared vocabulary, and an order list a caller can push to is a bug
|
|
381
|
+
* waiting for its second caller. */
|
|
382
|
+
export declare const SHELF_ORDERS: readonly ShelfOrder[];
|
|
383
|
+
/** The locale key naming one order (the toggle's buttons). */
|
|
384
|
+
export declare function shelfOrderLocaleKey(order: ShelfOrder): ShopLocaleKey;
|
|
327
385
|
declare const CATEGORY_KEYS: {
|
|
328
386
|
readonly tool: "categoryTool";
|
|
329
387
|
readonly provider: "categoryProvider";
|
|
@@ -430,6 +488,31 @@ export declare function starsOf(entry: CatalogEntry, stars: Record<string, numbe
|
|
|
430
488
|
* (case-insensitive) on ties (spec 2026-08-26-github-stars-design.md D1).
|
|
431
489
|
* Display-time only — the catalog's own name sort is untouched. */
|
|
432
490
|
export declare function sortByStars(entries: CatalogEntry[], stars: Record<string, number>): CatalogEntry[];
|
|
491
|
+
/**
|
|
492
|
+
* The entry's sort key under a date order, or undefined when it has no usable
|
|
493
|
+
* date (design §3): absent, off-form, unparseable, or later than the catalog's
|
|
494
|
+
* own `builtAt`. Milliseconds since the epoch. `'stars'` carries no date, so
|
|
495
|
+
* this answers undefined for it.
|
|
496
|
+
*/
|
|
497
|
+
export declare function shelfTime(entry: CatalogEntry, order: ShelfOrder, builtAt: string): number | undefined;
|
|
498
|
+
/**
|
|
499
|
+
* A UTC calendar day for display: "2026-10-12". Derived from the instant the
|
|
500
|
+
* sort ranked by, so a card's label and its position cannot disagree. UTC and
|
|
501
|
+
* never a local getter: a reader in UTC+8 must see the same days the catalog
|
|
502
|
+
* was built in, the calendar the stats row already prints.
|
|
503
|
+
*/
|
|
504
|
+
export declare function utcDay(ms: number): string;
|
|
505
|
+
/**
|
|
506
|
+
* The shelf in `order` (design 2026-10-12-shelf-orders §2, §5). `'stars'`
|
|
507
|
+
* returns the array it was handed, so the default path allocates nothing and
|
|
508
|
+
* does not invalidate the memos downstream of it.
|
|
509
|
+
*
|
|
510
|
+
* Each key is computed ONCE per entry rather than inside the comparator, and
|
|
511
|
+
* the sort is stable (ES2019), so entries sharing a date keep the star order
|
|
512
|
+
* they arrived in — which is how the tie-break is defined without a second
|
|
513
|
+
* comparator that could drift from `sortByStars`.
|
|
514
|
+
*/
|
|
515
|
+
export declare function orderShelf(starOrdered: readonly CatalogEntry[], order: ShelfOrder, builtAt: string): readonly CatalogEntry[];
|
|
433
516
|
/** 999 → "999"; 1000 → "1k"; 1234 → "1.2k"; 1500 → "1.5k"; 99999 → "100k". */
|
|
434
517
|
export declare function formatStars(n: number): string;
|
|
435
518
|
/**
|
|
@@ -25,6 +25,10 @@ import { type InstallView } from './present.ts';
|
|
|
25
25
|
/** One identity's flow, as the tab hands it to a panel. */
|
|
26
26
|
export interface KeyedFlow<TArgs> {
|
|
27
27
|
view: InstallView;
|
|
28
|
+
/** A start for THIS key is in flight and unanswered. The button that
|
|
29
|
+
* offered it renders disabled with a wait cursor while this holds, and a
|
|
30
|
+
* second `start` for the same key is ignored rather than sent. */
|
|
31
|
+
starting: boolean;
|
|
28
32
|
start: (args: TArgs) => Promise<void>;
|
|
29
33
|
reset: () => void;
|
|
30
34
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fold under a card's whole red block: two lines by default, a small pill
|
|
3
|
+
* that expands it when there is more, and the whole block again on a second
|
|
4
|
+
* press. Three rules keep the fold honest:
|
|
5
|
+
*
|
|
6
|
+
* - It is measured, not declared. The toggle is offered only where the block
|
|
7
|
+
* itself shows it holds more than the clamp lets through —
|
|
8
|
+
* `scrollHeight > clientHeight`, read while the block is collapsed. A count
|
|
9
|
+
* of lines or characters would lie on exactly the narrow window the fold
|
|
10
|
+
* matters most for.
|
|
11
|
+
* - It is independent of the card's own expand. The header's chevron opens
|
|
12
|
+
* the author description; the pill opens the red block.
|
|
13
|
+
* - It is visual only. The label's accessible name and tooltip carry the
|
|
14
|
+
* WHOLE block, folded or open, so a screen reader meets the same facts
|
|
15
|
+
* either way.
|
|
16
|
+
*
|
|
17
|
+
* The measure runs wherever its answer can change: at mount, on every
|
|
18
|
+
* collapse, when the block's box resizes (a ResizeObserver: the panel
|
|
19
|
+
* narrowing, a font arriving), and when its text changes (a MutationObserver:
|
|
20
|
+
* a verdict that lands after the first paint, or one a refresh withdraws).
|
|
21
|
+
* Both observers are needed. A block already clamped at two lines keeps its
|
|
22
|
+
* height when its content grows, so a ResizeObserver alone never hears the
|
|
23
|
+
* line that pushes it over; and a block that first mounts with no box (a
|
|
24
|
+
* hidden ancestor) changes no text when it is shown.
|
|
25
|
+
*
|
|
26
|
+
* While the block is open nothing is measured: an open block is as tall as
|
|
27
|
+
* its content and fits by construction. Reading that as "nothing to fold" is
|
|
28
|
+
* what once let the press that opened the fold unmount its own toggle.
|
|
29
|
+
*/
|
|
30
|
+
import { type MutableRefObject } from 'react';
|
|
31
|
+
export declare function useFoldableRedBlock(): {
|
|
32
|
+
rootRef: MutableRefObject<HTMLDivElement | null>;
|
|
33
|
+
expandable: boolean;
|
|
34
|
+
expanded: boolean;
|
|
35
|
+
toggle: () => void;
|
|
36
|
+
};
|
|
@@ -127,6 +127,11 @@ export interface CatalogEntry {
|
|
|
127
127
|
* §1.3). github entries only, additive and optional: the shelf badges it
|
|
128
128
|
* and nothing else — install, update, and enable are unchanged. */
|
|
129
129
|
archived?: boolean;
|
|
130
|
+
/** Whether GitHub reports the repository as a fork (design 2026-10-11
|
|
131
|
+
* §1.1). github entries only, additive and optional, and informative:
|
|
132
|
+
* nothing reads it here yet — it is telemetry the catalog publishes, not a
|
|
133
|
+
* gate, a badge, or an install decision. */
|
|
134
|
+
forked?: boolean;
|
|
130
135
|
}
|
|
131
136
|
export interface DeniedEntry {
|
|
132
137
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-shop",
|
|
3
|
-
"version": "0.8.7-beta.
|
|
3
|
+
"version": "0.8.7-beta.2",
|
|
4
4
|
"description": "The DeepSeek Harness plugin shop: browse, install, enable, and update dsh plugins from a git-auditable catalog.",
|
|
5
|
+
"icon": "./assets/icon.png",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"dsh-plugin",
|
|
7
8
|
"deepseek-harness",
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"LICENSE",
|
|
53
|
+
"assets/icon.png",
|
|
52
54
|
"lib/index.js",
|
|
53
55
|
"lib/client.js",
|
|
54
56
|
"lib/types/**/*.js",
|