@chatcode/cco-market 1.45.1 → 1.45.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/client/client.js +6 -1
- package/package.json +16 -18
- package/src/client/SkillMarketSection.tsx +13 -2
package/client/client.js
CHANGED
|
@@ -11202,7 +11202,7 @@ window.__ModuleLoader__.load({ id: "@chatcode/cco-market", factory: (require) =>
|
|
|
11202
11202
|
const subscribe = (0, react.useMemo)(() => (callback) => sessions.list.subscribe(callback), [sessions]);
|
|
11203
11203
|
const getSnapshot = (0, react.useCallback)(() => sessions.list.getSnapshot(), [sessions]);
|
|
11204
11204
|
const sessionList = (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
11205
|
-
const sessionId = sessionList
|
|
11205
|
+
const sessionId = currentSessionId(sessionList);
|
|
11206
11206
|
const cwd = sessionId === void 0 ? void 0 : sessionList.byId[sessionId]?.cwd;
|
|
11207
11207
|
const [query, setQuery] = (0, react.useState)("");
|
|
11208
11208
|
const [deferredQuery, setDeferredQuery] = (0, react.useState)("");
|
|
@@ -11403,6 +11403,11 @@ window.__ModuleLoader__.load({ id: "@chatcode/cco-market", factory: (require) =>
|
|
|
11403
11403
|
]
|
|
11404
11404
|
});
|
|
11405
11405
|
}
|
|
11406
|
+
/** Resolve both the legacy selected id and the current Controller retention projection. */
|
|
11407
|
+
function currentSessionId(snapshot) {
|
|
11408
|
+
if (snapshot.current !== void 0 && snapshot.byId[snapshot.current] !== void 0) return snapshot.current;
|
|
11409
|
+
return Object.entries(snapshot.byId).find(([, session]) => (session.retainedBy?.mainView ?? 0) > 0)?.[0];
|
|
11410
|
+
}
|
|
11406
11411
|
async function readResponse(response) {
|
|
11407
11412
|
const body = await response.json();
|
|
11408
11413
|
if (!response.ok) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatcode/cco-market",
|
|
3
3
|
"description": "ChatCode CLI Plugin Market — browse, search, and one-click install community plugins. · ChatCode CLI 可视化插件市场:逛一逛,点一下,装好。",
|
|
4
|
-
"version": "1.45.
|
|
4
|
+
"version": "1.45.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -20,22 +20,6 @@
|
|
|
20
20
|
"market",
|
|
21
21
|
"plugin-manager"
|
|
22
22
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
|
|
25
|
-
"build": "tsc -p tsconfig.json && npm run build:client",
|
|
26
|
-
"build:client": "tsdown && node scripts/normalize-client-banner.mjs",
|
|
27
|
-
"check": "npm run typecheck && npm run build && node scripts/restart-smoke.mjs",
|
|
28
|
-
"test": "vitest run",
|
|
29
|
-
"test:compat": "vitest run --config vitest.compat.config.ts",
|
|
30
|
-
"prepack": "npm run build && node scripts/preflight.mjs",
|
|
31
|
-
"prepare": "npm run build",
|
|
32
|
-
"validate:registry": "node scripts/validate-registry.mjs",
|
|
33
|
-
"snapshot": "node -e \"require('node:fs').mkdirSync('data',{recursive:true})\" && curl -sf https://awesome-dsh-plugin.com/plugins.json -o data/registry-snapshot.json && curl -sf https://awesome-dsh-plugin.com/readmes.json -o data/readmes-snapshot.json",
|
|
34
|
-
"check:web-auth-capture": "node scripts/check-web-auth-capture.mjs",
|
|
35
|
-
"test:web": "node scripts/check-web-auth-capture.mjs && vitest run --config vitest.web.config.ts",
|
|
36
|
-
"build:site": "node scripts/build-site.mjs",
|
|
37
|
-
"verify:brand": "node scripts/verify-brand.mjs"
|
|
38
|
-
},
|
|
39
23
|
"dependencies": {
|
|
40
24
|
"js-yaml": "^4.3.2",
|
|
41
25
|
"undici": "^7.29.0",
|
|
@@ -117,5 +101,19 @@
|
|
|
117
101
|
"@deepseek-ai/schemastery": {
|
|
118
102
|
"optional": true
|
|
119
103
|
}
|
|
104
|
+
},
|
|
105
|
+
"scripts": {
|
|
106
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
|
|
107
|
+
"build": "tsc -p tsconfig.json && npm run build:client",
|
|
108
|
+
"build:client": "tsdown && node scripts/normalize-client-banner.mjs",
|
|
109
|
+
"check": "npm run typecheck && npm run build && node scripts/restart-smoke.mjs",
|
|
110
|
+
"test": "vitest run",
|
|
111
|
+
"test:compat": "vitest run --config vitest.compat.config.ts",
|
|
112
|
+
"validate:registry": "node scripts/validate-registry.mjs",
|
|
113
|
+
"snapshot": "node -e \"require('node:fs').mkdirSync('data',{recursive:true})\" && curl -sf https://awesome-dsh-plugin.com/plugins.json -o data/registry-snapshot.json && curl -sf https://awesome-dsh-plugin.com/readmes.json -o data/readmes-snapshot.json",
|
|
114
|
+
"check:web-auth-capture": "node scripts/check-web-auth-capture.mjs",
|
|
115
|
+
"test:web": "node scripts/check-web-auth-capture.mjs && vitest run --config vitest.web.config.ts",
|
|
116
|
+
"build:site": "node scripts/build-site.mjs",
|
|
117
|
+
"verify:brand": "node scripts/verify-brand.mjs"
|
|
120
118
|
}
|
|
121
|
-
}
|
|
119
|
+
}
|
|
@@ -31,8 +31,12 @@ export interface SkillMarketSessions {
|
|
|
31
31
|
readonly list: {
|
|
32
32
|
subscribe(callback: () => void): () => void
|
|
33
33
|
getSnapshot(): {
|
|
34
|
+
/** Legacy client-runtime selection, removed when Session ownership moved into the Controller. */
|
|
34
35
|
readonly current?: string
|
|
35
|
-
readonly byId: Readonly<Record<string, {
|
|
36
|
+
readonly byId: Readonly<Record<string, {
|
|
37
|
+
readonly cwd?: string
|
|
38
|
+
readonly retainedBy?: Readonly<Record<string, number>>
|
|
39
|
+
}>>
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
@@ -42,7 +46,7 @@ export function SkillMarketSection({ t, sessions }: { readonly t: Translate; rea
|
|
|
42
46
|
const subscribe = useMemo(() => (callback: () => void) => sessions.list.subscribe(callback), [sessions])
|
|
43
47
|
const getSnapshot = useCallback(() => sessions.list.getSnapshot(), [sessions])
|
|
44
48
|
const sessionList = useSyncExternalStore(subscribe, getSnapshot, getSnapshot)
|
|
45
|
-
const sessionId = sessionList
|
|
49
|
+
const sessionId = currentSessionId(sessionList)
|
|
46
50
|
const cwd = sessionId === undefined ? undefined : sessionList.byId[sessionId]?.cwd
|
|
47
51
|
const [query, setQuery] = useState('')
|
|
48
52
|
const [deferredQuery, setDeferredQuery] = useState('')
|
|
@@ -150,6 +154,13 @@ export function SkillMarketSection({ t, sessions }: { readonly t: Translate; rea
|
|
|
150
154
|
</section>
|
|
151
155
|
}
|
|
152
156
|
|
|
157
|
+
/** Resolve both the legacy selected id and the current Controller retention projection. */
|
|
158
|
+
function currentSessionId(snapshot: ReturnType<SkillMarketSessions['list']['getSnapshot']>): string | undefined {
|
|
159
|
+
if (snapshot.current !== undefined && snapshot.byId[snapshot.current] !== undefined) return snapshot.current
|
|
160
|
+
return Object.entries(snapshot.byId)
|
|
161
|
+
.find(([, session]) => (session.retainedBy?.mainView ?? 0) > 0)?.[0]
|
|
162
|
+
}
|
|
163
|
+
|
|
153
164
|
async function readResponse<T>(response: Response): Promise<T> {
|
|
154
165
|
const body = await response.json() as unknown
|
|
155
166
|
if (!response.ok) {
|