@abco20/btxml-checker 0.1.1 → 0.1.3
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 +29 -27
- package/dist/config.d.ts +3 -3
- package/dist/config.js +1 -1
- package/dist/editor-node.d.ts +7 -7
- package/dist/editor-node.js +23 -21
- package/dist/editor.d.ts +7 -7
- package/dist/editor.js +22 -20
- package/dist/{effective-t_u6qJ-7.d.ts → effective-Dmz864HF.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +10 -9
- package/dist/model.d.ts +2 -2
- package/dist/model.js +3 -2
- package/dist/{public-types-DaawwXHQ.d.ts → public-types-D3_VR6Sy.d.ts} +5 -5
- package/dist/{public-types-B2noBQY9.d.ts → public-types-zg51kxSL.d.ts} +26 -4
- package/dist/rules.d.ts +26 -7
- package/dist/rules.js +4 -3
- package/dist/semantic.d.ts +6 -6
- package/dist/semantic.js +3 -2
- package/dist/server.cjs +1593 -464
- package/dist/server.cjs.map +1 -1
- package/dist/syntax.js +6 -6
- package/dist/{types-BaOc_AYN.d.ts → types-BIuA9iLZ.d.ts} +2 -2
- package/dist/{types-SY4-jKCn.d.ts → types-DPS-KRMY.d.ts} +2 -2
- package/dist/{types-CkOvIGPf.d.ts → types-DkQEPPAM.d.ts} +5 -3
- package/dist/{types-BgqDzlJ8.d.ts → types-H6H-_Z3F.d.ts} +12 -0
- package/package.json +1 -1
- package/schemas/btxml.config.schema.json +10 -0
package/dist/model.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as Diagnostic } from './diagnostic-B5htzyJ9.js';
|
|
2
2
|
import { B as BtDocument } from './ast-BbfR3S_b.js';
|
|
3
|
-
import {
|
|
4
|
-
export { A as AttributeValueRef,
|
|
3
|
+
import { c as BtDocumentModel, d as PortDirection, P as PortDef, e as BuiltinNodeDef, a as TreeNodeModelDef, T as TreeNodeKind } from './public-types-zg51kxSL.js';
|
|
4
|
+
export { A as AttributeValueRef, b as BehaviorTreeDef, f as BlackboardReference, g as BtDocumentModelKind, D as DocumentBlackboardReference, M as ModelSourceRef, N as NodeModelSource, h as NodeModelSourceKind, i as PortSourceRef, S as SubTreeReference } from './public-types-zg51kxSL.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
type BuildDocumentModelOptions = {
|
package/dist/model.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
var q={Error:"error",Warning:"warning",Info:"info"};function
|
|
2
|
-
`||t==="\r")return"port names must not contain whitespace";let r=Be.get(t);if(r)return r}}function E(e,t){let i=t.direction??"input";return{source:"config",name:e,direction:i,type:t.type,defaultValue:t.default,description:t.description,required:t.required??((i==="input"||i==="inout")&&t.default===void 0),enum:t.enum}}function G(e,t){return{id:e,kind:t.kind,source:"config",sourceMeta:{sourceKind:"config"},editable:!0,ports:Object.entries(t.ports??{}).map(([i,r])=>E(i,r))}}function K(e,t,i){return i!==void 0?i:(e==="input"||e==="inout")&&t===void 0}var O=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<bool, std::allocator<bool> > >",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<double, std::allocator<double> > >",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<int, std::allocator<int> > >",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once bu the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written int othe output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],j={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var W=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<bool, std::allocator<bool> > >",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<double, std::allocator<double> > >",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<int, std::allocator<int> > >",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once by the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written into the output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],X={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var z=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once by the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written into the output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"TryCatch",kind:"Control",ports:[{name:"catch_on_halt",direction:"input",type:"bool",defaultValue:"false",description:"If true, execute the catch child when the node is halted during the try-block",required:!1}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],$={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var J=["4.6.2","4.8.2","4.9.0"],C="4.9.0",b={"4.6.2":{models:O,genericSubTreeModel:j},"4.8.2":{models:W,genericSubTreeModel:X},"4.9.0":{models:z,genericSubTreeModel:$}};var x=J.map(e=>`btcpp-v${e}`),H=["btcpp-v4",...x],R=`btcpp-v${C}`;function Q(e){return{source:"builtin",direction:e.direction,name:e.name,type:e.type,defaultValue:e.defaultValue,description:e.description,required:e.required,enum:e.enum}}function qe(e){return e.map(t=>({id:t.id,kind:t.kind,ports:t.ports.map(Q)}))}function Y(e){if(e)return{id:e.id,kind:e.kind,ports:e.ports.map(Q)}}function Te(){let e={};for(let[t,i]of Object.entries(b))e[`btcpp-v${t}`]=qe(i.models);return e}function Me(){let e={};for(let[t,i]of Object.entries(b))e[`btcpp-v${t}`]=Y(i.genericSubTreeModel);return e}var Z=Te(),_e=Me();function Ee(e){let t=e.replace(/^btcpp-v/,"");return Object.hasOwn(b,t)}function N(e){return e==="btcpp-v4"?R:e}function Ce(e){return e==="btcpp-v4"?C:e.replace(/^btcpp-v/,"")}function A(e){if(e&&e!=="btcpp-v4"&&!Ee(e))throw new Error(`unsupported builtin model set: ${e}`)}function ee(e="btcpp-v4"){A(e);let t=N(e);return Z[t].map(r=>B(r))}function te(e,t="btcpp-v4"){A(t);let i=N(t),n=Z[i].find(o=>o.id===e);return n?B(n):void 0}function ie(e="btcpp-v4"){A(e);let t=_e[N(e)]??Y(b[Ce(e)].genericSubTreeModel);return t?(t.ports??[]).map(i=>({...i,enum:i.enum?[...i.enum]:void 0})):[]}function B(e){return{id:e.id,kind:e.kind,source:"builtin",sourceMeta:{sourceKind:"builtin"},editable:!1,ports:(e.ports??[]).map(t=>({...t,enum:t.enum?[...t.enum]:void 0}))}}function f(e){return{id:e.id,kind:e.kind,ports:[...e.ports].sort((t,i)=>{let r=t.name.localeCompare(i.name);if(r!==0)return r;let n=t.direction.localeCompare(i.direction);if(n!==0)return n;let o=(t.type??"").localeCompare(i.type??"");if(o!==0)return o;let a=(t.defaultValue??"").localeCompare(i.defaultValue??"");return a!==0?a:(t.description??"").localeCompare(i.description??"")}).map(t=>({name:t.name,direction:t.direction,type:t.type,required:t.required,defaultValue:t.defaultValue,enum:t.enum?[...t.enum].sort():void 0,description:t.description}))}}function v(e,t){let i=f(e),r=f(t);return JSON.stringify(i)===JSON.stringify(r)}function re(e,t){if(v(e,t))return"none";let i=f(e),r=f(t);if(i.kind!==r.kind)return"kind";if(i.ports.length!==r.ports.length)return"ports";let n=new Map(r.ports.map(d=>[d.name,d])),o=!1,a=!1;for(let d of i.ports){let u=n.get(d.name);if(!u){a=!0;continue}(d.direction!==u.direction||d.type!==u.type||d.required!==u.required)&&(a=!0);let c=d.enum?JSON.stringify(d.enum):"",l=u.enum?JSON.stringify(u.enum):"";c!==l&&(a=!0),d.description!==u.description&&(a=!0),d.defaultValue!==u.defaultValue&&(o=!0)}return a?"ports":o?"port-default":"mixed"}export{R as DEFAULT_BTCPP_V4_MODEL_SET,H as SUPPORTED_BUILTIN_MODEL_SETS,x as SUPPORTED_VERSIONED_BTCPP_MODEL_SETS,v as areEquivalentNodeModels,U as buildDocumentModel,M as buildDocumentModelResult,B as builtinToNodeModel,re as classifyNodeModelDifference,te as getBuiltinNodeModel,ie as getGenericSubTreePorts,F as getInvalidPortNameReason,f as getNodeModelSignature,K as inferRequired,L as isReservedAttribute,_ as isReservedPortName,ee as listBuiltinNodeModels,G as normalizeConfigNodeModel,E as normalizeConfigPort};
|
|
1
|
+
var q={Error:"error",Warning:"warning",Info:"info"};function M(e,t,r,n,i="",o,a){return{code:e,severity:t,message:r,uri:i,...n?{range:n}:{},...o?{details:o}:{},...a?{data:a}:{}}}var le=/^[A-Za-z_][A-Za-z0-9_./:-]*$/;function U(e){return{ok:!0,reference:e}}function y(e,t,r){return{ok:!1,error:{kind:e,raw:t,message:r}}}function w(e){return le.test(e)}function pe(e){if(!e)return y("empty-key",e,"Blackboard reference key must not be empty");if(e[0]==="@"){let t=e.slice(1);return t?w(t)?{ok:!0,scope:"global",key:t}:y("invalid-global-key",e,`Invalid global blackboard reference key: ${e}`):y("empty-key",e,"Global blackboard reference key must not be empty")}return w(e)?{ok:!0,scope:"local",key:e}:y("invalid-key",e,`Invalid blackboard reference key: ${e}`)}function _(e){let{portName:t}=e,r=e.rawValue.trim();if(r==="="||r==="{=}")return U({scope:"local",key:t,raw:r,syntax:"shorthand"});if(!r.startsWith("{")&&!r.endsWith("}"))return y("not-a-reference",r,`Not a blackboard reference: ${r}`);if(!(r.startsWith("{")&&r.endsWith("}")))return y("unbalanced-braces",r,`Unbalanced blackboard reference braces: ${r}`);let n=r.slice(1,-1).trim(),i=pe(n);return i.ok?U({scope:i.scope,key:i.key,raw:r,syntax:"braced"}):i}function L(e){return`${e.scope}:${e.key}`}var fe={DuplicateNodeModelId:"BT006_DUPLICATE_NODE_MODEL_ID"};function me(e){return e.kind==="bt-document"?"bt-xml":e.kind==="model-document"?"model-xml":"unknown"}function l(e,t){return e.attributes.find(r=>r.name===t)}function ye(e){return e==="Action"||e==="Condition"||e==="Control"||e==="Decorator"||e==="SubTree"}function ge(e){if(e)return{uri:e.uri,range:e.range,value:e.value}}function be(e,t="inline-tree-nodes-model"){return e.kind==="model-document"?"external-tree-nodes-model":t}function F(e,t){let r=e.line,n=e.character,i=e.offset;for(let o of t){if(i+=o.length,o===`
|
|
2
|
+
`){r+=1,n=0;continue}n+=o.length}return{line:r,character:n,offset:i}}function ke(e,t,r){let n=F(e,t),i=F(n,r);return{start:n,end:i}}function K(e,t,r,n){for(let i of e.attributes||[]){let o=i.valueContentRange??i.valueRange,a=n.slice(o.start.offset,o.end.offset),u=s=>{let c=_({portName:i.name,rawValue:s.parsedRaw});if(!c.ok)return;let p=c.reference.raw.length;t.push({raw:c.reference.raw,key:c.reference.key,scope:c.reference.scope,identity:L(c.reference),syntax:c.reference.syntax,attributeName:i.name,element:e,uri:r,range:ke(o.start,a.slice(0,s.parsedOffset),c.reference.raw.slice(0,p))})},d=_({portName:i.name,rawValue:a});if(d.ok){let s=Math.max(0,a.indexOf(d.reference.raw));u({parsedRaw:d.reference.raw,parsedOffset:s});continue}for(let s of a.matchAll(/\{[^}]*\}/g)){let c=s[0],p=s.index??0;u({parsedRaw:c,parsedOffset:p})}}for(let i of e.children||[])i.kind==="element"&&K(i,t,r,n)}function Se(e,t,r,n){let i=[];for(let o of e.children||[]){if(o.kind!=="element"||!ye(o.name))continue;let a=l(o,"ID");if(!a)continue;let u=[];for(let d of o.children||[]){if(d.kind!=="element"||d.name!=="input_port"&&d.name!=="output_port"&&d.name!=="inout_port")continue;let s=l(d,"name"),c=l(d,"type"),p=l(d,"default")||l(d,"default_value"),B=l(d,"enum"),D=(d.children||[]).filter(f=>f.kind==="text").map(f=>f.text).join("").trim()||void 0,b=d.name==="input_port"?"input":d.name==="output_port"?"output":"inout",h=(b==="input"||b==="inout")&&p===void 0;u.push({source:r,direction:b,name:s?s.value:"",type:c?.value||void 0,defaultValue:p?.value||void 0,description:D,required:h,element:d,uri:t,range:d.range,nameRange:s?.range,enum:B?.value?B.value.split(";"):void 0})}i.push({id:a.value,kind:o.name,source:r,sourceMeta:{sourceKind:r,file:t,range:o.range},editable:n,ports:u,element:o,uri:t,range:o.range,elementRange:o.range,idRange:a.range})}return i}function Be(e,t){let r=[];for(let n of e.children||[]){if(n.kind!=="element"||n.name!=="BehaviorTree")continue;let i=l(n,"ID");i&&r.push({id:i.value,kind:"BehaviorTree",uri:t,element:n,range:n.range,elementRange:n.range,idRange:i.range})}return r}function De(e,t){let r=[],n=(i,o,a=!1)=>{if(a)return;let u=i.name==="BehaviorTree"?l(i,"ID")?.value??o:o,d=i.name==="TreeNodesModel";if(i.name==="SubTree"){let s=l(i,"ID");s&&r.push({id:s.value,uri:t,element:i,range:i.range,elementRange:i.range,idRange:s.range,parentBehaviorTreeId:u,attributes:i.attributes})}for(let s of i.children||[])s.kind==="element"&&n(s,u,d)};if(e.name==="TreeNodesModel")return r;for(let i of e.children||[])i.kind==="element"&&n(i);return r}function he(e){return{id:e.id,kind:e.kind,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange}}function O(e){return{source:e.source,direction:e.direction,name:e.name,type:e.type,defaultValue:e.defaultValue,description:e.description,required:e.required,uri:e.uri,range:e.range,nameRange:e.nameRange,enum:e.enum?[...e.enum]:void 0}}function Te(e){return{id:e.id,kind:e.kind,editable:e.editable,ports:e.ports.map(O),source:e.source,sourceMeta:e.sourceMeta?{sourceKind:e.sourceMeta.sourceKind,file:e.sourceMeta.file,range:e.sourceMeta.range}:void 0,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange}}function qe(e){return{id:e.id,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange,parentBehaviorTreeId:e.parentBehaviorTreeId}}function Me(e){return{id:e.id,uri:e.uri,kind:e.kind,range:e.range,elementRange:e.elementRange,parentBehaviorTreeId:e.parentBehaviorTreeId}}function _e(e){return{raw:e.raw,key:e.key,scope:e.scope,identity:e.identity,syntax:e.syntax,attributeName:e.attributeName,uri:e.uri,range:e.range}}function Re(e){return{uri:e.uri,path:e.path,isBtXml:e.isBtXml,kind:e.kind,behaviorTrees:e.behaviorTrees.map(he),subtreeReferences:e.subtreeReferences.map(qe),nodeUsages:e.nodeUsages.map(Me),blackboardReferences:e.blackboardReferences.map(_e),treeNodesModel:e.treeNodesModel.map(Te),genericSubTreePorts:e.genericSubTreePorts.map(O),rootMainTreeToExecute:ge(e.rootMainTreeToExecute)}}function xe(e,t){if(e.name==="TreeNodesModel")return[];let r=[],n=(i,o,a=!1)=>{if(a)return;let u=i.name==="TreeNodesModel",d=i.name==="BehaviorTree"?l(i,"ID")?.value??o:o,s=d!==void 0;if(i.name==="SubTree"){let c=l(i,"ID");c&&s&&r.push({id:c.value,kind:"SubTree",uri:t,range:i.range,elementRange:i.range,parentBehaviorTreeId:d})}else s&&i.name!=="root"&&i.name!=="BehaviorTree"&&i.name!=="TreeNodesModel"&&r.push({id:i.name,kind:"node",uri:t,range:i.range,elementRange:i.range,parentBehaviorTreeId:d});for(let c of i.children||[])c.kind==="element"&&n(c,d,u)};for(let i of e.children||[])i.kind==="element"&&n(i);return r}function Ee(e){return e.node.kind==="SubTree"&&e.node.id==="SubTree"?(e.genericSubTreePorts.push(...e.node.ports),!0):(e.treeNodesModel.push(e.node),!1)}function Ne(e){return M(fe.DuplicateNodeModelId,q.Error,`duplicate node model ID \`${e.id}\``,e.idRange||e.range,e.uri,{primaryLabel:"this node model ID is already defined in the same model source",help:"merge the duplicate definitions or rename one of them"})}function Ce(e,t){let r=[],n=t?.uri||e.uri,i=e.root,o=e.isBtXml,a=me(e),u=be(e),d=((t?.path??e.path)||n==="")&&e.kind==="model-document"?!0:e.kind!=="model-document",s=i&&e.kind!=="model-document"?Be(i,n):[],c=[],p=[],B=i?i.name==="TreeNodesModel"?[i]:i.children.filter(m=>m.kind==="element"&&m.name==="TreeNodesModel"):[];for(let m of B){let ce=Se(m,n,u,d),V=new Map;for(let k of ce)Ee({node:k,treeNodesModel:c,genericSubTreePorts:p})||(V.has(k.id)?r.push(Ne(k)):V.set(k.id,k))}let D=i?De(i,n):[],b=i?xe(i,n):[],h=i?(()=>{let m=[];return K(i,m,n,e.originalText),m})():[],f=i?l(i,"main_tree_to_execute"):void 0;return{extracted:{publicModel:Re({uri:n,path:t?.path??e.path,isBtXml:o,kind:a,behaviorTrees:s,subtreeReferences:D,nodeUsages:b,blackboardReferences:h,treeNodesModel:c,genericSubTreePorts:p,rootMainTreeToExecute:f?{uri:n,range:f.range,value:f.value}:void 0}),extractedBehaviorTrees:s,extractedTreeNodesModel:c,extractedSubTreeReferences:D,extractedBlackboardReferences:h},diagnostics:r}}function R(e,t){let{extracted:r,diagnostics:n}=Ce(e,t);return{model:r.publicModel,diagnostics:n}}function G(e,t){return R(e,t)}var j=new Set(["ID","name","_name","_autoremap","_failureIf","_successIf","_skipIf","_while","_onSuccess","_onFailure","_onHalted","_post"]),Pe=new Set([...j,"_autoremap","_description","__shared_blackboard"]),ve=new Map([[".","port names must not contain `.`"],["<","port names must not contain `<`"],[">","port names must not contain `>`"],["&","port names must not contain `&`"],['"','port names must not contain `"`'],["'","port names must not contain `'`"],["/","port names must not contain `/`"],["\\","port names must not contain `\\`"],[":","port names must not contain `:`"],["*","port names must not contain `*`"],["?","port names must not contain `?`"],["|","port names must not contain `|`"]]);function W(e){return j.has(e)}function x(e){return Pe.has(e)}function $(e){if(e.length===0)return"port names must not be empty";if(/^[0-9]/.test(e))return"port names must not start with a digit";if(x(e))return`\`${e}\` is a reserved attribute name`;for(let t of e){let r=t.charCodeAt(0);if(r<=31||r===127)return"port names must not contain ASCII control characters";if(t===" "||t===" "||t===`
|
|
3
|
+
`||t==="\r")return"port names must not contain whitespace";let n=ve.get(t);if(n)return n}}function E(e,t){let r=t.direction??"input";return{source:"config",name:e,direction:r,type:t.type,defaultValue:t.default,description:t.description,required:t.required??((r==="input"||r==="inout")&&t.default===void 0),enum:t.enum}}function X(e,t){return{id:e,kind:t.kind,source:"config",sourceMeta:{sourceKind:"config"},editable:!0,ports:Object.entries(t.ports??{}).map(([r,n])=>E(r,n))}}function z(e,t,r){return r!==void 0?r:(e==="input"||e==="inout")&&t===void 0}var J=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<bool, std::allocator<bool> > >",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<double, std::allocator<double> > >",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<int, std::allocator<int> > >",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once bu the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written int othe output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],Z={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var H=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<bool, std::allocator<bool> > >",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<double, std::allocator<double> > >",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<int, std::allocator<int> > >",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"std::shared_ptr<std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once by the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written into the output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],Y={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var Q=[{id:"AlwaysFailure",kind:"Action",ports:[]},{id:"AlwaysSuccess",kind:"Action",ports:[]},{id:"AsyncFallback",kind:"Control",ports:[]},{id:"AsyncSequence",kind:"Control",ports:[]},{id:"Delay",kind:"Decorator",ports:[{name:"delay_msec",direction:"input",type:"unsigned int",description:"Tick the child after a few milliseconds",required:!0}]},{id:"Fallback",kind:"Control",ports:[]},{id:"ForceFailure",kind:"Decorator",ports:[]},{id:"ForceSuccess",kind:"Decorator",ports:[]},{id:"IfThenElse",kind:"Control",ports:[]},{id:"Inverter",kind:"Decorator",ports:[]},{id:"KeepRunningUntilFailure",kind:"Decorator",ports:[]},{id:"LoopBool",kind:"Decorator",ports:[{name:"value",direction:"output",type:"bool",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopDouble",kind:"Decorator",ports:[{name:"value",direction:"output",type:"double",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopInt",kind:"Decorator",ports:[{name:"value",direction:"output",type:"int",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"LoopString",kind:"Decorator",ports:[{name:"value",direction:"output",type:"std::string",required:!1},{name:"if_empty",direction:"input",type:"BT::NodeStatus",defaultValue:"SUCCESS",description:"Status to return if queue is empty: SUCCESS, FAILURE, SKIPPED",required:!1},{name:"queue",direction:"inout",type:"BT::AnyTypeAllowed",required:!0}]},{id:"Parallel",kind:"Control",ports:[{name:"failure_count",direction:"input",type:"int",defaultValue:"1",description:"number of children that need to fail to trigger a FAILURE",required:!1},{name:"success_count",direction:"input",type:"int",defaultValue:"-1",description:"number of children that need to succeed to trigger a SUCCESS",required:!1}]},{id:"ParallelAll",kind:"Control",ports:[{name:"max_failures",direction:"input",type:"int",defaultValue:"1",description:"If the number of children returning FAILURE exceeds this value, ParallelAll returns FAILURE",required:!1}]},{id:"Precondition",kind:"Decorator",ports:[{name:"else",direction:"input",type:"BT::NodeStatus",defaultValue:"FAILURE",description:"Return status if condition is false",required:!1},{name:"if",direction:"input",type:"std::string",required:!0}]},{id:"ReactiveFallback",kind:"Control",ports:[]},{id:"ReactiveSequence",kind:"Control",ports:[]},{id:"Repeat",kind:"Decorator",ports:[{name:"num_cycles",direction:"input",type:"int",description:"Repeat a successful child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RetryUntilSuccessful",kind:"Decorator",ports:[{name:"num_attempts",direction:"input",type:"int",description:"Execute again a failing child up to N times. Use -1 to create an infinite loop.",required:!0}]},{id:"RunOnce",kind:"Decorator",ports:[{name:"then_skip",direction:"input",type:"bool",defaultValue:"true",description:"If true, skip after the first execution, otherwise return the same NodeStatus returned once by the child.",required:!1}]},{id:"Script",kind:"Action",ports:[{name:"code",direction:"input",type:"std::string",description:"Piece of code that can be parsed",required:!0}]},{id:"ScriptCondition",kind:"Condition",ports:[{name:"code",direction:"input",type:"BT::AnyTypeAllowed",description:"Piece of code that can be parsed. Must return false or true",required:!0}]},{id:"Sequence",kind:"Control",ports:[]},{id:"SequenceWithMemory",kind:"Control",ports:[]},{id:"SetBlackboard",kind:"Action",ports:[{name:"output_key",direction:"inout",type:"BT::AnyTypeAllowed",description:"Name of the blackboard entry where the value should be written",required:!0},{name:"value",direction:"input",type:"BT::AnyTypeAllowed",description:"Value to be written into the output_key",required:!0}]},{id:"SkipUnlessUpdated",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"Sleep",kind:"Action",ports:[{name:"msec",direction:"input",type:"unsigned int",required:!0}]},{id:"Switch2",kind:"Control",ports:[{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch3",kind:"Control",ports:[{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch4",kind:"Control",ports:[{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch5",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Switch6",kind:"Control",ports:[{name:"case_5",direction:"input",type:"std::string",required:!0},{name:"case_4",direction:"input",type:"std::string",required:!0},{name:"case_6",direction:"input",type:"std::string",required:!0},{name:"case_3",direction:"input",type:"std::string",required:!0},{name:"case_2",direction:"input",type:"std::string",required:!0},{name:"case_1",direction:"input",type:"std::string",required:!0},{name:"variable",direction:"input",type:"std::string",required:!0}]},{id:"Timeout",kind:"Decorator",ports:[{name:"msec",direction:"input",type:"unsigned int",description:"After a certain amount of time, halt() the child if it is still running.",required:!0}]},{id:"TryCatch",kind:"Control",ports:[{name:"catch_on_halt",direction:"input",type:"bool",defaultValue:"false",description:"If true, execute the catch child when the node is halted during the try-block",required:!1}]},{id:"UnsetBlackboard",kind:"Action",ports:[{name:"key",direction:"input",type:"std::string",description:"Key of the entry to remove",required:!0}]},{id:"WaitValueUpdate",kind:"Decorator",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WasEntryUpdated",kind:"Action",ports:[{name:"entry",direction:"input",type:"BT::Any",description:"Entry to check",required:!0}]},{id:"WhileDoElse",kind:"Control",ports:[]}],ee={id:"SubTree",kind:"SubTree",ports:[{name:"_autoremap",direction:"input",type:"bool",defaultValue:"false",description:"If true, all the ports with the same name will be remapped",required:!1}]};var te=["4.6.2","4.8.2","4.9.0"],N="4.9.0",S={"4.6.2":{models:J,genericSubTreeModel:Z},"4.8.2":{models:H,genericSubTreeModel:Y},"4.9.0":{models:Q,genericSubTreeModel:ee}};var C=te.map(e=>`btcpp-v${e}`),re=["btcpp-v4",...C],P=`btcpp-v${N}`;function ie(e){return{source:"builtin",direction:e.direction,name:e.name,type:e.type,defaultValue:e.defaultValue,description:e.description,required:e.required,enum:e.enum}}function Ae(e){return e.map(t=>({id:t.id,kind:t.kind,ports:t.ports.map(ie)}))}function ne(e){if(e)return{id:e.id,kind:e.kind,ports:e.ports.map(ie)}}function Ie(){let e={};for(let[t,r]of Object.entries(S))e[`btcpp-v${t}`]=Ae(r.models);return e}function Ve(){let e={};for(let[t,r]of Object.entries(S))e[`btcpp-v${t}`]=ne(r.genericSubTreeModel);return e}var oe=Ie(),Ue=Ve();function we(e){let t=e.replace(/^btcpp-v/,"");return Object.hasOwn(S,t)}function v(e){return e==="btcpp-v4"?P:e}function Le(e){return e==="btcpp-v4"?N:e.replace(/^btcpp-v/,"")}function A(e){if(e&&e!=="btcpp-v4"&&!we(e))throw new Error(`unsupported builtin model set: ${e}`)}function de(e="btcpp-v4"){A(e);let t=v(e);return oe[t].map(n=>T(n))}function ae(e,t="btcpp-v4"){A(t);let r=v(t),i=oe[r].find(o=>o.id===e);return i?T(i):void 0}function se(e="btcpp-v4"){A(e);let t=Ue[v(e)]??ne(S[Le(e)].genericSubTreeModel);return t?(t.ports??[]).map(r=>({...r,enum:r.enum?[...r.enum]:void 0})):[]}function T(e){return{id:e.id,kind:e.kind,source:"builtin",sourceMeta:{sourceKind:"builtin"},editable:!1,ports:(e.ports??[]).map(t=>({...t,enum:t.enum?[...t.enum]:void 0}))}}function g(e){return{id:e.id,kind:e.kind,ports:[...e.ports].sort((t,r)=>{let n=t.name.localeCompare(r.name);if(n!==0)return n;let i=t.direction.localeCompare(r.direction);if(i!==0)return i;let o=(t.type??"").localeCompare(r.type??"");if(o!==0)return o;let a=(t.defaultValue??"").localeCompare(r.defaultValue??"");return a!==0?a:(t.description??"").localeCompare(r.description??"")}).map(t=>({name:t.name,direction:t.direction,type:t.type,required:t.required,defaultValue:t.defaultValue,enum:t.enum?[...t.enum].sort():void 0,description:t.description}))}}function I(e,t){let r=g(e),n=g(t);return JSON.stringify(r)===JSON.stringify(n)}function ue(e,t){if(I(e,t))return"none";let r=g(e),n=g(t);if(r.kind!==n.kind)return"kind";if(r.ports.length!==n.ports.length)return"ports";let i=new Map(n.ports.map(u=>[u.name,u])),o=!1,a=!1;for(let u of r.ports){let d=i.get(u.name);if(!d){a=!0;continue}(u.direction!==d.direction||u.type!==d.type||u.required!==d.required)&&(a=!0);let s=u.enum?JSON.stringify(u.enum):"",c=d.enum?JSON.stringify(d.enum):"";s!==c&&(a=!0),u.description!==d.description&&(a=!0),u.defaultValue!==d.defaultValue&&(o=!0)}return a?"ports":o?"port-default":"mixed"}export{P as DEFAULT_BTCPP_V4_MODEL_SET,re as SUPPORTED_BUILTIN_MODEL_SETS,C as SUPPORTED_VERSIONED_BTCPP_MODEL_SETS,I as areEquivalentNodeModels,G as buildDocumentModel,R as buildDocumentModelResult,T as builtinToNodeModel,ue as classifyNodeModelDifference,ae as getBuiltinNodeModel,se as getGenericSubTreePorts,$ as getInvalidPortNameReason,g as getNodeModelSignature,z as inferRequired,W as isReservedAttribute,x as isReservedPortName,de as listBuiltinNodeModels,X as normalizeConfigNodeModel,E as normalizeConfigPort};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { R as ResolvedBtxmlConfig, E as EffectiveFileConfig, a as RawBtxmlConfig } from './types-
|
|
1
|
+
import { R as ResolvedBtxmlConfig, E as EffectiveFileConfig, a as RawBtxmlConfig } from './types-H6H-_Z3F.js';
|
|
2
2
|
import { c as SourcePosition, S as SourceRange, D as Diagnostic } from './diagnostic-B5htzyJ9.js';
|
|
3
|
-
import { a as TreeNodeModelDef, P as PortDef } from './public-types-
|
|
4
|
-
import { M as ModelAugmentationFile } from './types-
|
|
5
|
-
import { S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView } from './types-
|
|
6
|
-
import { N as NodeUsageResolution, P as PortUsageResolution } from './types-
|
|
3
|
+
import { a as TreeNodeModelDef, P as PortDef } from './public-types-zg51kxSL.js';
|
|
4
|
+
import { M as ModelAugmentationFile } from './types-BIuA9iLZ.js';
|
|
5
|
+
import { S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView } from './types-DkQEPPAM.js';
|
|
6
|
+
import { N as NodeUsageResolution, P as PortUsageResolution } from './types-DPS-KRMY.js';
|
|
7
7
|
|
|
8
8
|
type TextDocument = {
|
|
9
9
|
readonly uri: string;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { S as SourceRange } from './diagnostic-B5htzyJ9.js';
|
|
2
2
|
|
|
3
|
+
type BlackboardScope = "local" | "global";
|
|
4
|
+
type BlackboardReferenceSyntax = "braced" | "shorthand" | "script";
|
|
5
|
+
type BlackboardReference = {
|
|
6
|
+
readonly scope: BlackboardScope;
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly raw: string;
|
|
9
|
+
readonly syntax: BlackboardReferenceSyntax;
|
|
10
|
+
};
|
|
11
|
+
|
|
3
12
|
type ModelSourceRef = {
|
|
4
13
|
readonly uri?: string;
|
|
5
14
|
readonly sourceKind: NodeModelSourceKind;
|
|
@@ -97,8 +106,20 @@ type SubTreeReference = {
|
|
|
97
106
|
readonly idRange?: SourceRange;
|
|
98
107
|
readonly parentBehaviorTreeId?: string;
|
|
99
108
|
};
|
|
100
|
-
type
|
|
101
|
-
readonly
|
|
109
|
+
type NodeUsageDef = {
|
|
110
|
+
readonly id: string;
|
|
111
|
+
readonly uri: string;
|
|
112
|
+
readonly kind: "node" | "SubTree";
|
|
113
|
+
readonly range?: SourceRange;
|
|
114
|
+
readonly elementRange?: SourceRange;
|
|
115
|
+
readonly parentBehaviorTreeId?: string;
|
|
116
|
+
};
|
|
117
|
+
type DocumentBlackboardReference = {
|
|
118
|
+
readonly raw: string;
|
|
119
|
+
readonly key: string;
|
|
120
|
+
readonly scope: BlackboardScope;
|
|
121
|
+
readonly identity: string;
|
|
122
|
+
readonly syntax: BlackboardReferenceSyntax;
|
|
102
123
|
readonly attributeName: string;
|
|
103
124
|
readonly uri: string;
|
|
104
125
|
readonly range?: SourceRange;
|
|
@@ -116,10 +137,11 @@ type BtDocumentModel = {
|
|
|
116
137
|
readonly kind: BtDocumentModelKind;
|
|
117
138
|
readonly behaviorTrees: readonly BehaviorTreeDef[];
|
|
118
139
|
readonly subtreeReferences: readonly SubTreeReference[];
|
|
119
|
-
readonly
|
|
140
|
+
readonly nodeUsages: readonly NodeUsageDef[];
|
|
141
|
+
readonly blackboardReferences: readonly DocumentBlackboardReference[];
|
|
120
142
|
readonly treeNodesModel: readonly TreeNodeModelDef[];
|
|
121
143
|
readonly genericSubTreePorts: readonly PortDef[];
|
|
122
144
|
readonly rootMainTreeToExecute?: AttributeValueRef;
|
|
123
145
|
};
|
|
124
146
|
|
|
125
|
-
export type { AttributeValueRef as A,
|
|
147
|
+
export type { AttributeValueRef as A, BlackboardScope as B, DocumentBlackboardReference as D, ModelSourceRef as M, NodeModelSource as N, PortDef as P, SubTreeReference as S, TreeNodeKind as T, TreeNodeModelDef as a, BehaviorTreeDef as b, BtDocumentModel as c, PortDirection as d, BuiltinNodeDef as e, BlackboardReference as f, BtDocumentModelKind as g, NodeModelSourceKind as h, PortSourceRef as i };
|
package/dist/rules.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as ConfigSeverity, E as EffectiveFileConfig, a as RawBtxmlConfig, C as ConfigDiagnostic } from './types-
|
|
1
|
+
import { f as ConfigSeverity, E as EffectiveFileConfig, a as RawBtxmlConfig, C as ConfigDiagnostic } from './types-H6H-_Z3F.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { d as createDiagnostic, e as DiagnosticSeverity } from './diagnostic-B5htzyJ9.js';
|
|
4
|
-
import { a as NodeUsagePolicy } from './types-
|
|
4
|
+
import { a as NodeUsagePolicy } from './types-DPS-KRMY.js';
|
|
5
5
|
import './ast-BbfR3S_b.js';
|
|
6
|
-
import './public-types-
|
|
7
|
-
import './types-
|
|
6
|
+
import './public-types-zg51kxSL.js';
|
|
7
|
+
import './types-BIuA9iLZ.js';
|
|
8
8
|
|
|
9
9
|
type RuleOptionDoc = {
|
|
10
10
|
name: string;
|
|
@@ -33,7 +33,7 @@ declare const RULES: {
|
|
|
33
33
|
};
|
|
34
34
|
readonly "script/valid-assignment": {
|
|
35
35
|
readonly code: "BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE";
|
|
36
|
-
readonly codes: readonly ["BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE", "BT406_INVALID_COMPOUND_ASSIGNMENT", "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH"];
|
|
36
|
+
readonly codes: readonly ["BT405_ASSIGNMENT_TO_UNKNOWN_VARIABLE", "BT406_INVALID_COMPOUND_ASSIGNMENT", "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH", "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER"];
|
|
37
37
|
readonly defaultSeverity: ConfigSeverity;
|
|
38
38
|
readonly description: "Script assignments must target known variables and use compatible types.";
|
|
39
39
|
};
|
|
@@ -238,6 +238,21 @@ declare const RULES: {
|
|
|
238
238
|
readonly defaultSeverity: ConfigSeverity;
|
|
239
239
|
readonly description: "Node model definitions must agree on kind and port shape.";
|
|
240
240
|
};
|
|
241
|
+
readonly "model/no-conflicting-kind-for-id": {
|
|
242
|
+
readonly code: "BT120_CONFLICTING_MODEL_KIND";
|
|
243
|
+
readonly defaultSeverity: "error";
|
|
244
|
+
readonly description: "A model ID must not be defined with different kinds.";
|
|
245
|
+
};
|
|
246
|
+
readonly "model/no-unused-definition": {
|
|
247
|
+
readonly code: "BT121_UNUSED_MODEL_DEFINITION";
|
|
248
|
+
readonly defaultSeverity: "error";
|
|
249
|
+
readonly description: "Inline model definitions should be used in the same BT XML file.";
|
|
250
|
+
};
|
|
251
|
+
readonly "model/no-duplicate-definition": {
|
|
252
|
+
readonly code: "BT122_DUPLICATE_MODEL_DEFINITION";
|
|
253
|
+
readonly defaultSeverity: "error";
|
|
254
|
+
readonly description: "A user-defined model (ID, kind) should be defined only once.";
|
|
255
|
+
};
|
|
241
256
|
readonly "suppression/no-unused": {
|
|
242
257
|
readonly code: "BT351_UNUSED_SUPPRESSION";
|
|
243
258
|
readonly defaultSeverity: ConfigSeverity;
|
|
@@ -262,6 +277,7 @@ declare const RuleCodes: {
|
|
|
262
277
|
readonly InvalidScriptOperandType: "BT407_INVALID_SCRIPT_OPERAND_TYPE";
|
|
263
278
|
readonly ScriptResultNotBoolCompatible: "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE";
|
|
264
279
|
readonly ScriptVariableTypeMismatch: "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH";
|
|
280
|
+
readonly InvalidGlobalBlackboardIdentifier: "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER";
|
|
265
281
|
readonly InvalidRootElement: "BT001_INVALID_ROOT_ELEMENT";
|
|
266
282
|
readonly MissingBTCPPFormat: "BT002_MISSING_BTCPP_FORMAT";
|
|
267
283
|
readonly MissingBehaviorTreeID: "BT003_MISSING_BEHAVIOR_TREE_ID";
|
|
@@ -301,6 +317,9 @@ declare const RuleCodes: {
|
|
|
301
317
|
readonly AugmentTargetNotFound: "BT117_AUGMENT_TARGET_NOT_FOUND";
|
|
302
318
|
readonly AugmentPortNotFound: "BT118_AUGMENT_PORT_NOT_FOUND";
|
|
303
319
|
readonly InvalidTypeRefinement: "BT119_INVALID_TYPE_REFINEMENT";
|
|
320
|
+
readonly ConflictingModelKind: "BT120_CONFLICTING_MODEL_KIND";
|
|
321
|
+
readonly UnusedModelDefinition: "BT121_UNUSED_MODEL_DEFINITION";
|
|
322
|
+
readonly DuplicateModelDefinition: "BT122_DUPLICATE_MODEL_DEFINITION";
|
|
304
323
|
readonly ExternalModelFileNotFound: "BT321_EXTERNAL_MODEL_FILE_NOT_FOUND";
|
|
305
324
|
readonly AugmentationFileNotFound: "BT324_AUGMENTATION_FILE_NOT_FOUND";
|
|
306
325
|
readonly MissingTreeNodesModel: "BT322_MISSING_TREENODESMODEL";
|
|
@@ -315,7 +334,7 @@ declare const RuleCodes: {
|
|
|
315
334
|
readonly UnusedSuppression: "BT351_UNUSED_SUPPRESSION";
|
|
316
335
|
readonly MissingSuppressionReason: "BT353_MISSING_SUPPRESSION_REASON";
|
|
317
336
|
};
|
|
318
|
-
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" | "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" | "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")[];
|
|
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")[];
|
|
319
338
|
|
|
320
339
|
declare function getNodeUsagePolicyForRules(config: EffectiveFileConfig): Partial<NodeUsagePolicy>;
|
|
321
340
|
|
|
@@ -346,7 +365,7 @@ type RuleMetadata = {
|
|
|
346
365
|
};
|
|
347
366
|
declare function findRuleMetadata(code: string): RuleMetadata;
|
|
348
367
|
declare function getRuleMetadata(value: string): RuleMetadata;
|
|
349
|
-
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" | "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" | "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")[];
|
|
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")[];
|
|
350
369
|
declare function listRuleSlugs(): string[];
|
|
351
370
|
declare function listRules(): Array<{
|
|
352
371
|
name: RuleName;
|
package/dist/rules.js
CHANGED
|
@@ -1,5 +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",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",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"},T=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],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."},"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,r,a="",l,d){return{code:t,severity:o,message:i,uri:a,...r?{range:r}:{},...l?{details:l}:{},...d?{data:d}:{}}}function I(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 _(t){for(let[o,i]of Object.entries(s)){let r=i;if(r.code===t||r.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 r={severity:o};return i!==void 0&&(r.options=i),r}}return null}function h(t,o){let i=t[o];if(i!==void 0){let r=u(i);if(r)return r.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(...k(t,d));return i}function k(t,o){if(o.code==="unrecognized_keys")return o.keys.map(r=>g("CFG011_INVALID_RULE_OPTION",f.Error,`unknown option \`${String(r)}\` 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(r=>r.name)??[];return i.length>0?`valid options are: ${i.join(", ")}`:void 0}function b(t){let o=[];D(t.linter,"linter.rules",o);for(let[i,r]of(t.overrides??[]).entries())D(r.linter,`overrides.${i}.linter.rules`,o);return o}function D(t,o,i){for(let[r,a]of Object.entries(t?.rules??{})){let l=`${o}.${r}`;if(!v(r)){i.push({code:"CFG010_UNKNOWN_RULE",severity:"error",path:l,message:`unknown lint rule \`${r}\``,help:"see docs/rules.md for a list of valid rule names"});continue}let d=u(a);if(d?.options)for(let E of y(r,d.options))i.push({code:"CFG011_INVALID_RULE_OPTION",severity:"error",path:B(l,d.options,E.message),message:E.message,help:E.details?.help})}}function B(t,o,i){let r=Object.keys(o).find(a=>i.includes(`\`${a}\``));return r?`${t}.1.${r}`:`${t}.1`}var n=(t,o,i,r=!0)=>({code:t,title:o,description:i,suppressible:r}),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.InvalidRootElement]:n(e.InvalidRootElement,"Invalid root element","Root element must be <root>.",!1),[e.MissingBTCPPFormat]:n(e.MissingBTCPPFormat,"Missing BTCPP format",'Root element must declare BTCPP_format="4".',!1),[e.MissingBehaviorTreeID]:n(e.MissingBehaviorTreeID,"Missing BehaviorTree ID","BehaviorTree elements require an ID attribute.",!1),[e.DuplicateBehaviorTreeID]:n(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]:n(e.DuplicateNodeModelId,"Duplicate node model ID in TreeNodesModel","TreeNodesModel elements must have unique IDs within the same model block.",!1),[e.MissingPortName]:n(e.MissingPortName,"Missing port name","Port elements require a name attribute.",!1),[e.DuplicatePortName]:n(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]:n(e.UnknownTopLevelElement,"Unknown top-level element","Top-level elements must be BehaviorTree, TreeNodesModel, or configured include elements.",!1),[e.UnknownMainTree]:n(e.UnknownMainTree,"Unknown main tree","main_tree_to_execute must reference a known BehaviorTree.",!1),[e.AmbiguousSubTree]:n(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.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",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"/>
|
|
2
3
|
<!-- file2.xml --><BehaviorTree ID="shared"/>`,validExample:`<!-- file1.xml --><BehaviorTree ID="shared"/>
|
|
3
|
-
<!-- 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]:
|
|
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 write to a blackboard remap.",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>
|
|
4
5
|
<AlwaysSuccess/>
|
|
5
|
-
</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]:
|
|
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 C(t){return c[t]}function M(t){return I[t]??c[t]}function O(){return[...Object.values(e)].sort()}function T(){return Object.keys(s).sort()}function w(){let t=[];for(let o of T()){let i=I[o];i&&t.push({name:o,metadata:i})}return t}export{s as RULES,R as RULE_CODES,e as RuleCodes,C as findRuleMetadata,x as getDiagnosticCodeForRule,E as getNodeUsagePolicyForRules,M as getRuleMetadata,D as getRuleNameForCode,_ as getRuleSeverity,v as isRuleName,O as listRuleCodes,T as listRuleSlugs,w as listRules,u as normalizeRuleConfig,b as validateRawConfigRules,y as validateRuleOptions};
|