@dsh-workbench/core 1.1.2 → 1.1.4
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.js +1094 -520
- package/dist/client/client.body.js +1094 -520
- package/dist/client/index.js +946 -372
- package/dist/host/index.js +322 -9
- package/dist/types/app/layouts/market/discover-confirm.d.ts +4 -3
- package/dist/types/app/layouts/market/discover-detail.d.ts +1 -0
- package/dist/types/app/layouts/market/discover-installing.d.ts +8 -0
- package/dist/types/app/layouts/market/discover-rows.d.ts +4 -2
- package/dist/types/app/layouts/market/discover-states.d.ts +6 -0
- package/dist/types/app/layouts/market/discover-transport.d.ts +7 -0
- package/dist/types/app/layouts/market/discover-versions.d.ts +2 -1
- package/dist/types/app/layouts/market/market-check.d.ts +10 -0
- package/dist/types/app/layouts/market/market-header.d.ts +1 -3
- package/dist/types/app/layouts/market/use-discover.d.ts +10 -2
- package/dist/types/app/layouts/market/use-git-transport.d.ts +19 -0
- package/dist/types/app/layouts/market/use-module-versions.d.ts +4 -0
- package/dist/types/app/layouts/market/use-settling-modules.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +3 -1
- package/dist/types/app/layouts/rightbar/market-freshness.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/market-row-types.d.ts +4 -1
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +2 -0
- package/dist/types/app/layouts/rightbar/market-section.d.ts +4 -2
- package/dist/types/app/layouts/rightbar/use-market-default.d.ts +12 -0
- package/dist/types/kernel/contract/market-index.d.ts +2 -2
- package/dist/types/modules/panels/model/market-installed.d.ts +19 -0
- package/dist/types/modules/panels/model/market-installed.test.d.ts +1 -0
- package/dist/types/modules/panels/model/market-route.d.ts +1 -0
- package/dist/types/shared/api/host/git-exec.d.ts +2 -0
- package/dist/types/shared/api/host/git-probe.d.ts +9 -0
- package/dist/types/shared/api/host/git-routes.d.ts +3 -0
- package/dist/types/shared/api/host/market-sources-store.d.ts +2 -1
- package/dist/types/shared/api/host/profile-dependencies.d.ts +1 -0
- package/dist/types/shared/hooks/market-queries.d.ts +3 -1
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModuleUpdateBlock } from '../../../kernel/contract/bundle-install';
|
|
2
|
-
|
|
2
|
+
import type { MarketInstalledModule } from '../../../kernel/contract/market-index';
|
|
3
|
+
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'install-version' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin' | 'update-workbench' | 'migrate-workbench' | 'dismiss-followup';
|
|
3
4
|
export type MarketState = 'checking' | 'installed' | 'inactive' | 'unusable' | 'broken' | 'outdated' | 'pending-restart' | 'pending-followup' | 'missing' | 'unchecked' | 'unknown';
|
|
4
5
|
export interface MarketNote {
|
|
5
6
|
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.needCommands' | 'panels.market.needBinary' | 'panels.market.needLib' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
|
|
@@ -12,6 +13,7 @@ export interface ModuleUpdate {
|
|
|
12
13
|
readonly latest?: string;
|
|
13
14
|
readonly local?: boolean;
|
|
14
15
|
readonly blocked?: ModuleUpdateBlock;
|
|
16
|
+
readonly market?: MarketInstalledModule;
|
|
15
17
|
}
|
|
16
18
|
export interface MarketFollowUp {
|
|
17
19
|
readonly id: string;
|
|
@@ -35,6 +37,7 @@ export interface MarketRow {
|
|
|
35
37
|
readonly latest?: string;
|
|
36
38
|
};
|
|
37
39
|
readonly moduleUpdate?: ModuleUpdate;
|
|
40
|
+
readonly market?: MarketInstalledModule;
|
|
38
41
|
readonly pkg?: string;
|
|
39
42
|
readonly local?: boolean;
|
|
40
43
|
readonly versionLabel?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ModuleUpdateBlock, ModuleVersion } from '../../../kernel/contract/bundle-install';
|
|
2
|
+
import type { MarketInstalledModule } from '../../../kernel/contract/market-index';
|
|
2
3
|
import type { Translate, UnitManifest, UnitTitle } from '@dsh-workbench/shared';
|
|
3
4
|
import type { MarketNameMap } from './market-names';
|
|
4
5
|
import type { MarketRow, MarketRowAction, MarketState, ModuleUpdate } from './market-row-types';
|
|
@@ -21,6 +22,7 @@ export interface InstalledWorkbenchModule {
|
|
|
21
22
|
readonly local?: boolean | undefined;
|
|
22
23
|
readonly refused?: readonly string[] | undefined;
|
|
23
24
|
readonly clientRefused?: readonly string[] | undefined;
|
|
25
|
+
readonly market?: MarketInstalledModule | undefined;
|
|
24
26
|
}
|
|
25
27
|
export declare function withClientRefusals(modules: readonly InstalledWorkbenchModule[], refusals: readonly {
|
|
26
28
|
readonly unit: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Translate } from '@dsh-workbench/shared';
|
|
1
|
+
import type { ReactNode, Translate } from '@dsh-workbench/shared';
|
|
2
2
|
import type { MarketRow } from './market-row-types';
|
|
3
3
|
import { type MarketRowAction } from './market-rows';
|
|
4
4
|
import type { MarketSectionIcon } from './market-section-icon';
|
|
5
5
|
import { type Pending } from './market-view-text';
|
|
6
|
-
export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, }: {
|
|
6
|
+
export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, headAction, keepHead, }: {
|
|
7
7
|
readonly t: Translate;
|
|
8
8
|
readonly titleKey?: string;
|
|
9
9
|
readonly icon?: MarketSectionIcon;
|
|
@@ -15,4 +15,6 @@ export declare function MarketSection({ t, titleKey, icon, rows, pending, failur
|
|
|
15
15
|
readonly boardBusy?: boolean | undefined;
|
|
16
16
|
readonly confirmActions: readonly MarketRowAction[];
|
|
17
17
|
readonly onConfirming: (id: string | null) => void;
|
|
18
|
+
readonly headAction?: ReactNode;
|
|
19
|
+
readonly keepHead?: boolean;
|
|
18
20
|
}): JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
export interface MarketDefaultSeat {
|
|
3
|
+
readonly pending: boolean;
|
|
4
|
+
setDefault(id: string, next: boolean): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare function useMarketDefault(input: {
|
|
7
|
+
readonly t: Translate;
|
|
8
|
+
readonly mocked: boolean;
|
|
9
|
+
readonly defaults: readonly string[];
|
|
10
|
+
readonly changed: Readonly<Record<string, number>>;
|
|
11
|
+
readonly setNotice: (next: string | null) => void;
|
|
12
|
+
}): MarketDefaultSeat;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MARKET_DISCOVER_ROUTE, MARKET_DOC_ROUTE, MARKET_INDEX_FORMAT, MARKET_INDEX_PATH, MARKET_PUBLISH_PREVIEW_ROUTE, MARKET_SOURCES_RESOURCE, MARKET_SOURCES_ROUTE, MARKET_WORKBENCH_LABEL, } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
2
|
-
export type { DiscoverCompat, DiscoverDoc, DiscoverDocKind, DiscoverEntry, DiscoverFilter, DiscoverInstallState, DiscoverPayload, DiscoverProblem, DiscoverSourceRow, DiscoverState, DiscoverVersionRow, IndexSourceSpec, MarketClaim, MarketIndex, MarketIndexCategory, MarketIndexEngines, MarketIndexEntry, MarketIndexEntryMetadata, MarketIndexGitSource, MarketIndexLabel, MarketIndexMetadata, MarketIndexNpmSource, MarketIndexParse, MarketIndexProblem, MarketIndexProblemKind, MarketIndexSortKey, MarketIndexSource, MarketIndexVersion, MarketLocalizedText, MarketPublishDestination, MarketSourceConfig, MarketSourceKind, MarketSourcePolicy, MarketSourcesAction, MarketSourcesPayload, PublishChangelog, PublishPreview, } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
1
|
+
export { MARKET_DISCOVER_ROUTE, MARKET_DOC_ROUTE, MARKET_GIT_PROBE_ROUTE, MARKET_INSTALLED_ROUTE, MARKET_INDEX_FORMAT, MARKET_INDEX_PATH, MARKET_PUBLISH_PREVIEW_ROUTE, MARKET_SOURCES_RESOURCE, MARKET_SOURCES_ROUTE, MARKET_WORKBENCH_LABEL, } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
2
|
+
export type { DiscoverCompat, DiscoverDoc, DiscoverDocKind, DiscoverEntry, DiscoverFilter, DiscoverInstallState, DiscoverPayload, DiscoverProblem, DiscoverSourceRow, DiscoverState, DiscoverVersionRow, GitProbePayload, GitProbeStatus, GitTransportKind, MarketInstalledModule, MarketInstalledPayload, IndexSourceSpec, MarketClaim, MarketIndex, MarketIndexCategory, MarketIndexEngines, MarketIndexEntry, MarketIndexEntryMetadata, MarketIndexGitSource, MarketIndexLabel, MarketIndexMetadata, MarketIndexNpmSource, MarketIndexParse, MarketIndexProblem, MarketIndexProblemKind, MarketIndexSortKey, MarketIndexSource, MarketIndexVersion, MarketLocalizedText, MarketPublishDestination, MarketSourceConfig, MarketSourceKind, MarketSourcePolicy, MarketSourcesAction, MarketSourcesPayload, PublishChangelog, PublishPreview, } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GitTransportKind, MarketIndex, MarketInstalledModule, MarketInstalledPayload, MarketSourceConfig } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
2
|
+
import type { RouteTable } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { ProfileModule } from '@dsh-workbench/shared/host';
|
|
4
|
+
import type { GitProbeStatus } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
5
|
+
export interface InstalledIndexInput {
|
|
6
|
+
readonly sources: readonly MarketSourceConfig[];
|
|
7
|
+
readonly cached: (source: MarketSourceConfig) => MarketIndex | undefined;
|
|
8
|
+
readonly modules: readonly ProfileModule[];
|
|
9
|
+
readonly dependencyOf: (pkg: string) => string | undefined;
|
|
10
|
+
readonly isNewer: (latest: string, installed: string) => boolean;
|
|
11
|
+
readonly probe?: ((url: string) => Promise<GitProbeStatus>) | undefined;
|
|
12
|
+
readonly preferred?: ((host: string) => GitTransportKind | undefined) | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function installedFromIndexes(input: InstalledIndexInput): Promise<readonly MarketInstalledModule[]>;
|
|
15
|
+
export declare function marketInstalledRoutes(read: () => MarketInstalledPayload | Promise<MarketInstalledPayload>): RouteTable;
|
|
16
|
+
export declare function transportOfSpec(spec: string): {
|
|
17
|
+
readonly host: string;
|
|
18
|
+
readonly kind: GitTransportKind;
|
|
19
|
+
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -25,6 +25,7 @@ export interface BundleInstallDeps {
|
|
|
25
25
|
readonly rememberSource: (manager: BundleManager, pkg: string, registry: string | undefined) => Promise<void>;
|
|
26
26
|
readonly remove?: ((pkg: string) => Promise<BundleChange>) | undefined;
|
|
27
27
|
}
|
|
28
|
+
export declare function bundleNameOf(change: BundleChange, spec: string): string;
|
|
28
29
|
export declare function installDshBundle(deps: Omit<BundleInstallDeps, 'spec' | 'options'>, spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
29
30
|
export type ReplaceBundleDeps = Omit<BundleInstallDeps, 'spec' | 'options' | 'remove'> & {
|
|
30
31
|
readonly remove: (pkg: string) => Promise<BundleChange>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
+
import type { GitProbePayload, GitProbeStatus } from '../../../kernel/contract/market-index';
|
|
3
|
+
export declare function classifyGitProbe(stderr: string, timedOut: boolean): GitProbeStatus;
|
|
4
|
+
export declare function probeGitAddress(shell: DshShell, url: string, options?: {
|
|
5
|
+
readonly timeoutMs?: number;
|
|
6
|
+
}): Promise<GitProbePayload>;
|
|
7
|
+
export declare function probeGitAddressCached(shell: DshShell, url: string, options?: {
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
}): Promise<GitProbePayload>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MarketSourcesAction, MarketSourcesPayload } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
1
|
+
import type { GitTransportKind, MarketSourcesAction, MarketSourcesPayload } from '@dsh-workbench/shared/contract/protocol/market-index';
|
|
2
2
|
export type MarketSourcesWrite = Exclude<MarketSourcesAction, {
|
|
3
3
|
readonly action: 'init';
|
|
4
4
|
} | {
|
|
@@ -7,6 +7,7 @@ export type MarketSourcesWrite = Exclude<MarketSourcesAction, {
|
|
|
7
7
|
export interface MarketSourcesStore {
|
|
8
8
|
read(): MarketSourcesPayload;
|
|
9
9
|
apply(action: MarketSourcesWrite): Promise<MarketSourcesPayload>;
|
|
10
|
+
rememberTransport(host: string, kind: GitTransportKind): Promise<void>;
|
|
10
11
|
}
|
|
11
12
|
export interface MarketSourcesStoreOptions {
|
|
12
13
|
readonly root: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dependencyReader(profileDir: string | null): (pkg: string) => string | undefined;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ApiResponse } from '@dsh-workbench/shared';
|
|
2
|
-
import { type DiscoverDoc, type DiscoverDocKind, type DiscoverPayload, type MarketSourcesPayload, type PublishPreview } from '../../kernel/contract/market-index';
|
|
2
|
+
import { type DiscoverDoc, type DiscoverDocKind, type DiscoverPayload, type GitProbePayload, type MarketInstalledPayload, type MarketSourcesPayload, type PublishPreview } from '../../kernel/contract/market-index';
|
|
3
3
|
export declare function readMarketDiscover(options?: {
|
|
4
4
|
readonly force?: boolean;
|
|
5
5
|
}): Promise<ApiResponse<DiscoverPayload>>;
|
|
6
6
|
export declare function readMarketSources(): Promise<ApiResponse<MarketSourcesPayload>>;
|
|
7
|
+
export declare function readGitProbe(url: string): Promise<ApiResponse<GitProbePayload>>;
|
|
8
|
+
export declare function readMarketInstalled(): Promise<ApiResponse<MarketInstalledPayload>>;
|
|
7
9
|
export declare function readMarketDoc(name: string, version: string, kind: DiscoverDocKind): Promise<ApiResponse<{
|
|
8
10
|
readonly doc: DiscoverDoc;
|
|
9
11
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "个人工作台:Agent 工作台(左栏 + 常驻对话 + 自研右侧数据面板)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"proper-lockfile": "^4.1.2",
|
|
101
101
|
"which": "^7.0.0",
|
|
102
102
|
"write-file-atomic": "^8.0.0",
|
|
103
|
-
"@dsh-workbench/shared": "1.1.
|
|
104
|
-
"@dsh-workbench/adapters-default": "1.1.
|
|
103
|
+
"@dsh-workbench/shared": "1.1.4",
|
|
104
|
+
"@dsh-workbench/adapters-default": "1.1.4"
|
|
105
105
|
},
|
|
106
106
|
"license": "MIT",
|
|
107
107
|
"repository": {
|