@warmhub/cli 0.94.0 → 0.96.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 (2) hide show
  1. package/dist/wh.js +20 -26
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -42109,47 +42109,41 @@ function normalizeOptionalTypeSpec(spec) {
42109
42109
  return { spec, optionalByType: false };
42110
42110
  }
42111
42111
 
42112
- // ../../packages/rules/src/shape-validation-runtime.ts
42113
- function validatePersistedStringFieldLimits(value, typeDef, errors3, path) {
42114
- const normalized = normalizeOptionalTypeSpec(typeDef).spec;
42112
+ // ../../packages/rules/src/shape-validation-content-limits.ts
42113
+ function validatePersistedContentLimits(value, typeDefs, errors3, path) {
42114
+ const declared = normalizedCandidates(typeDefs);
42115
42115
  if (typeof value === "string") {
42116
- if (isDeclaredStringType(normalized) || isDeclaredWrefType(normalized))
42117
- return;
42118
- if (normalized !== undefined)
42116
+ if (declared.length > 0)
42119
42117
  return;
42120
42118
  assertContentFieldWithinLimit(path ?? "<value>", value, errors3);
42121
42119
  return;
42122
42120
  }
42123
42121
  if (Array.isArray(value)) {
42124
- const elementType = arrayElementType(normalized);
42125
- if (normalized !== undefined && elementType === undefined && !isDeclaredArrayType(normalized)) {
42122
+ const arrayCandidates = declared.filter(isDeclaredArrayType);
42123
+ if (declared.length > 0 && arrayCandidates.length === 0)
42126
42124
  return;
42127
- }
42125
+ const elementTypes = definedOnly(arrayCandidates.map(arrayElementType));
42128
42126
  for (let i = 0;i < value.length; i++) {
42129
- validatePersistedStringFieldLimits(value[i], elementType, errors3, `${path ?? "<value>"}[${i}]`);
42127
+ validatePersistedContentLimits(value[i], elementTypes, errors3, `${path ?? "<value>"}[${i}]`);
42130
42128
  }
42131
42129
  return;
42132
42130
  }
42133
42131
  if (!isPlainObject2(value))
42134
42132
  return;
42135
- const fields = nestedObjectFields(normalized);
42136
- if (normalized !== undefined && fields === undefined)
42133
+ const objectCandidates = definedOnly(declared.map(nestedObjectFields));
42134
+ if (declared.length > 0 && objectCandidates.length === 0)
42137
42135
  return;
42138
42136
  for (const [key, nestedValue] of Object.entries(value)) {
42139
42137
  const keyPath = path ? joinFieldPath(path, key) : escapeFieldNameForDisplay(key);
42140
42138
  assertContentFieldWithinLimit(keyPath, key, errors3);
42141
- validatePersistedStringFieldLimits(nestedValue, fields?.get(key), errors3, keyPath);
42139
+ validatePersistedContentLimits(nestedValue, definedOnly(objectCandidates.map((fields) => fields.get(key))), errors3, keyPath);
42142
42140
  }
42143
42141
  }
42144
- function isDeclaredStringType(typeDef) {
42145
- if (typeDef === "string")
42146
- return true;
42147
- return isTypeSpecObject(typeDef) && typeDef.type === "string";
42142
+ function normalizedCandidates(typeDefs) {
42143
+ return definedOnly(typeDefs.map((typeDef) => normalizeOptionalTypeSpec(typeDef).spec));
42148
42144
  }
42149
- function isDeclaredWrefType(typeDef) {
42150
- if (typeDef === "wref")
42151
- return true;
42152
- return isTypeSpecObject(typeDef) && typeDef.type === "wref";
42145
+ function definedOnly(values) {
42146
+ return values.filter((value) => value !== undefined);
42153
42147
  }
42154
42148
  function arrayElementType(typeDef) {
42155
42149
  if (Array.isArray(typeDef))
@@ -42538,7 +42532,7 @@ function validateShapeDefinition(data, options = {}) {
42538
42532
  if ("description" in obj && typeof obj.description !== "string") {
42539
42533
  errors3.push('"description" must be a string');
42540
42534
  }
42541
- validatePersistedStringFieldLimits(obj, undefined, errors3);
42535
+ validatePersistedContentLimits(obj, [], errors3);
42542
42536
  if (errors3.length > 0) {
42543
42537
  return { valid: false, errors: errors3 };
42544
42538
  }
@@ -43547,7 +43541,7 @@ function normalizeChunkSize(chunkSize) {
43547
43541
  // ../../packages/sdk-ts/package.json
43548
43542
  var package_default = {
43549
43543
  name: "@warmhub/sdk-ts",
43550
- version: "0.92.0",
43544
+ version: "0.94.0",
43551
43545
  private: false,
43552
43546
  type: "module",
43553
43547
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -66801,7 +66795,7 @@ function resolveLogLevel(flagLevel, env) {
66801
66795
  // package.json
66802
66796
  var package_default3 = {
66803
66797
  name: "@warmhub/cli",
66804
- version: "0.94.0",
66798
+ version: "0.96.0",
66805
66799
  private: false,
66806
66800
  type: "module",
66807
66801
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -67420,5 +67414,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
67420
67414
  version: package_default3.version
67421
67415
  }) : interceptedExitCode;
67422
67416
 
67423
- //# debugId=EE112F9789F2A17964756E2164756E21
67424
- //# warmhub-cli-build-info {"cliVersion":"0.94.0","sdkVersion":"0.92.0"}
67417
+ //# debugId=575D3DBDBC81FCF364756E2164756E21
67418
+ //# warmhub-cli-build-info {"cliVersion":"0.96.0","sdkVersion":"0.94.0"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.94.0",
3
+ "version": "0.96.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",