@dsh-workbench/core 0.2.1 → 0.2.3

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.
@@ -0,0 +1,42 @@
1
+ import type { UnitCapability } from '../../../shared/api/host/probe-units';
2
+ import type { BundleManager } from '../../../shared/api/host/bundle-manager';
3
+ import type { InstalledModule, ProfileModule, ProfilePackage } from '../../../shared/api/host/installed-module';
4
+ import type { PluginSource, UnitManifest } from '@dsh-workbench/shared';
5
+ import { type PluginLedger } from '../model/plugin-ledger';
6
+ export declare function unit(id: string, plugin: string, source?: PluginSource): UnitManifest;
7
+ export declare function libUnit(id: string, libName: string): UnitManifest;
8
+ export declare function cleanupRoots(): void;
9
+ export declare function ledgerWith(entries: readonly {
10
+ pkg: string;
11
+ name?: string;
12
+ registry?: string;
13
+ }[]): PluginLedger;
14
+ export declare function harness(options: {
15
+ manifests: UnitManifest[];
16
+ statuses?: Readonly<Record<string, UnitCapability['status']>>;
17
+ withShell?: boolean;
18
+ bundles?: BundleManager;
19
+ installed?: (pkg: string) => InstalledModule;
20
+ modules?: () => readonly ProfileModule[];
21
+ workbench?: (pkg: string) => ProfilePackage | undefined;
22
+ ledger?: PluginLedger;
23
+ references?: {
24
+ readonly trustworthy: boolean;
25
+ };
26
+ npmLatest?: string;
27
+ npmMissing?: readonly string[];
28
+ }): {
29
+ registered: {
30
+ name: string;
31
+ execute: (args: unknown) => Promise<unknown>;
32
+ }[];
33
+ fake: {
34
+ shell: import("@dsh-workbench/shared").DshShell;
35
+ calls: import("@dsh-workbench/shared/testing").ShellCall[];
36
+ peak: () => number;
37
+ commands: () => string[];
38
+ };
39
+ disposers: (() => void)[];
40
+ };
41
+ export declare function fakeBundles(over?: Partial<BundleManager>): BundleManager;
42
+ export declare function call(h: ReturnType<typeof harness>, args: unknown): Promise<Record<string, unknown>>;
@@ -21,6 +21,11 @@ export interface BundleInstallDeps {
21
21
  readonly runAll: (commands: readonly PluginSourceCommand[]) => Promise<void>;
22
22
  readonly supplyAfter: (module: InstalledModule, change: BundleChange) => Promise<BundleSupply>;
23
23
  readonly rememberSource: (manager: BundleManager, pkg: string, registry: string | undefined) => Promise<void>;
24
+ readonly remove?: ((pkg: string) => Promise<BundleChange>) | undefined;
24
25
  }
25
26
  export declare function installDshBundle(deps: Omit<BundleInstallDeps, 'spec' | 'options'>, spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
27
+ export type ReplaceBundleDeps = Omit<BundleInstallDeps, 'spec' | 'options' | 'remove'> & {
28
+ readonly remove: (pkg: string) => Promise<BundleChange>;
29
+ };
30
+ export declare function replaceDshBundle(deps: ReplaceBundleDeps, spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
26
31
  export declare function installRouted(deps: BundleInstallDeps): Promise<BundleInstallOutcome>;
@@ -1,3 +1,5 @@
1
1
  export declare const DIY_PRESET_ID = "workbench-diy";
2
+ export declare const WORKSHOP_RELATIVE = "workbench/diy";
2
3
  export declare const WORKSHOP_TITLE = "\u5DE5\u4F5C\u53F0DIY";
3
4
  export declare const WORKSHOP_PAST_TITLES: readonly string[];
5
+ export declare function isWorkshopPath(path: string): boolean;
@@ -2,5 +2,6 @@ import type { DshHostContext, DshShell } from '@dsh-workbench/shared';
2
2
  import { type RouteHandler } from '@dsh-workbench/shared/host';
3
3
  export declare function bundleRegistriesHandler(ctx: DshHostContext): RouteHandler;
4
4
  export declare function resetRefusalLog(): void;
5
+ export declare function resetHoldLog(): void;
5
6
  export declare function moduleVersionsHandler(ctx: DshHostContext, shell: DshShell | undefined): RouteHandler;
6
7
  export declare function bundleInspectHandler(ctx: DshHostContext): RouteHandler;
@@ -1,3 +1,2 @@
1
1
  import type { DshHostContext } from '@dsh-workbench/shared';
2
- export declare const WORKSHOP_RELATIVE = "workbench/diy";
3
2
  export declare function workshopPathOf(ctx: DshHostContext): string | null;
@@ -9,6 +9,12 @@ export declare function latestVersion(options: {
9
9
  registry: string;
10
10
  force?: boolean;
11
11
  }): Promise<string | undefined>;
12
+ export declare function missingReleaseParts(options: {
13
+ shell: DshShell;
14
+ registry: string;
15
+ version: string;
16
+ force?: boolean;
17
+ }): Promise<readonly string[]>;
12
18
  export declare function probeRelease(options: {
13
19
  shell: DshShell;
14
20
  package: string;
package/docs/HANDOFF.md CHANGED
@@ -242,6 +242,10 @@ pnpm release:dry # 同上,但 publish 只 dry-run:零上传,结束
242
242
  落到脚本顶部的 `REGISTRY`(npmjs);本仓现在这 4 个包都发公网,命令一律带 `--access public`。
243
243
  注意 `inspectTarget` **只查 npmjs** —— "这个版本发出去没有"对发内网源的包看不准;
244
244
  - **什么顺序** = pnpm 自己拓扑排序(`shared` → `core` → 用到它们的模块);
245
+ - **市场什么时候说"有新版本"** = 要**整份发布铺齐**才亮:`core` / `shared` / `module-tools` 三包
246
+ 在同一版上都拉得到才算数([ADR-0043](../../../docs/adr/0043-version-prompt-waits-for-the-whole-release.md))。
247
+ 所以中断续跑那段窗口里、或镜像还没同步全时,市场**不会**提示更新 —— 铺齐后等 10 分钟,
248
+ 或让用户点市场页那颗「重新检查」即可(用户主动的时机一路 `force`,不等缓存);
245
249
  - **发什么** = pnpm 按各包 `files` / `.gitignore` 打包;**打包清单没人替你核**(见上一章
246
250
  「只能自己盯」)。要看清单用 `dsh-wb-module publish`:它只 dry-run、打印清单,不发布。
247
251
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "个人工作台:Agent 工作台外壳(左栏 + 常驻对话 + 自研右侧数据面板)。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
@@ -87,7 +87,7 @@
87
87
  "access": "public"
88
88
  },
89
89
  "dependencies": {
90
- "@dsh-workbench/shared": "0.2.1"
90
+ "@dsh-workbench/shared": "0.2.3"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "node scripts/build.mjs && node scripts/build-types.mjs",