@yejiming/dsh-data-agent 0.0.10 → 0.0.12
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/README.en.md +19 -16
- package/README.md +19 -16
- package/lib/client.js +137 -93
- package/lib/client.js.map +1 -1
- package/lib/{command-LFgLb6el.js → command-DuCpwVbl.js} +2 -2
- package/lib/command.js +1 -1
- package/lib/{connections-WmjuUrDj.js → connections-5sfdEDsG.js} +44 -23
- package/lib/index.js +18 -14
- package/lib/routes.js +6 -2
- package/lib/{tool-Dka6RyEp.js → tool-DgL0fBfj.js} +157 -11
- package/lib/tool.js +1 -1
- package/lib/types/analysis-html.d.ts +27 -0
- package/lib/types/analysis.d.ts +13 -1
- package/lib/types/client/locales.d.ts +6 -0
- package/lib/types/client/persistence.d.ts +1 -1
- package/lib/types/connections.d.ts +10 -0
- package/lib/types/index.d.ts +5 -6
- package/lib/types/presentation-text.d.ts +3 -0
- package/lib/types/storage.d.ts +5 -0
- package/package.json +40 -40
- package/preset/data-agent/agent.cordis.yml +5 -3
|
@@ -40,12 +40,15 @@ export declare const zh: {
|
|
|
40
40
|
'state.disconnected': string;
|
|
41
41
|
'state.checking': string;
|
|
42
42
|
'state.reconnecting': string;
|
|
43
|
+
'state.reconnectRequired': string;
|
|
43
44
|
'workbench.open.connected': string;
|
|
44
45
|
'workbench.open.disconnected': string;
|
|
45
46
|
'workbench.open.checking': string;
|
|
46
47
|
'workbench.open.error': string;
|
|
48
|
+
'workbench.open.reconnectRequired': string;
|
|
47
49
|
'composer.placeholder.disconnected': string;
|
|
48
50
|
'composer.placeholder.connected': string;
|
|
51
|
+
'composer.placeholder.reconnectRequired': string;
|
|
49
52
|
'wb.workbench.title': string;
|
|
50
53
|
'wb.workbench.description': string;
|
|
51
54
|
'wb.workbench.tabs': string;
|
|
@@ -125,12 +128,15 @@ export declare const en: {
|
|
|
125
128
|
'state.disconnected': string;
|
|
126
129
|
'state.checking': string;
|
|
127
130
|
'state.reconnecting': string;
|
|
131
|
+
'state.reconnectRequired': string;
|
|
128
132
|
'workbench.open.connected': string;
|
|
129
133
|
'workbench.open.disconnected': string;
|
|
130
134
|
'workbench.open.checking': string;
|
|
131
135
|
'workbench.open.error': string;
|
|
136
|
+
'workbench.open.reconnectRequired': string;
|
|
132
137
|
'composer.placeholder.disconnected': string;
|
|
133
138
|
'composer.placeholder.connected': string;
|
|
139
|
+
'composer.placeholder.reconnectRequired': string;
|
|
134
140
|
'wb.workbench.title': string;
|
|
135
141
|
'wb.workbench.description': string;
|
|
136
142
|
'wb.workbench.tabs': string;
|
|
@@ -24,7 +24,7 @@ export interface SavedConnection {
|
|
|
24
24
|
/** Non-secret credential reference; mutually exclusive with `password`. */
|
|
25
25
|
passwordRef?: string;
|
|
26
26
|
/** Explicit form mode; absent legacy records infer it from passwordRef. */
|
|
27
|
-
credentialMode?: 'password' | 'reference';
|
|
27
|
+
credentialMode?: 'none' | 'password' | 'reference';
|
|
28
28
|
/** Opt-in flag; when true, {@link saveConnection} may write `password`. */
|
|
29
29
|
persistPassword?: boolean;
|
|
30
30
|
readonly?: boolean;
|
|
@@ -14,6 +14,8 @@ import { type QueryResult } from './query.ts';
|
|
|
14
14
|
export declare const WILDCARD_SESSION = "*";
|
|
15
15
|
/** Supported database client kinds. */
|
|
16
16
|
export type DatabaseType = 'mysql' | 'postgres' | 'sqlite' | 'oracle' | 'hive' | 'impala';
|
|
17
|
+
/** How a non-SQLite profile authenticates without ever persisting a secret. */
|
|
18
|
+
export type CredentialMode = 'none' | 'password' | 'reference';
|
|
17
19
|
/** Safe credential facts returned to UI/command surfaces. */
|
|
18
20
|
export interface CredentialSummary {
|
|
19
21
|
configured: boolean;
|
|
@@ -38,6 +40,8 @@ export interface DatabaseConnectionInput {
|
|
|
38
40
|
}
|
|
39
41
|
/** Runtime connection. `tables` and temporary `password` are never durable. */
|
|
40
42
|
export interface DatabaseConnection extends DatabaseConnectionInput {
|
|
43
|
+
/** Internal authentication shape retained in the non-secret durable profile. */
|
|
44
|
+
credentialMode?: CredentialMode;
|
|
41
45
|
tables?: string[];
|
|
42
46
|
}
|
|
43
47
|
/** Password-free public connection view. */
|
|
@@ -53,6 +57,11 @@ export interface ConnectionSummary {
|
|
|
53
57
|
name?: string;
|
|
54
58
|
tables?: string[];
|
|
55
59
|
credential?: CredentialSummary;
|
|
60
|
+
credentialMode?: CredentialMode;
|
|
61
|
+
/** True only when the current process can execute a database operation now. */
|
|
62
|
+
ready?: boolean;
|
|
63
|
+
/** A saved profile exists, but its credential must be supplied/configured again. */
|
|
64
|
+
reconnectRequired?: boolean;
|
|
56
65
|
}
|
|
57
66
|
/** Value stored in the `profiles` domain table. Never add secrets here. */
|
|
58
67
|
export interface PersistedConnectionProfile {
|
|
@@ -64,6 +73,7 @@ export interface PersistedConnectionProfile {
|
|
|
64
73
|
database: string;
|
|
65
74
|
readonly?: boolean;
|
|
66
75
|
passwordRef?: string;
|
|
76
|
+
credentialMode?: CredentialMode;
|
|
67
77
|
updatedAt: string;
|
|
68
78
|
}
|
|
69
79
|
/** Value stored in the `bindings` domain table. */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -166,12 +166,11 @@ export declare function resolveDshHome(env?: Record<string, string | undefined>)
|
|
|
166
166
|
/**
|
|
167
167
|
* Install the packaged `preset/data-agent/` directory into
|
|
168
168
|
* `$DSH_HOME/.agent-presets/<presetId>/`. Idempotent: an existing target is
|
|
169
|
-
* normally left untouched.
|
|
170
|
-
* migrated once
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* the boot.
|
|
169
|
+
* normally left untouched. Exact package-owned legacy compositions are
|
|
170
|
+
* migrated once when their runtime contract changes; user-edited compositions
|
|
171
|
+
* are never overwritten. `installPreset: false` never calls this. Best-effort
|
|
172
|
+
* — a failure logs a warning with manual install instructions instead of
|
|
173
|
+
* failing the boot.
|
|
175
174
|
*/
|
|
176
175
|
export declare function installPreset(ctx: Context, presetId: string): Promise<boolean>;
|
|
177
176
|
/** Public for regression tests of the non-destructive preset migration gate. */
|
package/lib/types/storage.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare const persistedConnectionProfileSchema: z.ZodObject<{
|
|
|
31
31
|
database: z.ZodString;
|
|
32
32
|
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
passwordRef: z.ZodOptional<z.ZodString>;
|
|
34
|
+
credentialMode: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
none: "none";
|
|
36
|
+
password: "password";
|
|
37
|
+
reference: "reference";
|
|
38
|
+
}>>;
|
|
34
39
|
updatedAt: z.ZodString;
|
|
35
40
|
}, z.core.$strict>;
|
|
36
41
|
/** Durable session-to-profile binding schema. */
|
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, a masked TUI form, secure credential references, SQL tools, and the data-agent preset",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -78,25 +78,25 @@
|
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
81
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.
|
|
82
|
-
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.
|
|
83
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.
|
|
84
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
85
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.
|
|
86
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.
|
|
87
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.
|
|
88
|
-
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.
|
|
89
|
-
"@deepseek-ai/dsh-commands": "^0.1.0-rc.
|
|
90
|
-
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.
|
|
91
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
92
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.
|
|
93
|
-
"@deepseek-ai/dsh-scope": "^0.1.0-rc.
|
|
94
|
-
"@deepseek-ai/dsh-storage": "^0.1.0-rc.
|
|
95
|
-
"@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.
|
|
96
|
-
"@deepseek-ai/dsh-storage-json": "^0.1.0-rc.
|
|
97
|
-
"@deepseek-ai/dsh-subprocess": "^0.1.0-rc.
|
|
98
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.
|
|
99
|
-
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.
|
|
81
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
|
|
82
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.7",
|
|
83
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
84
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.7",
|
|
89
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
|
|
90
|
+
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.7",
|
|
91
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
92
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
|
|
93
|
+
"@deepseek-ai/dsh-scope": "^0.1.0-rc.7",
|
|
94
|
+
"@deepseek-ai/dsh-storage": "^0.1.0-rc.7",
|
|
95
|
+
"@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.7",
|
|
96
|
+
"@deepseek-ai/dsh-storage-json": "^0.1.0-rc.7",
|
|
97
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.0-rc.7",
|
|
98
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.7",
|
|
99
|
+
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.7",
|
|
100
100
|
"react": "^18.2.0 || ^19.0.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependenciesMeta": {
|
|
@@ -130,26 +130,26 @@
|
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
133
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.
|
|
134
|
-
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.
|
|
138
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.
|
|
139
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.
|
|
140
|
-
"@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.
|
|
141
|
-
"@deepseek-ai/dsh-commands": "^0.1.0-rc.
|
|
142
|
-
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.
|
|
143
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
144
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.
|
|
145
|
-
"@deepseek-ai/dsh-scope": "^0.1.0-rc.
|
|
146
|
-
"@deepseek-ai/dsh-storage": "^0.1.0-rc.
|
|
147
|
-
"@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.
|
|
148
|
-
"@deepseek-ai/dsh-storage-json": "^0.1.0-rc.
|
|
149
|
-
"@deepseek-ai/dsh-subprocess": "^0.1.0-rc.
|
|
150
|
-
"@deepseek-ai/dsh-subprocess-local": "0.1.0-rc.
|
|
151
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.
|
|
152
|
-
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.
|
|
133
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
|
|
134
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.7",
|
|
135
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
136
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
137
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
138
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
139
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
140
|
+
"@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.7",
|
|
141
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
|
|
142
|
+
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.7",
|
|
143
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
144
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
|
|
145
|
+
"@deepseek-ai/dsh-scope": "^0.1.0-rc.7",
|
|
146
|
+
"@deepseek-ai/dsh-storage": "^0.1.0-rc.7",
|
|
147
|
+
"@deepseek-ai/dsh-storage-domain": "^0.1.0-rc.7",
|
|
148
|
+
"@deepseek-ai/dsh-storage-json": "^0.1.0-rc.7",
|
|
149
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.0-rc.7",
|
|
150
|
+
"@deepseek-ai/dsh-subprocess-local": "0.1.0-rc.7",
|
|
151
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.7",
|
|
152
|
+
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.7",
|
|
153
153
|
"@testing-library/dom": "^10.4.1",
|
|
154
154
|
"@testing-library/react": "^16.3.2",
|
|
155
155
|
"@types/node": "^25.0.0",
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
你是数据工程师 Agent。工作目录 {{cwd}}。可用工具:sql-query(只读 SQL,返回结构化
|
|
28
28
|
JSON 结果)、sql-write(写/管理 SQL,单条自动提交)、sql-cmd(原始客户端输出,兼容
|
|
29
29
|
SHOW TABLES、DESCRIBE users 等命令)、str_replace_editor(查看、创建和修改本地文件)。
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
datasetId
|
|
30
|
+
另有 render-analysis:把一次调用渲染成一份版本化分析
|
|
31
|
+
报告(1-6 个只读数据集、1-8 个 metric/line/bar/pie/scatter/table 视图,同一数据集可被
|
|
32
|
+
多个视图通过 datasetId 复用),并在当前工作目录的 analysis-reports/ 中保存离线 HTML
|
|
33
|
+
Dashboard。Web 可同时打开分析面板;TUI 只返回 HTML 路径,不输出字符图。是否生成分析
|
|
34
|
+
由你自主判断:先用 sql-query 探查表结构与样例数据并
|
|
33
35
|
核对事实(禁止臆造表名与列名);schema 探查、单标量或原始明细等无视觉增益的查询
|
|
34
36
|
直接回答、不强制画图;简单关系可生成一个主图,涉及多指标、时间或分群的复杂问题可
|
|
35
37
|
生成 3-6 个互补视图。聚合、Top N、排序必须写在 SQL 中,line/time 数据需 ORDER BY。
|