@dsh-workbench/core 1.1.10 → 1.1.11

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.
@@ -6501,6 +6501,22 @@ function migrationFollowUp(input) {
6501
6501
  } : void 0;
6502
6502
  }
6503
6503
  //#endregion
6504
+ //#region src/shared/api/host/profile-dependencies.ts
6505
+ function dependencyReader(profileDir) {
6506
+ if (profileDir === null) return () => void 0;
6507
+ let dependencies;
6508
+ return (pkg) => {
6509
+ if (dependencies === void 0) try {
6510
+ const raw = JSON.parse(readFileSync(join(profileDir, "package.json"), "utf8")).dependencies;
6511
+ dependencies = typeof raw === "object" && raw !== null ? raw : {};
6512
+ } catch {
6513
+ dependencies = {};
6514
+ }
6515
+ const value = dependencies[pkg];
6516
+ return typeof value === "string" ? value : void 0;
6517
+ };
6518
+ }
6519
+ //#endregion
6504
6520
  //#region src/shared/api/host/bundle-routes.ts
6505
6521
  function registryOf(search) {
6506
6522
  const raw = param(search, "registry");
@@ -6564,6 +6580,7 @@ async function latestIfReleaseReady(supply, input) {
6564
6580
  async function workbenchVersion(supply, input) {
6565
6581
  const read = supply.readProfilePackage(input.dir, PLUGIN_ID);
6566
6582
  if (read === void 0) return void 0;
6583
+ const spec = dependencyReader(input.dir)(PLUGIN_ID);
6567
6584
  const registry = read.registry ?? input.fallback;
6568
6585
  const shell = input.shell;
6569
6586
  const queried = read.local === true || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
@@ -6586,7 +6603,9 @@ async function workbenchVersion(supply, input) {
6586
6603
  ...latest === void 0 ? {} : { latest },
6587
6604
  ...input.running === void 0 ? {} : { running: input.running },
6588
6605
  ...read.local === true ? { local: true } : {},
6589
- ...input.followUp === void 0 ? {} : { followUp: input.followUp }
6606
+ ...input.followUp === void 0 ? {} : { followUp: input.followUp },
6607
+ ...spec === void 0 ? {} : { spec },
6608
+ ...registry === void 0 || read.local === true ? {} : { registry }
6590
6609
  };
6591
6610
  }
6592
6611
  function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
@@ -6602,10 +6621,12 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
6602
6621
  const refusals = new Map((ctx.get("workbenchUnits")?.refusals() ?? []).filter((one) => one.unit !== "").map((one) => [one.unit, one.reasons]));
6603
6622
  const force = param(search, "force") === "1";
6604
6623
  const fallback = (await manager.registries())?.resolved ?? void 0;
6624
+ const dependencyOf = dependencyReader(dir);
6605
6625
  const modules = await Promise.all(found.map(async (module) => {
6606
6626
  const local = module.local === true;
6607
6627
  const fromRegistry = module.fromRegistry !== false;
6608
6628
  const registry = fromRegistry ? module.registry ?? fallback : void 0;
6629
+ const spec = dependencyOf(module.pkg);
6609
6630
  const latest = local || !fromRegistry || shell === void 0 || registry === void 0 ? void 0 : await supply.latestVersion({
6610
6631
  shell,
6611
6632
  name: module.pkg,
@@ -6642,7 +6663,9 @@ function moduleVersionsHandler(ctx, shell, running, selfUpdate) {
6642
6663
  local: true,
6643
6664
  latestUnavailable: "local"
6644
6665
  } : latest !== void 0 ? {} : { latestUnavailable: !fromRegistry ? "not-registry" : registry === void 0 ? "no-registry" : "probe-failed" },
6645
- ...refused === void 0 ? {} : { refused }
6666
+ ...refused === void 0 ? {} : { refused },
6667
+ ...spec === void 0 ? {} : { spec },
6668
+ ...registry === void 0 ? {} : { registry }
6646
6669
  };
6647
6670
  }));
6648
6671
  const selfUpdateNow = selfUpdate?.();
@@ -14646,22 +14669,6 @@ function transportOfSpec(spec) {
14646
14669
  };
14647
14670
  }
14648
14671
  //#endregion
14649
- //#region src/shared/api/host/profile-dependencies.ts
14650
- function dependencyReader(profileDir) {
14651
- if (profileDir === null) return () => void 0;
14652
- let dependencies;
14653
- return (pkg) => {
14654
- if (dependencies === void 0) try {
14655
- const raw = JSON.parse(readFileSync(join(profileDir, "package.json"), "utf8")).dependencies;
14656
- dependencies = typeof raw === "object" && raw !== null ? raw : {};
14657
- } catch {
14658
- dependencies = {};
14659
- }
14660
- const value = dependencies[pkg];
14661
- return typeof value === "string" ? value : void 0;
14662
- };
14663
- }
14664
- //#endregion
14665
14672
  //#region src/modules/panels/model/market-sources-act.ts
14666
14673
  function marketSourcesRoutes(store) {
14667
14674
  return { [MARKET_SOURCES_ROUTE]: async () => ({
@@ -16654,6 +16661,8 @@ async function installedPlugins(options) {
16654
16661
  ...release.latest === void 0 ? {} : { latest: release.latest }
16655
16662
  },
16656
16663
  ...entry.local === true ? { local: true } : {},
16664
+ ...entry.registry === void 0 ? {} : { registry: entry.registry },
16665
+ ...entry.installedAt === void 0 ? {} : { installedAt: entry.installedAt },
16657
16666
  ...pluginOnDisk(entry, ledger.pluginFiles) ? {} : { broken: true }
16658
16667
  });
16659
16668
  }
@@ -1,15 +1,13 @@
1
- import type { ReactNode, Translate } from '@dsh-workbench/shared';
1
+ import type { Translate } from '@dsh-workbench/shared';
2
2
  import type { UnitManifest } from '@dsh-workbench/shared';
3
3
  import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
4
4
  import type { MarketFreshness } from './market-freshness';
5
5
  import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
6
- import { type InstalledWorkbenchModule, type MarketRow, type MarketRowAction, type SharedRow } from './market-rows';
6
+ import { type InstalledWorkbenchModule } from './market-rows';
7
7
  import type { TitleResolve } from './market-names';
8
8
  import type { MarketMock } from './market-mock';
9
- import type { MarketFailure } from './market-row-types';
10
9
  import type { ModuleUpdateMap } from './market-rows';
11
10
  import type { WorkbenchSelfUpdate, WorkbenchVersion } from '../../../kernel/contract/bundle-install';
12
- import { type Pending } from './market-view-text';
13
11
  import type { VersionsCheck, VersionsPart } from '../market/use-module-versions';
14
12
  export interface MarketViewProps {
15
13
  readonly t: Translate;
@@ -38,23 +36,4 @@ export interface MarketViewProps {
38
36
  readonly defaults?: readonly string[] | undefined;
39
37
  readonly changed?: Readonly<Record<string, number>> | undefined;
40
38
  }
41
- export declare function MarketBody({ t, self, shown, pluginList, installedList, shared, pending, failed, notice, act, onConfirming, setDefault, boardBusy, checks, onRecheck, rechecking, runtimePluginMarket, }: {
42
- readonly t: Translate;
43
- readonly runtimePluginMarket?: boolean | undefined;
44
- readonly self: MarketRow | undefined;
45
- readonly shown: readonly MarketRow[];
46
- readonly pluginList: readonly MarketRow[];
47
- readonly installedList: readonly MarketRow[];
48
- readonly shared: readonly SharedRow[];
49
- readonly pending: Pending | null;
50
- readonly failed: MarketFailure | null;
51
- readonly notice: string | null;
52
- readonly act: (id: string, action: MarketRowAction) => Promise<void>;
53
- readonly onConfirming: (id: string | null) => void;
54
- readonly setDefault: (id: string, next: boolean) => Promise<void>;
55
- readonly boardBusy: boolean;
56
- readonly checks: Readonly<Record<VersionsPart, ReactNode>>;
57
- readonly onRecheck: () => void;
58
- readonly rechecking: boolean;
59
- }): JSX.Element;
60
39
  export declare function MarketView({ t, titleOf, manifests, installable, capabilities, runtimePluginMarket, freshness, onChanged, onPending, updates, modulesCheck, pluginsCheck, onCheck, installed, installedRead, workbench, selfUpdate, plugins, settling, installing, mock, defaults, changed, }: MarketViewProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ import type { ReactNode, Translate } from '@dsh-workbench/shared';
2
+ import type { MarketFailure, MarketRow, MarketRowAction } from './market-row-types';
3
+ import type { SharedRow } from './market-shared-rows';
4
+ import type { Pending } from './market-view-text';
5
+ import type { VersionsPart } from '../market/use-module-versions';
6
+ export declare function MarketBody({ t, self, shown, pluginList, installedList, shared, pending, failed, notice, act, onConfirming, setDefault, boardBusy, checks, onRecheck, rechecking, runtimePluginMarket, onOpenDetail, }: {
7
+ readonly t: Translate;
8
+ readonly runtimePluginMarket?: boolean | undefined;
9
+ readonly self: MarketRow | undefined;
10
+ readonly shown: readonly MarketRow[];
11
+ readonly pluginList: readonly MarketRow[];
12
+ readonly installedList: readonly MarketRow[];
13
+ readonly shared: readonly SharedRow[];
14
+ readonly pending: Pending | null;
15
+ readonly failed: MarketFailure | null;
16
+ readonly notice: string | null;
17
+ readonly act: (id: string, action: MarketRowAction) => Promise<void>;
18
+ readonly onConfirming: (id: string | null) => void;
19
+ readonly setDefault: (id: string, next: boolean) => Promise<void>;
20
+ readonly boardBusy: boolean;
21
+ readonly checks: Readonly<Record<VersionsPart, ReactNode>>;
22
+ readonly onRecheck: () => void;
23
+ readonly rechecking: boolean;
24
+ readonly onOpenDetail?: ((id: string) => void) | undefined;
25
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { MarketRow } from './market-row-types';
3
+ export interface MarketDetailFact {
4
+ readonly labelKey: string;
5
+ readonly value: string;
6
+ readonly code?: boolean;
7
+ }
8
+ export declare function isDirectSourceSpec(spec: string): boolean;
9
+ export declare function localPathOf(row: MarketRow): string | undefined;
10
+ export declare function installSourceOf(row: MarketRow, t: Translate): {
11
+ readonly text: string;
12
+ readonly code: boolean;
13
+ };
14
+ export declare function marketDetailFacts(row: MarketRow, t: Translate): readonly MarketDetailFact[];
@@ -0,0 +1,20 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { MarketFailure, MarketRow, MarketRowAction } from './market-row-types';
3
+ import type { Pending } from './market-view-text';
4
+ export declare function MarketDetailPage({ t, row, pending, failure, notice, boardBusy, confirming, confirmingRow, rowById, onBack, onConfirming, onDefault, onAct, onRecheck, rechecking, }: {
5
+ readonly t: Translate;
6
+ readonly row: MarketRow;
7
+ readonly pending: Pending | null;
8
+ readonly failure: MarketFailure | null;
9
+ readonly notice: string | null;
10
+ readonly boardBusy?: boolean | undefined;
11
+ readonly confirming: string | null;
12
+ readonly confirmingRow: MarketRow | undefined;
13
+ readonly rowById: ReadonlyMap<string, MarketRow>;
14
+ readonly onBack: () => void;
15
+ readonly onConfirming: (id: string | null) => void;
16
+ readonly onDefault: (id: string, next: boolean) => Promise<void>;
17
+ readonly onAct: (id: string, action: MarketRowAction) => Promise<void>;
18
+ readonly onRecheck: () => void;
19
+ readonly rechecking: boolean;
20
+ }): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { MarketFailure, MarketRow, MarketRowAction } from './market-row-types';
3
+ import type { Pending } from './market-view-text';
4
+ export interface MarketDetailProps {
5
+ readonly t: Translate;
6
+ readonly row: MarketRow;
7
+ readonly pending: Pending | null;
8
+ readonly failure: MarketFailure | null;
9
+ readonly notice: string | null;
10
+ readonly boardBusy?: boolean | undefined;
11
+ readonly onBack: () => void;
12
+ readonly onRequest: (action: MarketRowAction) => void;
13
+ readonly onDefault?: ((next: boolean) => void) | undefined;
14
+ readonly onRecheck: () => void;
15
+ readonly rechecking: boolean;
16
+ }
17
+ export declare function MarketDetail({ t, row, pending, failure, notice, boardBusy, onBack, onRequest, onDefault, onRecheck, rechecking, }: MarketDetailProps): JSX.Element;
@@ -22,6 +22,9 @@ export interface ModuleUpdate {
22
22
  readonly local?: boolean;
23
23
  readonly blocked?: ModuleUpdateBlock;
24
24
  readonly market?: MarketInstalledModule;
25
+ readonly pkg?: string;
26
+ readonly spec?: string;
27
+ readonly registry?: string;
25
28
  }
26
29
  export interface MarketFollowUp {
27
30
  readonly id: string;
@@ -53,4 +56,8 @@ export interface MarketRow {
53
56
  readonly defaultChanged?: number;
54
57
  readonly broken?: boolean;
55
58
  readonly followUp?: MarketFollowUp;
59
+ readonly spec?: string;
60
+ readonly registry?: string;
61
+ readonly installedAt?: string;
62
+ readonly removeViaBundle?: boolean;
56
63
  }
@@ -25,6 +25,8 @@ export interface InstalledWorkbenchModule {
25
25
  readonly refused?: readonly string[] | undefined;
26
26
  readonly clientRefused?: readonly string[] | undefined;
27
27
  readonly market?: MarketInstalledModule | undefined;
28
+ readonly spec?: string | undefined;
29
+ readonly registry?: string | undefined;
28
30
  }
29
31
  export declare function withClientRefusals(modules: readonly InstalledWorkbenchModule[], refusals: readonly {
30
32
  readonly unit: string;
@@ -0,0 +1,33 @@
1
+ import type { ReactNode, Translate } from '@dsh-workbench/shared';
2
+ import type { MarketFailure, MarketRow, MarketRowAction } from './market-row-types';
3
+ import type { SharedRow } from './market-shared-rows';
4
+ import type { VersionsPart } from '../market/use-module-versions';
5
+ import type { Pending } from './market-view-text';
6
+ export declare function MarketSceneView({ t, runtimePluginMarket, self, shown, pluginList, installedList, shared, pending, failed, notice, act, onConfirming, setDefault, boardBusy, checks, onRecheck, rechecking, onOpenDetail, detailRow, confirming, confirmingRow, rowById, settled, nothing, settlingSize, onBack, }: {
7
+ readonly t: Translate;
8
+ readonly runtimePluginMarket?: boolean | undefined;
9
+ readonly self: MarketRow | undefined;
10
+ readonly shown: readonly MarketRow[];
11
+ readonly pluginList: readonly MarketRow[];
12
+ readonly installedList: readonly MarketRow[];
13
+ readonly shared: readonly SharedRow[];
14
+ readonly pending: Pending | null;
15
+ readonly failed: MarketFailure | null;
16
+ readonly notice: string | null;
17
+ readonly act: (id: string, action: MarketRowAction) => Promise<void>;
18
+ readonly onConfirming: (id: string | null) => void;
19
+ readonly setDefault: (id: string, next: boolean) => Promise<void>;
20
+ readonly boardBusy: boolean;
21
+ readonly checks: Readonly<Record<VersionsPart, ReactNode>>;
22
+ readonly onRecheck: () => void;
23
+ readonly rechecking: boolean;
24
+ readonly onOpenDetail: (id: string) => void;
25
+ readonly detailRow: MarketRow | undefined;
26
+ readonly confirming: string | null;
27
+ readonly confirmingRow: MarketRow | undefined;
28
+ readonly rowById: ReadonlyMap<string, MarketRow>;
29
+ readonly settled: boolean;
30
+ readonly nothing: boolean;
31
+ readonly settlingSize: number;
32
+ readonly onBack: () => void;
33
+ }): JSX.Element;
@@ -1,9 +1,27 @@
1
1
  import type { ReactNode, Translate } from '@dsh-workbench/shared';
2
- import type { MarketFailure, MarketRow } from './market-row-types';
3
- import { type MarketRowAction } from './market-rows';
4
- import type { MarketSectionIcon } from './market-section-icon';
2
+ import type { MarketFailure, MarketRow, MarketRowAction } from './market-row-types';
5
3
  import { type Pending } from './market-view-text';
6
- export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, headAction, keepHead, onRecheck, rechecking, }: {
4
+ import type { MarketSectionIcon } from './market-section-icon';
5
+ export declare function MarketLineStatus({ t, row, quiet, }: {
6
+ readonly t: Translate;
7
+ readonly row: MarketRow;
8
+ readonly quiet: boolean;
9
+ }): JSX.Element | null;
10
+ export declare function MarketRowFailure({ t, failure, onRecheck, rechecking, }: {
11
+ readonly t: Translate;
12
+ readonly failure: MarketFailure | null;
13
+ readonly onRecheck: () => void;
14
+ readonly rechecking: boolean;
15
+ }): JSX.Element | null;
16
+ export declare function MarketRowControls({ t, row, pending, boardBusy, onRequest, onDefault, }: {
17
+ readonly t: Translate;
18
+ readonly row: MarketRow;
19
+ readonly pending: Pending | null;
20
+ readonly boardBusy?: boolean | undefined;
21
+ readonly onRequest: (action: MarketRowAction) => void;
22
+ readonly onDefault?: ((next: boolean) => void) | undefined;
23
+ }): JSX.Element;
24
+ export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, onOpenDetail, boardBusy, headAction, keepHead, onRecheck, rechecking, }: {
7
25
  readonly t: Translate;
8
26
  readonly titleKey?: string;
9
27
  readonly icon?: MarketSectionIcon;
@@ -12,6 +30,7 @@ export declare function MarketSection({ t, titleKey, icon, rows, pending, failur
12
30
  readonly failureOf: (id: string) => MarketFailure | null;
13
31
  readonly act: (id: string, action: MarketRowAction) => Promise<void>;
14
32
  readonly onDefault?: ((id: string, next: boolean) => void) | undefined;
33
+ readonly onOpenDetail?: ((id: string) => void) | undefined;
15
34
  readonly boardBusy?: boolean | undefined;
16
35
  readonly confirmActions: readonly MarketRowAction[];
17
36
  readonly onConfirming: (id: string | null) => void;
@@ -34,6 +34,7 @@ export declare function heldIdOf(pending: Pending | null, held: HeldRow | undefi
34
34
  export declare function pinnedRowOf(pending: Pending | null, held: HeldRow | undefined): MarketRow | undefined;
35
35
  export declare function withPinnedRow(rows: readonly MarketRow[], pinned: MarketRow | undefined): MarketRow[];
36
36
  export declare function marketFootVisible(shown: readonly MarketRow[], installed: readonly MarketRow[]): boolean;
37
+ export declare function marketRowMap(shown: readonly MarketRow[], self: MarketRow | undefined, installed: readonly MarketRow[], plugins: readonly MarketRow[]): ReadonlyMap<string, MarketRow>;
37
38
  export declare function marketNamesOf(t: Translate, modules: readonly NameSource[], titleOf: TitleResolve, mocked: boolean): MarketNameMap;
38
39
  export interface HeldRowControl {
39
40
  readonly held: HeldRow | undefined;
@@ -6,6 +6,8 @@ export interface InstalledPlugin {
6
6
  readonly latest?: string;
7
7
  readonly local?: boolean;
8
8
  readonly broken?: boolean;
9
+ readonly registry?: string;
10
+ readonly installedAt?: string;
9
11
  }
10
12
  export interface InstalledPluginsPayload {
11
13
  readonly plugins: readonly InstalledPlugin[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "个人工作台:Agent 工作台(左栏 + 常驻对话 + 自研右侧数据面板)。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
@@ -76,7 +76,7 @@
76
76
  }
77
77
  },
78
78
  "devDependencies": {
79
- "@arch-guard/core": "^0.11.1",
79
+ "@arch-guard/core": "^0.11.2",
80
80
  "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
81
81
  "@types/node": "^24.19.0",
82
82
  "@types/proper-lockfile": "^4.1.4",
@@ -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.10",
104
- "@dsh-workbench/adapters-default": "1.1.10"
103
+ "@dsh-workbench/shared": "1.1.11",
104
+ "@dsh-workbench/adapters-default": "1.1.11"
105
105
  },
106
106
  "license": "MIT",
107
107
  "repository": {