@abco20/btxml-checker 0.1.4 → 0.1.5
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/dist/cli.js +42 -29
- package/dist/editor-node.js +22 -22
- package/dist/editor.js +19 -19
- package/dist/index.d.ts +30 -0
- package/dist/index.js +7 -7
- package/dist/rules.d.ts +9 -3
- package/dist/rules.js +4 -4
- package/dist/server.cjs +316 -91
- package/dist/server.cjs.map +1 -1
- package/package.json +1 -1
- package/schemas/btxml.config.schema.json +2 -0
package/dist/rules.d.ts
CHANGED
|
@@ -216,7 +216,7 @@ declare const RULES: {
|
|
|
216
216
|
readonly "model/require-output-port-remap": {
|
|
217
217
|
readonly code: "BT115_OUTPUT_PORT_REQUIRES_REMAP";
|
|
218
218
|
readonly defaultSeverity: ConfigSeverity;
|
|
219
|
-
readonly description: "Resolved output ports must
|
|
219
|
+
readonly description: "Resolved output ports must be explicitly or default-remapped to a blackboard entry.";
|
|
220
220
|
};
|
|
221
221
|
readonly "model/no-childless-control-shape-mismatch": {
|
|
222
222
|
readonly code: "BT108_CHILD_CAPABLE_NODE_SELF_CLOSING";
|
|
@@ -248,6 +248,11 @@ declare const RULES: {
|
|
|
248
248
|
readonly defaultSeverity: "error";
|
|
249
249
|
readonly description: "Inline model definitions should be used in the same BT XML file.";
|
|
250
250
|
};
|
|
251
|
+
readonly "model/require-local-definition": {
|
|
252
|
+
readonly code: "BT123_MISSING_LOCAL_MODEL_DEFINITION";
|
|
253
|
+
readonly defaultSeverity: "error";
|
|
254
|
+
readonly description: "When models.convention is used-only, normal node usages should have a local TreeNodesModel definition in the same file.";
|
|
255
|
+
};
|
|
251
256
|
readonly "model/no-duplicate-definition": {
|
|
252
257
|
readonly code: "BT122_DUPLICATE_MODEL_DEFINITION";
|
|
253
258
|
readonly defaultSeverity: "error";
|
|
@@ -320,6 +325,7 @@ declare const RuleCodes: {
|
|
|
320
325
|
readonly ConflictingModelKind: "BT120_CONFLICTING_MODEL_KIND";
|
|
321
326
|
readonly UnusedModelDefinition: "BT121_UNUSED_MODEL_DEFINITION";
|
|
322
327
|
readonly DuplicateModelDefinition: "BT122_DUPLICATE_MODEL_DEFINITION";
|
|
328
|
+
readonly MissingLocalModelDefinition: "BT123_MISSING_LOCAL_MODEL_DEFINITION";
|
|
323
329
|
readonly ExternalModelFileNotFound: "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND";
|
|
324
330
|
readonly AugmentationFileNotFound: "BT324_AUGMENTATION_FILE_NOT_FOUND";
|
|
325
331
|
readonly MissingTreeNodesModel: "BT322_MISSING_TREENODESMODEL";
|
|
@@ -334,7 +340,7 @@ declare const RuleCodes: {
|
|
|
334
340
|
readonly UnusedSuppression: "BT351_UNUSED_SUPPRESSION";
|
|
335
341
|
readonly MissingSuppressionReason: "BT353_MISSING_SUPPRESSION_REASON";
|
|
336
342
|
};
|
|
337
|
-
declare const RULE_CODES: ("BT006_DUPLICATE_NODE_MODEL_ID" | "BT401_INVALID_SCRIPT_SYNTAX" | "BT402_EMPTY_SCRIPT" | "BT403_INVALID_SCRIPT_TOKEN" | "BT404_UNKNOWN_SCRIPT_VARIABLE" | "BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE" | "BT406_INVALID_COMPOUND_ASSIGNMENT" | "BT407_INVALID_SCRIPT_OPERAND_TYPE" | "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE" | "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH" | "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER" | "BT001_INVALID_ROOT_ELEMENT" | "BT002_MISSING_BTCPP_FORMAT" | "BT003_MISSING_BEHAVIOR_TREE_ID" | "BT004_DUPLICATE_BEHAVIOR_TREE_ID" | "BT005_UNKNOWN_SUBTREE" | "BT007_MISSING_PORT_NAME" | "BT008_DUPLICATE_PORT_NAME" | "BT009_UNKNOWN_TOP_LEVEL_ELEMENT" | "BT010_UNKNOWN_MAIN_TREE" | "BT011_AMBIGUOUS_SUBTREE" | "BT012_CONFLICTING_NODE_MODEL" | "BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE" | "BT301_MISSING_INCLUDE_PATH" | "BT302_INCLUDE_NOT_FOUND" | "BT303_INCLUDE_CYCLE" | "BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE" | "BT306_INCLUDE_OUTSIDE_WORKSPACE" | "BT307_EXTERNAL_INCLUDE_USED" | "BT309_INCLUDE_DEPTH_EXCEEDED" | "BT310_TOO_MANY_RESOLVED_FILES" | "BT311_ENTRYPOINT_NOT_FOUND" | "BT312_ROS_PACKAGE_RESOLVER_MISSING" | "BT313_ROS_PACKAGE_NOT_FOUND" | "BT105_UNKNOWN_NODE" | "BT101_MISSING_REQUIRED_PORT" | "BT102_UNKNOWN_PORT" | "BT103_INVALID_PORT_VALUE_TYPE" | "BT108_CHILD_CAPABLE_NODE_SELF_CLOSING" | "BT109_LEAF_NODE_OPEN_CLOSE" | "BT110_INVALID_CHILD_COUNT" | "BT111_BLACKBOARD_TYPE_MISMATCH" | "BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR" | "BT114_INVALID_PORT_DEFAULT_VALUE" | "BT115_OUTPUT_PORT_REQUIRES_REMAP" | "BT116_INVALID_PORT_NAME" | "BT117_AUGMENT_TARGET_NOT_FOUND" | "BT118_AUGMENT_PORT_NOT_FOUND" | "BT119_INVALID_TYPE_REFINEMENT" | "BT120_CONFLICTING_MODEL_KIND" | "BT121_UNUSED_MODEL_DEFINITION" | "BT122_DUPLICATE_MODEL_DEFINITION" | "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND" | "BT324_AUGMENTATION_FILE_NOT_FOUND" | "BT322_MISSING_TREENODESMODEL" | "BT323_EXTERNAL_MODEL_XML_PARSE_ERROR" | "BT331_NODE_DEFINITION_FILE_NOT_FOUND" | "BT332_INVALID_NODE_DEFINITION_JSON" | "BT333_INVALID_NODE_DEFINITION_SCHEMA" | "BT334_DUPLICATE_NODE_DEFINITION_ID" | "BT335_INVALID_AUGMENTATION_JSON" | "BT336_INVALID_AUGMENTATION_SCHEMA" | "BT107_CONFLICTING_PORT_DEFAULT" | "BT351_UNUSED_SUPPRESSION" | "BT353_MISSING_SUPPRESSION_REASON")[];
|
|
343
|
+
declare const RULE_CODES: ("BT006_DUPLICATE_NODE_MODEL_ID" | "BT401_INVALID_SCRIPT_SYNTAX" | "BT402_EMPTY_SCRIPT" | "BT403_INVALID_SCRIPT_TOKEN" | "BT404_UNKNOWN_SCRIPT_VARIABLE" | "BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE" | "BT406_INVALID_COMPOUND_ASSIGNMENT" | "BT407_INVALID_SCRIPT_OPERAND_TYPE" | "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE" | "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH" | "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER" | "BT001_INVALID_ROOT_ELEMENT" | "BT002_MISSING_BTCPP_FORMAT" | "BT003_MISSING_BEHAVIOR_TREE_ID" | "BT004_DUPLICATE_BEHAVIOR_TREE_ID" | "BT005_UNKNOWN_SUBTREE" | "BT007_MISSING_PORT_NAME" | "BT008_DUPLICATE_PORT_NAME" | "BT009_UNKNOWN_TOP_LEVEL_ELEMENT" | "BT010_UNKNOWN_MAIN_TREE" | "BT011_AMBIGUOUS_SUBTREE" | "BT012_CONFLICTING_NODE_MODEL" | "BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE" | "BT301_MISSING_INCLUDE_PATH" | "BT302_INCLUDE_NOT_FOUND" | "BT303_INCLUDE_CYCLE" | "BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE" | "BT306_INCLUDE_OUTSIDE_WORKSPACE" | "BT307_EXTERNAL_INCLUDE_USED" | "BT309_INCLUDE_DEPTH_EXCEEDED" | "BT310_TOO_MANY_RESOLVED_FILES" | "BT311_ENTRYPOINT_NOT_FOUND" | "BT312_ROS_PACKAGE_RESOLVER_MISSING" | "BT313_ROS_PACKAGE_NOT_FOUND" | "BT105_UNKNOWN_NODE" | "BT101_MISSING_REQUIRED_PORT" | "BT102_UNKNOWN_PORT" | "BT103_INVALID_PORT_VALUE_TYPE" | "BT108_CHILD_CAPABLE_NODE_SELF_CLOSING" | "BT109_LEAF_NODE_OPEN_CLOSE" | "BT110_INVALID_CHILD_COUNT" | "BT111_BLACKBOARD_TYPE_MISMATCH" | "BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR" | "BT114_INVALID_PORT_DEFAULT_VALUE" | "BT115_OUTPUT_PORT_REQUIRES_REMAP" | "BT116_INVALID_PORT_NAME" | "BT117_AUGMENT_TARGET_NOT_FOUND" | "BT118_AUGMENT_PORT_NOT_FOUND" | "BT119_INVALID_TYPE_REFINEMENT" | "BT120_CONFLICTING_MODEL_KIND" | "BT121_UNUSED_MODEL_DEFINITION" | "BT122_DUPLICATE_MODEL_DEFINITION" | "BT123_MISSING_LOCAL_MODEL_DEFINITION" | "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND" | "BT324_AUGMENTATION_FILE_NOT_FOUND" | "BT322_MISSING_TREENODESMODEL" | "BT323_EXTERNAL_MODEL_XML_PARSE_ERROR" | "BT331_NODE_DEFINITION_FILE_NOT_FOUND" | "BT332_INVALID_NODE_DEFINITION_JSON" | "BT333_INVALID_NODE_DEFINITION_SCHEMA" | "BT334_DUPLICATE_NODE_DEFINITION_ID" | "BT335_INVALID_AUGMENTATION_JSON" | "BT336_INVALID_AUGMENTATION_SCHEMA" | "BT107_CONFLICTING_PORT_DEFAULT" | "BT351_UNUSED_SUPPRESSION" | "BT353_MISSING_SUPPRESSION_REASON")[];
|
|
338
344
|
|
|
339
345
|
declare function getNodeUsagePolicyForRules(config: EffectiveFileConfig): Partial<NodeUsagePolicy>;
|
|
340
346
|
|
|
@@ -365,7 +371,7 @@ type RuleMetadata = {
|
|
|
365
371
|
};
|
|
366
372
|
declare function findRuleMetadata(code: string): RuleMetadata;
|
|
367
373
|
declare function getRuleMetadata(value: string): RuleMetadata;
|
|
368
|
-
declare function listRuleCodes(): ("BT006_DUPLICATE_NODE_MODEL_ID" | "BT401_INVALID_SCRIPT_SYNTAX" | "BT402_EMPTY_SCRIPT" | "BT403_INVALID_SCRIPT_TOKEN" | "BT404_UNKNOWN_SCRIPT_VARIABLE" | "BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE" | "BT406_INVALID_COMPOUND_ASSIGNMENT" | "BT407_INVALID_SCRIPT_OPERAND_TYPE" | "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE" | "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH" | "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER" | "BT001_INVALID_ROOT_ELEMENT" | "BT002_MISSING_BTCPP_FORMAT" | "BT003_MISSING_BEHAVIOR_TREE_ID" | "BT004_DUPLICATE_BEHAVIOR_TREE_ID" | "BT005_UNKNOWN_SUBTREE" | "BT007_MISSING_PORT_NAME" | "BT008_DUPLICATE_PORT_NAME" | "BT009_UNKNOWN_TOP_LEVEL_ELEMENT" | "BT010_UNKNOWN_MAIN_TREE" | "BT011_AMBIGUOUS_SUBTREE" | "BT012_CONFLICTING_NODE_MODEL" | "BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE" | "BT301_MISSING_INCLUDE_PATH" | "BT302_INCLUDE_NOT_FOUND" | "BT303_INCLUDE_CYCLE" | "BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE" | "BT306_INCLUDE_OUTSIDE_WORKSPACE" | "BT307_EXTERNAL_INCLUDE_USED" | "BT309_INCLUDE_DEPTH_EXCEEDED" | "BT310_TOO_MANY_RESOLVED_FILES" | "BT311_ENTRYPOINT_NOT_FOUND" | "BT312_ROS_PACKAGE_RESOLVER_MISSING" | "BT313_ROS_PACKAGE_NOT_FOUND" | "BT105_UNKNOWN_NODE" | "BT101_MISSING_REQUIRED_PORT" | "BT102_UNKNOWN_PORT" | "BT103_INVALID_PORT_VALUE_TYPE" | "BT108_CHILD_CAPABLE_NODE_SELF_CLOSING" | "BT109_LEAF_NODE_OPEN_CLOSE" | "BT110_INVALID_CHILD_COUNT" | "BT111_BLACKBOARD_TYPE_MISMATCH" | "BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR" | "BT114_INVALID_PORT_DEFAULT_VALUE" | "BT115_OUTPUT_PORT_REQUIRES_REMAP" | "BT116_INVALID_PORT_NAME" | "BT117_AUGMENT_TARGET_NOT_FOUND" | "BT118_AUGMENT_PORT_NOT_FOUND" | "BT119_INVALID_TYPE_REFINEMENT" | "BT120_CONFLICTING_MODEL_KIND" | "BT121_UNUSED_MODEL_DEFINITION" | "BT122_DUPLICATE_MODEL_DEFINITION" | "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND" | "BT324_AUGMENTATION_FILE_NOT_FOUND" | "BT322_MISSING_TREENODESMODEL" | "BT323_EXTERNAL_MODEL_XML_PARSE_ERROR" | "BT331_NODE_DEFINITION_FILE_NOT_FOUND" | "BT332_INVALID_NODE_DEFINITION_JSON" | "BT333_INVALID_NODE_DEFINITION_SCHEMA" | "BT334_DUPLICATE_NODE_DEFINITION_ID" | "BT335_INVALID_AUGMENTATION_JSON" | "BT336_INVALID_AUGMENTATION_SCHEMA" | "BT107_CONFLICTING_PORT_DEFAULT" | "BT351_UNUSED_SUPPRESSION" | "BT353_MISSING_SUPPRESSION_REASON")[];
|
|
374
|
+
declare function listRuleCodes(): ("BT006_DUPLICATE_NODE_MODEL_ID" | "BT401_INVALID_SCRIPT_SYNTAX" | "BT402_EMPTY_SCRIPT" | "BT403_INVALID_SCRIPT_TOKEN" | "BT404_UNKNOWN_SCRIPT_VARIABLE" | "BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE" | "BT406_INVALID_COMPOUND_ASSIGNMENT" | "BT407_INVALID_SCRIPT_OPERAND_TYPE" | "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE" | "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH" | "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER" | "BT001_INVALID_ROOT_ELEMENT" | "BT002_MISSING_BTCPP_FORMAT" | "BT003_MISSING_BEHAVIOR_TREE_ID" | "BT004_DUPLICATE_BEHAVIOR_TREE_ID" | "BT005_UNKNOWN_SUBTREE" | "BT007_MISSING_PORT_NAME" | "BT008_DUPLICATE_PORT_NAME" | "BT009_UNKNOWN_TOP_LEVEL_ELEMENT" | "BT010_UNKNOWN_MAIN_TREE" | "BT011_AMBIGUOUS_SUBTREE" | "BT012_CONFLICTING_NODE_MODEL" | "BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE" | "BT301_MISSING_INCLUDE_PATH" | "BT302_INCLUDE_NOT_FOUND" | "BT303_INCLUDE_CYCLE" | "BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE" | "BT306_INCLUDE_OUTSIDE_WORKSPACE" | "BT307_EXTERNAL_INCLUDE_USED" | "BT309_INCLUDE_DEPTH_EXCEEDED" | "BT310_TOO_MANY_RESOLVED_FILES" | "BT311_ENTRYPOINT_NOT_FOUND" | "BT312_ROS_PACKAGE_RESOLVER_MISSING" | "BT313_ROS_PACKAGE_NOT_FOUND" | "BT105_UNKNOWN_NODE" | "BT101_MISSING_REQUIRED_PORT" | "BT102_UNKNOWN_PORT" | "BT103_INVALID_PORT_VALUE_TYPE" | "BT108_CHILD_CAPABLE_NODE_SELF_CLOSING" | "BT109_LEAF_NODE_OPEN_CLOSE" | "BT110_INVALID_CHILD_COUNT" | "BT111_BLACKBOARD_TYPE_MISMATCH" | "BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR" | "BT114_INVALID_PORT_DEFAULT_VALUE" | "BT115_OUTPUT_PORT_REQUIRES_REMAP" | "BT116_INVALID_PORT_NAME" | "BT117_AUGMENT_TARGET_NOT_FOUND" | "BT118_AUGMENT_PORT_NOT_FOUND" | "BT119_INVALID_TYPE_REFINEMENT" | "BT120_CONFLICTING_MODEL_KIND" | "BT121_UNUSED_MODEL_DEFINITION" | "BT122_DUPLICATE_MODEL_DEFINITION" | "BT123_MISSING_LOCAL_MODEL_DEFINITION" | "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND" | "BT324_AUGMENTATION_FILE_NOT_FOUND" | "BT322_MISSING_TREENODESMODEL" | "BT323_EXTERNAL_MODEL_XML_PARSE_ERROR" | "BT331_NODE_DEFINITION_FILE_NOT_FOUND" | "BT332_INVALID_NODE_DEFINITION_JSON" | "BT333_INVALID_NODE_DEFINITION_SCHEMA" | "BT334_DUPLICATE_NODE_DEFINITION_ID" | "BT335_INVALID_AUGMENTATION_JSON" | "BT336_INVALID_AUGMENTATION_SCHEMA" | "BT107_CONFLICTING_PORT_DEFAULT" | "BT351_UNUSED_SUPPRESSION" | "BT353_MISSING_SUPPRESSION_REASON")[];
|
|
369
375
|
declare function listRuleSlugs(): string[];
|
|
370
376
|
declare function listRules(): Array<{
|
|
371
377
|
name: RuleName;
|
package/dist/rules.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{z as p}from"zod";var e={InvalidScriptSyntax:"BT401_INVALID_SCRIPT_SYNTAX",EmptyScript:"BT402_EMPTY_SCRIPT",InvalidScriptToken:"BT403_INVALID_SCRIPT_TOKEN",UnknownScriptVariable:"BT404_UNKNOWN_SCRIPT_VARIABLE",AssignmentToUnknownVariable:"BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE",InvalidCompoundAssignment:"BT406_INVALID_COMPOUND_ASSIGNMENT",InvalidScriptOperandType:"BT407_INVALID_SCRIPT_OPERAND_TYPE",ScriptResultNotBoolCompatible:"BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE",ScriptVariableTypeMismatch:"BT410_SCRIPT_VARIABLE_TYPE_MISMATCH",InvalidGlobalBlackboardIdentifier:"BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER",InvalidRootElement:"BT001_INVALID_ROOT_ELEMENT",MissingBTCPPFormat:"BT002_MISSING_BTCPP_FORMAT",MissingBehaviorTreeID:"BT003_MISSING_BEHAVIOR_TREE_ID",DuplicateBehaviorTreeID:"BT004_DUPLICATE_BEHAVIOR_TREE_ID",UnknownSubTree:"BT005_UNKNOWN_SUBTREE",DuplicateNodeModelId:"BT006_DUPLICATE_NODE_MODEL_ID",MissingPortName:"BT007_MISSING_PORT_NAME",DuplicatePortName:"BT008_DUPLICATE_PORT_NAME",UnknownTopLevelElement:"BT009_UNKNOWN_TOP_LEVEL_ELEMENT",UnknownMainTree:"BT010_UNKNOWN_MAIN_TREE",AmbiguousSubTree:"BT011_AMBIGUOUS_SUBTREE",ConflictingNodeModel:"BT012_CONFLICTING_NODE_MODEL",DuplicateBehaviorTreeIdInWorkspace:"BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE",MissingIncludePath:"BT301_MISSING_INCLUDE_PATH",IncludeNotFound:"BT302_INCLUDE_NOT_FOUND",IncludeCycle:"BT303_INCLUDE_CYCLE",UnresolvedIncludePathVariable:"BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE",IncludeOutsideWorkspace:"BT306_INCLUDE_OUTSIDE_WORKSPACE",ExternalIncludeUsed:"BT307_EXTERNAL_INCLUDE_USED",IncludeDepthExceeded:"BT309_INCLUDE_DEPTH_EXCEEDED",TooManyResolvedFiles:"BT310_TOO_MANY_RESOLVED_FILES",EntrypointNotFound:"BT311_ENTRYPOINT_NOT_FOUND",RosPackageResolverMissing:"BT312_ROS_PACKAGE_RESOLVER_MISSING",RosPackageNotFound:"BT313_ROS_PACKAGE_NOT_FOUND",UnknownNode:"BT105_UNKNOWN_NODE",MissingRequiredPort:"BT101_MISSING_REQUIRED_PORT",UnknownPort:"BT102_UNKNOWN_PORT",InvalidPortValueType:"BT103_INVALID_PORT_VALUE_TYPE",ChildCapableNodeSelfClosing:"BT108_CHILD_CAPABLE_NODE_SELF_CLOSING",LeafNodeOpenClose:"BT109_LEAF_NODE_OPEN_CLOSE",InvalidChildCount:"BT110_INVALID_CHILD_COUNT",BlackboardTypeMismatch:"BT111_BLACKBOARD_TYPE_MISMATCH",CustomLiteralRequiresValidator:"BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR",InvalidPortDefaultValue:"BT114_INVALID_PORT_DEFAULT_VALUE",OutputPortRequiresRemap:"BT115_OUTPUT_PORT_REQUIRES_REMAP",InvalidPortName:"BT116_INVALID_PORT_NAME",AugmentTargetNotFound:"BT117_AUGMENT_TARGET_NOT_FOUND",AugmentPortNotFound:"BT118_AUGMENT_PORT_NOT_FOUND",InvalidTypeRefinement:"BT119_INVALID_TYPE_REFINEMENT",ConflictingModelKind:"BT120_CONFLICTING_MODEL_KIND",UnusedModelDefinition:"BT121_UNUSED_MODEL_DEFINITION",DuplicateModelDefinition:"BT122_DUPLICATE_MODEL_DEFINITION",ExternalModelFileNotFound:"BT321_EXTERNAL_MODEL_FILE_NOT_FOUND",AugmentationFileNotFound:"BT324_AUGMENTATION_FILE_NOT_FOUND",MissingTreeNodesModel:"BT322_MISSING_TREENODESMODEL",ExternalModelXmlParseError:"BT323_EXTERNAL_MODEL_XML_PARSE_ERROR",NodeDefinitionFileNotFound:"BT331_NODE_DEFINITION_FILE_NOT_FOUND",InvalidNodeDefinitionJson:"BT332_INVALID_NODE_DEFINITION_JSON",InvalidNodeDefinitionSchema:"BT333_INVALID_NODE_DEFINITION_SCHEMA",DuplicateNodeDefinitionId:"BT334_DUPLICATE_NODE_DEFINITION_ID",InvalidAugmentationJson:"BT335_INVALID_AUGMENTATION_JSON",InvalidAugmentationSchema:"BT336_INVALID_AUGMENTATION_SCHEMA",ConflictingPortDefault:"BT107_CONFLICTING_PORT_DEFAULT",UnusedSuppression:"BT351_UNUSED_SUPPRESSION",MissingSuppressionReason:"BT353_MISSING_SUPPRESSION_REASON"},R=Object.values(e).sort();var P=p.object({subTreePorts:p.enum(["loose","strict"]).optional()}).strict(),A=p.object({allowStringEntryCompatibility:p.boolean().optional()}).strict(),s={"script/valid-syntax":{code:e.InvalidScriptSyntax,defaultSeverity:"error",description:"Script-bearing attributes must parse as valid BT.CPP scripts."},"script/no-unknown-variable":{code:e.UnknownScriptVariable,defaultSeverity:"warn",description:"Script-bearing attributes should not reference unknown variables."},"script/valid-assignment":{code:e.AssignmentToUnknownVariable,codes:[e.AssignmentToUnknownVariable,e.InvalidCompoundAssignment,e.ScriptVariableTypeMismatch,e.InvalidGlobalBlackboardIdentifier],defaultSeverity:"error",description:"Script assignments must target known variables and use compatible types."},"script/valid-expression-type":{code:e.InvalidScriptOperandType,defaultSeverity:"error",description:"Script expressions must use operators with compatible operand types."},"script/valid-result-type":{code:e.ScriptResultNotBoolCompatible,defaultSeverity:"error",description:"Condition-style script attributes must have a bool-compatible inferred result."},"xml/valid-root":{code:e.InvalidRootElement,defaultSeverity:"error",description:"Root element must be <root>."},"xml/require-btcpp-format":{code:e.MissingBTCPPFormat,defaultSeverity:"warn",description:'Root element must declare BTCPP_format="4".'},"tree/require-id":{code:e.MissingBehaviorTreeID,defaultSeverity:"error",description:"BehaviorTree elements require an ID attribute."},"tree/no-duplicate-id-in-file":{code:e.DuplicateBehaviorTreeID,defaultSeverity:"error",description:"BehaviorTree IDs must be unique within a file."},"tree/no-duplicate-id":{code:e.DuplicateBehaviorTreeIdInWorkspace,defaultSeverity:"error",description:"BehaviorTree IDs must be unique across the workspace."},"tree/no-unknown-subtree":{code:e.UnknownSubTree,defaultSeverity:"error",description:"A SubTree must resolve to a BehaviorTree or a configured model."},"tree/no-unknown-main-tree":{code:e.UnknownMainTree,defaultSeverity:"error",description:"main_tree_to_execute must reference a known BehaviorTree."},"tree/no-ambiguous-subtree":{code:e.AmbiguousSubTree,defaultSeverity:"error",description:"SubTree references must resolve to a single definition."},"tree/no-duplicate-node-model-id":{code:e.DuplicateNodeModelId,defaultSeverity:"error",description:"TreeNodesModel elements must have unique IDs within the same model block."},"xml/no-unknown-top-level-element":{code:e.UnknownTopLevelElement,defaultSeverity:"warn",description:"Top-level elements must be BehaviorTree, TreeNodesModel, or configured include elements."},"include/require-path":{code:e.MissingIncludePath,defaultSeverity:"error",description:"include elements require a path attribute."},"include/no-missing-file":{code:e.IncludeNotFound,defaultSeverity:"error",description:"Referenced include file does not exist."},"include/no-cycle":{code:e.IncludeCycle,defaultSeverity:"error",description:"Include graph cycles are not allowed."},"include/no-outside-root":{code:e.IncludeOutsideWorkspace,defaultSeverity:"error",description:"Includes must stay within the workspace root."},"include/no-unresolved-variable":{code:e.UnresolvedIncludePathVariable,defaultSeverity:"error",description:"Include path variables must resolve before lookup."},"include/no-depth-exceeded":{code:e.IncludeDepthExceeded,defaultSeverity:"error",description:"Include resolution must stay within the configured maximum depth."},"include/no-too-many-files":{code:e.TooManyResolvedFiles,defaultSeverity:"error",description:"Include resolution must stay within the configured file limit."},"include/require-ros-package-resolver":{code:e.RosPackageResolverMissing,defaultSeverity:"error",description:"When include uses ros_pkg, a host resolvePackageUri capability must be provided."},"include/no-missing-ros-package":{code:e.RosPackageNotFound,defaultSeverity:"error",description:"ros_pkg include must resolve to an existing ROS package root URI."},"include/report-external-used":{code:e.ExternalIncludeUsed,defaultSeverity:"info",description:"Reports when an allowed include resolves outside the workspace root."},"model/no-unknown-node":{code:e.UnknownNode,defaultSeverity:"warn",description:"Node usages must resolve to a known model."},"model/require-port":{code:e.MissingRequiredPort,defaultSeverity:"error",description:"Required ports must be supplied."},"model/require-port-name":{code:e.MissingPortName,defaultSeverity:"error",description:"Port elements require a name attribute."},"model/no-duplicate-port-name":{code:e.DuplicatePortName,defaultSeverity:"error",description:"Ports with the same name are not allowed."},"model/valid-port-name":{code:e.InvalidPortName,defaultSeverity:"error",description:"Port names must be valid XML attribute names for BT nodes."},"model/no-unknown-port":{code:e.UnknownPort,defaultSeverity:"warn",optionsSchema:P,options:[{name:"subTreePorts",type:'"loose" | "strict"',default:"loose",description:"Controls whether SubTree remap attributes are checked strictly."}],description:"Reports ports that are not declared by the resolved node model."},"model/valid-port-value":{code:e.InvalidPortValueType,defaultSeverity:"error",description:"Port values must match the declared type."},"model/no-blackboard-type-mismatch":{code:e.BlackboardTypeMismatch,defaultSeverity:"error",optionsSchema:A,options:[{name:"allowStringEntryCompatibility",type:"boolean",default:"true",description:"Treat std::string blackboard entries as runtime-compatible with other port types, matching BT.CPP's existing-entry special case."}],description:"Blackboard entries must not mix incompatible resolved port types."},"model/valid-port-default-value":{code:e.InvalidPortDefaultValue,defaultSeverity:"error",description:"TreeNodesModel port defaults must match the declared type."},"model/require-output-port-remap":{code:e.OutputPortRequiresRemap,defaultSeverity:"warn",description:"Resolved output ports must write to a blackboard remap."},"model/no-childless-control-shape-mismatch":{code:e.ChildCapableNodeSelfClosing,defaultSeverity:"warn",description:"Control and decorator nodes should normally use open/close tags."},"model/no-leaf-block-shape":{code:e.LeafNodeOpenClose,defaultSeverity:"warn",description:"Leaf nodes should normally be self-closing unless they contain child nodes."},"model/valid-child-count":{code:e.InvalidChildCount,defaultSeverity:"warn",description:"Child count must match the expected count for the node kind (Action/Condition: 0, Decorator: 1, Control: >=1, special builtins: fixed range)."},"model/no-conflicting-definition":{code:e.ConflictingNodeModel,defaultSeverity:"error",description:"Node model definitions must agree on kind and port shape."},"model/no-conflicting-kind-for-id":{code:e.ConflictingModelKind,defaultSeverity:"error",description:"A model ID must not be defined with different kinds."},"model/no-unused-definition":{code:e.UnusedModelDefinition,defaultSeverity:"error",description:"Inline model definitions should be used in the same BT XML file."},"model/no-duplicate-definition":{code:e.DuplicateModelDefinition,defaultSeverity:"error",description:"A user-defined model (ID, kind) should be defined only once."},"suppression/no-unused":{code:e.UnusedSuppression,defaultSeverity:"warn",description:"Suppressions should match at least one diagnostic."},"suppression/require-reason":{code:e.MissingSuppressionReason,defaultSeverity:"off",description:"Suppressions should include a reason when required."}};var m=["off","info","warn","error"];var f={Error:"error",Warning:"warning",Info:"info"};function g(t,o,i,n,a="",l,d){return{code:t,severity:o,message:i,uri:a,...n?{range:n}:{},...l?{details:l}:{},...d?{data:d}:{}}}function E(t){let o=t.linter.rules["model/no-unknown-port"];return Array.isArray(o)&&o.length>=2&&o[1].subTreePorts==="strict"?{unknownSubTreePorts:"reject"}:{unknownSubTreePorts:"allow"}}function v(t){return t in s}function D(t){for(let[o,i]of Object.entries(s)){let n=i;if(n.code===t||n.codes?.includes(t))return o}}function x(t){return s[t].code}function u(t){if(typeof t=="string")return m.includes(t)?{severity:t}:null;if(Array.isArray(t)&&t.length>=1&&t.length<=2){let[o,i]=t;if(typeof o=="string"&&m.includes(o)&&(i===void 0||typeof i=="object"&&i!==null&&!Array.isArray(i))){let n={severity:o};return i!==void 0&&(n.options=i),n}}return null}function _(t,o){let i=t[o];if(i!==void 0){let n=u(i);if(n)return n.severity}return s[o].defaultSeverity}function y(t,o){let i=[],a=s[t].optionsSchema;if(!a)return i;let l=a.safeParse(o);if(l.success)return i;for(let d of l.error.issues)i.push(...B(t,d));return i}function B(t,o){if(o.code==="unrecognized_keys")return o.keys.map(n=>g("CFG011_INVALID_RULE_OPTION",f.Error,`unknown option \`${String(n)}\` for rule \`${t}\``,void 0,void 0,{help:N(t)}));let i=typeof o.path[0]=="string"?o.path[0]:void 0;return[g("CFG011_INVALID_RULE_OPTION",f.Error,i?`invalid option \`${i}\`: ${o.message}`:`invalid options for rule \`${t}\`: ${o.message}`,void 0,void 0,{help:N(t)})]}function N(t){let i=s[t].options?.map(n=>n.name)??[];return i.length>0?`valid options are: ${i.join(", ")}`:void 0}function b(t){let o=[];h(t.linter,"linter.rules",o);for(let[i,n]of(t.overrides??[]).entries())h(n.linter,`overrides.${i}.linter.rules`,o);return o}function h(t,o,i){for(let[n,a]of Object.entries(t?.rules??{})){let l=`${o}.${n}`;if(!v(n)){i.push({code:"CFG010_UNKNOWN_RULE",severity:"error",path:l,message:`unknown lint rule \`${n}\``,help:"see docs/rules.md for a list of valid rule names"});continue}let d=u(a);if(d?.options)for(let S of y(n,d.options))i.push({code:"CFG011_INVALID_RULE_OPTION",severity:"error",path:k(l,d.options,S.message),message:S.message,help:S.details?.help})}}function k(t,o,i){let n=Object.keys(o).find(a=>i.includes(`\`${a}\``));return n?`${t}.1.${n}`:`${t}.1`}var r=(t,o,i,n=!0)=>({code:t,title:o,description:i,suppressible:n}),U={[e.InvalidScriptSyntax]:{code:e.InvalidScriptSyntax,title:"Invalid script syntax",description:"Script-bearing attributes must parse as valid BT.CPP scripts.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf="A +"/>',validExample:'<AlwaysSuccess _successIf="A == 1"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.EmptyScript]:{code:e.EmptyScript,title:"Empty script",description:"Script-bearing attributes must not be empty.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf=""/>',validExample:'<AlwaysSuccess _successIf="true"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.InvalidScriptToken]:{code:e.InvalidScriptToken,title:"Invalid script token",description:"Script-bearing attributes must not contain invalid BT.CPP tokens.",suppressible:!0,invalidExample:'<Script code="0x"/>',validExample:'<Script code="value := 0x10"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.UnknownScriptVariable]:{code:e.UnknownScriptVariable,title:"Unknown script variable",description:"Script-bearing attributes should not read blackboard or local variables that were never introduced.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf="missing == 1"/>',validExample:'<Script code="count := 1; done = count"/>',configExample:'{"linter":{"rules":{"script/no-unknown-variable":"warn"}}}'},[e.AssignmentToUnknownVariable]:{code:e.AssignmentToUnknownVariable,title:"Assignment to unknown script variable",description:"Assignments with `=` or compound operators must target an existing script or blackboard variable.",suppressible:!0,invalidExample:'<Script code="count = 1"/>',validExample:'<Script code="count := 1; count = 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidCompoundAssignment]:{code:e.InvalidCompoundAssignment,title:"Invalid compound assignment",description:"Compound assignment operators must be used with supported operand types (`number` or `string` for `+=`, numbers only otherwise).",suppressible:!0,invalidExample:'<Script code="name := "x"; name -= 1"/>',validExample:'<Script code="count := 1; count += 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidScriptOperandType]:{code:e.InvalidScriptOperandType,title:"Invalid script operand type",description:"Script operators and ternary conditions must be applied to operands with compatible inferred types.",suppressible:!0,invalidExample:`<AlwaysSuccess _successIf="'x' * 2"/>`,validExample:'<AlwaysSuccess _successIf="count * 2 > 0"/>',configExample:'{"linter":{"rules":{"script/valid-expression-type":"error"}}}'},[e.ScriptResultNotBoolCompatible]:{code:e.ScriptResultNotBoolCompatible,title:"Script result is not bool-compatible",description:"Condition-style script attributes must end in an inferred bool-compatible result type.",suppressible:!0,invalidExample:`<AlwaysSuccess _successIf="'hello'"/>`,validExample:'<AlwaysSuccess _successIf="true"/>',configExample:'{"linter":{"rules":{"script/valid-result-type":"error"}}}'},[e.ScriptVariableTypeMismatch]:{code:e.ScriptVariableTypeMismatch,title:"Script variable type mismatch",description:"Script assignments must not write an incompatible inferred type into an existing variable.",suppressible:!0,invalidExample:'<Script code="count := 1; count = "x""/>',validExample:'<Script code="count := 1; count = 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidGlobalBlackboardIdentifier]:{code:e.InvalidGlobalBlackboardIdentifier,title:"Invalid global blackboard identifier",description:"Script global blackboard identifiers must use `@name` with a valid blackboard key after the scope marker.",suppressible:!0,invalidExample:'<Script code="@ := 1"/>',validExample:'<Script code="@count := 1"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidRootElement]:r(e.InvalidRootElement,"Invalid root element","Root element must be <root>.",!1),[e.MissingBTCPPFormat]:r(e.MissingBTCPPFormat,"Missing BTCPP format",'Root element must declare BTCPP_format="4".',!1),[e.MissingBehaviorTreeID]:r(e.MissingBehaviorTreeID,"Missing BehaviorTree ID","BehaviorTree elements require an ID attribute.",!1),[e.DuplicateBehaviorTreeID]:r(e.DuplicateBehaviorTreeID,"Duplicate BehaviorTree ID","BehaviorTree IDs must be unique within a file.",!1),[e.UnknownSubTree]:{code:e.UnknownSubTree,title:"Unknown SubTree reference",description:"A SubTree must resolve to a BehaviorTree or a configured model.",suppressible:!0,invalidExample:'<SubTree ID="missing_tree"/>',validExample:'<BehaviorTree ID="missing_tree"><Sequence/></BehaviorTree>',fix:"Define the BehaviorTree, add an external TreeNodesModel file, or add a nodes config entry.",configExample:'{"linter":{"rules":{"tree/no-unknown-subtree":"warn"}}}'},[e.DuplicateNodeModelId]:r(e.DuplicateNodeModelId,"Duplicate node model ID in TreeNodesModel","TreeNodesModel elements must have unique IDs within the same model block.",!1),[e.MissingPortName]:r(e.MissingPortName,"Missing port name","Port elements require a name attribute.",!1),[e.DuplicatePortName]:r(e.DuplicatePortName,"Duplicate port name","Ports with the same name are not allowed.",!1),[e.InvalidPortName]:{code:e.InvalidPortName,title:"Invalid port name",description:"Port names must be valid XML attribute names for BT nodes.",suppressible:!1,invalidExample:'<input_port name="request.name" type="string"/>',validExample:'<input_port name="request_name" type="string"/>',fix:"Rename the port so it does not use reserved names, leading digits, whitespace, control characters, or XML/path punctuation.",configExample:'{"linter":{"rules":{"model/valid-port-name":"warn"}}}'},[e.UnknownTopLevelElement]:r(e.UnknownTopLevelElement,"Unknown top-level element","Top-level elements must be BehaviorTree, TreeNodesModel, or configured include elements.",!1),[e.UnknownMainTree]:r(e.UnknownMainTree,"Unknown main tree","main_tree_to_execute must reference a known BehaviorTree.",!1),[e.AmbiguousSubTree]:r(e.AmbiguousSubTree,"Ambiguous SubTree","SubTree references must resolve to a single definition.",!1),[e.ConflictingNodeModel]:{code:e.ConflictingNodeModel,title:"Conflicting node model",description:"Node model definitions must agree on kind and port shape.",suppressible:!1,fix:"Run `btxmlc repair` to inspect conflicts. Run `btxmlc repair --write` to resolve the conflict interactively."},[e.ConflictingModelKind]:{code:e.ConflictingModelKind,title:"Conflicting model kind for ID",description:"The same model ID must not be defined with different node kinds.",suppressible:!1,invalidExample:'<TreeNodesModel><Action ID="Foo"/><Condition ID="Foo"/></TreeNodesModel>',validExample:'<TreeNodesModel><Action ID="Foo"/></TreeNodesModel>'},[e.UnusedModelDefinition]:{code:e.UnusedModelDefinition,title:"Unused inline model definition",description:"When models.convention is used-only, inline Action/Condition/Decorator/Control definitions must be used in the same file.",suppressible:!1,invalidExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Run/></BehaviorTree><TreeNodesModel><Action ID="Run"/><Action ID="Unused"/></TreeNodesModel></root>',validExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Run/></BehaviorTree><TreeNodesModel><Action ID="Run"/></TreeNodesModel></root>',fix:"Run `btxmlc lint --fix` to remove unused inline model definitions when safe."},[e.DuplicateModelDefinition]:{code:e.DuplicateModelDefinition,title:"Duplicate model definition",description:"When models.convention is single-source, each user-defined (ID, kind) model definition should appear only once.",suppressible:!1,invalidExample:`<!-- a.xml --><TreeNodesModel><Action ID="Move"/></TreeNodesModel>
|
|
2
|
-
<!-- b.xml --><TreeNodesModel><Action ID="Move"/></TreeNodesModel>`,validExample:'<TreeNodesModel><Action ID="Move"/></TreeNodesModel>',fix:"Run `btxmlc lint --fix` to delete non-canonical duplicates when safe."},[e.DuplicateBehaviorTreeIdInWorkspace]:{code:e.DuplicateBehaviorTreeIdInWorkspace,title:"Duplicate BehaviorTree ID in workspace",description:"BehaviorTree IDs must be unique across the workspace.",suppressible:!1,invalidExample:`<!-- file1.xml --><BehaviorTree ID="shared"/>
|
|
1
|
+
import{z as p}from"zod";var e={InvalidScriptSyntax:"BT401_INVALID_SCRIPT_SYNTAX",EmptyScript:"BT402_EMPTY_SCRIPT",InvalidScriptToken:"BT403_INVALID_SCRIPT_TOKEN",UnknownScriptVariable:"BT404_UNKNOWN_SCRIPT_VARIABLE",AssignmentToUnknownVariable:"BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE",InvalidCompoundAssignment:"BT406_INVALID_COMPOUND_ASSIGNMENT",InvalidScriptOperandType:"BT407_INVALID_SCRIPT_OPERAND_TYPE",ScriptResultNotBoolCompatible:"BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE",ScriptVariableTypeMismatch:"BT410_SCRIPT_VARIABLE_TYPE_MISMATCH",InvalidGlobalBlackboardIdentifier:"BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER",InvalidRootElement:"BT001_INVALID_ROOT_ELEMENT",MissingBTCPPFormat:"BT002_MISSING_BTCPP_FORMAT",MissingBehaviorTreeID:"BT003_MISSING_BEHAVIOR_TREE_ID",DuplicateBehaviorTreeID:"BT004_DUPLICATE_BEHAVIOR_TREE_ID",UnknownSubTree:"BT005_UNKNOWN_SUBTREE",DuplicateNodeModelId:"BT006_DUPLICATE_NODE_MODEL_ID",MissingPortName:"BT007_MISSING_PORT_NAME",DuplicatePortName:"BT008_DUPLICATE_PORT_NAME",UnknownTopLevelElement:"BT009_UNKNOWN_TOP_LEVEL_ELEMENT",UnknownMainTree:"BT010_UNKNOWN_MAIN_TREE",AmbiguousSubTree:"BT011_AMBIGUOUS_SUBTREE",ConflictingNodeModel:"BT012_CONFLICTING_NODE_MODEL",DuplicateBehaviorTreeIdInWorkspace:"BT013_DUPLICATE_BEHAVIOR_TREE_ID_IN_WORKSPACE",MissingIncludePath:"BT301_MISSING_INCLUDE_PATH",IncludeNotFound:"BT302_INCLUDE_NOT_FOUND",IncludeCycle:"BT303_INCLUDE_CYCLE",UnresolvedIncludePathVariable:"BT304_UNRESOLVED_INCLUDE_PATH_VARIABLE",IncludeOutsideWorkspace:"BT306_INCLUDE_OUTSIDE_WORKSPACE",ExternalIncludeUsed:"BT307_EXTERNAL_INCLUDE_USED",IncludeDepthExceeded:"BT309_INCLUDE_DEPTH_EXCEEDED",TooManyResolvedFiles:"BT310_TOO_MANY_RESOLVED_FILES",EntrypointNotFound:"BT311_ENTRYPOINT_NOT_FOUND",RosPackageResolverMissing:"BT312_ROS_PACKAGE_RESOLVER_MISSING",RosPackageNotFound:"BT313_ROS_PACKAGE_NOT_FOUND",UnknownNode:"BT105_UNKNOWN_NODE",MissingRequiredPort:"BT101_MISSING_REQUIRED_PORT",UnknownPort:"BT102_UNKNOWN_PORT",InvalidPortValueType:"BT103_INVALID_PORT_VALUE_TYPE",ChildCapableNodeSelfClosing:"BT108_CHILD_CAPABLE_NODE_SELF_CLOSING",LeafNodeOpenClose:"BT109_LEAF_NODE_OPEN_CLOSE",InvalidChildCount:"BT110_INVALID_CHILD_COUNT",BlackboardTypeMismatch:"BT111_BLACKBOARD_TYPE_MISMATCH",CustomLiteralRequiresValidator:"BT112_CUSTOM_LITERAL_REQUIRES_VALIDATOR",InvalidPortDefaultValue:"BT114_INVALID_PORT_DEFAULT_VALUE",OutputPortRequiresRemap:"BT115_OUTPUT_PORT_REQUIRES_REMAP",InvalidPortName:"BT116_INVALID_PORT_NAME",AugmentTargetNotFound:"BT117_AUGMENT_TARGET_NOT_FOUND",AugmentPortNotFound:"BT118_AUGMENT_PORT_NOT_FOUND",InvalidTypeRefinement:"BT119_INVALID_TYPE_REFINEMENT",ConflictingModelKind:"BT120_CONFLICTING_MODEL_KIND",UnusedModelDefinition:"BT121_UNUSED_MODEL_DEFINITION",DuplicateModelDefinition:"BT122_DUPLICATE_MODEL_DEFINITION",MissingLocalModelDefinition:"BT123_MISSING_LOCAL_MODEL_DEFINITION",ExternalModelFileNotFound:"BT321_EXTERNAL_MODEL_FILE_NOT_FOUND",AugmentationFileNotFound:"BT324_AUGMENTATION_FILE_NOT_FOUND",MissingTreeNodesModel:"BT322_MISSING_TREENODESMODEL",ExternalModelXmlParseError:"BT323_EXTERNAL_MODEL_XML_PARSE_ERROR",NodeDefinitionFileNotFound:"BT331_NODE_DEFINITION_FILE_NOT_FOUND",InvalidNodeDefinitionJson:"BT332_INVALID_NODE_DEFINITION_JSON",InvalidNodeDefinitionSchema:"BT333_INVALID_NODE_DEFINITION_SCHEMA",DuplicateNodeDefinitionId:"BT334_DUPLICATE_NODE_DEFINITION_ID",InvalidAugmentationJson:"BT335_INVALID_AUGMENTATION_JSON",InvalidAugmentationSchema:"BT336_INVALID_AUGMENTATION_SCHEMA",ConflictingPortDefault:"BT107_CONFLICTING_PORT_DEFAULT",UnusedSuppression:"BT351_UNUSED_SUPPRESSION",MissingSuppressionReason:"BT353_MISSING_SUPPRESSION_REASON"},R=Object.values(e).sort();var w=p.object({subTreePorts:p.enum(["loose","strict"]).optional()}).strict(),A=p.object({allowStringEntryCompatibility:p.boolean().optional()}).strict(),s={"script/valid-syntax":{code:e.InvalidScriptSyntax,defaultSeverity:"error",description:"Script-bearing attributes must parse as valid BT.CPP scripts."},"script/no-unknown-variable":{code:e.UnknownScriptVariable,defaultSeverity:"warn",description:"Script-bearing attributes should not reference unknown variables."},"script/valid-assignment":{code:e.AssignmentToUnknownVariable,codes:[e.AssignmentToUnknownVariable,e.InvalidCompoundAssignment,e.ScriptVariableTypeMismatch,e.InvalidGlobalBlackboardIdentifier],defaultSeverity:"error",description:"Script assignments must target known variables and use compatible types."},"script/valid-expression-type":{code:e.InvalidScriptOperandType,defaultSeverity:"error",description:"Script expressions must use operators with compatible operand types."},"script/valid-result-type":{code:e.ScriptResultNotBoolCompatible,defaultSeverity:"error",description:"Condition-style script attributes must have a bool-compatible inferred result."},"xml/valid-root":{code:e.InvalidRootElement,defaultSeverity:"error",description:"Root element must be <root>."},"xml/require-btcpp-format":{code:e.MissingBTCPPFormat,defaultSeverity:"warn",description:'Root element must declare BTCPP_format="4".'},"tree/require-id":{code:e.MissingBehaviorTreeID,defaultSeverity:"error",description:"BehaviorTree elements require an ID attribute."},"tree/no-duplicate-id-in-file":{code:e.DuplicateBehaviorTreeID,defaultSeverity:"error",description:"BehaviorTree IDs must be unique within a file."},"tree/no-duplicate-id":{code:e.DuplicateBehaviorTreeIdInWorkspace,defaultSeverity:"error",description:"BehaviorTree IDs must be unique across the workspace."},"tree/no-unknown-subtree":{code:e.UnknownSubTree,defaultSeverity:"error",description:"A SubTree must resolve to a BehaviorTree or a configured model."},"tree/no-unknown-main-tree":{code:e.UnknownMainTree,defaultSeverity:"error",description:"main_tree_to_execute must reference a known BehaviorTree."},"tree/no-ambiguous-subtree":{code:e.AmbiguousSubTree,defaultSeverity:"error",description:"SubTree references must resolve to a single definition."},"tree/no-duplicate-node-model-id":{code:e.DuplicateNodeModelId,defaultSeverity:"error",description:"TreeNodesModel elements must have unique IDs within the same model block."},"xml/no-unknown-top-level-element":{code:e.UnknownTopLevelElement,defaultSeverity:"warn",description:"Top-level elements must be BehaviorTree, TreeNodesModel, or configured include elements."},"include/require-path":{code:e.MissingIncludePath,defaultSeverity:"error",description:"include elements require a path attribute."},"include/no-missing-file":{code:e.IncludeNotFound,defaultSeverity:"error",description:"Referenced include file does not exist."},"include/no-cycle":{code:e.IncludeCycle,defaultSeverity:"error",description:"Include graph cycles are not allowed."},"include/no-outside-root":{code:e.IncludeOutsideWorkspace,defaultSeverity:"error",description:"Includes must stay within the workspace root."},"include/no-unresolved-variable":{code:e.UnresolvedIncludePathVariable,defaultSeverity:"error",description:"Include path variables must resolve before lookup."},"include/no-depth-exceeded":{code:e.IncludeDepthExceeded,defaultSeverity:"error",description:"Include resolution must stay within the configured maximum depth."},"include/no-too-many-files":{code:e.TooManyResolvedFiles,defaultSeverity:"error",description:"Include resolution must stay within the configured file limit."},"include/require-ros-package-resolver":{code:e.RosPackageResolverMissing,defaultSeverity:"error",description:"When include uses ros_pkg, a host resolvePackageUri capability must be provided."},"include/no-missing-ros-package":{code:e.RosPackageNotFound,defaultSeverity:"error",description:"ros_pkg include must resolve to an existing ROS package root URI."},"include/report-external-used":{code:e.ExternalIncludeUsed,defaultSeverity:"info",description:"Reports when an allowed include resolves outside the workspace root."},"model/no-unknown-node":{code:e.UnknownNode,defaultSeverity:"warn",description:"Node usages must resolve to a known model."},"model/require-port":{code:e.MissingRequiredPort,defaultSeverity:"error",description:"Required ports must be supplied."},"model/require-port-name":{code:e.MissingPortName,defaultSeverity:"error",description:"Port elements require a name attribute."},"model/no-duplicate-port-name":{code:e.DuplicatePortName,defaultSeverity:"error",description:"Ports with the same name are not allowed."},"model/valid-port-name":{code:e.InvalidPortName,defaultSeverity:"error",description:"Port names must be valid XML attribute names for BT nodes."},"model/no-unknown-port":{code:e.UnknownPort,defaultSeverity:"warn",optionsSchema:w,options:[{name:"subTreePorts",type:'"loose" | "strict"',default:"loose",description:"Controls whether SubTree remap attributes are checked strictly."}],description:"Reports ports that are not declared by the resolved node model."},"model/valid-port-value":{code:e.InvalidPortValueType,defaultSeverity:"error",description:"Port values must match the declared type."},"model/no-blackboard-type-mismatch":{code:e.BlackboardTypeMismatch,defaultSeverity:"error",optionsSchema:A,options:[{name:"allowStringEntryCompatibility",type:"boolean",default:"true",description:"Treat std::string blackboard entries as runtime-compatible with other port types, matching BT.CPP's existing-entry special case."}],description:"Blackboard entries must not mix incompatible resolved port types."},"model/valid-port-default-value":{code:e.InvalidPortDefaultValue,defaultSeverity:"error",description:"TreeNodesModel port defaults must match the declared type."},"model/require-output-port-remap":{code:e.OutputPortRequiresRemap,defaultSeverity:"error",description:"Resolved output ports must be explicitly or default-remapped to a blackboard entry."},"model/no-childless-control-shape-mismatch":{code:e.ChildCapableNodeSelfClosing,defaultSeverity:"warn",description:"Control and decorator nodes should normally use open/close tags."},"model/no-leaf-block-shape":{code:e.LeafNodeOpenClose,defaultSeverity:"warn",description:"Leaf nodes should normally be self-closing unless they contain child nodes."},"model/valid-child-count":{code:e.InvalidChildCount,defaultSeverity:"warn",description:"Child count must match the expected count for the node kind (Action/Condition: 0, Decorator: 1, Control: >=1, special builtins: fixed range)."},"model/no-conflicting-definition":{code:e.ConflictingNodeModel,defaultSeverity:"error",description:"Node model definitions must agree on kind and port shape."},"model/no-conflicting-kind-for-id":{code:e.ConflictingModelKind,defaultSeverity:"error",description:"A model ID must not be defined with different kinds."},"model/no-unused-definition":{code:e.UnusedModelDefinition,defaultSeverity:"error",description:"Inline model definitions should be used in the same BT XML file."},"model/require-local-definition":{code:e.MissingLocalModelDefinition,defaultSeverity:"error",description:"When models.convention is used-only, normal node usages should have a local TreeNodesModel definition in the same file."},"model/no-duplicate-definition":{code:e.DuplicateModelDefinition,defaultSeverity:"error",description:"A user-defined model (ID, kind) should be defined only once."},"suppression/no-unused":{code:e.UnusedSuppression,defaultSeverity:"warn",description:"Suppressions should match at least one diagnostic."},"suppression/require-reason":{code:e.MissingSuppressionReason,defaultSeverity:"off",description:"Suppressions should include a reason when required."}};var m=["off","info","warn","error"];var f={Error:"error",Warning:"warning",Info:"info"};function v(t,o,i,n,a="",l,d){return{code:t,severity:o,message:i,uri:a,...n?{range:n}:{},...l?{details:l}:{},...d?{data:d}:{}}}function T(t){let o=t.linter.rules["model/no-unknown-port"];return Array.isArray(o)&&o.length>=2&&o[1].subTreePorts==="strict"?{unknownSubTreePorts:"reject"}:{unknownSubTreePorts:"allow"}}function g(t){return t in s}function D(t){for(let[o,i]of Object.entries(s)){let n=i;if(n.code===t||n.codes?.includes(t))return o}}function x(t){return s[t].code}function u(t){if(typeof t=="string")return m.includes(t)?{severity:t}:null;if(Array.isArray(t)&&t.length>=1&&t.length<=2){let[o,i]=t;if(typeof o=="string"&&m.includes(o)&&(i===void 0||typeof i=="object"&&i!==null&&!Array.isArray(i))){let n={severity:o};return i!==void 0&&(n.options=i),n}}return null}function _(t,o){let i=t[o];if(i!==void 0){let n=u(i);if(n)return n.severity}return s[o].defaultSeverity}function y(t,o){let i=[],a=s[t].optionsSchema;if(!a)return i;let l=a.safeParse(o);if(l.success)return i;for(let d of l.error.issues)i.push(...B(t,d));return i}function B(t,o){if(o.code==="unrecognized_keys")return o.keys.map(n=>v("CFG011_INVALID_RULE_OPTION",f.Error,`unknown option \`${String(n)}\` for rule \`${t}\``,void 0,void 0,{help:N(t)}));let i=typeof o.path[0]=="string"?o.path[0]:void 0;return[v("CFG011_INVALID_RULE_OPTION",f.Error,i?`invalid option \`${i}\`: ${o.message}`:`invalid options for rule \`${t}\`: ${o.message}`,void 0,void 0,{help:N(t)})]}function N(t){let i=s[t].options?.map(n=>n.name)??[];return i.length>0?`valid options are: ${i.join(", ")}`:void 0}function b(t){let o=[];h(t.linter,"linter.rules",o);for(let[i,n]of(t.overrides??[]).entries())h(n.linter,`overrides.${i}.linter.rules`,o);return o}function h(t,o,i){for(let[n,a]of Object.entries(t?.rules??{})){let l=`${o}.${n}`;if(!g(n)){i.push({code:"CFG010_UNKNOWN_RULE",severity:"error",path:l,message:`unknown lint rule \`${n}\``,help:"see docs/rules.md for a list of valid rule names"});continue}let d=u(a);if(d?.options)for(let S of y(n,d.options))i.push({code:"CFG011_INVALID_RULE_OPTION",severity:"error",path:k(l,d.options,S.message),message:S.message,help:S.details?.help})}}function k(t,o,i){let n=Object.keys(o).find(a=>i.includes(`\`${a}\``));return n?`${t}.1.${n}`:`${t}.1`}var r=(t,o,i,n=!0)=>({code:t,title:o,description:i,suppressible:n}),U={[e.InvalidScriptSyntax]:{code:e.InvalidScriptSyntax,title:"Invalid script syntax",description:"Script-bearing attributes must parse as valid BT.CPP scripts.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf="A +"/>',validExample:'<AlwaysSuccess _successIf="A == 1"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.EmptyScript]:{code:e.EmptyScript,title:"Empty script",description:"Script-bearing attributes must not be empty.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf=""/>',validExample:'<AlwaysSuccess _successIf="true"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.InvalidScriptToken]:{code:e.InvalidScriptToken,title:"Invalid script token",description:"Script-bearing attributes must not contain invalid BT.CPP tokens.",suppressible:!0,invalidExample:'<Script code="0x"/>',validExample:'<Script code="value := 0x10"/>',configExample:'{"linter":{"rules":{"script/valid-syntax":"error"}}}'},[e.UnknownScriptVariable]:{code:e.UnknownScriptVariable,title:"Unknown script variable",description:"Script-bearing attributes should not read blackboard or local variables that were never introduced.",suppressible:!0,invalidExample:'<AlwaysSuccess _successIf="missing == 1"/>',validExample:'<Script code="count := 1; done = count"/>',configExample:'{"linter":{"rules":{"script/no-unknown-variable":"warn"}}}'},[e.AssignmentToUnknownVariable]:{code:e.AssignmentToUnknownVariable,title:"Assignment to unknown script variable",description:"Assignments with `=` or compound operators must target an existing script or blackboard variable.",suppressible:!0,invalidExample:'<Script code="count = 1"/>',validExample:'<Script code="count := 1; count = 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidCompoundAssignment]:{code:e.InvalidCompoundAssignment,title:"Invalid compound assignment",description:"Compound assignment operators must be used with supported operand types (`number` or `string` for `+=`, numbers only otherwise).",suppressible:!0,invalidExample:'<Script code="name := "x"; name -= 1"/>',validExample:'<Script code="count := 1; count += 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidScriptOperandType]:{code:e.InvalidScriptOperandType,title:"Invalid script operand type",description:"Script operators and ternary conditions must be applied to operands with compatible inferred types.",suppressible:!0,invalidExample:`<AlwaysSuccess _successIf="'x' * 2"/>`,validExample:'<AlwaysSuccess _successIf="count * 2 > 0"/>',configExample:'{"linter":{"rules":{"script/valid-expression-type":"error"}}}'},[e.ScriptResultNotBoolCompatible]:{code:e.ScriptResultNotBoolCompatible,title:"Script result is not bool-compatible",description:"Condition-style script attributes must end in an inferred bool-compatible result type.",suppressible:!0,invalidExample:`<AlwaysSuccess _successIf="'hello'"/>`,validExample:'<AlwaysSuccess _successIf="true"/>',configExample:'{"linter":{"rules":{"script/valid-result-type":"error"}}}'},[e.ScriptVariableTypeMismatch]:{code:e.ScriptVariableTypeMismatch,title:"Script variable type mismatch",description:"Script assignments must not write an incompatible inferred type into an existing variable.",suppressible:!0,invalidExample:'<Script code="count := 1; count = "x""/>',validExample:'<Script code="count := 1; count = 2"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidGlobalBlackboardIdentifier]:{code:e.InvalidGlobalBlackboardIdentifier,title:"Invalid global blackboard identifier",description:"Script global blackboard identifiers must use `@name` with a valid blackboard key after the scope marker.",suppressible:!0,invalidExample:'<Script code="@ := 1"/>',validExample:'<Script code="@count := 1"/>',configExample:'{"linter":{"rules":{"script/valid-assignment":"error"}}}'},[e.InvalidRootElement]:r(e.InvalidRootElement,"Invalid root element","Root element must be <root>.",!1),[e.MissingBTCPPFormat]:r(e.MissingBTCPPFormat,"Missing BTCPP format",'Root element must declare BTCPP_format="4".',!1),[e.MissingBehaviorTreeID]:r(e.MissingBehaviorTreeID,"Missing BehaviorTree ID","BehaviorTree elements require an ID attribute.",!1),[e.DuplicateBehaviorTreeID]:r(e.DuplicateBehaviorTreeID,"Duplicate BehaviorTree ID","BehaviorTree IDs must be unique within a file.",!1),[e.UnknownSubTree]:{code:e.UnknownSubTree,title:"Unknown SubTree reference",description:"A SubTree must resolve to a BehaviorTree or a configured model.",suppressible:!0,invalidExample:'<SubTree ID="missing_tree"/>',validExample:'<BehaviorTree ID="missing_tree"><Sequence/></BehaviorTree>',fix:"Define the BehaviorTree, add an external TreeNodesModel file, or add a nodes config entry.",configExample:'{"linter":{"rules":{"tree/no-unknown-subtree":"warn"}}}'},[e.DuplicateNodeModelId]:r(e.DuplicateNodeModelId,"Duplicate node model ID in TreeNodesModel","TreeNodesModel elements must have unique IDs within the same model block.",!1),[e.MissingPortName]:r(e.MissingPortName,"Missing port name","Port elements require a name attribute.",!1),[e.DuplicatePortName]:r(e.DuplicatePortName,"Duplicate port name","Ports with the same name are not allowed.",!1),[e.InvalidPortName]:{code:e.InvalidPortName,title:"Invalid port name",description:"Port names must be valid XML attribute names for BT nodes.",suppressible:!1,invalidExample:'<input_port name="request.name" type="string"/>',validExample:'<input_port name="request_name" type="string"/>',fix:"Rename the port so it does not use reserved names, leading digits, whitespace, control characters, or XML/path punctuation.",configExample:'{"linter":{"rules":{"model/valid-port-name":"warn"}}}'},[e.UnknownTopLevelElement]:r(e.UnknownTopLevelElement,"Unknown top-level element","Top-level elements must be BehaviorTree, TreeNodesModel, or configured include elements.",!1),[e.UnknownMainTree]:r(e.UnknownMainTree,"Unknown main tree","main_tree_to_execute must reference a known BehaviorTree.",!1),[e.AmbiguousSubTree]:r(e.AmbiguousSubTree,"Ambiguous SubTree","SubTree references must resolve to a single definition.",!1),[e.ConflictingNodeModel]:{code:e.ConflictingNodeModel,title:"Conflicting node model",description:"Node model definitions must agree on kind and port shape.",suppressible:!1,fix:"Run `btxmlc repair` to inspect conflicts. Run `btxmlc repair --write` to resolve the conflict interactively."},[e.ConflictingModelKind]:{code:e.ConflictingModelKind,title:"Conflicting model kind for ID",description:"The same model ID must not be defined with different node kinds.",suppressible:!1,invalidExample:'<TreeNodesModel><Action ID="Foo"/><Condition ID="Foo"/></TreeNodesModel>',validExample:'<TreeNodesModel><Action ID="Foo"/></TreeNodesModel>'},[e.UnusedModelDefinition]:{code:e.UnusedModelDefinition,title:"Unused inline model definition",description:"When models.convention is used-only, inline Action/Condition/Decorator/Control definitions must be used in the same file.",suppressible:!1,invalidExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Run/></BehaviorTree><TreeNodesModel><Action ID="Run"/><Action ID="Unused"/></TreeNodesModel></root>',validExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Run/></BehaviorTree><TreeNodesModel><Action ID="Run"/></TreeNodesModel></root>',fix:"Run `btxmlc lint --fix` to remove unused inline model definitions when safe."},[e.DuplicateModelDefinition]:{code:e.DuplicateModelDefinition,title:"Duplicate model definition",description:"When models.convention is single-source, each user-defined (ID, kind) model definition should appear only once.",suppressible:!1,invalidExample:`<!-- a.xml --><TreeNodesModel><Action ID="Move"/></TreeNodesModel>
|
|
2
|
+
<!-- b.xml --><TreeNodesModel><Action ID="Move"/></TreeNodesModel>`,validExample:'<TreeNodesModel><Action ID="Move"/></TreeNodesModel>',fix:"Run `btxmlc lint --fix` to delete non-canonical duplicates when safe."},[e.MissingLocalModelDefinition]:{code:e.MissingLocalModelDefinition,title:"Missing local model definition",description:"When models.convention is used-only, each normal node used in a file should have a local TreeNodesModel definition in that same file.",suppressible:!1,invalidExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Sequence/><Move/></BehaviorTree><TreeNodesModel><Action ID="Move"/></TreeNodesModel></root>',validExample:'<root BTCPP_format="4"><BehaviorTree ID="Main"><Sequence/><Move/></BehaviorTree><TreeNodesModel><Control ID="Sequence"/><Action ID="Move"/></TreeNodesModel></root>',fix:"Run `btxmlc lint --fix` to add missing local model definitions when they can be resolved safely."},[e.DuplicateBehaviorTreeIdInWorkspace]:{code:e.DuplicateBehaviorTreeIdInWorkspace,title:"Duplicate BehaviorTree ID in workspace",description:"BehaviorTree IDs must be unique across the workspace.",suppressible:!1,invalidExample:`<!-- file1.xml --><BehaviorTree ID="shared"/>
|
|
3
3
|
<!-- file2.xml --><BehaviorTree ID="shared"/>`,validExample:`<!-- file1.xml --><BehaviorTree ID="shared"/>
|
|
4
|
-
<!-- file2.xml --><BehaviorTree ID="other"/>`,configExample:'{"linter":{"rules":{"tree/no-duplicate-id":"warn"}}}'},[e.MissingIncludePath]:{code:e.MissingIncludePath,title:"Missing include path",description:"include elements require a path attribute.",suppressible:!1,invalidExample:"<include/>",validExample:'<include path="common.xml"/>',configExample:'{"linter":{"rules":{"include/require-path":"warn"}}}'},[e.IncludeNotFound]:{code:e.IncludeNotFound,title:"Include not found",description:"Referenced include file does not exist.",suppressible:!1,invalidExample:'<include path="missing.xml"/>',validExample:'<include path="common.xml"/>',configExample:'{"linter":{"rules":{"include/no-missing-file":"warn"}}}'},[e.IncludeCycle]:r(e.IncludeCycle,"Include cycle","Include graph cycles are not allowed.",!1),[e.UnresolvedIncludePathVariable]:r(e.UnresolvedIncludePathVariable,"Unresolved include path variable","Include path variables must resolve before lookup.",!1),[e.IncludeOutsideWorkspace]:r(e.IncludeOutsideWorkspace,"Include outside workspace","Includes must stay within the workspace root.",!1),[e.ExternalIncludeUsed]:r(e.ExternalIncludeUsed,"External include used","An include file outside the workspace root was used.",!1),[e.IncludeDepthExceeded]:r(e.IncludeDepthExceeded,"Include depth exceeded","The maximum depth of nested includes was reached.",!1),[e.TooManyResolvedFiles]:r(e.TooManyResolvedFiles,"Too many resolved files","The maximum number of allowed files included was reached.",!1),[e.EntrypointNotFound]:r(e.EntrypointNotFound,"Entrypoint not found","Configured entrypoint files must exist.",!1),[e.RosPackageResolverMissing]:{code:e.RosPackageResolverMissing,title:"ROS package resolver is missing",description:"include elements with ros_pkg require ProjectHost.resolvePackageUri to be provided.",suppressible:!1,invalidExample:'<include ros_pkg="my_pkg" path="trees/common.xml"/>',validExample:"Provide a host implementation of resolvePackageUri that resolves my_pkg to a package root URI."},[e.RosPackageNotFound]:{code:e.RosPackageNotFound,title:"ROS package not found",description:"ros_pkg include must resolve to a known package root URI.",suppressible:!1,invalidExample:'<include ros_pkg="missing_pkg" path="trees/common.xml"/>',validExample:'<include ros_pkg="my_pkg" path="trees/common.xml"/>'},[e.UnknownNode]:r(e.UnknownNode,"Unknown node","Node usages must resolve to a known model.",!0),[e.MissingRequiredPort]:{code:e.MissingRequiredPort,title:"Missing required port",description:"Required ports must be supplied.",suppressible:!0,invalidExample:'<Action ID="SetFlag"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/require-port":"warn"}}}'},[e.UnknownPort]:{code:e.UnknownPort,title:"Unknown port",description:"Unknown ports are reported against the resolved node model.",suppressible:!0,invalidExample:'<Action ID="SetFlag" unknown="1"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/no-unknown-port":"error"}}}'},[e.InvalidPortValueType]:{code:e.InvalidPortValueType,title:"Invalid port value type",description:"Port values must match the declared type.",suppressible:!0,invalidExample:'<Action ID="SetFlag" enabled="yes"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/valid-port-value":"warn"}}}'},[e.BlackboardTypeMismatch]:{code:e.BlackboardTypeMismatch,title:"Blackboard type mismatch",description:"Blackboard entries must not mix incompatible resolved port types.",suppressible:!0,invalidExample:'<Sequence><ReadPose pose="{target}"/><UseString text="{target}"/></Sequence>',validExample:'<Sequence><ReadPose pose="{target}"/><UsePose pose="{target}"/></Sequence>',configExample:'{"linter":{"rules":{"model/no-blackboard-type-mismatch":["warn",{"allowStringEntryCompatibility":true}]}}}'},[e.CustomLiteralRequiresValidator]:{code:e.CustomLiteralRequiresValidator,title:"Custom literal requires validator",description:"Literal values for custom port types require a validator.",suppressible:!0,invalidExample:'<Action ID="MoveTo" target="1.0;2.0;3.14"/>',validExample:'<Action ID="MoveTo" target="{target}"/>',configExample:'{"linter":{"rules":{"model/valid-port-value":"warn"}}}'},[e.InvalidPortDefaultValue]:{code:e.InvalidPortDefaultValue,title:"Invalid port default value",description:"TreeNodesModel port defaults must match the declared type.",suppressible:!0,invalidExample:'<input_port name="count" type="int" default="abc"/>',validExample:'<input_port name="count" type="int" default="1"/>',configExample:'{"linter":{"rules":{"model/valid-port-default-value":"warn"}}}'},[e.OutputPortRequiresRemap]:{code:e.OutputPortRequiresRemap,title:"Output port requires remap",description:"Resolved output ports must
|
|
4
|
+
<!-- file2.xml --><BehaviorTree ID="other"/>`,configExample:'{"linter":{"rules":{"tree/no-duplicate-id":"warn"}}}'},[e.MissingIncludePath]:{code:e.MissingIncludePath,title:"Missing include path",description:"include elements require a path attribute.",suppressible:!1,invalidExample:"<include/>",validExample:'<include path="common.xml"/>',configExample:'{"linter":{"rules":{"include/require-path":"warn"}}}'},[e.IncludeNotFound]:{code:e.IncludeNotFound,title:"Include not found",description:"Referenced include file does not exist.",suppressible:!1,invalidExample:'<include path="missing.xml"/>',validExample:'<include path="common.xml"/>',configExample:'{"linter":{"rules":{"include/no-missing-file":"warn"}}}'},[e.IncludeCycle]:r(e.IncludeCycle,"Include cycle","Include graph cycles are not allowed.",!1),[e.UnresolvedIncludePathVariable]:r(e.UnresolvedIncludePathVariable,"Unresolved include path variable","Include path variables must resolve before lookup.",!1),[e.IncludeOutsideWorkspace]:r(e.IncludeOutsideWorkspace,"Include outside workspace","Includes must stay within the workspace root.",!1),[e.ExternalIncludeUsed]:r(e.ExternalIncludeUsed,"External include used","An include file outside the workspace root was used.",!1),[e.IncludeDepthExceeded]:r(e.IncludeDepthExceeded,"Include depth exceeded","The maximum depth of nested includes was reached.",!1),[e.TooManyResolvedFiles]:r(e.TooManyResolvedFiles,"Too many resolved files","The maximum number of allowed files included was reached.",!1),[e.EntrypointNotFound]:r(e.EntrypointNotFound,"Entrypoint not found","Configured entrypoint files must exist.",!1),[e.RosPackageResolverMissing]:{code:e.RosPackageResolverMissing,title:"ROS package resolver is missing",description:"include elements with ros_pkg require ProjectHost.resolvePackageUri to be provided.",suppressible:!1,invalidExample:'<include ros_pkg="my_pkg" path="trees/common.xml"/>',validExample:"Provide a host implementation of resolvePackageUri that resolves my_pkg to a package root URI."},[e.RosPackageNotFound]:{code:e.RosPackageNotFound,title:"ROS package not found",description:"ros_pkg include must resolve to a known package root URI.",suppressible:!1,invalidExample:'<include ros_pkg="missing_pkg" path="trees/common.xml"/>',validExample:'<include ros_pkg="my_pkg" path="trees/common.xml"/>'},[e.UnknownNode]:r(e.UnknownNode,"Unknown node","Node usages must resolve to a known model.",!0),[e.MissingRequiredPort]:{code:e.MissingRequiredPort,title:"Missing required port",description:"Required ports must be supplied.",suppressible:!0,invalidExample:'<Action ID="SetFlag"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/require-port":"warn"}}}'},[e.UnknownPort]:{code:e.UnknownPort,title:"Unknown port",description:"Unknown ports are reported against the resolved node model.",suppressible:!0,invalidExample:'<Action ID="SetFlag" unknown="1"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/no-unknown-port":"error"}}}'},[e.InvalidPortValueType]:{code:e.InvalidPortValueType,title:"Invalid port value type",description:"Port values must match the declared type.",suppressible:!0,invalidExample:'<Action ID="SetFlag" enabled="yes"/>',validExample:'<Action ID="SetFlag" enabled="true"/>',configExample:'{"linter":{"rules":{"model/valid-port-value":"warn"}}}'},[e.BlackboardTypeMismatch]:{code:e.BlackboardTypeMismatch,title:"Blackboard type mismatch",description:"Blackboard entries must not mix incompatible resolved port types.",suppressible:!0,invalidExample:'<Sequence><ReadPose pose="{target}"/><UseString text="{target}"/></Sequence>',validExample:'<Sequence><ReadPose pose="{target}"/><UsePose pose="{target}"/></Sequence>',configExample:'{"linter":{"rules":{"model/no-blackboard-type-mismatch":["warn",{"allowStringEntryCompatibility":true}]}}}'},[e.CustomLiteralRequiresValidator]:{code:e.CustomLiteralRequiresValidator,title:"Custom literal requires validator",description:"Literal values for custom port types require a validator.",suppressible:!0,invalidExample:'<Action ID="MoveTo" target="1.0;2.0;3.14"/>',validExample:'<Action ID="MoveTo" target="{target}"/>',configExample:'{"linter":{"rules":{"model/valid-port-value":"warn"}}}'},[e.InvalidPortDefaultValue]:{code:e.InvalidPortDefaultValue,title:"Invalid port default value",description:"TreeNodesModel port defaults must match the declared type.",suppressible:!0,invalidExample:'<input_port name="count" type="int" default="abc"/>',validExample:'<input_port name="count" type="int" default="1"/>',configExample:'{"linter":{"rules":{"model/valid-port-default-value":"warn"}}}'},[e.OutputPortRequiresRemap]:{code:e.OutputPortRequiresRemap,title:"Output port requires remap",description:"Resolved output ports must be explicitly or default-remapped to a blackboard entry.",suppressible:!0,invalidExample:'<Action ID="Producer" result="value"/>',validExample:'<Action ID="Producer" result="{value}"/>',configExample:'{"linter":{"rules":{"model/require-output-port-remap":"error"}}}'},[e.AugmentTargetNotFound]:{code:e.AugmentTargetNotFound,title:"Augmentation target not found",description:"Model augmentations must target an existing node model.",suppressible:!1,invalidExample:'{"augment":{"MissingNode":{"ports":{}}}}',validExample:'{"augment":{"MoveTo":{"ports":{}}}}'},[e.AugmentPortNotFound]:{code:e.AugmentPortNotFound,title:"Augmentation port not found",description:"Model augmentations must target an existing port on the node model.",suppressible:!1,invalidExample:'{"augment":{"MoveTo":{"ports":{"missing":{}}}}}',validExample:'{"augment":{"MoveTo":{"ports":{"target":{}}}}}'},[e.InvalidTypeRefinement]:{code:e.InvalidTypeRefinement,title:"Invalid type refinement",description:"Model augmentation type refinements must match the port base type when `from` is provided.",suppressible:!1,invalidExample:'{"typeRefinement":{"from":"std::string","to":"Pose2D"}}',validExample:'{"typeRefinement":{"from":"int","to":"Pose2D"}}'},[e.ChildCapableNodeSelfClosing]:{code:e.ChildCapableNodeSelfClosing,title:"Child-capable node is self-closing",description:"Control and decorator nodes should normally use open/close tags.",suppressible:!0,invalidExample:"<Sequence/>",validExample:`<Sequence>
|
|
5
5
|
<AlwaysSuccess/>
|
|
6
|
-
</Sequence>`,configExample:'{"linter":{"rules":{"model/no-childless-control-shape-mismatch":"off"}}}'},[e.LeafNodeOpenClose]:{code:e.LeafNodeOpenClose,title:"Leaf node uses block shape",description:"Leaf nodes should normally be self-closing unless they contain child nodes.",suppressible:!0,invalidExample:"<AlwaysSuccess></AlwaysSuccess>",validExample:"<AlwaysSuccess/>",configExample:'{"linter":{"rules":{"model/no-leaf-block-shape":"off"}}}'},[e.InvalidChildCount]:{code:e.InvalidChildCount,title:"Invalid child count",description:"Node child count must satisfy the constraints for its kind: Action/Condition have no children, Decorator has exactly one, Control has one or more, SubTree has none, and special builtins like IfThenElse/WhileDoElse require 2 or 3.",suppressible:!0,invalidExample:"<Sequence/>",validExample:"<Sequence><AlwaysSuccess/></Sequence>",configExample:'{"linter":{"rules":{"model/valid-child-count":"warn"}}}'},[e.ExternalModelFileNotFound]:{code:e.ExternalModelFileNotFound,title:"External model file not found",description:"Configured external TreeNodesModel files must exist.",suppressible:!1,invalidExample:'{"models":{"files":["missing.xml"]}}',validExample:'{"models":{"files":["models.xml"]}}'},[e.AugmentationFileNotFound]:{code:e.AugmentationFileNotFound,title:"Augmentation file not found",description:"Configured augmentation files must exist.",suppressible:!1,invalidExample:'{"models":{"augmentations":["missing.xml"]}}',validExample:'{"models":{"augmentations":["augmentations.xml"]}}'},[e.MissingTreeNodesModel]:r(e.MissingTreeNodesModel,"Missing TreeNodesModel","External model files must contain a TreeNodesModel.",!1),[e.ExternalModelXmlParseError]:r(e.ExternalModelXmlParseError,"External model XML parse error","External model files must parse as XML.",!1),[e.NodeDefinitionFileNotFound]:{code:e.NodeDefinitionFileNotFound,title:"Node definition file not found",description:"Configured node definition files must exist.",suppressible:!1,invalidExample:'{"models":{"definitions":["missing.json"]}}',validExample:'{"models":{"definitions":["nodes.json"]}}'},[e.InvalidNodeDefinitionJson]:r(e.InvalidNodeDefinitionJson,"Invalid node definition JSON","Node definition files must parse as JSON.",!1),[e.InvalidNodeDefinitionSchema]:r(e.InvalidNodeDefinitionSchema,"Invalid node definition schema","Node definition files must match the expected schema.",!1),[e.DuplicateNodeDefinitionId]:r(e.DuplicateNodeDefinitionId,"Duplicate node definition ID","Node definition IDs must be unique.",!1),[e.InvalidAugmentationJson]:r(e.InvalidAugmentationJson,"Invalid augmentation JSON","Model augmentation files must parse as JSON.",!1),[e.InvalidAugmentationSchema]:r(e.InvalidAugmentationSchema,"Invalid augmentation schema","Model augmentation files must match the expected schema.",!1),[e.ConflictingPortDefault]:{code:e.ConflictingPortDefault,title:"Conflicting port default",description:"Merged port defaults must agree.",suppressible:!1,fix:"Run `btxmlc repair` to inspect conflicts. Run `btxmlc repair --write` to resolve the conflict interactively."},[e.UnusedSuppression]:r(e.UnusedSuppression,"Unused suppression","Suppressions should match at least one diagnostic.",!1),[e.MissingSuppressionReason]:r(e.MissingSuppressionReason,"Missing suppression reason","Suppressions should include a reason when required.",!1),XML016_TEXT_OUTSIDE_ROOT:r("XML016_TEXT_OUTSIDE_ROOT","Text outside root element","Non-whitespace text is not allowed outside the root element.",!1)},L=Object.fromEntries(Object.values(s).flatMap(t=>{let o=t;return[o.code,...(o.codes??[]).filter(i=>i!==o.code)].map(i=>[i,o.defaultSeverity])})),F={[e.DuplicateNodeModelId]:"error",[e.UnknownTopLevelElement]:"warning",[e.UnresolvedIncludePathVariable]:"error",[e.ExternalIncludeUsed]:"info",[e.IncludeDepthExceeded]:"error",[e.TooManyResolvedFiles]:"error",[e.EntrypointNotFound]:"error",[e.ExternalModelFileNotFound]:"error",[e.AugmentationFileNotFound]:"error",[e.MissingTreeNodesModel]:"error",[e.ExternalModelXmlParseError]:"error",[e.NodeDefinitionFileNotFound]:"error",[e.InvalidNodeDefinitionJson]:"error",[e.InvalidNodeDefinitionSchema]:"error",[e.DuplicateNodeDefinitionId]:"error",[e.InvalidAugmentationJson]:"error",[e.InvalidAugmentationSchema]:"error",[e.CustomLiteralRequiresValidator]:"error",[e.InvalidPortDefaultValue]:"error",[e.InvalidPortName]:"error",[e.AugmentTargetNotFound]:"error",[e.AugmentPortNotFound]:"error",[e.InvalidTypeRefinement]:"error",[e.ConflictingPortDefault]:"warning",[e.EmptyScript]:"error",[e.InvalidScriptToken]:"error",[e.InvalidCompoundAssignment]:"error",[e.ScriptVariableTypeMismatch]:"error",XML016_TEXT_OUTSIDE_ROOT:"error"};function V(t){let o=L[t]??F[t];if(!o)throw new Error(`Missing default severity metadata for ${t}`);return o}var c={};for(let[t,o]of Object.entries(U))c[t]={...o,defaultSeverity:V(t)};var I={};for(let[t,o]of Object.entries(s)){let i=c[o.code];if(i){let n=o;I[t]=n.options?{...i,options:n.options}:i}}function
|
|
6
|
+
</Sequence>`,configExample:'{"linter":{"rules":{"model/no-childless-control-shape-mismatch":"off"}}}'},[e.LeafNodeOpenClose]:{code:e.LeafNodeOpenClose,title:"Leaf node uses block shape",description:"Leaf nodes should normally be self-closing unless they contain child nodes.",suppressible:!0,invalidExample:"<AlwaysSuccess></AlwaysSuccess>",validExample:"<AlwaysSuccess/>",configExample:'{"linter":{"rules":{"model/no-leaf-block-shape":"off"}}}'},[e.InvalidChildCount]:{code:e.InvalidChildCount,title:"Invalid child count",description:"Node child count must satisfy the constraints for its kind: Action/Condition have no children, Decorator has exactly one, Control has one or more, SubTree has none, and special builtins like IfThenElse/WhileDoElse require 2 or 3.",suppressible:!0,invalidExample:"<Sequence/>",validExample:"<Sequence><AlwaysSuccess/></Sequence>",configExample:'{"linter":{"rules":{"model/valid-child-count":"warn"}}}'},[e.ExternalModelFileNotFound]:{code:e.ExternalModelFileNotFound,title:"External model file not found",description:"Configured external TreeNodesModel files must exist.",suppressible:!1,invalidExample:'{"models":{"files":["missing.xml"]}}',validExample:'{"models":{"files":["models.xml"]}}'},[e.AugmentationFileNotFound]:{code:e.AugmentationFileNotFound,title:"Augmentation file not found",description:"Configured augmentation files must exist.",suppressible:!1,invalidExample:'{"models":{"augmentations":["missing.xml"]}}',validExample:'{"models":{"augmentations":["augmentations.xml"]}}'},[e.MissingTreeNodesModel]:r(e.MissingTreeNodesModel,"Missing TreeNodesModel","External model files must contain a TreeNodesModel.",!1),[e.ExternalModelXmlParseError]:r(e.ExternalModelXmlParseError,"External model XML parse error","External model files must parse as XML.",!1),[e.NodeDefinitionFileNotFound]:{code:e.NodeDefinitionFileNotFound,title:"Node definition file not found",description:"Configured node definition files must exist.",suppressible:!1,invalidExample:'{"models":{"definitions":["missing.json"]}}',validExample:'{"models":{"definitions":["nodes.json"]}}'},[e.InvalidNodeDefinitionJson]:r(e.InvalidNodeDefinitionJson,"Invalid node definition JSON","Node definition files must parse as JSON.",!1),[e.InvalidNodeDefinitionSchema]:r(e.InvalidNodeDefinitionSchema,"Invalid node definition schema","Node definition files must match the expected schema.",!1),[e.DuplicateNodeDefinitionId]:r(e.DuplicateNodeDefinitionId,"Duplicate node definition ID","Node definition IDs must be unique.",!1),[e.InvalidAugmentationJson]:r(e.InvalidAugmentationJson,"Invalid augmentation JSON","Model augmentation files must parse as JSON.",!1),[e.InvalidAugmentationSchema]:r(e.InvalidAugmentationSchema,"Invalid augmentation schema","Model augmentation files must match the expected schema.",!1),[e.ConflictingPortDefault]:{code:e.ConflictingPortDefault,title:"Conflicting port default",description:"Merged port defaults must agree.",suppressible:!1,fix:"Run `btxmlc repair` to inspect conflicts. Run `btxmlc repair --write` to resolve the conflict interactively."},[e.UnusedSuppression]:r(e.UnusedSuppression,"Unused suppression","Suppressions should match at least one diagnostic.",!1),[e.MissingSuppressionReason]:r(e.MissingSuppressionReason,"Missing suppression reason","Suppressions should include a reason when required.",!1),XML016_TEXT_OUTSIDE_ROOT:r("XML016_TEXT_OUTSIDE_ROOT","Text outside root element","Non-whitespace text is not allowed outside the root element.",!1)},L=Object.fromEntries(Object.values(s).flatMap(t=>{let o=t;return[o.code,...(o.codes??[]).filter(i=>i!==o.code)].map(i=>[i,o.defaultSeverity])})),F={[e.DuplicateNodeModelId]:"error",[e.UnknownTopLevelElement]:"warning",[e.UnresolvedIncludePathVariable]:"error",[e.ExternalIncludeUsed]:"info",[e.IncludeDepthExceeded]:"error",[e.TooManyResolvedFiles]:"error",[e.EntrypointNotFound]:"error",[e.ExternalModelFileNotFound]:"error",[e.AugmentationFileNotFound]:"error",[e.MissingTreeNodesModel]:"error",[e.ExternalModelXmlParseError]:"error",[e.NodeDefinitionFileNotFound]:"error",[e.InvalidNodeDefinitionJson]:"error",[e.InvalidNodeDefinitionSchema]:"error",[e.DuplicateNodeDefinitionId]:"error",[e.InvalidAugmentationJson]:"error",[e.InvalidAugmentationSchema]:"error",[e.CustomLiteralRequiresValidator]:"error",[e.InvalidPortDefaultValue]:"error",[e.InvalidPortName]:"error",[e.AugmentTargetNotFound]:"error",[e.AugmentPortNotFound]:"error",[e.InvalidTypeRefinement]:"error",[e.ConflictingPortDefault]:"warning",[e.EmptyScript]:"error",[e.InvalidScriptToken]:"error",[e.InvalidCompoundAssignment]:"error",[e.ScriptVariableTypeMismatch]:"error",XML016_TEXT_OUTSIDE_ROOT:"error"};function V(t){let o=L[t]??F[t];if(!o)throw new Error(`Missing default severity metadata for ${t}`);return o}var c={};for(let[t,o]of Object.entries(U))c[t]={...o,defaultSeverity:V(t)};var I={};for(let[t,o]of Object.entries(s)){let i=c[o.code];if(i){let n=o;I[t]=n.options?{...i,options:n.options}:i}}function M(t){return c[t]}function C(t){return I[t]??c[t]}function O(){return[...Object.values(e)].sort()}function E(){return Object.keys(s).sort()}function P(){let t=[];for(let o of E()){let i=I[o];i&&t.push({name:o,metadata:i})}return t}export{s as RULES,R as RULE_CODES,e as RuleCodes,M as findRuleMetadata,x as getDiagnosticCodeForRule,T as getNodeUsagePolicyForRules,C as getRuleMetadata,D as getRuleNameForCode,_ as getRuleSeverity,g as isRuleName,O as listRuleCodes,E as listRuleSlugs,P as listRules,u as normalizeRuleConfig,b as validateRawConfigRules,y as validateRuleOptions};
|