intelligent-system-design-language 0.3.13 → 0.3.14

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.
@@ -345,9 +345,10 @@
345
345
 
346
346
  .v-row {
347
347
  column-gap: 1rem;
348
- height: 100%;
348
+ height: auto;
349
349
 
350
350
  > .v-col {
351
+ height: auto;
351
352
  padding-left: 0;
352
353
  padding-right: 0;
353
354
  }
@@ -671,7 +672,7 @@
671
672
  }
672
673
 
673
674
  .isdl-tracker {
674
- height: 100%;
675
+ height: auto;
675
676
 
676
677
  .tracker-content {
677
678
  width: 100%;
@@ -345,9 +345,10 @@
345
345
 
346
346
  .v-row {
347
347
  column-gap: 1rem;
348
- height: 100%;
348
+ height: auto;
349
349
 
350
350
  > .v-col {
351
+ height: auto;
351
352
  padding-left: 0;
352
353
  padding-right: 0;
353
354
  }
@@ -671,7 +672,7 @@
671
672
  }
672
673
 
673
674
  .isdl-tracker {
674
- height: 100%;
675
+ height: auto;
675
676
 
676
677
  .tracker-content {
677
678
  width: 100%;
@@ -65641,7 +65641,11 @@ function registerValidationChecks(services) {
65641
65641
  NumberExp: validator.validateNumberExp,
65642
65642
  ResourceExp: validator.validateResourceExp,
65643
65643
  AttributeExp: validator.validateAttributeExp,
65644
- DamageTrackExp: validator.validateWipField
65644
+ DamageTrackExp: validator.validateWipField,
65645
+ ParentAccess: validator.validateParentAccess,
65646
+ ParentAssignment: validator.validateParentAccess,
65647
+ TargetAccess: validator.validateTargetAccess,
65648
+ TargetAssignment: validator.validateTargetAccess
65645
65649
  };
65646
65650
  registry.register(checks, validator);
65647
65651
  }
@@ -65882,6 +65886,51 @@ var IntelligentSystemDesignLanguageValidator = class {
65882
65886
  this.validateNumericExpression(modParam.method.body, accept);
65883
65887
  }
65884
65888
  }
65889
+ /**
65890
+ * `parent.X` only resolves inside an `if (parent is SomeActor)` check, because an
65891
+ * Item can be owned by any Actor type. Without the guard the property reference
65892
+ * fails to resolve, producing a cryptic "Could not resolve reference to Property"
65893
+ * error. Detect the missing guard and surface a clear, actionable message instead.
65894
+ */
65895
+ validateParentAccess(node, accept) {
65896
+ var _a, _b;
65897
+ const guard = ast_utils_exports.getContainerOfType(node, (n) => isIfStatement(n) && isParentTypeCheckExpression(n.expression));
65898
+ if (guard)
65899
+ return;
65900
+ const propName = (_b = (_a = node.property) == null ? void 0 : _a.$refText) != null ? _b : "<property>";
65901
+ accept(
65902
+ "error",
65903
+ `'parent' access must be wrapped in an 'if (parent is SomeActor)' check. An Item can be owned by any Actor type, so ISDL needs to know which Actor's fields you mean before it can resolve 'parent.${propName}'.
65904
+
65905
+ Example:
65906
+ if (parent is Hero) {
65907
+ parent.${propName} -= 1
65908
+ }`,
65909
+ { node, property: "property" }
65910
+ );
65911
+ }
65912
+ /**
65913
+ * `target.X` only resolves inside an `if (target is SomeActor)` check, for the same
65914
+ * reason as `parent` — the targeted token can be any Actor type. Surface a clear
65915
+ * message when the guard is missing.
65916
+ */
65917
+ validateTargetAccess(node, accept) {
65918
+ var _a, _b;
65919
+ const guard = ast_utils_exports.getContainerOfType(node, (n) => isIfStatement(n) && isTargetTypeCheckExpression(n.expression));
65920
+ if (guard)
65921
+ return;
65922
+ const propName = (_b = (_a = node.property) == null ? void 0 : _a.$refText) != null ? _b : "<property>";
65923
+ accept(
65924
+ "error",
65925
+ `'target' access must be wrapped in an 'if (target is SomeActor)' check. The targeted token can be any Actor type, so ISDL needs to know which Actor's fields you mean before it can resolve 'target.${propName}'.
65926
+
65927
+ Example:
65928
+ if (target is Monster) {
65929
+ target.${propName} -= 1
65930
+ }`,
65931
+ { node, property: "property" }
65932
+ );
65933
+ }
65885
65934
  validateNumericExpression(body, accept) {
65886
65935
  for (const expr of body) {
65887
65936
  if (isReturnExpression(expr) && expr.value) {