@dsh-libing/market 0.0.0-stage → 0.1.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/CHANGELOG.md +7 -0
- package/README.md +27 -2
- package/cordis.patch.yml +3 -0
- package/icon.svg +7 -0
- package/lib/archive.d.ts +8 -0
- package/lib/archive.js +33 -0
- package/lib/catalog.d.ts +19 -0
- package/lib/catalog.js +81 -0
- package/lib/client-types/client/MarketIcon.d.ts +9 -0
- package/lib/client-types/client/MarketPage.d.ts +13 -0
- package/lib/client-types/client/api.d.ts +7 -0
- package/lib/client-types/client/index.d.ts +14 -0
- package/lib/client-types/client/locales.d.ts +40 -0
- package/lib/client-types/shared.d.ts +124 -0
- package/lib/client.js +95 -0
- package/lib/config.d.ts +31 -0
- package/lib/config.js +35 -0
- package/lib/controller.d.ts +29 -0
- package/lib/controller.js +108 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +43 -0
- package/lib/shared.d.ts +124 -0
- package/lib/shared.js +71 -0
- package/package.json +99 -3
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dsh-libing/market
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSH `0.2.0-rc.2` 的 TypeScript 插件市场,在 Web 侧边栏提供「LiBing 市场」。首版支持搜索、已安装状态、版本确认、安装、更新与卸载 `@dsh-libing/*` 插件;实际包操作和配置应用由官方 `pluginManager` 执行。
|
|
4
|
+
|
|
5
|
+
## 本地测试
|
|
6
|
+
|
|
7
|
+
在仓库根目录运行 `pnpm dev:market`。命令构建、打包并准备仓库 `.dsh/market-dev` 下的独立 Web 环境;机器目录和安装包分别来自 `packages/market-catalog/catalog.json` 与 `artifacts/`。启动日志提供带认证的浏览器地址。打开「LiBing 市场」,可安装和卸载 hello,再在会话中调用 `libing_hello`。
|
|
8
|
+
|
|
9
|
+
源码修改后退出并重新运行命令。更新测试时提高 hello 的版本、同步 CHANGELOG、运行 `pnpm catalog:generate`,再启动;市场只把更高版本标为可更新。暂未发布 npm 包,所以本地模式是当前推荐测试入口。
|
|
10
|
+
|
|
11
|
+
## 配置与分发
|
|
12
|
+
|
|
13
|
+
Cordis entry id 为 `libing-market`,注入 `pluginManager`、`profileContext` 和 Host `connection`。路由位于 `/api/libing-market/state` 与 `/api/libing-market/mutate`,使用 Connection 的浏览器认证和同源检查。客户端只提交操作、包名及确认版本,不能指定路径或命令。
|
|
14
|
+
|
|
15
|
+
| 配置 | 默认值 | 用途 |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `source` | `npm` | `npm` 或 `local`,显式选择目录和安装源 |
|
|
18
|
+
| `registry` | `https://registry.npmjs.org/` | npm 模式查询和安装使用的 registry |
|
|
19
|
+
| `catalogPath` | 无 | local 模式必填,catalog.json 的绝对路径 |
|
|
20
|
+
| `artifactsDir` | 无 | local 模式必填,tarball 目录的绝对路径 |
|
|
21
|
+
| `fetchTimeoutMs` | `20000` | 单次目录请求超时 |
|
|
22
|
+
| `maxArchiveBytes` | `52428800` | 目录压缩包与 JSON 成员的大小上限 |
|
|
23
|
+
|
|
24
|
+
npm 模式读取 `@dsh-libing/market-catalog` 的 latest 元数据,校验 tarball integrity,安装目录中的精确版本。local 模式校验 tarball 包名、版本和安装生命周期脚本。首次安装市场自身使用 DSH CLI;页面禁止自行卸载市场。
|
|
25
|
+
|
|
26
|
+
目录失败时显示已安装插件,暂停安装和更新,保留允许的卸载操作。操作反馈区分立即生效、需要重启、被配置覆盖、取消与失败。首版不包含登录、GitCode 凭据、第三方插件、自动发布或安装脚本授权。
|
|
27
|
+
|
|
28
|
+
市场卡片展示目录内嵌的插件图标,无需额外访问 CDN;缺失或加载失败时回退占位图。本插件的商店图标为随包分发的 `icon.svg`,由 `dsh.market.icon` 声明。
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 16 16" fill="none" stroke="#4778e8" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<path d="M2.35 5.5v8.9h11.3V5.5"/>
|
|
3
|
+
<path d="M1.25 5.5 2.85 1.6h10.3l1.6 3.9H1.25Z"/>
|
|
4
|
+
<path d="m4.7 5.5.55-3.9m6.05 3.9-.55-3.9"/>
|
|
5
|
+
<rect x="4.1" y="8.1" width="3.45" height="3.6" rx=".35"/>
|
|
6
|
+
<path d="M5.825 8.1v3.6M4.1 9.9h3.45M9.7 14.4V8.1h2.15"/>
|
|
7
|
+
</svg>
|
package/lib/archive.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract one regular JSON member into an owned temporary directory.
|
|
3
|
+
* @param archive - absolute tarball path.
|
|
4
|
+
* @param member - owned npm member: package.json or catalog.json.
|
|
5
|
+
* @param maxBytes - compressed archive and selected-member size limit.
|
|
6
|
+
* @returns parsed JSON, to be narrowed by its owning schema.
|
|
7
|
+
*/
|
|
8
|
+
export declare function archiveJson(archive: string, member: 'package.json' | 'catalog.json', maxBytes: number): Promise<unknown>;
|
package/lib/archive.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Read bounded JSON members of npm archives without running package code. */
|
|
2
|
+
import { mkdtemp, readFile, rm, stat } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { x } from 'tar';
|
|
6
|
+
/**
|
|
7
|
+
* Extract one regular JSON member into an owned temporary directory.
|
|
8
|
+
* @param archive - absolute tarball path.
|
|
9
|
+
* @param member - owned npm member: package.json or catalog.json.
|
|
10
|
+
* @param maxBytes - compressed archive and selected-member size limit.
|
|
11
|
+
* @returns parsed JSON, to be narrowed by its owning schema.
|
|
12
|
+
*/
|
|
13
|
+
export async function archiveJson(archive, member, maxBytes) {
|
|
14
|
+
if ((await stat(archive)).size > maxBytes)
|
|
15
|
+
throw new Error('market archive exceeds maxArchiveBytes');
|
|
16
|
+
const directory = await mkdtemp(join(tmpdir(), 'libing-market-json-'));
|
|
17
|
+
try {
|
|
18
|
+
await x({
|
|
19
|
+
file: archive, cwd: directory, strict: true,
|
|
20
|
+
filter: (path, entry) => {
|
|
21
|
+
if (path !== `package/${member}`)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('type' in entry) || entry.type !== 'File' || entry.size > maxBytes)
|
|
24
|
+
throw new Error('market archive JSON member is not a bounded regular file');
|
|
25
|
+
return true;
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return JSON.parse(await readFile(join(directory, 'package', member), 'utf8'));
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
await rm(directory, { recursive: true, force: true });
|
|
32
|
+
}
|
|
33
|
+
}
|
package/lib/catalog.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Settings } from './config.ts';
|
|
2
|
+
import type { Catalog, CatalogEntry } from './shared.ts';
|
|
3
|
+
/** Source reads and install-spec resolution owned by one plugin activation. */
|
|
4
|
+
export declare class CatalogSource {
|
|
5
|
+
private readonly settings;
|
|
6
|
+
private readonly abort;
|
|
7
|
+
constructor(settings: Settings);
|
|
8
|
+
/** Cancel active network reads when the owning plugin is released. */
|
|
9
|
+
dispose(): void;
|
|
10
|
+
private fetch;
|
|
11
|
+
/** Read fresh catalog data; failures never return an old snapshot as online data. */
|
|
12
|
+
read(): Promise<Catalog>;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a catalog-approved exact npm version or an identity-checked local tarball.
|
|
15
|
+
* @param entry - latest validated catalog entry approved by the request.
|
|
16
|
+
* @returns specification passed to the DSH package manager.
|
|
17
|
+
*/
|
|
18
|
+
spec(entry: CatalogEntry): Promise<string>;
|
|
19
|
+
}
|
package/lib/catalog.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Catalog readers use registry integrity or explicit local artifacts. */
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { checkData } from 'ssri';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { archiveJson } from "./archive.js";
|
|
8
|
+
import { catalogSchema, CATALOG_PACKAGE } from "./shared.js";
|
|
9
|
+
/** Source reads and install-spec resolution owned by one plugin activation. */
|
|
10
|
+
export class CatalogSource {
|
|
11
|
+
settings;
|
|
12
|
+
abort = new AbortController();
|
|
13
|
+
constructor(settings) {
|
|
14
|
+
this.settings = settings;
|
|
15
|
+
}
|
|
16
|
+
/** Cancel active network reads when the owning plugin is released. */
|
|
17
|
+
dispose() { this.abort.abort(); }
|
|
18
|
+
async fetch(url) {
|
|
19
|
+
const response = await fetch(url, { signal: AbortSignal.any([this.abort.signal, AbortSignal.timeout(this.settings.fetchTimeoutMs)]) });
|
|
20
|
+
if (!response.ok)
|
|
21
|
+
throw new Error(`market registry request failed: HTTP ${response.status}`);
|
|
22
|
+
return response;
|
|
23
|
+
}
|
|
24
|
+
/** Read fresh catalog data; failures never return an old snapshot as online data. */
|
|
25
|
+
async read() {
|
|
26
|
+
const source = this.settings.source;
|
|
27
|
+
if (source.kind === 'local')
|
|
28
|
+
return catalogSchema.parse(JSON.parse(await readFile(source.catalogPath, 'utf8')));
|
|
29
|
+
const metadata = z.object({
|
|
30
|
+
name: z.literal(CATALOG_PACKAGE), version: z.string(),
|
|
31
|
+
dist: z.object({ tarball: z.url(), integrity: z.string().min(1) }),
|
|
32
|
+
}).parse(await (await this.fetch(new URL(`${encodeURIComponent(CATALOG_PACKAGE)}/latest`, source.registry).href)).json());
|
|
33
|
+
const tarballUrl = new URL(metadata.dist.tarball);
|
|
34
|
+
if (!['https:', 'http:'].includes(tarballUrl.protocol) || tarballUrl.username !== '' || tarballUrl.password !== '')
|
|
35
|
+
throw new Error('market catalog tarball URL is invalid');
|
|
36
|
+
const response = await this.fetch(tarballUrl.href);
|
|
37
|
+
const chunks = [];
|
|
38
|
+
let length = 0;
|
|
39
|
+
for await (const chunk of response.body ?? []) {
|
|
40
|
+
length += chunk.length;
|
|
41
|
+
if (length > this.settings.maxArchiveBytes)
|
|
42
|
+
throw new Error('market catalog archive exceeds maxArchiveBytes');
|
|
43
|
+
chunks.push(chunk);
|
|
44
|
+
}
|
|
45
|
+
const bytes = Buffer.concat(chunks);
|
|
46
|
+
if (!checkData(bytes, metadata.dist.integrity))
|
|
47
|
+
throw new Error('market catalog integrity mismatch');
|
|
48
|
+
const directory = await mkdtemp(join(tmpdir(), 'libing-market-catalog-'));
|
|
49
|
+
try {
|
|
50
|
+
const file = join(directory, 'catalog.tgz');
|
|
51
|
+
await writeFile(file, bytes);
|
|
52
|
+
const catalog = catalogSchema.parse(await archiveJson(file, 'catalog.json', this.settings.maxArchiveBytes));
|
|
53
|
+
if (catalog.version !== metadata.version)
|
|
54
|
+
throw new Error('market catalog package version mismatch');
|
|
55
|
+
return catalog;
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
await rm(directory, { recursive: true, force: true });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve a catalog-approved exact npm version or an identity-checked local tarball.
|
|
63
|
+
* @param entry - latest validated catalog entry approved by the request.
|
|
64
|
+
* @returns specification passed to the DSH package manager.
|
|
65
|
+
*/
|
|
66
|
+
async spec(entry) {
|
|
67
|
+
if (this.settings.source.kind === 'npm')
|
|
68
|
+
return `${entry.name}@${entry.version}`;
|
|
69
|
+
const file = join(this.settings.source.artifactsDir, `${entry.name.slice(1).replace('/', '-')}-${entry.version}.tgz`);
|
|
70
|
+
const manifest = z.object({
|
|
71
|
+
name: z.literal(entry.name), version: z.literal(entry.version),
|
|
72
|
+
dsh: z.object({ bundle: z.object({ patch: z.string() }) }),
|
|
73
|
+
scripts: z.record(z.string(), z.string()).optional(),
|
|
74
|
+
}).parse(await archiveJson(file, 'package.json', this.settings.maxArchiveBytes));
|
|
75
|
+
for (const hook of ['preinstall', 'install', 'postinstall', 'prepare']) {
|
|
76
|
+
if (manifest.scripts?.[hook] !== undefined)
|
|
77
|
+
throw new Error('market local artifact contains an install lifecycle script');
|
|
78
|
+
}
|
|
79
|
+
return file;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Sidebar glyph; DSH owns the button, label and selection state. */
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
+
/**
|
|
5
|
+
* Render the market glyph at the shell's requested size.
|
|
6
|
+
* @param props - sidebar-owned icon sizing and state.
|
|
7
|
+
* @returns decorative icon element.
|
|
8
|
+
*/
|
|
9
|
+
export declare function MarketIcon({ size }: PropsRuntime<'sidebar.panellist'>): ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { MarketApi } from './api.ts';
|
|
4
|
+
export interface MarketPageProps extends PropsLocale<'libingMarket'> {
|
|
5
|
+
api: MarketApi;
|
|
6
|
+
localeId: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Render plugin discovery and version-confirmed mutations for one active profile.
|
|
10
|
+
* @param props - locale dictionary and typed market API supplied by the plugin.
|
|
11
|
+
* @returns the root main panel.
|
|
12
|
+
*/
|
|
13
|
+
export declare function MarketPage({ api, localeId, t }: MarketPageProps): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MarketState, Mutation, Outcome } from '../shared.ts';
|
|
2
|
+
export interface MarketApi {
|
|
3
|
+
state(signal: AbortSignal): Promise<MarketState>;
|
|
4
|
+
mutate(request: Mutation): Promise<Outcome>;
|
|
5
|
+
}
|
|
6
|
+
/** Network implementation; tests may supply the same typed API without a server. */
|
|
7
|
+
export declare const marketApi: MarketApi;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Lifecycle-owned market panel and sidebar entry in the DSH Web shell. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { LocaleKey } from './locales.ts';
|
|
4
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
5
|
+
interface LocaleNamespaceMap {
|
|
6
|
+
libingMarket: LocaleKey;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register browser contributions through parent-owned slots.
|
|
12
|
+
* @param ctx - browser context with locale and slot services.
|
|
13
|
+
*/
|
|
14
|
+
export declare function apply(ctx: Context): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Product copy owned by the market's typed locale namespace. */
|
|
2
|
+
export declare const zh: {
|
|
3
|
+
nav: string;
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
profile: string;
|
|
7
|
+
local: string;
|
|
8
|
+
npm: string;
|
|
9
|
+
refresh: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
search: string;
|
|
12
|
+
empty: string;
|
|
13
|
+
installed: string;
|
|
14
|
+
notInstalled: string;
|
|
15
|
+
installedVersion: string;
|
|
16
|
+
availableVersion: string;
|
|
17
|
+
unknownVersion: string;
|
|
18
|
+
enabled: string;
|
|
19
|
+
disabled: string;
|
|
20
|
+
updateAvailable: string;
|
|
21
|
+
install: string;
|
|
22
|
+
update: string;
|
|
23
|
+
remove: string;
|
|
24
|
+
busy: string;
|
|
25
|
+
offline: string;
|
|
26
|
+
failed: string;
|
|
27
|
+
applied: string;
|
|
28
|
+
restart: string;
|
|
29
|
+
overridden: string;
|
|
30
|
+
cancelled: string;
|
|
31
|
+
confirmTitle: string;
|
|
32
|
+
confirmBody: string;
|
|
33
|
+
confirm: string;
|
|
34
|
+
cancel: string;
|
|
35
|
+
close: string;
|
|
36
|
+
selfProtected: string;
|
|
37
|
+
loadFailed: string;
|
|
38
|
+
};
|
|
39
|
+
export type LocaleKey = keyof typeof zh;
|
|
40
|
+
export declare const en: Record<LocaleKey, string>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Validated JSON records exchanged by the market Host and browser. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** Public market package identity and its supported runtime. */
|
|
4
|
+
export declare const MARKET_PACKAGE = "@dsh-libing/market";
|
|
5
|
+
export declare const CATALOG_PACKAGE = "@dsh-libing/market-catalog";
|
|
6
|
+
export declare const DSH_VERSION = "0.2.0-rc.2";
|
|
7
|
+
export declare const API = "/api/libing-market";
|
|
8
|
+
export declare const packageName: z.ZodString;
|
|
9
|
+
/** Small embedded images rendered through img; never interpreted as page markup. */
|
|
10
|
+
export declare const iconDataUrlSchema: z.ZodString;
|
|
11
|
+
/** Catalog v1 carries exact versions rather than executable install specifications. */
|
|
12
|
+
export declare const catalogEntrySchema: z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
version: z.ZodString;
|
|
15
|
+
description: z.ZodString;
|
|
16
|
+
displayName: z.ZodObject<{
|
|
17
|
+
zh: z.ZodString;
|
|
18
|
+
en: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
category: z.ZodString;
|
|
21
|
+
maintainers: z.ZodArray<z.ZodString>;
|
|
22
|
+
compatibility: z.ZodObject<{
|
|
23
|
+
dsh: z.ZodLiteral<"0.2.0-rc.2">;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
allowedBuilds: z.ZodArray<z.ZodString>;
|
|
26
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
27
|
+
iconDataUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/** Catalog structure accepted from a local file or an npm package. */
|
|
30
|
+
export declare const catalogSchema: z.ZodObject<{
|
|
31
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
32
|
+
version: z.ZodString;
|
|
33
|
+
dshVersion: z.ZodLiteral<"0.2.0-rc.2">;
|
|
34
|
+
plugins: z.ZodArray<z.ZodObject<{
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
version: z.ZodString;
|
|
37
|
+
description: z.ZodString;
|
|
38
|
+
displayName: z.ZodObject<{
|
|
39
|
+
zh: z.ZodString;
|
|
40
|
+
en: z.ZodString;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
category: z.ZodString;
|
|
43
|
+
maintainers: z.ZodArray<z.ZodString>;
|
|
44
|
+
compatibility: z.ZodObject<{
|
|
45
|
+
dsh: z.ZodLiteral<"0.2.0-rc.2">;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
allowedBuilds: z.ZodArray<z.ZodString>;
|
|
48
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
49
|
+
iconDataUrl: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
/** One available or installed package with actions resolved by the Host. */
|
|
53
|
+
export declare const marketEntrySchema: z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
displayName: z.ZodObject<{
|
|
56
|
+
zh: z.ZodString;
|
|
57
|
+
en: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
description: z.ZodString;
|
|
60
|
+
iconUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
availableVersion: z.ZodNullable<z.ZodString>;
|
|
62
|
+
installedVersion: z.ZodNullable<z.ZodString>;
|
|
63
|
+
installed: z.ZodBoolean;
|
|
64
|
+
enabled: z.ZodBoolean;
|
|
65
|
+
installable: z.ZodBoolean;
|
|
66
|
+
updatable: z.ZodBoolean;
|
|
67
|
+
removable: z.ZodBoolean;
|
|
68
|
+
loadError: z.ZodNullable<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
/** State fetched on panel entry and after a user-triggered operation. */
|
|
71
|
+
export declare const marketStateSchema: z.ZodObject<{
|
|
72
|
+
profile: z.ZodString;
|
|
73
|
+
source: z.ZodEnum<{
|
|
74
|
+
npm: "npm";
|
|
75
|
+
local: "local";
|
|
76
|
+
}>;
|
|
77
|
+
catalogVersion: z.ZodNullable<z.ZodString>;
|
|
78
|
+
catalogError: z.ZodNullable<z.ZodString>;
|
|
79
|
+
plugins: z.ZodArray<z.ZodObject<{
|
|
80
|
+
name: z.ZodString;
|
|
81
|
+
displayName: z.ZodObject<{
|
|
82
|
+
zh: z.ZodString;
|
|
83
|
+
en: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
description: z.ZodString;
|
|
86
|
+
iconUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
availableVersion: z.ZodNullable<z.ZodString>;
|
|
88
|
+
installedVersion: z.ZodNullable<z.ZodString>;
|
|
89
|
+
installed: z.ZodBoolean;
|
|
90
|
+
enabled: z.ZodBoolean;
|
|
91
|
+
installable: z.ZodBoolean;
|
|
92
|
+
updatable: z.ZodBoolean;
|
|
93
|
+
removable: z.ZodBoolean;
|
|
94
|
+
loadError: z.ZodNullable<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
/** The browser approves a package and an exact catalog version, never a path or command. */
|
|
98
|
+
export declare const mutationSchema: z.ZodObject<{
|
|
99
|
+
kind: z.ZodEnum<{
|
|
100
|
+
install: "install";
|
|
101
|
+
update: "update";
|
|
102
|
+
remove: "remove";
|
|
103
|
+
}>;
|
|
104
|
+
packageName: z.ZodString;
|
|
105
|
+
version: z.ZodNullable<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
/** User-visible operation outcome; package-manager diagnostics stay on the Host. */
|
|
108
|
+
export declare const outcomeSchema: z.ZodObject<{
|
|
109
|
+
application: z.ZodEnum<{
|
|
110
|
+
applied: "applied";
|
|
111
|
+
"restart-required": "restart-required";
|
|
112
|
+
overridden: "overridden";
|
|
113
|
+
failed: "failed";
|
|
114
|
+
cancelled: "cancelled";
|
|
115
|
+
}>;
|
|
116
|
+
changed: z.ZodBoolean;
|
|
117
|
+
error: z.ZodNullable<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
export type Catalog = z.infer<typeof catalogSchema>;
|
|
120
|
+
export type CatalogEntry = z.infer<typeof catalogEntrySchema>;
|
|
121
|
+
export type MarketEntry = z.infer<typeof marketEntrySchema>;
|
|
122
|
+
export type MarketState = z.infer<typeof marketStateSchema>;
|
|
123
|
+
export type Mutation = z.infer<typeof mutationSchema>;
|
|
124
|
+
export type Outcome = z.infer<typeof outcomeSchema>;
|