mlclaw 0.4.8 → 0.4.10

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/Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
1
  ARG OPENCLAW_VERSION=2026.7.1
2
2
  ARG OPENCLAW_BASE_IMAGE=ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION}
3
- ARG BROKERKIT_PLUGIN_VERSION=0.3.4
4
- ARG BROKERKIT_VERSION=hf-broker/v0.4.2
5
- ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/huggingface/mlclaw:0.4.8-openclaw-2026.7.1
3
+ ARG BROKERKIT_PLUGIN_VERSION=0.4.1
4
+ ARG BROKERKIT_VERSION=hf-broker/v0.5.2
5
+ ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/huggingface/mlclaw:0.4.10-openclaw-2026.7.1
6
6
 
7
7
  FROM golang:1.26.5-bookworm AS hf-broker-build
8
8
  ARG BROKERKIT_VERSION
@@ -947,6 +947,8 @@ var formats = import_formats.default.fullFormats;
947
947
  var equal = import_equal.default.default ?? import_equal.default;
948
948
  var ucs2length = import_ucs2length.default.default ?? import_ucs2length.default;
949
949
  var validateDescriptor = validate20;
950
+ var pattern4 = new RegExp("^sha256:[0-9a-f]{64}$", "u");
951
+ var func1 = ucs2length;
950
952
  function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
951
953
  ;
952
954
  let vErrors = null;
@@ -962,13 +964,13 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
962
964
  if (errors === _errs0) {
963
965
  if (data && typeof data == "object" && !Array.isArray(data)) {
964
966
  let missing0;
965
- if (data.api_version === void 0 && (missing0 = "api_version")) {
967
+ if (data.api_version === void 0 && (missing0 = "api_version") || data.contract_digest === void 0 && (missing0 = "contract_digest") || data.build_id === void 0 && (missing0 = "build_id")) {
966
968
  validate20.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
967
969
  return false;
968
970
  } else {
969
971
  const _errs2 = errors;
970
972
  for (const key0 in data) {
971
- if (!(key0 === "api_version")) {
973
+ if (!(key0 === "api_version" || key0 === "contract_digest" || key0 === "build_id")) {
972
974
  validate20.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
973
975
  return false;
974
976
  break;
@@ -977,6 +979,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
977
979
  if (_errs2 === errors) {
978
980
  if (data.api_version !== void 0) {
979
981
  let data0 = data.api_version;
982
+ const _errs3 = errors;
980
983
  if (typeof data0 !== "string") {
981
984
  validate20.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/api_version/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
982
985
  return false;
@@ -985,6 +988,54 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
985
988
  validate20.errors = [{ instancePath: instancePath + "/api_version", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/api_version/const", keyword: "const", params: { allowedValue: "brokerkit.io/operator/v1" }, message: "must be equal to constant" }];
986
989
  return false;
987
990
  }
991
+ var valid1 = _errs3 === errors;
992
+ } else {
993
+ var valid1 = true;
994
+ }
995
+ if (valid1) {
996
+ if (data.contract_digest !== void 0) {
997
+ let data1 = data.contract_digest;
998
+ const _errs5 = errors;
999
+ if (errors === _errs5) {
1000
+ if (typeof data1 === "string") {
1001
+ if (!pattern4.test(data1)) {
1002
+ validate20.errors = [{ instancePath: instancePath + "/contract_digest", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/contract_digest/pattern", keyword: "pattern", params: { pattern: "^sha256:[0-9a-f]{64}$" }, message: 'must match pattern "^sha256:[0-9a-f]{64}$"' }];
1003
+ return false;
1004
+ }
1005
+ } else {
1006
+ validate20.errors = [{ instancePath: instancePath + "/contract_digest", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/contract_digest/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1007
+ return false;
1008
+ }
1009
+ }
1010
+ var valid1 = _errs5 === errors;
1011
+ } else {
1012
+ var valid1 = true;
1013
+ }
1014
+ if (valid1) {
1015
+ if (data.build_id !== void 0) {
1016
+ let data2 = data.build_id;
1017
+ const _errs7 = errors;
1018
+ if (errors === _errs7) {
1019
+ if (typeof data2 === "string") {
1020
+ if (func1(data2) > 128) {
1021
+ validate20.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/build_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
1022
+ return false;
1023
+ } else {
1024
+ if (func1(data2) < 1) {
1025
+ validate20.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/build_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
1026
+ return false;
1027
+ }
1028
+ }
1029
+ } else {
1030
+ validate20.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor/properties/build_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1031
+ return false;
1032
+ }
1033
+ }
1034
+ var valid1 = _errs7 === errors;
1035
+ } else {
1036
+ var valid1 = true;
1037
+ }
1038
+ }
988
1039
  }
989
1040
  }
990
1041
  }
@@ -997,7 +1048,6 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
997
1048
  return errors === 0;
998
1049
  }
999
1050
  validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
1000
- var func1 = ucs2length;
1001
1051
  function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1002
1052
  ;
1003
1053
  let vErrors = null;
@@ -1013,13 +1063,13 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1013
1063
  if (errors === _errs0) {
1014
1064
  if (data && typeof data == "object" && !Array.isArray(data)) {
1015
1065
  let missing0;
1016
- if (data.status === void 0 && (missing0 = "status")) {
1066
+ if (data.status === void 0 && (missing0 = "status") || data.contract_digest === void 0 && (missing0 = "contract_digest") || data.build_id === void 0 && (missing0 = "build_id")) {
1017
1067
  validate22.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1018
1068
  return false;
1019
1069
  } else {
1020
1070
  const _errs2 = errors;
1021
1071
  for (const key0 in data) {
1022
- if (!(key0 === "status")) {
1072
+ if (!(key0 === "status" || key0 === "contract_digest" || key0 === "build_id")) {
1023
1073
  validate22.errors = [{ instancePath, schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
1024
1074
  return false;
1025
1075
  break;
@@ -1045,6 +1095,54 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1045
1095
  return false;
1046
1096
  }
1047
1097
  }
1098
+ var valid1 = _errs3 === errors;
1099
+ } else {
1100
+ var valid1 = true;
1101
+ }
1102
+ if (valid1) {
1103
+ if (data.contract_digest !== void 0) {
1104
+ let data1 = data.contract_digest;
1105
+ const _errs5 = errors;
1106
+ if (errors === _errs5) {
1107
+ if (typeof data1 === "string") {
1108
+ if (!pattern4.test(data1)) {
1109
+ validate22.errors = [{ instancePath: instancePath + "/contract_digest", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/contract_digest/pattern", keyword: "pattern", params: { pattern: "^sha256:[0-9a-f]{64}$" }, message: 'must match pattern "^sha256:[0-9a-f]{64}$"' }];
1110
+ return false;
1111
+ }
1112
+ } else {
1113
+ validate22.errors = [{ instancePath: instancePath + "/contract_digest", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/contract_digest/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1114
+ return false;
1115
+ }
1116
+ }
1117
+ var valid1 = _errs5 === errors;
1118
+ } else {
1119
+ var valid1 = true;
1120
+ }
1121
+ if (valid1) {
1122
+ if (data.build_id !== void 0) {
1123
+ let data2 = data.build_id;
1124
+ const _errs7 = errors;
1125
+ if (errors === _errs7) {
1126
+ if (typeof data2 === "string") {
1127
+ if (func1(data2) > 128) {
1128
+ validate22.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/build_id/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" }];
1129
+ return false;
1130
+ } else {
1131
+ if (func1(data2) < 1) {
1132
+ validate22.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/build_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }];
1133
+ return false;
1134
+ }
1135
+ }
1136
+ } else {
1137
+ validate22.errors = [{ instancePath: instancePath + "/build_id", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Health/properties/build_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1138
+ return false;
1139
+ }
1140
+ }
1141
+ var valid1 = _errs7 === errors;
1142
+ } else {
1143
+ var valid1 = true;
1144
+ }
1145
+ }
1048
1146
  }
1049
1147
  }
1050
1148
  }
@@ -1062,7 +1160,7 @@ var schema37 = { "type": "object", "additionalProperties": false, "required": ["
1062
1160
  var schema38 = { "type": "string", "enum": ["pending", "active", "denied", "canceled", "expired", "consumed", "revoked"] };
1063
1161
  var schema44 = { "type": "string", "enum": ["approve", "deny", "revoke"] };
1064
1162
  var schema45 = { "type": "object", "additionalProperties": false, "required": ["max_duration_seconds", "max_uses"], "properties": { "max_duration_seconds": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "max_uses": { "type": ["integer", "null"], "minimum": 1, "maximum": 9007199254740991 } } };
1065
- var func3 = Object.prototype.hasOwnProperty;
1163
+ var func7 = Object.prototype.hasOwnProperty;
1066
1164
  var func0 = equal;
1067
1165
  var formats0 = formats["date-time"];
1068
1166
  var schema40 = { "type": "string", "enum": ["unknown", "low", "medium", "high", "critical"] };
@@ -1441,7 +1539,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
1441
1539
  } else {
1442
1540
  const _errs1 = errors;
1443
1541
  for (const key0 in data) {
1444
- if (!func3.call(schema37.properties, key0)) {
1542
+ if (!func7.call(schema37.properties, key0)) {
1445
1543
  validate24.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
1446
1544
  return false;
1447
1545
  break;
@@ -2022,7 +2120,7 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
2022
2120
  } else {
2023
2121
  const _errs1 = errors;
2024
2122
  for (const key0 in data) {
2025
- if (!func3.call(schema37.properties, key0)) {
2123
+ if (!func7.call(schema37.properties, key0)) {
2026
2124
  validate32.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
2027
2125
  return false;
2028
2126
  break;
@@ -3083,7 +3181,7 @@ function validate39(data, { instancePath = "", parentData, parentDataProperty, r
3083
3181
  return errors === 0;
3084
3182
  }
3085
3183
  validate39.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
3086
- var pattern4 = new RegExp("^[A-Za-z0-9_-]+$", "u");
3184
+ var pattern6 = new RegExp("^[A-Za-z0-9_-]+$", "u");
3087
3185
  function validate47(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3088
3186
  let vErrors = null;
3089
3187
  let errors = 0;
@@ -3171,7 +3269,7 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
3171
3269
  validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/minLength", keyword: "minLength", params: { limit: 22 }, message: "must NOT have fewer than 22 characters" }];
3172
3270
  return false;
3173
3271
  } else {
3174
- if (!pattern4.test(data2)) {
3272
+ if (!pattern6.test(data2)) {
3175
3273
  validate47.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' }];
3176
3274
  return false;
3177
3275
  }
@@ -3841,7 +3939,7 @@ function validate54(data, { instancePath = "", parentData, parentDataProperty, r
3841
3939
  validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/minLength", keyword: "minLength", params: { limit: 22 }, message: "must NOT have fewer than 22 characters" }];
3842
3940
  return false;
3843
3941
  } else {
3844
- if (!pattern4.test(data2)) {
3942
+ if (!pattern6.test(data2)) {
3845
3943
  validate54.errors = [{ instancePath: instancePath + "/handle", schemaPath: "#/properties/handle/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' }];
3846
3944
  return false;
3847
3945
  }
package/dist/mlclaw.mjs CHANGED
@@ -15383,10 +15383,10 @@ function nextLink(header) {
15383
15383
 
15384
15384
  // src/mlclaw/release-config.generated.ts
15385
15385
  var RELEASE_CONFIG = {
15386
- "packageVersion": "0.4.8",
15386
+ "packageVersion": "0.4.10",
15387
15387
  "openclawVersion": "2026.7.1",
15388
- "brokerkitVersion": "hf-broker/v0.4.2",
15389
- "brokerkitPluginVersion": "0.3.4",
15388
+ "brokerkitVersion": "hf-broker/v0.5.2",
15389
+ "brokerkitPluginVersion": "0.4.1",
15390
15390
  "runtimeImageRepository": "ghcr.io/huggingface/mlclaw"
15391
15391
  };
15392
15392
 
@@ -23346,8 +23346,9 @@ async function update(repoId, opts, hub, hfToken, runtime) {
23346
23346
  }
23347
23347
  const runtimeImage = resolveSpaceRuntimeImage(opts, runtime.env);
23348
23348
  const agentName = variables.get("OPENCLAW_AGENT_NAME")?.value?.trim() || repoId.split("/")[1] || "openclaw";
23349
+ let localManifest;
23349
23350
  if (!canonicalTemplate) {
23350
- await ensureUpdateCredentials({
23351
+ localManifest = await ensureUpdateCredentials({
23351
23352
  repoId,
23352
23353
  agentName,
23353
23354
  model: variables.get("OPENCLAW_MODEL")?.value ?? DEFAULT_MODEL2,
@@ -23362,8 +23363,9 @@ async function update(repoId, opts, hub, hfToken, runtime) {
23362
23363
  token: hfToken,
23363
23364
  ...runtimeImage ? { runtimeImage } : {}
23364
23365
  });
23366
+ const effectiveRuntimeImage = runtimeImage ?? bundledSpaceRuntimeRef(templateRev);
23365
23367
  await hub.addSpaceVariable(repoId, "MLCLAW_TEMPLATE_REV", templateRev);
23366
- await hub.addSpaceVariable(repoId, "MLCLAW_RUNTIME_IMAGE", runtimeImage ?? bundledSpaceRuntimeRef(templateRev));
23368
+ await hub.addSpaceVariable(repoId, "MLCLAW_RUNTIME_IMAGE", effectiveRuntimeImage);
23367
23369
  if (canonicalTemplate) {
23368
23370
  await hub.addSpaceVariable(repoId, "MLCLAW_CANONICAL_SPACE_ID", canonicalTemplateSpaceId(runtime.env));
23369
23371
  await doctor(repoId, { fix: true }, hub, runtime);
@@ -23382,8 +23384,36 @@ async function update(repoId, opts, hub, hfToken, runtime) {
23382
23384
  await ensureSpaceStateVolume(hub, repoId, bucket);
23383
23385
  }
23384
23386
  await doctor(repoId, { fix: true }, hub, runtime);
23387
+ if (!localManifest) {
23388
+ throw new Error(`local deployment metadata is unavailable for ${repoId}`);
23389
+ }
23390
+ await reconcileUpdatedDeployment(localManifest, effectiveRuntimeImage, hub, runtime);
23385
23391
  runtime.stdout.log(`Space deployment triggered: ${repoId}`);
23386
23392
  }
23393
+ async function reconcileUpdatedDeployment(localManifest, runtimeImage, hub, runtime) {
23394
+ const secrets = await readSecretEnv(runtime.configRoot, localManifest.agent);
23395
+ await reconcileManifest({
23396
+ manifest: {
23397
+ ...localManifest,
23398
+ gatewayLocation: "space",
23399
+ runtimeImage,
23400
+ updatedAt: runtime.now().toISOString()
23401
+ },
23402
+ bucketPrefix: persistedBucketPrefix(secrets),
23403
+ hub,
23404
+ runtime,
23405
+ apply: async ({ manifest, assertLease }) => {
23406
+ await assertLease();
23407
+ const currentSecrets = await readSecretEnv(runtime.configRoot, manifest.agent);
23408
+ await writeLocalDeployment(runtime.configRoot, manifest, {
23409
+ ...currentSecrets,
23410
+ MLCLAW_GATEWAY_LOCATION: "space",
23411
+ MLCLAW_RUNTIME_IMAGE: runtimeImage,
23412
+ MLCLAW_RUNTIME_ID: spaceRuntimeId(manifest.agent)
23413
+ });
23414
+ }
23415
+ });
23416
+ }
23387
23417
  async function ensureUpdateCredentials(params) {
23388
23418
  const hasExplicitOverride = params.opts.routerToken !== void 0 || params.opts.routerTokenFile !== void 0;
23389
23419
  const hasManifest = await manifestExists(params.runtime.configRoot, params.agentName);
@@ -23417,6 +23447,7 @@ async function ensureUpdateCredentials(params) {
23417
23447
  MLCLAW_BROKER_HF_TOKEN: brokerCredential.token,
23418
23448
  ...routerToken ? { MLCLAW_ROUTER_TOKEN: routerToken } : {}
23419
23449
  });
23450
+ return localManifest;
23420
23451
  }
23421
23452
  async function doctor(repoId, opts, hub, runtime) {
23422
23453
  if (!repoId.includes("/") && await manifestExists(runtime.configRoot, repoId)) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mlclaw",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "license": "MIT",
5
5
  "config": {
6
6
  "openclawVersion": "2026.7.1",
7
- "brokerkitVersion": "hf-broker/v0.4.2",
8
- "brokerkitPluginVersion": "0.3.4",
7
+ "brokerkitVersion": "hf-broker/v0.5.2",
8
+ "brokerkitPluginVersion": "0.4.1",
9
9
  "runtimeImageRepository": "ghcr.io/huggingface/mlclaw"
10
10
  },
11
11
  "repository": {
@@ -76,7 +76,7 @@
76
76
  "commander": "^14.0.3",
77
77
  "hono": "^4.12.28",
78
78
  "lucide-react": "^0.468.0",
79
- "openclaw-brokerkit": "0.3.4",
79
+ "openclaw-brokerkit": "0.4.1",
80
80
  "react": "^19.2.7",
81
81
  "react-dom": "^19.2.7",
82
82
  "skillflag": "^0.2.0",