@zhuoyuezs/ml-platform 0.2.2-alpha.3 → 0.2.2
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/DEVELOPMENT.md +2 -1
- package/README.md +7 -5
- package/checksums.json +14 -4
- package/package.json +1 -1
- package/release.json +16 -10
- package/runtime/business-client/package-lock.json +2 -2
- package/runtime/business-client/package.json +1 -1
- package/runtime/business-client/src/cli.js +42 -1
- package/skills/data-source-exploration/SKILL.md +90 -0
- package/skills/data-source-exploration/agents/openai.yaml +4 -0
package/DEVELOPMENT.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- Skill 直接调用正式命令 `ml-platform`,不嵌入 CLI runtime。
|
|
11
11
|
- 正式 npm 包只有 `@zhuoyuezs/ml-platform`,正式 bin 只有 `ml-platform`。
|
|
12
12
|
- `business-client-js/src-ts/` 是 business CLI 的唯一 TypeScript 源码,`src/` 是供 Node.js 和
|
|
13
|
-
release payload 使用的编译输出;仓库 `skills/`
|
|
13
|
+
release payload 使用的编译输出;仓库 `skills/` 下四个受支持 Skill 是各自唯一源码。
|
|
14
14
|
- `npx @zhuoyuezs/ml-platform@<version> install` 是面向用户的统一安装入口;默认目标是 Codex
|
|
15
15
|
用户级 Skill,不要求额外安装参数。
|
|
16
16
|
- 管理命令默认输出简洁结果;Agent 和 CI 显式使用 `--json` 获取稳定结构化输出。
|
|
@@ -31,6 +31,7 @@ business-client-js/
|
|
|
31
31
|
└── src/ generated Node.js runtime
|
|
32
32
|
npm/ml-platform/src/ TypeScript installer and dispatcher source
|
|
33
33
|
skills/feature-management/
|
|
34
|
+
skills/data-source-exploration/
|
|
34
35
|
skills/model-lifecycle-management/
|
|
35
36
|
skills/model-deployment-management/
|
|
36
37
|
npm/ml-platform/
|
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# ML Platform
|
|
2
2
|
|
|
3
|
-
ML Platform 的 TypeScript CLI(编译为 Node.js JavaScript runtime)、`feature-management
|
|
4
|
-
`model-
|
|
3
|
+
ML Platform 的 TypeScript CLI(编译为 Node.js JavaScript runtime)、`feature-management`、
|
|
4
|
+
`data-source-exploration`、`model-lifecycle-management` 与 `model-deployment-management`
|
|
5
|
+
Agent Skill。CLI 与 Skill 由同一个 npm
|
|
5
6
|
release 安装和升级,运行时不需要 Python 或 `uv`。
|
|
6
7
|
|
|
7
8
|
## 环境要求
|
|
@@ -18,7 +19,7 @@ release 安装和升级,运行时不需要 Python 或 `uv`。
|
|
|
18
19
|
npx @zhuoyuezs/ml-platform@latest install
|
|
19
20
|
```
|
|
20
21
|
|
|
21
|
-
这条命令不需要额外参数。默认安装持久化的 `ml-platform`
|
|
22
|
+
这条命令不需要额外参数。默认安装持久化的 `ml-platform` 命令,并将四个 Skill 安装到
|
|
22
23
|
`~/.codex/skills/`,供当前用户的 Codex 使用。安装后重启终端和 Agent 会话。
|
|
23
24
|
|
|
24
25
|
只在当前项目使用 Skill 时,在项目根目录运行:
|
|
@@ -94,6 +95,7 @@ Skill。`status --json` 中 `installed_release` 是当前 scope 的 Skill releas
|
|
|
94
95
|
|
|
95
96
|
```bash
|
|
96
97
|
ml-platform list-parameters
|
|
98
|
+
ml-platform list-datasource-connections
|
|
97
99
|
ml-platform list-datasets --project <project>
|
|
98
100
|
ml-platform get-dataset <dataset_id> <dataset_version> --project <project>
|
|
99
101
|
ml-platform resolve-dataset <dataset_id> <dataset_version> --project <project>
|
|
@@ -129,8 +131,8 @@ npx --yes --registry=https://registry.npmjs.org/ \
|
|
|
129
131
|
## 包内容
|
|
130
132
|
|
|
131
133
|
- 一份由 TypeScript 编译的 business CLI;
|
|
132
|
-
-
|
|
133
|
-
`model-deployment-management`;
|
|
134
|
+
- 四份纯 Skill:`feature-management`、`data-source-exploration`、
|
|
135
|
+
`model-lifecycle-management` 与 `model-deployment-management`;
|
|
134
136
|
- 显式安装、升级、状态、校验和回滚逻辑。
|
|
135
137
|
|
|
136
138
|
不包含 Codex CLI、Python business-client wheel、Agent Host、平台服务端、模型训练或 Kubernetes
|
package/checksums.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"path": "runtime/business-client/package-lock.json",
|
|
10
|
-
"sha256": "sha256:
|
|
10
|
+
"sha256": "sha256:ebc31820ae0d2985879efd87ba4b0d8843e44a175d4c9e1dc557737893f8bdae",
|
|
11
11
|
"size_bytes": 1628
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"path": "runtime/business-client/package.json",
|
|
15
|
-
"sha256": "sha256:
|
|
15
|
+
"sha256": "sha256:4685ca172b5b23bd5de53bcccbd7f7412df281eff67533d72d1b598c63a28b47",
|
|
16
16
|
"size_bytes": 671
|
|
17
17
|
},
|
|
18
18
|
{
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"path": "runtime/business-client/src/cli.js",
|
|
25
|
-
"sha256": "sha256:
|
|
26
|
-
"size_bytes":
|
|
25
|
+
"sha256": "sha256:c1beda5fd4e2d6f23f81529017679d85c0703d6859cfa0155a8597e50b7b6cdf",
|
|
26
|
+
"size_bytes": 60617
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"path": "runtime/business-client/src/config.js",
|
|
@@ -35,6 +35,16 @@
|
|
|
35
35
|
"sha256": "sha256:4ae9e9ec10a74f36ed19ca7a63b0ba58a34cedea13ed95131ef1d07cd7d9e674",
|
|
36
36
|
"size_bytes": 17176
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"path": "skills/data-source-exploration/SKILL.md",
|
|
40
|
+
"sha256": "sha256:3b609d61f3c73da3657ce2e6bb4d1eff95a90e4ac5e5445b8513536438b26b0b",
|
|
41
|
+
"size_bytes": 3853
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "skills/data-source-exploration/agents/openai.yaml",
|
|
45
|
+
"sha256": "sha256:5c7f7d497ad7738c672b8ee906d514284a2f2583a854f8fa487708a75836256f",
|
|
46
|
+
"size_bytes": 299
|
|
47
|
+
},
|
|
38
48
|
{
|
|
39
49
|
"path": "skills/feature-management/SKILL.md",
|
|
40
50
|
"sha256": "sha256:88898ea83ff339512d5512537db485a2764420abb67afceb9dd090cc780c00e0",
|
package/package.json
CHANGED
package/release.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"entrypoint": "src/cli.js",
|
|
14
14
|
"name": "ml-platform",
|
|
15
15
|
"path": "runtime/business-client",
|
|
16
|
-
"sha256": "sha256:
|
|
17
|
-
"version": "0.8.
|
|
16
|
+
"sha256": "sha256:4e06df68d4f849eae92d1fcfb57f1a3b9e949f97ed8042ec549c8b460f3736c8",
|
|
17
|
+
"version": "0.8.3"
|
|
18
18
|
},
|
|
19
19
|
"policy_sha256": "sha256:02fbde0134696b78c0c365d6e0b76c9814227208da5b2b3d4e5dbd82dc4a3606",
|
|
20
20
|
"public_schema_versions": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ml_data_platform.feature_set/v1",
|
|
26
26
|
"ml_data_platform.dataset_manifest/v1"
|
|
27
27
|
],
|
|
28
|
-
"release_version": "0.2.2
|
|
28
|
+
"release_version": "0.2.2",
|
|
29
29
|
"runtime_requirements": {
|
|
30
30
|
"node": ">=18",
|
|
31
31
|
"os": [
|
|
@@ -35,24 +35,30 @@
|
|
|
35
35
|
},
|
|
36
36
|
"schema_version": "data_platform.ml_platform_release/v2",
|
|
37
37
|
"skills": {
|
|
38
|
+
"data-source-exploration": {
|
|
39
|
+
"path": "skills/data-source-exploration",
|
|
40
|
+
"requires_cli": ">=0.8.3 <0.9.0",
|
|
41
|
+
"revision": "0.2.2",
|
|
42
|
+
"sha256": "sha256:ae3cfc88f8f3f46a5b7e0179d850b2216bc37275f34679dbea1ff2ba99875a96"
|
|
43
|
+
},
|
|
38
44
|
"feature-management": {
|
|
39
45
|
"path": "skills/feature-management",
|
|
40
|
-
"requires_cli": ">=0.8.
|
|
41
|
-
"revision": "0.2.2
|
|
46
|
+
"requires_cli": ">=0.8.3 <0.9.0",
|
|
47
|
+
"revision": "0.2.2",
|
|
42
48
|
"sha256": "sha256:d32f0306f129d7bf76eb037fe239c84dd3c29c64b61600799d6e40320784bb10"
|
|
43
49
|
},
|
|
44
50
|
"model-deployment-management": {
|
|
45
51
|
"path": "skills/model-deployment-management",
|
|
46
|
-
"requires_cli": ">=0.8.
|
|
47
|
-
"revision": "0.2.2
|
|
52
|
+
"requires_cli": ">=0.8.3 <0.9.0",
|
|
53
|
+
"revision": "0.2.2",
|
|
48
54
|
"sha256": "sha256:e7d87c272a0dcc028ea628d5e36f5b7e52ed27cb9c1bc17ea76527478e28b46d"
|
|
49
55
|
},
|
|
50
56
|
"model-lifecycle-management": {
|
|
51
57
|
"path": "skills/model-lifecycle-management",
|
|
52
|
-
"requires_cli": ">=0.8.
|
|
53
|
-
"revision": "0.2.2
|
|
58
|
+
"requires_cli": ">=0.8.3 <0.9.0",
|
|
59
|
+
"revision": "0.2.2",
|
|
54
60
|
"sha256": "sha256:ec6ebb2587fd7acd024def75a8c0e9cd94b6cdd8ee6df439609291b496751b91"
|
|
55
61
|
}
|
|
56
62
|
},
|
|
57
|
-
"source_commit": "
|
|
63
|
+
"source_commit": "03bf8af26abcf13a95dc41d2637598a8f0233552"
|
|
58
64
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhuoyuezs/ml-platform-business-client",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@zhuoyuezs/ml-platform-business-client",
|
|
9
|
-
"version": "0.8.
|
|
9
|
+
"version": "0.8.3",
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"bin": {
|
|
12
12
|
"ml-platform": "src/cli.js"
|
|
@@ -13,7 +13,10 @@ const BUSINESS_COMMANDS = new Set([
|
|
|
13
13
|
"get-model-runtime-release", "get-training-run", "get-model-artifact", "get-executable-package",
|
|
14
14
|
"validate-training-job", "validate-model-package",
|
|
15
15
|
"version", "create-project", "list-projects", "get-project", "delete-project",
|
|
16
|
-
"configure", "show-config", "health",
|
|
16
|
+
"configure", "show-config", "health",
|
|
17
|
+
"list-datasource-connections", "list-datasource-namespaces", "list-datasource-objects",
|
|
18
|
+
"list-datasource-fields", "query-datasource-object",
|
|
19
|
+
"list-parameters", "list-operators", "list-features",
|
|
17
20
|
"list-feature-sets", "list-datasets", "get-dataset", "list-jobs", "resolve-manifest",
|
|
18
21
|
"resolve-dataset", "build-dataset", "build-registered-dataset",
|
|
19
22
|
"get-parameter", "get-feature", "get-feature-set", "get-operator",
|
|
@@ -49,6 +52,11 @@ const COMMAND_USAGE = {
|
|
|
49
52
|
configure: "configure --api-url URL",
|
|
50
53
|
"show-config": "show-config",
|
|
51
54
|
health: "health",
|
|
55
|
+
"list-datasource-connections": "list-datasource-connections [--limit N] [--cursor CURSOR]",
|
|
56
|
+
"list-datasource-namespaces": "list-datasource-namespaces CONNECTION_ID [--limit N] [--cursor CURSOR]",
|
|
57
|
+
"list-datasource-objects": "list-datasource-objects CONNECTION_ID NAMESPACE_ID [--limit N] [--cursor CURSOR]",
|
|
58
|
+
"list-datasource-fields": "list-datasource-fields CONNECTION_ID OBJECT_ID [--limit N] [--cursor CURSOR]",
|
|
59
|
+
"query-datasource-object": "query-datasource-object CONNECTION_ID OBJECT_ID SPEC_JSON [--cursor CURSOR]",
|
|
52
60
|
"create-project": "create-project NAME [--display-name TEXT] [--description TEXT] [--owner OWNER]",
|
|
53
61
|
"list-projects": "list-projects",
|
|
54
62
|
"get-project": "get-project NAME",
|
|
@@ -238,6 +246,13 @@ function readObject(file) {
|
|
|
238
246
|
}
|
|
239
247
|
function readDataset(file) { return normalizeDataset(readObject(file)); }
|
|
240
248
|
function readSpec(file) { return readObject(file); }
|
|
249
|
+
function datasourcePageParams(rest) {
|
|
250
|
+
const rawLimit = take(rest, "--limit");
|
|
251
|
+
const limit = rawLimit === undefined ? 100 : integer(rawLimit, "--limit");
|
|
252
|
+
if (limit < 1 || limit > 500)
|
|
253
|
+
throw new Error("--limit must be between 1 and 500");
|
|
254
|
+
return { limit, cursor: take(rest, "--cursor") };
|
|
255
|
+
}
|
|
241
256
|
function datasetEndpoint(project, datasetId, datasetVersion) {
|
|
242
257
|
return `/datasets/${encodeURIComponent(project)}/${encodeURIComponent(datasetId)}/${encodeURIComponent(datasetVersion)}`;
|
|
243
258
|
}
|
|
@@ -382,6 +397,32 @@ async function runBusinessCli(argv) {
|
|
|
382
397
|
}
|
|
383
398
|
else if (options.command === "health")
|
|
384
399
|
result = await client(options).get("/health");
|
|
400
|
+
else if (options.command === "list-datasource-connections") {
|
|
401
|
+
result = await client(options).get("/datasource-connections", datasourcePageParams(rest));
|
|
402
|
+
}
|
|
403
|
+
else if (options.command === "list-datasource-namespaces") {
|
|
404
|
+
const connectionId = positional(rest, "connection id");
|
|
405
|
+
result = await client(options).get(`/datasource-connections/${encodeURIComponent(connectionId)}/namespaces`, datasourcePageParams(rest));
|
|
406
|
+
}
|
|
407
|
+
else if (options.command === "list-datasource-objects") {
|
|
408
|
+
const connectionId = positional(rest, "connection id");
|
|
409
|
+
const namespaceId = positional(rest, "namespace id");
|
|
410
|
+
result = await client(options).get(`/datasource-connections/${encodeURIComponent(connectionId)}/namespaces/${encodeURIComponent(namespaceId)}/objects`, datasourcePageParams(rest));
|
|
411
|
+
}
|
|
412
|
+
else if (options.command === "list-datasource-fields") {
|
|
413
|
+
const connectionId = positional(rest, "connection id");
|
|
414
|
+
const objectId = positional(rest, "object id");
|
|
415
|
+
result = await client(options).get(`/datasource-connections/${encodeURIComponent(connectionId)}/objects/${encodeURIComponent(objectId)}/fields`, datasourcePageParams(rest));
|
|
416
|
+
}
|
|
417
|
+
else if (options.command === "query-datasource-object") {
|
|
418
|
+
const connectionId = positional(rest, "connection id");
|
|
419
|
+
const objectId = positional(rest, "object id");
|
|
420
|
+
const spec = readSpec(positional(rest, "query spec JSON"));
|
|
421
|
+
const cursor = take(rest, "--cursor");
|
|
422
|
+
if (cursor !== undefined)
|
|
423
|
+
spec.cursor = cursor;
|
|
424
|
+
result = await client(options).post(`/datasource-connections/${encodeURIComponent(connectionId)}/objects/${encodeURIComponent(objectId)}/query`, spec);
|
|
425
|
+
}
|
|
385
426
|
else if (options.command === "create-project") {
|
|
386
427
|
const name = positional(rest, "project name");
|
|
387
428
|
result = await client(options).post("/projects", { schema_version: "ml_data_platform.project/v1", name, display_name: take(rest, "--display-name", name), description: take(rest, "--description", ""), owner: take(rest, "--owner", "demo") });
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-source-exploration
|
|
3
|
+
description: Discover platform-configured PostgreSQL, MySQL, SQL Server, or InfluxDB objects and run bounded structured reads for local data and feature exploration. Use when an algorithm engineer wants to inspect visible databases, schemas, tables, measurements, fields, or limited rows before defining governed feature assets. Do not use for free-form SQL, bulk export, asset publication, dataset builds, or model training.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Data Source Exploration
|
|
7
|
+
|
|
8
|
+
Use the platform API through `ml-platform`; never connect to a business database directly and
|
|
9
|
+
never request credentials. The platform exposes configured connections and their discoverable objects.
|
|
10
|
+
|
|
11
|
+
## Establish The Target
|
|
12
|
+
|
|
13
|
+
Before discovery, verify the installed client and server target:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
command -v ml-platform
|
|
17
|
+
ml-platform health
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If the server target is missing or unhealthy, stop. Do not fall back to a DSN, database client, SQL,
|
|
21
|
+
Flux, or a repository-local source adapter.
|
|
22
|
+
|
|
23
|
+
## Discover Hierarchically
|
|
24
|
+
|
|
25
|
+
Read one level at a time and preserve the returned opaque IDs:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
ml-platform list-datasource-connections
|
|
29
|
+
ml-platform list-datasource-namespaces <connection_id>
|
|
30
|
+
ml-platform list-datasource-objects <connection_id> <namespace_id>
|
|
31
|
+
ml-platform list-datasource-fields <connection_id> <object_id>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Follow `next_cursor` with `--cursor` until it is null when complete traversal is needed. Do not derive an
|
|
35
|
+
ID from a database, schema, table, measurement, or field name. An absent object means it is unavailable
|
|
36
|
+
or no longer present; do not probe alternate names.
|
|
37
|
+
|
|
38
|
+
## Query One Object
|
|
39
|
+
|
|
40
|
+
Create a `DatasourceQuerySpec` JSON in the user's workspace. Select only fields needed for the current
|
|
41
|
+
question, use bounded time filters for time-series data, and start with a small `limit`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"schema_version": "ml_data_platform.datasource_query/v1",
|
|
46
|
+
"field_ids": ["fld_time", "fld_entity", "fld_value"],
|
|
47
|
+
"filters": [
|
|
48
|
+
{
|
|
49
|
+
"field_id": "fld_time",
|
|
50
|
+
"operator": "between",
|
|
51
|
+
"values": ["2026-09-01T00:00:00+08:00", "2026-09-02T00:00:00+08:00"]
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"order_by": [{"field_id": "fld_time", "direction": "asc"}],
|
|
55
|
+
"limit": 200,
|
|
56
|
+
"cursor": null
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Run it with:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ml-platform query-datasource-object \
|
|
64
|
+
<connection_id> <object_id> datasource-query.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Supported filters are `eq`, `in`, `gt`, `gte`, `lt`, `lte`, `between`, and `is_null`. Only fields marked
|
|
68
|
+
filterable or sortable may be used in those positions. InfluxDB reads require bounded `_time` start and
|
|
69
|
+
end filters. For the next page, keep projection, filters, ordering, and `limit` unchanged and pass the
|
|
70
|
+
returned cursor with `--cursor`.
|
|
71
|
+
|
|
72
|
+
## Explore In The Workspace
|
|
73
|
+
|
|
74
|
+
Analyze returned rows with local code such as pandas or DuckDB. Keep these outputs outside the platform
|
|
75
|
+
repository unless the user explicitly asks for a repository-owned fixture. Record:
|
|
76
|
+
|
|
77
|
+
- the connection, namespace, object, field IDs, query spec, `audit_ref`, and response hash;
|
|
78
|
+
- observed facts such as dtypes, missingness, frequency, ranges, duplicates, and candidate entity/time keys;
|
|
79
|
+
- hypotheses about business meaning, target suitability, leakage, transformations, and model features;
|
|
80
|
+
- unresolved items that require a data owner or business owner to confirm.
|
|
81
|
+
|
|
82
|
+
Do not present inferred semantics as facts. Query results are exploratory evidence, not training data and
|
|
83
|
+
not a substitute for Parameter, Feature, FeatureSet, DatasetManifest, or DatasetArtifact.
|
|
84
|
+
|
|
85
|
+
## Hand Off Confirmed Work
|
|
86
|
+
|
|
87
|
+
After a human confirms source mapping, event time, entity keys, units, availability, quality rules, target,
|
|
88
|
+
horizon, and feature formulas, use `$feature-management` to create governed assets and build a
|
|
89
|
+
DatasetArtifact. Use `$model-lifecycle-management` only after that artifact exists. Exploration does not
|
|
90
|
+
authorize publishing assets, building datasets, or submitting training jobs.
|