@zhuoyuezs/ml-platform 0.1.14 → 0.1.16

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/checksums.json CHANGED
@@ -7,23 +7,23 @@
7
7
  },
8
8
  {
9
9
  "path": "runtime/business-client/package-lock.json",
10
- "sha256": "sha256:ce726848e97416159f1fe8141082f67927405b45de8367e35c3da30cb0e8a639",
10
+ "sha256": "sha256:a8da8027de475825949a661bc0d5674903e686d72ac945dcd964febfc5cf4667",
11
11
  "size_bytes": 381
12
12
  },
13
13
  {
14
14
  "path": "runtime/business-client/package.json",
15
- "sha256": "sha256:c275cc028d7f1e0257d1354ed2df082f879a6c79d17e73d65ae2e21b80dee33d",
15
+ "sha256": "sha256:e1f916820a4bb19929a76f2690970068d17bb12bf640b89aae007eef50ef7b95",
16
16
  "size_bytes": 501
17
17
  },
18
18
  {
19
19
  "path": "runtime/business-client/src/catalog.js",
20
- "sha256": "sha256:6c8f800574fda6ccc4e6176d9d607d4408df2e88c8e9c33289701dd7699b50ca",
21
- "size_bytes": 56017
20
+ "sha256": "sha256:9de30ed45b99e3be6ca23f0f0087cbbbf91f644f032273ccf3bec00e8062062e",
21
+ "size_bytes": 56271
22
22
  },
23
23
  {
24
24
  "path": "runtime/business-client/src/cli.js",
25
- "sha256": "sha256:5a31e407dba79205e56d2ed1e74260213d0b89c6bb5a665ec0f52e92927ebcaf",
26
- "size_bytes": 44897
25
+ "sha256": "sha256:4f135325b57725c614d266285013df799cdd9a2096d8fbe0a9e9608dae2bcdb7",
26
+ "size_bytes": 44947
27
27
  },
28
28
  {
29
29
  "path": "runtime/business-client/src/config.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "ML 数据平台 business CLI 与 Agent Skills 管理工具",
5
5
  "bin": {
6
6
  "ml-platform": "scripts/main.js"
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:b7c1b24987c680dc1b13bbcf49dc61c4856e9843a06499f78ed5bbd6ac10c0f5",
17
- "version": "0.7.4"
16
+ "sha256": "sha256:262508ceeef693cdd580e2952f49161d860cee257fbc87ee46c95979cf1285d1",
17
+ "version": "0.7.6"
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.1.14",
28
+ "release_version": "0.1.16",
29
29
  "runtime_requirements": {
30
30
  "node": ">=18",
31
31
  "os": [
@@ -37,16 +37,16 @@
37
37
  "skills": {
38
38
  "feature-management": {
39
39
  "path": "skills/feature-management",
40
- "requires_cli": ">=0.7.4 <0.8.0",
41
- "revision": "0.1.14",
40
+ "requires_cli": ">=0.7.6 <0.8.0",
41
+ "revision": "0.1.16",
42
42
  "sha256": "sha256:182b6f2df4fe58c946e482dfaf416c7d5b78c6fde9c8c8d7293103246618cb4e"
43
43
  },
44
44
  "model-lifecycle-management": {
45
45
  "path": "skills/model-lifecycle-management",
46
- "requires_cli": ">=0.7.4 <0.8.0",
47
- "revision": "0.1.14",
46
+ "requires_cli": ">=0.7.6 <0.8.0",
47
+ "revision": "0.1.16",
48
48
  "sha256": "sha256:61ba17f955b36d1c2e8329a10454d040ee7eca5afdb90ff0914d3f85b6e2d203"
49
49
  }
50
50
  },
51
- "source_commit": "9175c96d8475003b17c5e0c4c3df4f8cf8614c0f"
51
+ "source_commit": "49bc1482ab3a58874e40e308640db26e13e6ef12"
52
52
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform-business-client",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zhuoyuezs/ml-platform-business-client",
9
- "version": "0.7.4",
9
+ "version": "0.7.6",
10
10
  "license": "UNLICENSED",
11
11
  "bin": {
12
12
  "ml-platform": "src/cli.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform-business-client",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "private": true,
5
5
  "description": "JavaScript implementation of the ML Platform business client",
6
6
  "bin": {
@@ -146,6 +146,13 @@ function normalizeRegistryDataset(payload) {
146
146
  return normalized;
147
147
  }
148
148
 
149
+ function normalizeCatalogRegistryDataset(payload) {
150
+ const normalized = normalizeRegistryDataset(payload);
151
+ delete normalized.entity_keys;
152
+ if (!normalized.label_materializations?.length) delete normalized.label_materializations;
153
+ return normalized;
154
+ }
155
+
149
156
  function assetPath(root, relative, suffix) { if (typeof relative !== "string" || !relative) throw new Error("catalog asset path must be a non-empty string"); if (path.isAbsolute(relative)) throw new Error(`catalog asset path must be relative: ${relative}`); const target = path.resolve(root, relative); if (path.extname(target).toLowerCase() !== suffix) throw new Error(`catalog asset must use ${suffix}: ${relative}`); if (!target.startsWith(`${root}${path.sep}`)) throw new Error(`catalog asset path escapes catalog directory: ${relative}`); if (!fs.existsSync(target) || !fs.statSync(target).isFile()) throw new Error(`catalog asset not found: ${target}`); return target; }
150
157
  function readJson(file) { try { return JSON.parse(fs.readFileSync(file, "utf8")); } catch (error) { throw new Error(`cannot read JSON asset ${file}: ${error.message}`); } }
151
158
  function readObject(file) { return object(readJson(file), `JSON file ${file}`); }
@@ -178,7 +185,7 @@ async function hydrateCatalog(client, catalog, current) {
178
185
  await hydrate(client, current.operators, [...catalog.operators.map((item) => item.spec), ...operatorRefs], resource("operators"), normalizeOperator, key, hydrated.operators);
179
186
  const featureSetRefs = catalog.datasets.map((asset) => ({ project: asset.project, ...asset.feature_set }));
180
187
  await hydrate(client, current.feature_sets, [...catalog.feature_sets, ...featureSetRefs], resource("feature-sets"), normalizeFeatureSet, key, hydrated.feature_sets);
181
- await hydrate(client, current.datasets, catalog.datasets, (asset) => `/datasets/${encodeURIComponent(asset.project)}/${encodeURIComponent(asset.dataset_id)}/${encodeURIComponent(asset.dataset_version)}`, normalizeDataset, datasetKey, hydrated.datasets);
188
+ await hydrate(client, current.datasets, catalog.datasets, (asset) => `/datasets/${encodeURIComponent(asset.project)}/${encodeURIComponent(asset.dataset_id)}/${encodeURIComponent(asset.dataset_version)}`, normalizeCatalogRegistryDataset, datasetKey, hydrated.datasets);
182
189
  const declaredFeatureSets = new Map(catalog.feature_sets.map((asset) => [key(asset), asset]));
183
190
  const featureRefs = catalog.datasets.flatMap((asset) => (declaredFeatureSets.get(referenceKey(asset.feature_set)) ?? current.feature_sets.get(referenceKey(asset.feature_set)) ?? { features: [] }).features.map((feature) => ({ project: asset.project, ...feature })));
184
191
  await hydrate(client, current.features, [...catalog.features, ...featureRefs], resource("features"), normalizeFeature, key, hydrated.features);
@@ -220,7 +227,7 @@ async function applyCatalog(catalog, client, dryRun, targetProject) {
220
227
  try {
221
228
  await plain(catalog.parameters, current.parameters, "parameters", "/parameters");
222
229
  for (const item of catalog.operators) { const assetKey = key(item.spec); if (current.operators.has(assetKey)) summary.operators.unchanged += 1; else if (dryRun) summary.operators.planned += 1; else { let candidate = item.spec; if (item.package_path) { const uploaded = await client.uploadOperatorPackage(item.spec.project, item.spec.name, item.spec.version, item.package_path); candidate = normalizeOperator({ ...item.spec, code_hash: uploaded.code_artifact.sha256, package_uri: uploaded.code_artifact.uri, code_artifact: uploaded.code_artifact }); } await client.post("/operators", candidate); summary.operators.applied += 1; } }
223
- await plain(catalog.features, current.features, "features", "/features"); await plain(catalog.feature_sets, current.feature_sets, "feature_sets", "/feature-sets"); await plain(catalog.datasets, current.datasets, "datasets", "/datasets", datasetKey, { force: false });
230
+ await plain(catalog.features, current.features, "features", "/features"); await plain(catalog.feature_sets, current.feature_sets, "feature_sets", "/feature-sets"); await plain(catalog.datasets, current.datasets, "datasets", "/datasets", datasetKey);
224
231
  } catch (error) { throw new Error(`catalog apply failed after progress=${JSON.stringify(canonical(summary))}: ${error.message}`); }
225
232
  return { status: dryRun ? "validated" : "applied", profile: "server", catalog: { name: catalog.manifest.name, version: catalog.manifest.version, path: catalog.path }, summary };
226
233
  }
@@ -405,8 +405,9 @@ async function runBusinessCli(argv) {
405
405
  ({ result, exitCode } = await submitBuild(api, manifest, build));
406
406
  } else if (["add-dataset", "update-dataset"].includes(options.command)) {
407
407
  const manifest = readDataset(positional(rest, "manifest JSON")); const force = boolean(rest, "--force"); const project = manifest.project || "default";
408
- if (options.command === "add-dataset") result = await client(options).post("/datasets", manifest, { force });
409
- else result = await client(options).put(`/datasets/${encodeURIComponent(project)}/${encodeURIComponent(manifest.dataset_id)}/${encodeURIComponent(manifest.dataset_version)}`, manifest, { force });
408
+ const params = force ? { force: true } : undefined;
409
+ if (options.command === "add-dataset") result = await client(options).post("/datasets", manifest, params);
410
+ else result = await client(options).put(`/datasets/${encodeURIComponent(project)}/${encodeURIComponent(manifest.dataset_id)}/${encodeURIComponent(manifest.dataset_version)}`, manifest, params);
410
411
  } else if (options.command === "delete-dataset") {
411
412
  const id = positional(rest, "dataset id"); const version = positional(rest, "dataset version"); const project = take(rest, "--project", "default");
412
413
  result = await client(options).delete(`/datasets/${encodeURIComponent(project)}/${encodeURIComponent(id)}/${encodeURIComponent(version)}`);