@dsh-workbench/core 1.1.9 → 1.1.10

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.
@@ -16,6 +16,7 @@ export interface MarketDiscoverOptions {
16
16
  readonly docs: MarketDocReader;
17
17
  readonly modules: () => readonly ProfileModule[];
18
18
  readonly defaultRegistry: () => Promise<string | undefined>;
19
+ readonly profilePath?: string | undefined;
19
20
  readonly shell?: DshShell | undefined;
20
21
  readonly shellVersion?: string | undefined;
21
22
  readonly fetchImpl?: ((url: string, init: RequestInit) => Promise<Response>) | undefined;
@@ -1,14 +1,14 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
1
  import type { PublishPreview } from '@dsh-workbench/shared/contract/protocol/market-index';
2
+ import type { GitRunner } from './git-process';
3
3
  export interface PublishModuleFact {
4
4
  readonly dir: string;
5
5
  readonly name: string;
6
6
  readonly author: string;
7
7
  }
8
8
  export declare function moduleFactOf(root: string | null | undefined, unit: string): PublishModuleFact | null;
9
- export declare function localGitIdentityOf(shell: DshShell | undefined, dir: string): Promise<string | undefined>;
10
- export declare function lastCommitAuthorOf(shell: DshShell | undefined, dir: string): Promise<string | undefined>;
11
- export declare function inferredAuthorOf(root: string | null | undefined, unit: string, shell: DshShell | undefined): Promise<string | undefined>;
9
+ export declare function localGitIdentityOf(dir: string, runGit?: GitRunner): Promise<string | undefined>;
10
+ export declare function lastCommitAuthorOf(dir: string, runGit?: GitRunner): Promise<string | undefined>;
11
+ export declare function inferredAuthorOf(root: string | null | undefined, unit: string, runGit?: GitRunner): Promise<string | undefined>;
12
12
  export declare function publishPreviewOf(root: string | null | undefined, unit: string, options?: {
13
13
  readonly version?: string | undefined;
14
14
  readonly author?: string | undefined;
@@ -1,2 +1,3 @@
1
+ export declare const GIT_NO_PROMPT_ENV: Readonly<Record<string, string>>;
1
2
  export declare function gitNoPromptPrefix(): string;
2
3
  export declare function withoutAskpassNoise(text: string): string;
@@ -1,9 +1,9 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
1
  import type { GitProbePayload, GitProbeStatus } from '../../../kernel/contract/market-index';
2
+ import type { GitRunner } from './git-process.js';
3
3
  export declare function classifyGitProbe(stderr: string, timedOut: boolean): GitProbeStatus;
4
- export declare function probeGitAddress(shell: DshShell, url: string, options?: {
4
+ export interface GitProbeOptions {
5
5
  readonly timeoutMs?: number;
6
- }): Promise<GitProbePayload>;
7
- export declare function probeGitAddressCached(shell: DshShell, url: string, options?: {
8
- readonly timeoutMs?: number;
9
- }): Promise<GitProbePayload>;
6
+ readonly runGit?: GitRunner;
7
+ }
8
+ export declare function probeGitAddress(url: string, options?: GitProbeOptions): Promise<GitProbePayload>;
9
+ export declare function probeGitAddressCached(url: string, options?: GitProbeOptions): Promise<GitProbePayload>;
@@ -0,0 +1,13 @@
1
+ export interface GitRunResult {
2
+ readonly exitCode: number | null;
3
+ readonly stdout: string;
4
+ readonly stderr: string;
5
+ readonly timedOut: boolean;
6
+ }
7
+ export interface GitRunOptions {
8
+ readonly cwd?: string;
9
+ readonly timeoutMs?: number;
10
+ readonly maxBytes?: number;
11
+ }
12
+ export type GitRunner = (args: readonly string[], options?: GitRunOptions) => Promise<GitRunResult>;
13
+ export declare const runGitProcess: GitRunner;
@@ -1,3 +1,6 @@
1
- import type { DshHostContext } from '@dsh-workbench/shared';
2
1
  import { type RouteHandler } from '@dsh-workbench/shared/host';
3
- export declare function gitProbeHandler(ctx: DshHostContext): RouteHandler;
2
+ import type { GitRunner } from './git-process.js';
3
+ export interface GitProbeHandlerOptions {
4
+ readonly runGit?: GitRunner;
5
+ }
6
+ export declare function gitProbeHandler(options?: GitProbeHandlerOptions): RouteHandler;
@@ -1,5 +1,5 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
1
  import type { DiscoverDoc, DiscoverDocKind, MarketIndexSource, MarketSourceConfig } from '@dsh-workbench/shared/contract/protocol/market-index';
2
+ import type { GitRunner } from './git-process.js';
3
3
  export interface MarketDocTarget {
4
4
  readonly name: string;
5
5
  readonly version: string;
@@ -10,7 +10,7 @@ export interface MarketDocReader {
10
10
  }
11
11
  export interface MarketDocReaderOptions {
12
12
  readonly root: string;
13
- readonly shell?: DshShell | undefined;
13
+ readonly runGit?: GitRunner | undefined;
14
14
  readonly fetchImpl?: ((url: string, init: RequestInit) => Promise<Response>) | undefined;
15
15
  readonly timeoutMs?: number | undefined;
16
16
  readonly maxBytes?: number | undefined;
@@ -1,5 +1,5 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
1
  import type { DiscoverProblem, IndexSourceSpec, MarketIndex, MarketSourceConfig } from '@dsh-workbench/shared/contract/protocol/market-index';
2
+ import type { GitRunner } from './git-process.js';
3
3
  export interface CachedIndex {
4
4
  readonly index: MarketIndex;
5
5
  readonly fetchedAt: number;
@@ -24,7 +24,7 @@ export interface MarketIndexReader {
24
24
  }
25
25
  export interface MarketIndexReaderOptions {
26
26
  readonly root: string;
27
- readonly shell?: DshShell | undefined;
27
+ readonly runGit?: GitRunner | undefined;
28
28
  readonly fetchImpl?: ((url: string, init: RequestInit) => Promise<Response>) | undefined;
29
29
  readonly now?: (() => number) | undefined;
30
30
  readonly ttlMs?: number | undefined;
@@ -1,5 +1,5 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
1
  import type { MarketSourceConfig } from '@dsh-workbench/shared/contract/protocol/market-index';
2
+ import type { GitRunner } from './git-process';
3
3
  import type { MarketSourcesStore } from './market-sources-store';
4
4
  export interface MarketSourceInitRequest {
5
5
  readonly id: string;
@@ -17,7 +17,7 @@ export type MarketSourceInitializer = (request: MarketSourceInitRequest) => Prom
17
17
  export interface MarketSourceInitOptions {
18
18
  readonly root: string;
19
19
  readonly store: MarketSourcesStore;
20
- readonly shell?: DshShell | undefined;
20
+ readonly runGit?: GitRunner | undefined;
21
21
  readonly timeoutMs?: number | undefined;
22
22
  }
23
23
  export declare function createMarketSourceInitializer(options: MarketSourceInitOptions): MarketSourceInitializer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
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/adapters-default": "1.1.9",
104
- "@dsh-workbench/shared": "1.1.9"
103
+ "@dsh-workbench/shared": "1.1.10",
104
+ "@dsh-workbench/adapters-default": "1.1.10"
105
105
  },
106
106
  "license": "MIT",
107
107
  "repository": {