@yejiming/dsh-data-agent 0.0.13 → 0.1.0

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.
Files changed (38) hide show
  1. package/README.en.md +43 -8
  2. package/README.md +43 -8
  3. package/conformance/dsh-ecosystem/inventory.json +26 -3
  4. package/conformance/dsh-ecosystem/restrictions.json +2 -2
  5. package/cordis.patch.yml +6 -3
  6. package/dsh-plugin.json +9 -4
  7. package/lib/catalog-DEJqOXRo.js +1944 -0
  8. package/lib/catalog-identity-CVftmvQL.js +96 -0
  9. package/lib/client.js +2217 -109
  10. package/lib/client.js.map +1 -1
  11. package/lib/command-CzzSPmag.js +1719 -0
  12. package/lib/command.js +2 -2
  13. package/lib/{connections-CHY4uB6z.js → connections-CFXOZTHZ.js} +223 -9
  14. package/lib/index.js +366 -16
  15. package/lib/routes.js +257 -4
  16. package/lib/{tool-ZTOS4B33.js → tool-DNkywSph.js} +364 -3
  17. package/lib/tool.js +1 -1
  18. package/lib/types/catalog-adapters.d.ts +52 -0
  19. package/lib/types/catalog-ai.d.ts +49 -0
  20. package/lib/types/catalog-command.d.ts +28 -0
  21. package/lib/types/catalog-identity.d.ts +23 -0
  22. package/lib/types/catalog-storage.d.ts +265 -0
  23. package/lib/types/catalog-tools.d.ts +5 -0
  24. package/lib/types/catalog-tui.d.ts +18 -0
  25. package/lib/types/catalog-types.d.ts +1376 -0
  26. package/lib/types/catalog.d.ts +59 -0
  27. package/lib/types/client/CatalogPanel.d.ts +15 -0
  28. package/lib/types/client/catalog-client.d.ts +57 -0
  29. package/lib/types/client/locales.d.ts +242 -0
  30. package/lib/types/command.d.ts +14 -3
  31. package/lib/types/connections.d.ts +9 -0
  32. package/lib/types/defaults.d.ts +22 -0
  33. package/lib/types/index.d.ts +42 -5
  34. package/lib/types/tui-connection-form.d.ts +11 -5
  35. package/package.json +4 -2
  36. package/preset/data-agent/agent.cordis.yml +9 -1
  37. package/lib/command-utC5MHd9.js +0 -916
  38. package/lib/defaults-Cngd8Tf8.js +0 -131
@@ -1,131 +0,0 @@
1
- //#region src/database-types.ts
2
- /**
3
- * Browser-safe database type descriptors shared by every DSH surface.
4
- * Keep this module dependency-free: server-only client/process details belong
5
- * in the database adapters, not in Web or persistence bundles.
6
- */
7
- const DATABASE_TYPES = [
8
- "mysql",
9
- "postgres",
10
- "sqlite",
11
- "oracle",
12
- "hive",
13
- "impala",
14
- "clickhouse",
15
- "doris",
16
- "sqlserver"
17
- ];
18
- const DATABASE_TYPE_DESCRIPTORS = {
19
- mysql: {
20
- type: "mysql",
21
- label: "MySQL",
22
- localeKey: "type.mysql",
23
- defaultPort: 3306,
24
- defaultUser: "root",
25
- fileBased: false
26
- },
27
- postgres: {
28
- type: "postgres",
29
- label: "PostgreSQL",
30
- localeKey: "type.postgres",
31
- defaultPort: 5432,
32
- defaultUser: "postgres",
33
- fileBased: false
34
- },
35
- sqlite: {
36
- type: "sqlite",
37
- label: "SQLite",
38
- localeKey: "type.sqlite",
39
- defaultPort: 0,
40
- defaultUser: "",
41
- fileBased: true
42
- },
43
- oracle: {
44
- type: "oracle",
45
- label: "Oracle",
46
- localeKey: "type.oracle",
47
- defaultPort: 1521,
48
- defaultUser: "",
49
- fileBased: false
50
- },
51
- hive: {
52
- type: "hive",
53
- label: "Hive",
54
- localeKey: "type.hive",
55
- defaultPort: 1e4,
56
- defaultUser: "",
57
- fileBased: false
58
- },
59
- impala: {
60
- type: "impala",
61
- label: "Impala",
62
- localeKey: "type.impala",
63
- defaultPort: 21050,
64
- defaultUser: "",
65
- fileBased: false
66
- },
67
- clickhouse: {
68
- type: "clickhouse",
69
- label: "ClickHouse",
70
- localeKey: "type.clickhouse",
71
- defaultPort: 8123,
72
- securePort: 8443,
73
- defaultUser: "default",
74
- fileBased: false
75
- },
76
- doris: {
77
- type: "doris",
78
- label: "Apache Doris",
79
- localeKey: "type.doris",
80
- defaultPort: 9030,
81
- defaultUser: "root",
82
- fileBased: false
83
- },
84
- sqlserver: {
85
- type: "sqlserver",
86
- label: "SQL Server",
87
- localeKey: "type.sqlserver",
88
- defaultPort: 1433,
89
- defaultUser: "sa",
90
- fileBased: false
91
- }
92
- };
93
- function isDatabaseType(value) {
94
- return typeof value === "string" && DATABASE_TYPES.includes(value);
95
- }
96
- function defaultDatabasePort(type, secure = false) {
97
- const descriptor = DATABASE_TYPE_DESCRIPTORS[type];
98
- return secure && descriptor.securePort !== void 0 ? descriptor.securePort : descriptor.defaultPort;
99
- }
100
- function defaultDatabaseUser(type) {
101
- return DATABASE_TYPE_DESCRIPTORS[type].defaultUser;
102
- }
103
- function databaseTypeLabel(type) {
104
- return DATABASE_TYPE_DESCRIPTORS[type].label;
105
- }
106
- //#endregion
107
- //#region src/defaults.ts
108
- /**
109
- * Package-wide defaults shared by the server half (`src/index.ts`) and the
110
- * database tool half (`src/tool.ts`). Loader schemas carry these as their
111
- * defaults so a deployment may override every one of them in cordis.yml.
112
- * @module @yejiming/dsh-data-agent/defaults
113
- */
114
- /** Preset directory name installed into `$DSH_HOME/.agent-presets/`. */
115
- const DEFAULT_PRESET_ID = "data-agent";
116
- /** End-to-end deadline for one `/connect` connectivity check, milliseconds. */
117
- const DEFAULT_CONNECT_TIMEOUT_MS = 1e4;
118
- /** End-to-end deadline for one database-tool query, milliseconds. */
119
- const DEFAULT_QUERY_TIMEOUT_MS = 3e4;
120
- /** In-memory cap on database-tool captured output (stdout and stderr each). */
121
- const DEFAULT_MAX_RESULT_CHARS = 2e4;
122
- /** Hard row cap for one structured Web workbench result/export. */
123
- const WORKBENCH_MAX_EXPORT_ROWS = 5e4;
124
- /** Bounded capture size for the larger structured Web workbench result. */
125
- const WORKBENCH_MAX_RESULT_CHARS = 33554432;
126
- /** Cap on one /query SQL text length (abuse guard; the wire body stays small). */
127
- const DEFAULT_MAX_QUERY_CHARS = 65536;
128
- /** Grace period for the subprocess terminate escalation. */
129
- const DEFAULT_GRACE_MS = 5e3;
130
- //#endregion
131
- export { DEFAULT_PRESET_ID as a, WORKBENCH_MAX_RESULT_CHARS as c, defaultDatabasePort as d, defaultDatabaseUser as f, DEFAULT_MAX_RESULT_CHARS as i, DATABASE_TYPES as l, DEFAULT_GRACE_MS as n, DEFAULT_QUERY_TIMEOUT_MS as o, isDatabaseType as p, DEFAULT_MAX_QUERY_CHARS as r, WORKBENCH_MAX_EXPORT_ROWS as s, DEFAULT_CONNECT_TIMEOUT_MS as t, databaseTypeLabel as u };