@abco20/btxml-checker 0.1.1 → 0.1.2

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/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 { b as BtDocumentModel, c as PortDirection, P as PortDef, d as BuiltinNodeDef, a as TreeNodeModelDef, T as TreeNodeKind } from './public-types-B2noBQY9.js';
4
- export { A as AttributeValueRef, B as BehaviorTreeDef, e as BlackboardReference, f as BtDocumentModelKind, M as ModelSourceRef, N as NodeModelSource, g as NodeModelSourceKind, h as PortSourceRef, S as SubTreeReference } from './public-types-B2noBQY9.js';
3
+ import { c as BtDocumentModel, d as PortDirection, P as PortDef, e as BuiltinNodeDef, a as TreeNodeModelDef, T as TreeNodeKind } from './public-types-DCvVgnqw.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-DCvVgnqw.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 T(e,t,i,r,n="",o,a){return{code:e,severity:t,message:i,uri:n,...r?{range:r}:{},...o?{details:o}:{},...a?{data:a}:{}}}var oe={DuplicateNodeModelId:"BT006_DUPLICATE_NODE_MODEL_ID"};function de(e){return e.kind==="bt-document"?"bt-xml":e.kind==="model-document"?"model-xml":"unknown"}function s(e,t){return e.attributes.find(i=>i.name===t)}function ue(e){return e==="Action"||e==="Condition"||e==="Control"||e==="Decorator"||e==="SubTree"}function ae(e){if(e)return{uri:e.uri,range:e.range,value:e.value}}function se(e,t="inline-tree-nodes-model"){return e.kind==="model-document"?"external-tree-nodes-model":t}function V(e,t,i){for(let r of e.attributes||[]){let n=[...String(r.value).matchAll(/\{([^}]+)\}/g)];for(let o of n){let a=o.index??0,d=r.valueRange.start,u={...d,character:d.character+o[0].length,offset:d.offset+a+o[0].length};t.push({name:o[1],attributeName:r.name,element:e,uri:i,range:{start:{...d,character:d.character+a,offset:d.offset+a},end:u}})}}for(let r of e.children||[])r.kind==="element"&&V(r,t,i)}function ce(e,t,i,r){let n=[];for(let o of e.children||[]){if(o.kind!=="element"||!ue(o.name))continue;let a=s(o,"ID");if(!a)continue;let d=[];for(let u of o.children||[]){if(u.kind!=="element"||u.name!=="input_port"&&u.name!=="output_port"&&u.name!=="inout_port")continue;let c=s(u,"name"),l=s(u,"type"),y=s(u,"default")||s(u,"default_value"),D=s(u,"enum"),k=(u.children||[]).filter(h=>h.kind==="text").map(h=>h.text).join("").trim()||void 0,m=u.name==="input_port"?"input":u.name==="output_port"?"output":"inout",g=(m==="input"||m==="inout")&&y===void 0;d.push({source:i,direction:m,name:c?c.value:"",type:l?.value||void 0,defaultValue:y?.value||void 0,description:k,required:g,element:u,uri:t,range:u.range,nameRange:c?.range,enum:D?.value?D.value.split(";"):void 0})}n.push({id:a.value,kind:o.name,source:i,sourceMeta:{sourceKind:i,file:t,range:o.range},editable:r,ports:d,element:o,uri:t,range:o.range,elementRange:o.range,idRange:a.range})}return n}function le(e,t){let i=[];for(let r of e.children||[]){if(r.kind!=="element"||r.name!=="BehaviorTree")continue;let n=s(r,"ID");n&&i.push({id:n.value,kind:"BehaviorTree",uri:t,element:r,range:r.range,elementRange:r.range,idRange:n.range})}return i}function pe(e,t){let i=[],r=(n,o)=>{let a=n.name==="BehaviorTree"?s(n,"ID")?.value??o:o;if(n.name==="SubTree"){let d=s(n,"ID");d&&i.push({id:d.value,uri:t,element:n,range:n.range,elementRange:n.range,idRange:d.range,parentBehaviorTreeId:a,attributes:n.attributes})}for(let d of n.children||[])d.kind==="element"&&r(d,a)};for(let n of e.children||[])n.kind==="element"&&r(n);return i}function me(e){return{id:e.id,kind:e.kind,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange}}function I(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 fe(e){return{id:e.id,kind:e.kind,editable:e.editable,ports:e.ports.map(I),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 ye(e){return{id:e.id,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange,parentBehaviorTreeId:e.parentBehaviorTreeId}}function ge(e){return{name:e.name,attributeName:e.attributeName,uri:e.uri,range:e.range}}function Se(e){return{uri:e.uri,path:e.path,isBtXml:e.isBtXml,kind:e.kind,behaviorTrees:e.behaviorTrees.map(me),subtreeReferences:e.subtreeReferences.map(ye),blackboardReferences:e.blackboardReferences.map(ge),treeNodesModel:e.treeNodesModel.map(fe),genericSubTreePorts:e.genericSubTreePorts.map(I),rootMainTreeToExecute:ae(e.rootMainTreeToExecute)}}function be(e){return e.node.kind==="SubTree"&&e.node.id==="SubTree"?(e.genericSubTreePorts.push(...e.node.ports),!0):(e.treeNodesModel.push(e.node),!1)}function De(e){return T(oe.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 ke(e,t){let i=[],r=t?.uri||e.uri,n=e.root,o=e.isBtXml,a=de(e),d=se(e),u=((t?.path??e.path)||r==="")&&e.kind==="model-document"?!0:e.kind!=="model-document",c=n&&e.kind!=="model-document"?le(n,r):[],l=[],y=[],D=n?n.name==="TreeNodesModel"?[n]:n.children.filter(p=>p.kind==="element"&&p.name==="TreeNodesModel"):[];for(let p of D){let ne=ce(p,r,d,u),P=new Map;for(let S of ne)be({node:S,treeNodesModel:l,genericSubTreePorts:y})||(P.has(S.id)?i.push(De(S)):P.set(S.id,S))}let k=n?pe(n,r):[],m=n?(()=>{let p=[];return V(n,p,r),p})():[],g=n?s(n,"main_tree_to_execute"):void 0;return{extracted:{publicModel:Se({uri:r,path:t?.path??e.path,isBtXml:o,kind:a,behaviorTrees:c,subtreeReferences:k,blackboardReferences:m,treeNodesModel:l,genericSubTreePorts:y,rootMainTreeToExecute:g?{uri:r,range:g.range,value:g.value}:void 0}),extractedBehaviorTrees:c,extractedTreeNodesModel:l,extractedSubTreeReferences:k,extractedBlackboardReferences:m},diagnostics:i}}function M(e,t){let{extracted:i,diagnostics:r}=ke(e,t);return{model:i.publicModel,diagnostics:r}}function U(e,t){return M(e,t)}var w=new Set(["ID","name","_name","_autoremap","_failureIf","_successIf","_skipIf","_while","_onSuccess","_onFailure","_onHalted","_post"]),he=new Set([...w,"_autoremap","_description","__shared_blackboard"]),Be=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 L(e){return w.has(e)}function _(e){return he.has(e)}function F(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(_(e))return`\`${e}\` is a reserved attribute name`;for(let t of e){let i=t.charCodeAt(0);if(i<=31||i===127)return"port names must not contain ASCII control characters";if(t===" "||t===" "||t===`
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 T={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),s=u=>{let c=_({portName:i.name,rawValue:u.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,u.parsedOffset),c.reference.raw.slice(0,p))})},d=_({portName:i.name,rawValue:a});if(d.ok){let u=Math.max(0,a.indexOf(d.reference.raw));s({parsedRaw:d.reference.raw,parsedOffset:u});continue}for(let u of a.matchAll(/\{[^}]*\}/g)){let c=u[0],p=u.index??0;s({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 s=[];for(let d of o.children||[]){if(d.kind!=="element"||d.name!=="input_port"&&d.name!=="output_port"&&d.name!=="inout_port")continue;let u=l(d,"name"),c=l(d,"type"),p=l(d,"default")||l(d,"default_value"),B=l(d,"enum"),D=(d.children||[]).filter(h=>h.kind==="text").map(h=>h.text).join("").trim()||void 0,m=d.name==="input_port"?"input":d.name==="output_port"?"output":"inout",b=(m==="input"||m==="inout")&&p===void 0;s.push({source:r,direction:m,name:u?u.value:"",type:c?.value||void 0,defaultValue:p?.value||void 0,description:D,required:b,element:d,uri:t,range:d.range,nameRange:u?.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:s,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 s=i.name==="BehaviorTree"?l(i,"ID")?.value??o:o,d=i.name==="TreeNodesModel";if(i.name==="SubTree"){let u=l(i,"ID");u&&r.push({id:u.value,uri:t,element:i,range:i.range,elementRange:i.range,idRange:u.range,parentBehaviorTreeId:s,attributes:i.attributes})}for(let u of i.children||[])u.kind==="element"&&n(u,s,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 qe(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 Te(e){return{id:e.id,uri:e.uri,range:e.range,elementRange:e.elementRange,idRange:e.idRange,parentBehaviorTreeId:e.parentBehaviorTreeId}}function Me(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 _e(e){return{uri:e.uri,path:e.path,isBtXml:e.isBtXml,kind:e.kind,behaviorTrees:e.behaviorTrees.map(he),subtreeReferences:e.subtreeReferences.map(Te),blackboardReferences:e.blackboardReferences.map(Me),treeNodesModel:e.treeNodesModel.map(qe),genericSubTreePorts:e.genericSubTreePorts.map(O),rootMainTreeToExecute:ge(e.rootMainTreeToExecute)}}function Re(e){return e.node.kind==="SubTree"&&e.node.id==="SubTree"?(e.genericSubTreePorts.push(...e.node.ports),!0):(e.treeNodesModel.push(e.node),!1)}function xe(e){return M(fe.DuplicateNodeModelId,T.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 Ee(e,t){let r=[],n=t?.uri||e.uri,i=e.root,o=e.isBtXml,a=me(e),s=be(e),d=((t?.path??e.path)||n==="")&&e.kind==="model-document"?!0:e.kind!=="model-document",u=i&&e.kind!=="model-document"?Be(i,n):[],c=[],p=[],B=i?i.name==="TreeNodesModel"?[i]:i.children.filter(f=>f.kind==="element"&&f.name==="TreeNodesModel"):[];for(let f of B){let ce=Se(f,n,s,d),I=new Map;for(let k of ce)Re({node:k,treeNodesModel:c,genericSubTreePorts:p})||(I.has(k.id)?r.push(xe(k)):I.set(k.id,k))}let D=i?De(i,n):[],m=i?(()=>{let f=[];return K(i,f,n,e.originalText),f})():[],b=i?l(i,"main_tree_to_execute"):void 0;return{extracted:{publicModel:_e({uri:n,path:t?.path??e.path,isBtXml:o,kind:a,behaviorTrees:u,subtreeReferences:D,blackboardReferences:m,treeNodesModel:c,genericSubTreePorts:p,rootMainTreeToExecute:b?{uri:n,range:b.range,value:b.value}:void 0}),extractedBehaviorTrees:u,extractedTreeNodesModel:c,extractedSubTreeReferences:D,extractedBlackboardReferences:m},diagnostics:r}}function R(e,t){let{extracted:r,diagnostics:n}=Ee(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"]),Ne=new Set([...j,"_autoremap","_description","__shared_blackboard"]),Ce=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 Ne.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=Ce.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 Pe(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 Ae(){let e={};for(let[t,r]of Object.entries(S))e[`btcpp-v${t}`]=Pe(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=Ae(),Ve=ve();function Ie(e){let t=e.replace(/^btcpp-v/,"");return Object.hasOwn(S,t)}function A(e){return e==="btcpp-v4"?P:e}function Ue(e){return e==="btcpp-v4"?N:e.replace(/^btcpp-v/,"")}function v(e){if(e&&e!=="btcpp-v4"&&!Ie(e))throw new Error(`unsupported builtin model set: ${e}`)}function de(e="btcpp-v4"){v(e);let t=A(e);return oe[t].map(n=>q(n))}function ae(e,t="btcpp-v4"){v(t);let r=A(t),i=oe[r].find(o=>o.id===e);return i?q(i):void 0}function ue(e="btcpp-v4"){v(e);let t=Ve[A(e)]??ne(S[Ue(e)].genericSubTreeModel);return t?(t.ports??[]).map(r=>({...r,enum:r.enum?[...r.enum]:void 0})):[]}function q(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 V(e,t){let r=g(e),n=g(t);return JSON.stringify(r)===JSON.stringify(n)}function se(e,t){if(V(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(s=>[s.name,s])),o=!1,a=!1;for(let s of r.ports){let d=i.get(s.name);if(!d){a=!0;continue}(s.direction!==d.direction||s.type!==d.type||s.required!==d.required)&&(a=!0);let u=s.enum?JSON.stringify(s.enum):"",c=d.enum?JSON.stringify(d.enum):"";u!==c&&(a=!0),s.description!==d.description&&(a=!0),s.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,V as areEquivalentNodeModels,G as buildDocumentModel,R as buildDocumentModelResult,q as builtinToNodeModel,se as classifyNodeModelDifference,ae as getBuiltinNodeModel,ue 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
1
  import { R as ResolvedBtxmlConfig, E as EffectiveFileConfig, a as RawBtxmlConfig } from './types-BgqDzlJ8.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-B2noBQY9.js';
4
- import { M as ModelAugmentationFile } from './types-BaOc_AYN.js';
5
- import { S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView } from './types-CkOvIGPf.js';
6
- import { N as NodeUsageResolution, P as PortUsageResolution } from './types-SY4-jKCn.js';
3
+ import { a as TreeNodeModelDef, P as PortDef } from './public-types-DCvVgnqw.js';
4
+ import { M as ModelAugmentationFile } from './types-f9KgrQFd.js';
5
+ import { S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView } from './types-B2hnkNNL.js';
6
+ import { N as NodeUsageResolution, P as PortUsageResolution } from './types-BRzExVMv.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,12 @@ type SubTreeReference = {
97
106
  readonly idRange?: SourceRange;
98
107
  readonly parentBehaviorTreeId?: string;
99
108
  };
100
- type BlackboardReference = {
101
- readonly name: string;
109
+ type DocumentBlackboardReference = {
110
+ readonly raw: string;
111
+ readonly key: string;
112
+ readonly scope: BlackboardScope;
113
+ readonly identity: string;
114
+ readonly syntax: BlackboardReferenceSyntax;
102
115
  readonly attributeName: string;
103
116
  readonly uri: string;
104
117
  readonly range?: SourceRange;
@@ -116,10 +129,10 @@ type BtDocumentModel = {
116
129
  readonly kind: BtDocumentModelKind;
117
130
  readonly behaviorTrees: readonly BehaviorTreeDef[];
118
131
  readonly subtreeReferences: readonly SubTreeReference[];
119
- readonly blackboardReferences: readonly BlackboardReference[];
132
+ readonly blackboardReferences: readonly DocumentBlackboardReference[];
120
133
  readonly treeNodesModel: readonly TreeNodeModelDef[];
121
134
  readonly genericSubTreePorts: readonly PortDef[];
122
135
  readonly rootMainTreeToExecute?: AttributeValueRef;
123
136
  };
124
137
 
125
- export type { AttributeValueRef as A, BehaviorTreeDef as B, ModelSourceRef as M, NodeModelSource as N, PortDef as P, SubTreeReference as S, TreeNodeKind as T, TreeNodeModelDef as a, BtDocumentModel as b, PortDirection as c, BuiltinNodeDef as d, BlackboardReference as e, BtDocumentModelKind as f, NodeModelSourceKind as g, PortSourceRef as h };
138
+ 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
1
  import { f as ConfigSeverity, E as EffectiveFileConfig, a as RawBtxmlConfig, C as ConfigDiagnostic } from './types-BgqDzlJ8.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-SY4-jKCn.js';
4
+ import { a as NodeUsagePolicy } from './types-BRzExVMv.js';
5
5
  import './ast-BbfR3S_b.js';
6
- import './public-types-B2noBQY9.js';
7
- import './types-BaOc_AYN.js';
6
+ import './public-types-DCvVgnqw.js';
7
+ import './types-f9KgrQFd.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
  };
@@ -262,6 +262,7 @@ declare const RuleCodes: {
262
262
  readonly InvalidScriptOperandType: "BT407_INVALID_SCRIPT_OPERAND_TYPE";
263
263
  readonly ScriptResultNotBoolCompatible: "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE";
264
264
  readonly ScriptVariableTypeMismatch: "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH";
265
+ readonly InvalidGlobalBlackboardIdentifier: "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER";
265
266
  readonly InvalidRootElement: "BT001_INVALID_ROOT_ELEMENT";
266
267
  readonly MissingBTCPPFormat: "BT002_MISSING_BTCPP_FORMAT";
267
268
  readonly MissingBehaviorTreeID: "BT003_MISSING_BEHAVIOR_TREE_ID";
@@ -315,7 +316,7 @@ declare const RuleCodes: {
315
316
  readonly UnusedSuppression: "BT351_UNUSED_SUPPRESSION";
316
317
  readonly MissingSuppressionReason: "BT353_MISSING_SUPPRESSION_REASON";
317
318
  };
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")[];
319
+ 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" | "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
320
 
320
321
  declare function getNodeUsagePolicyForRules(config: EffectiveFileConfig): Partial<NodeUsagePolicy>;
321
322
 
@@ -346,7 +347,7 @@ type RuleMetadata = {
346
347
  };
347
348
  declare function findRuleMetadata(code: string): RuleMetadata;
348
349
  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")[];
350
+ 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" | "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
351
  declare function listRuleSlugs(): string[];
351
352
  declare function listRules(): Array<{
352
353
  name: RuleName;
package/dist/rules.js CHANGED
@@ -1,5 +1,5 @@
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",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(),a={"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."},"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,s="",l,d){return{code:t,severity:o,message:i,uri:s,...r?{range:r}:{},...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 a}function _(t){for(let[o,i]of Object.entries(a)){let r=i;if(r.code===t||r.codes?.includes(t))return o}}function x(t){return a[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 D(t,o){let i=t[o];if(i!==void 0){let r=u(i);if(r)return r.severity}return a[o].defaultSeverity}function y(t,o){let i=[],s=a[t].optionsSchema;if(!s)return i;let l=s.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=a[t].options?.map(r=>r.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,r]of(t.overrides??[]).entries())h(r.linter,`overrides.${i}.linter.rules`,o);return o}function h(t,o,i){for(let[r,s]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(s);if(d?.options)for(let I of y(r,d.options))i.push({code:"CFG011_INVALID_RULE_OPTION",severity:"error",path:B(l,d.options,I.message),message:I.message,help:I.details?.help})}}function B(t,o,i){let r=Object.keys(o).find(s=>i.includes(`\`${s}\``));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.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]: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"/>
2
2
  <!-- file2.xml --><BehaviorTree ID="shared"/>`,validExample:`<!-- file1.xml --><BehaviorTree ID="shared"/>
3
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]:n(e.IncludeCycle,"Include cycle","Include graph cycles are not allowed.",!1),[e.UnresolvedIncludePathVariable]:n(e.UnresolvedIncludePathVariable,"Unresolved include path variable","Include path variables must resolve before lookup.",!1),[e.IncludeOutsideWorkspace]:n(e.IncludeOutsideWorkspace,"Include outside workspace","Includes must stay within the workspace root.",!1),[e.ExternalIncludeUsed]:n(e.ExternalIncludeUsed,"External include used","An include file outside the workspace root was used.",!1),[e.IncludeDepthExceeded]:n(e.IncludeDepthExceeded,"Include depth exceeded","The maximum depth of nested includes was reached.",!1),[e.TooManyResolvedFiles]:n(e.TooManyResolvedFiles,"Too many resolved files","The maximum number of allowed files included was reached.",!1),[e.EntrypointNotFound]:n(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]:n(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
4
  <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]:n(e.MissingTreeNodesModel,"Missing TreeNodesModel","External model files must contain a TreeNodesModel.",!1),[e.ExternalModelXmlParseError]:n(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]:n(e.InvalidNodeDefinitionJson,"Invalid node definition JSON","Node definition files must parse as JSON.",!1),[e.InvalidNodeDefinitionSchema]:n(e.InvalidNodeDefinitionSchema,"Invalid node definition schema","Node definition files must match the expected schema.",!1),[e.DuplicateNodeDefinitionId]:n(e.DuplicateNodeDefinitionId,"Duplicate node definition ID","Node definition IDs must be unique.",!1),[e.InvalidAugmentationJson]:n(e.InvalidAugmentationJson,"Invalid augmentation JSON","Model augmentation files must parse as JSON.",!1),[e.InvalidAugmentationSchema]:n(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]:n(e.UnusedSuppression,"Unused suppression","Suppressions should match at least one diagnostic.",!1),[e.MissingSuppressionReason]:n(e.MissingSuppressionReason,"Missing suppression reason","Suppressions should include a reason when required.",!1),XML016_TEXT_OUTSIDE_ROOT:n("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 S={};for(let[t,o]of Object.entries(s)){let i=c[o.code];if(i){let r=o;S[t]=r.options?{...i,options:r.options}:i}}function C(t){return c[t]}function w(t){return S[t]??c[t]}function O(){return[...Object.values(e)].sort()}function R(){return Object.keys(s).sort()}function M(){let t=[];for(let o of R()){let i=S[o];i&&t.push({name:o,metadata:i})}return t}export{s as RULES,T as RULE_CODES,e as RuleCodes,C as findRuleMetadata,x as getDiagnosticCodeForRule,I as getNodeUsagePolicyForRules,w as getRuleMetadata,_ as getRuleNameForCode,h as getRuleSeverity,v as isRuleName,O as listRuleCodes,R as listRuleSlugs,M as listRules,u as normalizeRuleConfig,b as validateRawConfigRules,y as validateRuleOptions};
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]:n(e.MissingTreeNodesModel,"Missing TreeNodesModel","External model files must contain a TreeNodesModel.",!1),[e.ExternalModelXmlParseError]:n(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]:n(e.InvalidNodeDefinitionJson,"Invalid node definition JSON","Node definition files must parse as JSON.",!1),[e.InvalidNodeDefinitionSchema]:n(e.InvalidNodeDefinitionSchema,"Invalid node definition schema","Node definition files must match the expected schema.",!1),[e.DuplicateNodeDefinitionId]:n(e.DuplicateNodeDefinitionId,"Duplicate node definition ID","Node definition IDs must be unique.",!1),[e.InvalidAugmentationJson]:n(e.InvalidAugmentationJson,"Invalid augmentation JSON","Model augmentation files must parse as JSON.",!1),[e.InvalidAugmentationSchema]:n(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]:n(e.UnusedSuppression,"Unused suppression","Suppressions should match at least one diagnostic.",!1),[e.MissingSuppressionReason]:n(e.MissingSuppressionReason,"Missing suppression reason","Suppressions should include a reason when required.",!1),XML016_TEXT_OUTSIDE_ROOT:n("XML016_TEXT_OUTSIDE_ROOT","Text outside root element","Non-whitespace text is not allowed outside the root element.",!1)},L=Object.fromEntries(Object.values(a).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 S={};for(let[t,o]of Object.entries(a)){let i=c[o.code];if(i){let r=o;S[t]=r.options?{...i,options:r.options}:i}}function C(t){return c[t]}function w(t){return S[t]??c[t]}function O(){return[...Object.values(e)].sort()}function R(){return Object.keys(a).sort()}function M(){let t=[];for(let o of R()){let i=S[o];i&&t.push({name:o,metadata:i})}return t}export{a as RULES,T as RULE_CODES,e as RuleCodes,C as findRuleMetadata,x as getDiagnosticCodeForRule,E as getNodeUsagePolicyForRules,w as getRuleMetadata,_ as getRuleNameForCode,D as getRuleSeverity,v as isRuleName,O as listRuleCodes,R as listRuleSlugs,M as listRules,u as normalizeRuleConfig,b as validateRawConfigRules,y as validateRuleOptions};
@@ -1,10 +1,10 @@
1
1
  import { B as BtDocument, a as BtXmlElement } from './ast-BbfR3S_b.js';
2
- import { a as SemanticIndexOptions, b as SemanticIndexResult, S as SemanticIndex, c as ModelConflictFact } from './types-BaOc_AYN.js';
3
- import { B as BuildSemanticDocumentViewOptions, S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView, c as SemanticSubTreeCallView } from './types-CkOvIGPf.js';
2
+ import { a as SemanticIndexOptions, b as SemanticIndexResult, S as SemanticIndex, c as ModelConflictFact } from './types-f9KgrQFd.js';
3
+ import { B as BuildSemanticDocumentViewOptions, S as SemanticDocumentView, a as SemanticTreeNodeView, b as SemanticPortBindingView, c as SemanticSubTreeCallView } from './types-B2hnkNNL.js';
4
4
  import { c as SourcePosition } from './diagnostic-B5htzyJ9.js';
5
- import { P as PortDef, a as TreeNodeModelDef, S as SubTreeReference, B as BehaviorTreeDef } from './public-types-B2noBQY9.js';
6
- import { R as ResolveNodeUsageInput, b as ResolvePortUsageInput, P as PortUsageResolution, N as NodeUsageResolution } from './types-SY4-jKCn.js';
7
- export { a as NodeUsagePolicy, S as SubTreeResolution, r as resolveSubTreeTarget } from './types-SY4-jKCn.js';
5
+ import { P as PortDef, a as TreeNodeModelDef, S as SubTreeReference, b as BehaviorTreeDef } from './public-types-DCvVgnqw.js';
6
+ import { R as ResolveNodeUsageInput, b as ResolvePortUsageInput, P as PortUsageResolution, N as NodeUsageResolution } from './types-BRzExVMv.js';
7
+ export { a as NodeUsagePolicy, S as SubTreeResolution, r as resolveSubTreeTarget } from './types-BRzExVMv.js';
8
8
  import './types-BgqDzlJ8.js';
9
9
  import 'zod';
10
10