@yejiming/dsh-data-agent 0.1.3 → 0.1.5

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/lib/index.js CHANGED
@@ -532,7 +532,9 @@ async function installPreset(ctx, presetId) {
532
532
  const LEGACY_MANAGED_PRESET_SHA256 = /* @__PURE__ */ new Set([
533
533
  "bae875a90d638ea78715030246b0f8a9f1a2c3359ca61febb6ceb59d0fcd930a",
534
534
  "d3c6f4049580069eec1c6b7de101f12c7fb30482ad317434afb69afb08a91fc6",
535
- "11c4b5ef62c5934d1dc7133950bd78622dd68dc4e1075b5f24d0789011d6da9d"
535
+ "11c4b5ef62c5934d1dc7133950bd78622dd68dc4e1075b5f24d0789011d6da9d",
536
+ "1e42e007ad4cac04af95a67a5af1b7a0b02cc0f78e21d2da35461309db8dc9db",
537
+ "2c5a8fc07dd49d0c10d6d10f0056da2d84575f47b47d4b28bc0e37f7d166413a"
536
538
  ]);
537
539
  /** Public for regression tests of the non-destructive preset migration gate. */
538
540
  function isLegacyManagedPreset(source) {
@@ -1,5 +1,5 @@
1
1
  /** Read-only Catalog model tools. No scan or review service is injected here. */
2
2
  import type { Context } from '@deepseek-ai/cordis';
3
- import { type JsonValue } from '@deepseek-ai/dsh-tools';
3
+ import type { JsonValue } from '@deepseek-ai/dsh-util-values';
4
4
  export declare function applyCatalogTools(ctx: Context): void;
5
5
  export declare function sanitizeToolValue(value: unknown): JsonValue;
@@ -0,0 +1,24 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { AgentPresetSeatProps, AgentPresetSeatState } from '@deepseek-ai/dsh-client-ui-agent-preset/client';
3
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
4
+ import { type ObservableSnapshot, type WorkbenchOpenSnapshot } from './workbench-open.ts';
5
+ export interface DataAgentHeroControlsInjected {
6
+ /** The host entry shadowed by this additive wrapper. */
7
+ originalSeat: ComponentType<AgentPresetSeatProps>;
8
+ /** Data-agent copy; the slot's own `t` remains bound to agent-preset copy. */
9
+ dataAgentT: TranslateNS<'data-agent'>;
10
+ requestWorkbench(): void;
11
+ useHeroWorkbench: <T>(selector: (snapshot: WorkbenchOpenSnapshot) => T) => T;
12
+ }
13
+ export type DataAgentHeroControlsProps = AgentPresetSeatProps & DataAgentHeroControlsInjected;
14
+ /** Render the original preset picker plus the database entry for data-agent. */
15
+ export declare function DataAgentHeroControls(props: DataAgentHeroControlsProps): import("react").JSX.Element;
16
+ /** Structural type of the host preset entry's raw inject face. */
17
+ export interface HostAgentPresetSeatFace {
18
+ hooks: {
19
+ agentPresetSeat: ObservableSnapshot<AgentPresetSeatState>;
20
+ };
21
+ load(): Promise<void>;
22
+ select(id: string): Promise<string | undefined>;
23
+ introduced(): void;
24
+ }
@@ -1,9 +1,13 @@
1
1
  import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import { type ObservableSnapshot, type WorkbenchOpenSnapshot } from './workbench-open.ts';
2
3
  export type { DatabaseType } from '../database-types.ts';
3
4
  /** The sessions-list slice the workbench needs (structural; avoids a runtime import). */
4
5
  export interface SessionListLike {
6
+ current?: string;
5
7
  byId: Record<string, {
6
- agentPreset?: string;
8
+ projectionValues?: {
9
+ agentPreset?: string | null;
10
+ };
7
11
  }>;
8
12
  }
9
13
  /** Registration-side business face: the sessions-list observable becomes `useSessions`. */
@@ -13,9 +17,11 @@ export interface DataAgentWorkbenchInjected {
13
17
  getSnapshot(): SessionListLike;
14
18
  subscribe(fn: () => void): () => void;
15
19
  };
20
+ workbenchOpen: ObservableSnapshot<WorkbenchOpenSnapshot>;
16
21
  };
22
+ acknowledgeWorkbenchOpen(revision: number): void;
17
23
  }
18
24
  /** The workbench's full component props: the composer-right seat + locale + sessions hook. */
19
25
  export type DataAgentWorkbenchProps = PropsRuntime<'conversation.input.right'> & PropsLocale<'data-agent'> & InjectFace<DataAgentWorkbenchInjected>;
20
26
  /** The database workbench body. */
21
- export declare function DataAgentWorkbench({ sessionId, useSessions, t }: DataAgentWorkbenchProps): import("react").JSX.Element | null;
27
+ export declare function DataAgentWorkbench({ sessionId, useSessions, useWorkbenchOpen, acknowledgeWorkbenchOpen, t, }: DataAgentWorkbenchProps): import("react").JSX.Element | null;
@@ -14,7 +14,7 @@
14
14
  * degrade to the safe model content text, never guess or re-query.
15
15
  * @module @yejiming/dsh-data-agent/client/analysis-view-model
16
16
  */
17
- import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
17
+ import type { ToolCallBlock } from '@deepseek-ai/dsh-client-ui-conversation/client';
18
18
  import { type AnalysisReportV1 } from '../analysis.ts';
19
19
  /** The five display states of one render-analysis call. */
20
20
  export type AnalysisBlockState = 'running' | 'error' | 'interrupted' | 'report' | 'fallback';
@@ -7,7 +7,7 @@
7
7
  * `/plugins/data-agent/status` reports.
8
8
  * @module @yejiming/dsh-data-agent/client
9
9
  */
10
- import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
10
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
11
11
  import { type DataAgentKey } from './locales.ts';
12
12
  declare module '@deepseek-ai/dsh-client-ui-slots' {
13
13
  interface LocaleNamespaceMap {
@@ -15,7 +15,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
15
15
  'data-agent': DataAgentKey;
16
16
  }
17
17
  }
18
- /** Required services: the locale service, the slot registry, and the sessions list. */
18
+ /** Required services: locale/slots, Session state, and host New Session navigation. */
19
19
  export declare const inject: string[];
20
20
  /**
21
21
  * Client plugin body: register the data-agent dictionaries and the database
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Cross-surface hand-off for opening the session-scoped database workbench
3
+ * from the alpha.2 New Session hero, where no Session scope exists yet.
4
+ */
5
+ import type { SessionListLike } from './DataAgentWorkbench.tsx';
6
+ /** The plugin preset id used by both the hero stage and Session projection. */
7
+ export declare const DATA_AGENT_PRESET = "data-agent";
8
+ /** Minimal observable contract consumed by the slot renderer's Hook binder. */
9
+ export interface ObservableSnapshot<T> {
10
+ getSnapshot(): T;
11
+ subscribe(fn: () => void): () => void;
12
+ }
13
+ /** One pending/ready request to open the workbench. */
14
+ export interface WorkbenchOpenSnapshot {
15
+ pending: boolean;
16
+ revision: number;
17
+ sessionId?: string;
18
+ }
19
+ /** The Session-list operations needed to bridge a root action into one Session. */
20
+ export interface SessionListSource extends ObservableSnapshot<SessionListLike> {
21
+ }
22
+ export interface WorkbenchOpenBridge {
23
+ store: ObservableSnapshot<WorkbenchOpenSnapshot>;
24
+ /** Start the host's New Session flow and open once data-agent is mounted. */
25
+ requestFromHero(): void;
26
+ /** Clear a delivered request after the target workbench accepts it. */
27
+ acknowledge(revision: number): void;
28
+ dispose(): void;
29
+ }
30
+ /**
31
+ * Create the one-way hero → Session workbench bridge.
32
+ *
33
+ * The host remains responsible for workspace inheritance, Session creation,
34
+ * navigation, and applying the staged agent preset. This bridge only waits
35
+ * for the resulting Session projection before publishing an open request.
36
+ */
37
+ export declare function createWorkbenchOpenBridge(sessions: SessionListSource, startSession: () => void): WorkbenchOpenBridge;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Apply data-agent copy to one host composer card and return an exact cleanup.
3
+ * alpha.2's Lexical surface renders a visible placeholder sibling in addition
4
+ * to the editor attributes; older compatible surfaces still use a textarea.
5
+ */
6
+ export declare function overrideComposerPlaceholder(card: ParentNode | null | undefined, placeholder: string): (() => void) | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yejiming/dsh-data-agent",
3
3
  "description": "Data Agent for DSH Web and TUI: shared database connections, versioned metadata Catalog governance, secure credentials, SQL and Catalog tools, and the data-agent preset",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,15 +49,22 @@
49
49
  "./cordis.patch.yml": "./cordis.patch.yml"
50
50
  },
51
51
  "dsh": {
52
+ "engines": {
53
+ "dsh": ">=0.1.2-alpha.2"
54
+ },
52
55
  "bundle": {
53
56
  "patch": "./cordis.patch.yml"
54
57
  },
55
58
  "client": {
56
59
  "inject": [
60
+ "@deepseek-ai/dsh-api-session-controller",
57
61
  "@deepseek-ai/dsh-client-locale",
58
- "@deepseek-ai/dsh-client-runtime",
62
+ "@deepseek-ai/dsh-client-ui-agent-preset",
59
63
  "@deepseek-ai/dsh-client-ui-tool",
60
- "@deepseek-ai/dsh-client-ui-conversation"
64
+ "@deepseek-ai/dsh-client-ui-conversation",
65
+ "@deepseek-ai/dsh-client-ui-renderer",
66
+ "@deepseek-ai/dsh-client-ui-session",
67
+ "@deepseek-ai/dsh-client-ui-workspace"
61
68
  ],
62
69
  "platform": "web"
63
70
  }
@@ -88,35 +95,43 @@
88
95
  "zod": "^4.4.3"
89
96
  },
90
97
  "peerDependencies": {
91
- "@deepseek-ai/cordis": "^4.0.1",
92
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
93
- "@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.7",
94
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
95
- "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
96
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
97
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
98
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
99
- "@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.7",
100
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
101
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.7",
102
- "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
103
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
104
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.7",
105
- "@deepseek-ai/dsh-scope": "^0.1.0-rc.7",
106
- "@deepseek-ai/dsh-session": "^0.1.0-rc.7",
107
- "@deepseek-ai/dsh-storage": "^0.1.0-rc.7",
108
- "@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.7",
109
- "@deepseek-ai/dsh-storage-json": "^0.1.0-rc.7",
110
- "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.7",
111
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.7",
112
- "@deepseek-ai/dsh-user-questions": "^0.1.0-rc.7",
98
+ "@deepseek-ai/cordis": "^4.0.2",
99
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
100
+ "@deepseek-ai/dsh-agent-presets": "^0.1.2-alpha.2",
101
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.2",
102
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.2",
103
+ "@deepseek-ai/dsh-client-ui-agent-preset": "^0.1.2-alpha.2",
104
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-alpha.2",
105
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.2",
106
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.2",
107
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.2-alpha.2",
108
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.2",
109
+ "@deepseek-ai/dsh-client-ui-tool": "^0.1.2-alpha.2",
110
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.1.2-alpha.2",
111
+ "@deepseek-ai/dsh-commands": "^0.1.2-alpha.2",
112
+ "@deepseek-ai/dsh-credentials": "^0.1.2-alpha.2",
113
+ "@deepseek-ai/dsh-host-webserver": "^0.1.2-alpha.2",
114
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
115
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.2",
116
+ "@deepseek-ai/dsh-scope": "^0.1.2-alpha.2",
117
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
118
+ "@deepseek-ai/dsh-storage": "^0.1.2-alpha.2",
119
+ "@deepseek-ai/dsh-storage-domain": "^0.1.2-alpha.2",
120
+ "@deepseek-ai/dsh-storage-json": "^0.1.2-alpha.2",
121
+ "@deepseek-ai/dsh-subprocess": "^0.1.2-alpha.2",
122
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.2",
123
+ "@deepseek-ai/dsh-user-questions": "^0.1.2-alpha.2",
124
+ "@deepseek-ai/dsh-util-values": "^0.1.2-alpha.2",
113
125
  "react": "^18.2.0 || ^19.0.0"
114
126
  },
115
127
  "peerDependenciesMeta": {
116
128
  "@deepseek-ai/dsh-client-locale": {
117
129
  "optional": true
118
130
  },
119
- "@deepseek-ai/dsh-client-runtime": {
131
+ "@deepseek-ai/dsh-api-session-controller": {
132
+ "optional": true
133
+ },
134
+ "@deepseek-ai/dsh-client-ui-agent-preset": {
120
135
  "optional": true
121
136
  },
122
137
  "@deepseek-ai/dsh-client-ui-conversation": {
@@ -125,6 +140,12 @@
125
140
  "@deepseek-ai/dsh-client-ui-primitives": {
126
141
  "optional": true
127
142
  },
143
+ "@deepseek-ai/dsh-client-ui-renderer": {
144
+ "optional": true
145
+ },
146
+ "@deepseek-ai/dsh-client-ui-session": {
147
+ "optional": true
148
+ },
128
149
  "@deepseek-ai/dsh-client-ui-slots": {
129
150
  "optional": true
130
151
  },
@@ -139,36 +160,44 @@
139
160
  },
140
161
  "@deepseek-ai/dsh-client-ui-tool": {
141
162
  "optional": true
163
+ },
164
+ "@deepseek-ai/dsh-client-ui-workspace": {
165
+ "optional": true
142
166
  }
143
167
  },
144
168
  "devDependencies": {
145
- "@deepseek-ai/cordis": "^4.0.1",
146
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
147
- "@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.7",
148
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.7",
149
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
150
- "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
151
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
152
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
153
- "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.7",
154
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
155
- "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.7",
156
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
157
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.7",
158
- "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
159
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
160
- "@deepseek-ai/dsh-llm": "0.1.0-rc.7",
161
- "@deepseek-ai/dsh-scope": "^0.1.0-rc.7",
162
- "@deepseek-ai/dsh-session": "0.1.0-rc.7",
163
- "@deepseek-ai/dsh-storage": "^0.1.0-rc.7",
164
- "@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.7",
165
- "@deepseek-ai/dsh-storage-json": "^0.1.0-rc.7",
166
- "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.7",
167
- "@deepseek-ai/dsh-subprocess-local": "0.1.0-rc.7",
168
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.7",
169
- "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.7",
170
- "@deepseek-ai/dsh-user-questions": "^0.1.0-rc.7",
171
- "@deepseek-ai/schemastery": "3.18.1",
169
+ "@deepseek-ai/cordis": "^4.0.2",
170
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
171
+ "@deepseek-ai/dsh-agent-presets": "^0.1.2-alpha.2",
172
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.2",
173
+ "@deepseek-ai/dsh-attachment": "0.1.2-alpha.2",
174
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.2",
175
+ "@deepseek-ai/dsh-client-ui-agent-preset": "0.1.2-alpha.2",
176
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-alpha.2",
177
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.2",
178
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-alpha.2",
179
+ "@deepseek-ai/dsh-client-ui-session": "0.1.2-alpha.2",
180
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.2-alpha.2",
181
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.2",
182
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.2-alpha.2",
183
+ "@deepseek-ai/dsh-client-ui-workspace": "0.1.2-alpha.2",
184
+ "@deepseek-ai/dsh-commands": "^0.1.2-alpha.2",
185
+ "@deepseek-ai/dsh-credentials": "^0.1.2-alpha.2",
186
+ "@deepseek-ai/dsh-host-webserver": "^0.1.2-alpha.2",
187
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
188
+ "@deepseek-ai/dsh-llm": "0.1.2-alpha.2",
189
+ "@deepseek-ai/dsh-scope": "^0.1.2-alpha.2",
190
+ "@deepseek-ai/dsh-session": "0.1.2-alpha.2",
191
+ "@deepseek-ai/dsh-storage": "^0.1.2-alpha.2",
192
+ "@deepseek-ai/dsh-storage-domain": "^0.1.2-alpha.2",
193
+ "@deepseek-ai/dsh-storage-json": "^0.1.2-alpha.2",
194
+ "@deepseek-ai/dsh-subprocess": "^0.1.2-alpha.2",
195
+ "@deepseek-ai/dsh-subprocess-local": "0.1.2-alpha.2",
196
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.2",
197
+ "@deepseek-ai/dsh-typert-protocol": "0.1.2-alpha.2",
198
+ "@deepseek-ai/dsh-user-questions": "^0.1.2-alpha.2",
199
+ "@deepseek-ai/dsh-util-values": "^0.1.2-alpha.2",
200
+ "@deepseek-ai/schemastery": "3.18.2",
172
201
  "@dsh-std/adapter-dsh": "0.1.0-rc3",
173
202
  "@dsh-std/command": "0.1.0-rc2",
174
203
  "@dsh-std/core": "0.1.0-rc1",
@@ -180,6 +209,7 @@
180
209
  "@testing-library/react": "^16.3.2",
181
210
  "@types/node": "^25.0.0",
182
211
  "@types/react": "~18.3.1",
212
+ "js-yaml": "4.3.1",
183
213
  "jsdom": "^30.0.1",
184
214
  "lightningcss": "^1.32.0",
185
215
  "react": "^18.2.0",
@@ -23,7 +23,7 @@
23
23
  - id: persona
24
24
  name: '@deepseek-ai/dsh-persona'
25
25
  config:
26
- text: >-
26
+ prefix: &data_agent_persona >-
27
27
  你是数据工程师 Agent。工作目录 {{cwd}}。可用工具:sql-query(只读 SQL,返回结构化
28
28
  JSON 结果)、sql-write(写/管理 SQL,单条自动提交)、sql-cmd(原始客户端输出,兼容
29
29
  SHOW TABLES、DESCRIBE users 等命令)、catalog-search(搜索持久化数据目录)、catalog-get
@@ -49,6 +49,8 @@
49
49
  不使用LIMIT,也不输出GO、冒号命令、!!或sqlcmd变量;ClickHouse、Doris等支持LIMIT的
50
50
  数据库才使用LIMIT。Doris首版只按当前/internal catalog浏览,不臆造外部catalog层级;
51
51
  未经真实部署验证,不宣称任意ClickHouse Cloud或TLS组合都可用。
52
+ # DSH before 0.1.3-alpha.2 reads text; both schemas share the same prompt.
53
+ text: *data_agent_persona
52
54
 
53
55
  # ── filesystem ──────────────────────────────────────────────────────────────
54
56